From nobody Mon Nov 25 03:41:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1718974844; cv=pass; d=zohomail.com; s=zohoarc; b=Xd9yqIHpsf37g7i1fLl5vrq9ILcjfo9pAFMYvNRPQXr5ToYNrsADUqHAILwvqdFNQNhfwEgaUrU2+zA9r+8r7ZGdZc/n/S1HQvCWZ0oB32Nkdq2W/SCqDb2nM0lSIQ7rf9NZLK8a2PPG+Pe8KQH75JZ14BuIj0r0DE0jSmSDQz8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718974844; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UJ6n6nZoM54e8HZCrnceC2U4DysPCWXSlPZ3QhACs6w=; b=SBfwcCTosn95T7Fnk3ifdAgEMMwPdamI2cK9mGGft+9sPN28LdMK4VMRyX4weW49E8t7+CBbhhE68AXEoSSPPaUwxGXvkO7fVDR3DDMv4trm0Bczgu2JJxvFpHxJ1Vxt/NZuTyv8zrubwUq42MAKx2jHsB8nx13FzaJv1rqw0SY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718974844179991.7781489678041; Fri, 21 Jun 2024 06:00:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKdre-00018U-Ke; Fri, 21 Jun 2024 08:59:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKdrY-000123-0X; Fri, 21 Jun 2024 08:59:32 -0400 Received: from mail-bn7nam10on2061f.outbound.protection.outlook.com ([2a01:111:f403:2009::61f] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKdrW-00013E-1P; Fri, 21 Jun 2024 08:59:31 -0400 Received: from SJ0PR03CA0364.namprd03.prod.outlook.com (2603:10b6:a03:3a1::9) by MW4PR12MB5642.namprd12.prod.outlook.com (2603:10b6:303:187::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.19; Fri, 21 Jun 2024 12:59:23 +0000 Received: from SJ1PEPF0000231B.namprd03.prod.outlook.com (2603:10b6:a03:3a1:cafe::a6) by SJ0PR03CA0364.outlook.office365.com (2603:10b6:a03:3a1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.36 via Frontend Transport; Fri, 21 Jun 2024 12:59:23 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF0000231B.mail.protection.outlook.com (10.167.242.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Fri, 21 Jun 2024 12:59:23 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 21 Jun 2024 07:59:22 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 21 Jun 2024 07:59:21 -0500 Received: from xhdsaipava41.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 21 Jun 2024 07:59:19 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UFq/84e+LQk4IL+mmCe/xGoWml7BIBginqOlhI/78Uhf8O5j+O4CQ+noyLrdbP4aFLj4o0LpnAO9j+hb2VBeqSvjVWFWYprHVVphFs5SuJE2hpxZm8vblSIPcupTNMULhkcThn90SkZQPzA9dOV+ElqyAmLyirGnHauOxxGFA7W/BcDbKFVrsBP52Dj5/Kmaf6z6pUL+GzSv/tz0aYvQngBJKCThCY3XQRG0V50+v31Dl2Xf3m6hMZ/tkuxuoZHNGvZ1TTXF9A/q4PJXEHzWGFgteec7+qTSl9UIqkW5zqqiZP1bQc0PDXcWT/8LMrfBrm9OIcq124T0MjMXP5hDPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UJ6n6nZoM54e8HZCrnceC2U4DysPCWXSlPZ3QhACs6w=; b=ScFYh0p5vMgQajvAOv6g+kDJSo98PpN7boiWOouVrwXBvZdM4BekcYyhEWU4w/lMAhP9/ApBj3E15XNsrYHay9Yo7tmJPT6MMKm+t2jPIrfkzVDMv2Jha3emCTTcPpicl3JXaJIrzp07uL+o3JU2y/qkr5cN//t+qFqVaZ3JdnpLOnhJuYeeP+il5KN+3/2MxLVsL1aKZuTVPZRmBYhE+LpnI8qLpzfM/5X82gW9PZKkPai6ps7s/UeiAxLyOhvjv8g3jlxgvVMILyiXteYkhnimFWkZ+c+G3y4Cf2xCF79eCU5507MtHfqM+Gy6QVgFkPhOLH2EFy668ygrA9xT5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UJ6n6nZoM54e8HZCrnceC2U4DysPCWXSlPZ3QhACs6w=; b=MfPSw3/NuSKyzGL1py8WV5+8sievnwR7f2JTAO1MPbvIjtd0Yrq4Qr1sHnXyf5uojf2CfDpRMLRDR6C3clQIT7sXtI6ELMTgdpTbJoVpw6tjMZ8gZxhCvmPeC4AemHD9t0emN09zbmELe+VmJ9p8TDTKSfSR2HLe7KSMvf4xZjc= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Sai Pavan Boddu To: , CC: "'Edgar E . Iglesias'" , Peter Maydell , , , "Edgar E . Iglesias" Subject: [PATCH v4 2/3] hw/arm/xilinx_zynq: Add boot-mode property Date: Fri, 21 Jun 2024 18:29:05 +0530 Message-ID: <20240621125906.1300995-3-sai.pavan.boddu@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621125906.1300995-1-sai.pavan.boddu@amd.com> References: <20240621125906.1300995-1-sai.pavan.boddu@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF0000231B:EE_|MW4PR12MB5642:EE_ X-MS-Office365-Filtering-Correlation-Id: 184162ac-68e3-45ab-48ee-08dc91f1f912 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|376011|36860700010|1800799021|82310400023; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?qp+orFz4vMuETUekul6yznNpampYvMbRAVGJxYo/rq3Dqt34boMQ7RSIXkae?= =?us-ascii?Q?9ptiQnGBQ9o8oFVHy5IeP5a3IIeiICib98saH9sI0j2zlxvid5/eoe+uLnTu?= =?us-ascii?Q?0HSsrVEieZA3EokJNPVggWLKloH4Sq/l8deaMTPSUlA9Xlvuvrwoydwpm8dY?= =?us-ascii?Q?nRhi5dbuJBjxUPkzhVeE8XwtsHPJhXADzwOTez1RYVi3RywrHHwiNoO/Y8X8?= =?us-ascii?Q?ip989Ll1ZjnQpNjYTySvcDpIk3+/xrkPnDEG+5yUXQh74+R5idMXRAoxKqNw?= =?us-ascii?Q?WXDls8ZDwrI1vTMaqaN5RrFSBh56PXPN761T5Ii3T3q2r6JM5rWIOJ7/7APt?= =?us-ascii?Q?ruAlhlMktlwFVthodpgra/qBnlIJVCO+tsYjR62jHYQaqydo4LRwfwc9gLIv?= =?us-ascii?Q?C2nEQ0zM3SZ4uERnQgRndC/fowLb/7BFBCh8JKNwPdaZLdbtbV7WgF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88wkKa0URbbey/R4mU9rP2hiTt?= =?us-ascii?Q?JE36i9Rmq5wV7q4SIz5yF+AVeN85RBBd9qFcIYztEExSn7J3lg=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230037)(376011)(36860700010)(1800799021)(82310400023); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2024 12:59:23.0232 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 184162ac-68e3-45ab-48ee-08dc91f1f912 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF0000231B.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5642 Received-SPF: permerror client-ip=2a01:111:f403:2009::61f; envelope-from=sai.pavan.boddu@amd.com; helo=NAM10-BN7-obe.outbound.protection.outlook.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1718974844943100005 Content-Type: text/plain; charset="utf-8" Read boot-mode value as machine property and propagate that to SLCR.BOOT_MODE register. Signed-off-by: Sai Pavan Boddu Acked-by: Edgar E. Iglesias Reviewed-by: Francisco Iglesias --- hw/arm/xilinx_zynq.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index 7f7a3d23fbe..97b6fd8e35d 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -38,6 +38,7 @@ #include "qom/object.h" #include "exec/tswap.h" #include "target/arm/cpu-qom.h" +#include "qapi/visitor.h" =20 #define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9") OBJECT_DECLARE_SIMPLE_TYPE(ZynqMachineState, ZYNQ_MACHINE) @@ -90,6 +91,7 @@ struct ZynqMachineState { MachineState parent; Clock *ps_clk; ARMCPU *cpu[ZYNQ_MAX_CPUS]; + uint8_t boot_mode; }; =20 static void zynq_write_board_setup(ARMCPU *cpu, @@ -176,6 +178,27 @@ static inline int zynq_init_spi_flashes(uint32_t base_= addr, qemu_irq irq, return unit; } =20 +static void zynq_set_boot_mode(Object *obj, const char *str, + Error **errp) +{ + ZynqMachineState *m =3D ZYNQ_MACHINE(obj); + uint8_t mode =3D 0; + + if (!strncasecmp(str, "qspi", 4)) { + mode =3D 1; + } else if (!strncasecmp(str, "sd", 2)) { + mode =3D 5; + } else if (!strncasecmp(str, "nor", 3)) { + mode =3D 2; + } else if (!strncasecmp(str, "jtag", 4)) { + mode =3D 0; + } else { + error_setg(errp, "%s boot mode not supported", str); + return; + } + m->boot_mode =3D mode; +} + static void zynq_init(MachineState *machine) { ZynqMachineState *zynq_machine =3D ZYNQ_MACHINE(machine); @@ -241,6 +264,7 @@ static void zynq_init(MachineState *machine) /* Create slcr, keep a pointer to connect clocks */ slcr =3D qdev_new("xilinx-zynq_slcr"); qdev_connect_clock_in(slcr, "ps_clk", zynq_machine->ps_clk); + qdev_prop_set_uint8(slcr, "boot-mode", zynq_machine->boot_mode); sysbus_realize_and_unref(SYS_BUS_DEVICE(slcr), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(slcr), 0, 0xF8000000); =20 @@ -372,6 +396,7 @@ static void zynq_machine_class_init(ObjectClass *oc, vo= id *data) NULL }; MachineClass *mc =3D MACHINE_CLASS(oc); + ObjectProperty *prop; mc->desc =3D "Xilinx Zynq Platform Baseboard for Cortex-A9"; mc->init =3D zynq_init; mc->max_cpus =3D ZYNQ_MAX_CPUS; @@ -379,6 +404,12 @@ static void zynq_machine_class_init(ObjectClass *oc, v= oid *data) mc->ignore_memory_transaction_failures =3D true; mc->valid_cpu_types =3D valid_cpu_types; mc->default_ram_id =3D "zynq.ext_ram"; + prop =3D object_class_property_add_str(oc, "boot-mode", NULL, + zynq_set_boot_mode); + object_class_property_set_description(oc, "boot-mode", + "Supported boot modes:" + " jtag qspi sd nor"); + object_property_set_default_str(prop, "qspi"); } =20 static const TypeInfo zynq_machine_type =3D { --=20 2.34.1