From nobody Thu May 16 22:50:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.65 as permitted sender) client-ip=209.85.221.65; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f65.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1600624710; cv=none; d=zohomail.com; s=zohoarc; b=KZi5XthG6Cja2gRZSeA1Umqh7Mpz4vH3aBcjTX59zwIXYKj5BaC7XiVdmZg4dfotVYjpEbgYo0weUTXpPbFzl4hQwXdQWrlMGjRRjxpdgOpYvMBx28w22th2lRhwFP01F3rRgBw5mIyuJuA+zqZBOMSlfZLHt105oI1imkd3rjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600624710; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gjFOw5Zj9oE5Q4kDhKw5pc8BNx41CMef2pSlNT1oQak=; b=EP3O+jbSTp0cB1YTpkkw6xjxO+OkYcFOimlOe1XK1O/yrTg/tpMC6kNYnpKychdZtavfPAAERmHI2I3mwGVd0B3JRlBy7d6lkm0vM7alMj/NoHdrBE9Hx0sIz6xjQqOZaRWRt8QOOinSGrqzMRBF8b8VXJEapuXt+bA/WAi6rqo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.zohomail.com with SMTPS id 1600624710829253.50260668192686; Sun, 20 Sep 2020 10:58:30 -0700 (PDT) Received: by mail-wr1-f65.google.com with SMTP id s12so10420517wrw.11 for ; Sun, 20 Sep 2020 10:58:30 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id u66sm15675781wme.12.2020.09.20.10.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Sep 2020 10:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gjFOw5Zj9oE5Q4kDhKw5pc8BNx41CMef2pSlNT1oQak=; b=YgR9Wz4fm5JbsRmTNRj8JY8gJwvE+Des/NbC9m9cuu0N50cRUWJLnzYmUWzqQTC5DQ co05vfpnoBIg31An0iq5wX40fl5fAP/DV07l7SZrwSQNdFtyWQaLTuRn4AtI7mCfXzUY I8iosslRoltgVmSw6oMTJ4Kh4YNVtv+7htBWcM5eW5QEZ5B6Z1RxMiFfgsW6coKT5n8f 6Gv8kN7sPDuDxJJGw6LiImSBaQcyHWwKkr5Xec0/V9zvoXNewZ0X55YjfEtnOPqrsj0S y/WMdbB6sn+oJfTw3mDrzHU9iDGf9k9esZy93oDC3qYSClEWsEsadH0tzXHwesfEeGkP Nv4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gjFOw5Zj9oE5Q4kDhKw5pc8BNx41CMef2pSlNT1oQak=; b=pRpicMnco525HsZaaDDFt3VuGsg528n9sZrIVi2WRXSxLPtusbiw0EGQIIARImXoB/ mbp63IJUp5MWntZkYo/7GTUNqS4nat5bP7727NwwTrU4Rpq9TemangSdCJPB0NsXKBah CZPthz0/miFXWFSKbZeaWcnK/ihwUY2PW5HI+623s6EvpPq7rRTvzndvKhP/c6jMSqcw QDOFfDs1CplssBZJLePNwAWCCSJrIVtVzEVgyn1fRydrYHPsLADFeoc3hEK8crTC+tQz TZRuibn+sA2Jvk3VV1v5RI5VrY/Y2SK7yktsbmxADVAOVW/s7m3cnFCXaHdminnMCzNS thfw== X-Gm-Message-State: AOAM532WjrG8/Zg2YN1973jD3PMYtB/UjZdUKJJJVsUohROKjhgi78aF VymGUy0AyHEHXZEtOgmMXJs= X-Google-Smtp-Source: ABdhPJz/oIP+1CZ+zU7vhPqv1w1jA3pFbEbTUr/DXvT5ZGQZ7XG0RRllezW3eKbk4cyVWTyBHPPxHA== X-Received: by 2002:a05:6000:1184:: with SMTP id g4mr47993796wrx.20.1600624708996; Sun, 20 Sep 2020 10:58:28 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Niek Linnenbank , Peter Maydell , Paul Zimmerman , Andrew Baumann , Luc Michel , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 1/7] hw/arm/raspi: Define various blocks base addresses Date: Sun, 20 Sep 2020 19:58:19 +0200 Message-Id: <20200920175825.417680-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200920175825.417680-1-f4bug@amsat.org> References: <20200920175825.417680-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The Raspberry firmware is closed-source. While running it, it accesses various I/O registers. Logging these accesses as UNIMP (unimplemented) help to understand what the firmware is doing (ideally we want it able to boot a Linux kernel). Document various blocks we might use later. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/arm/raspi_platform.h | 51 +++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/include/hw/arm/raspi_platform.h b/include/hw/arm/raspi_platfor= m.h index 61b04a1bd4a..c7f50b260f6 100644 --- a/include/hw/arm/raspi_platform.h +++ b/include/hw/arm/raspi_platform.h @@ -20,20 +20,29 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U= SA + * + * Various undocumented addresses and names come from Herman Hermitage's V= C4 + * documentation: + * https://github.com/hermanhermitage/videocoreiv/wiki/MMIO-Register-map */ =20 #ifndef HW_ARM_RASPI_PLATFORM_H #define HW_ARM_RASPI_PLATFORM_H =20 #define MSYNC_OFFSET 0x0000 /* Multicore Sync Block */ -#define IC0_OFFSET 0x2000 +#define CCPT_OFFSET 0x1000 /* Compact Camera Port 2 TX */ +#define INTE_OFFSET 0x2000 /* VC Interrupt controller */ #define ST_OFFSET 0x3000 /* System Timer */ +#define TXP_OFFSET 0x4000 /* Transposer */ +#define JPEG_OFFSET 0x5000 #define MPHI_OFFSET 0x6000 /* Message-based Parallel Host In= tf. */ #define DMA_OFFSET 0x7000 /* DMA controller, channels 0-14 = */ -#define ARM_OFFSET 0xB000 /* BCM2708 ARM control block */ +#define ARBA_OFFSET 0x9000 +#define BRDG_OFFSET 0xa000 +#define ARM_OFFSET 0xB000 /* ARM control block */ #define ARMCTRL_OFFSET (ARM_OFFSET + 0x000) #define ARMCTRL_IC_OFFSET (ARM_OFFSET + 0x200) /* Interrupt controll= er */ -#define ARMCTRL_TIMER0_1_OFFSET (ARM_OFFSET + 0x400) /* Timer 0 and 1 */ +#define ARMCTRL_TIMER0_1_OFFSET (ARM_OFFSET + 0x400) /* Timer 0 and 1 (SP8= 04) */ #define ARMCTRL_0_SBM_OFFSET (ARM_OFFSET + 0x800) /* User 0 (ARM) Semap= hores * Doorbells & Mailbo= xes */ #define CPRMAN_OFFSET 0x100000 /* Power Management, Watchdog */ @@ -42,24 +51,50 @@ #define AVS_OFFSET 0x103000 /* Audio Video Standard */ #define RNG_OFFSET 0x104000 #define GPIO_OFFSET 0x200000 -#define UART0_OFFSET 0x201000 -#define MMCI0_OFFSET 0x202000 -#define I2S_OFFSET 0x203000 -#define SPI0_OFFSET 0x204000 +#define UART0_OFFSET 0x201000 /* PL011 */ +#define MMCI0_OFFSET 0x202000 /* Legacy MMC */ +#define I2S_OFFSET 0x203000 /* PCM */ +#define SPI0_OFFSET 0x204000 /* SPI master */ #define BSC0_OFFSET 0x205000 /* BSC0 I2C/TWI */ +#define PIXV0_OFFSET 0x206000 +#define PIXV1_OFFSET 0x207000 +#define DPI_OFFSET 0x208000 +#define DSI0_OFFSET 0x209000 /* Display Serial Interface */ +#define PWM_OFFSET 0x20c000 +#define PERM_OFFSET 0x20d000 +#define TEC_OFFSET 0x20e000 #define OTP_OFFSET 0x20f000 +#define SLIM_OFFSET 0x210000 /* SLIMbus */ +#define CPG_OFFSET 0x211000 #define THERMAL_OFFSET 0x212000 -#define BSC_SL_OFFSET 0x214000 /* SPI slave */ +#define AVSP_OFFSET 0x213000 +#define BSC_SL_OFFSET 0x214000 /* SPI slave (bootrom) */ #define AUX_OFFSET 0x215000 /* AUX: UART1/SPI1/SPI2 */ #define EMMC1_OFFSET 0x300000 +#define EMMC2_OFFSET 0x340000 +#define HVS_OFFSET 0x400000 #define SMI_OFFSET 0x600000 +#define DSI1_OFFSET 0x700000 +#define UCAM_OFFSET 0x800000 +#define CMI_OFFSET 0x802000 #define BSC1_OFFSET 0x804000 /* BSC1 I2C/TWI */ #define BSC2_OFFSET 0x805000 /* BSC2 I2C/TWI */ +#define VECA_OFFSET 0x806000 +#define PIXV2_OFFSET 0x807000 +#define HDMI_OFFSET 0x808000 +#define HDCP_OFFSET 0x809000 +#define ARBR0_OFFSET 0x80a000 #define DBUS_OFFSET 0x900000 #define AVE0_OFFSET 0x910000 #define USB_OTG_OFFSET 0x980000 /* DTC_OTG USB controller */ +#define V3D_OFFSET 0xc00000 #define SDRAMC_OFFSET 0xe00000 +#define L2CC_OFFSET 0xe01000 /* Level 2 Cache controller */ +#define L1CC_OFFSET 0xe02000 /* Level 1 Cache controller */ +#define ARBR1_OFFSET 0xe04000 #define DMA15_OFFSET 0xE05000 /* DMA controller, channel 15 */ +#define DCRC_OFFSET 0xe07000 +#define AXIP_OFFSET 0xe08000 =20 /* GPU interrupts */ #define INTERRUPT_TIMER0 0 --=20 2.26.2 From nobody Thu May 16 22:50:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) client-ip=209.85.221.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1600624712; cv=none; d=zohomail.com; s=zohoarc; b=nYVwjtCNYSiLrOT0M6XRE9JSD2lMTCMQSBCyU+cAdcDdZGsS2V1kg7R0F05PhLpjx74bY+flWXW9A/ATtopt9q9/Uz6AJ+VTlxJ2ngxtKjtsFz94INYpISiOmeWfQFlfNZIpy6CzdkyOpu2k5H/73n7hjN4wtPECTHz6VxFsakE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600624712; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=exASe8riCxZfialHMwQ4chenzKGKS91MOy7C7us9oAE=; b=AohPZA9FQFuYiZF1ELTv+HwYr1gbLO6qgcIgeeeuF1XE1HO2XoktU84GZfT5eOE7Y2IiHy3+VxSS4kVdMP9UZvKfTUUXBBfjc6VQ2YCmCQTRAIzrTYgRWUokGGCV7tFbw2p0AaWE+cfu7Ru55+TsFfV18RnIKlCNui5v1Otz+IU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.zohomail.com with SMTPS id 1600624712206722.1559870704939; Sun, 20 Sep 2020 10:58:32 -0700 (PDT) Received: by mail-wr1-f67.google.com with SMTP id o5so10418683wrn.13 for ; Sun, 20 Sep 2020 10:58:31 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id u66sm15675781wme.12.2020.09.20.10.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Sep 2020 10:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=exASe8riCxZfialHMwQ4chenzKGKS91MOy7C7us9oAE=; b=aB9ikbhA1WxIY00RVeYkATZZwVwF9rr9FdbyV+XjSVrBSII4FeZQMvyiR71cSphkTN 4XTo1rQ9aWcQMkKOLpbfWtkaGk4097Y0Kaq8nCPZ1VYVyGX3zgzUjlZtfZhBZZZ/PGpQ 6swYwb9453TbiwzYvfRHh0ZTszsM/J7m9TXuryI3apcRAsSHuZvMrd9kCzVbMXC953wZ L/WslWDk2Gk7KB7s8Yo3SE7l8z+UwaP+Dkg1KBDNv+Xhfu2OZGujqLfqhQAfVk0l98ct GsZ8XGyaTOcpetncJGKpxAnqV0drPkSej3ksFUHoPx0Cc7xaWepK2tOHNPEt0gdq42AD HDhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=exASe8riCxZfialHMwQ4chenzKGKS91MOy7C7us9oAE=; b=Nq4KCQ04rfBlggBF1AiJ7nRojQhsQ322aqP1GCvDMMkkNBdHPUCzkin0kNchebULwk CZ5qGzuubJp1v1Lh115saayqUcaFR8Mtg/Qr6mM9gmCEyhzc1RGfkv3L9ZS9scPYkwKe 5ihgQQ8RSnu400PlyMMu6Fek8dTx8b/oct3Du84Cwd5zh3c5VvGScVB9lOFXktRzQPjb ru5MoGLKTeA7Hg92+3dKFIbBoLXpMX7G+PN/VnYfystvsfHNPwM437YRvyfteszG5nkH hDA593uTeNmwQinjRb8QgAsixZGhGIZAC0ND0W7NdyV6QsH2tlvZHsjCETEowFf9FPOY 1yww== X-Gm-Message-State: AOAM531xJJj38tcUVwz+XYjlGOn07/ldbrN2lq+juT3FQiQ3pJaPLb6D xI3qzDkqSPqKceXpL/6BCyI= X-Google-Smtp-Source: ABdhPJy9tRbHrwObNDOH1LtPq7s+jobQcrpZ1objkviac8YBiukYpRQ0FDZZ9TO21sdJMAvEYFPqVQ== X-Received: by 2002:adf:ea01:: with SMTP id q1mr46406039wrm.97.1600624710298; Sun, 20 Sep 2020 10:58:30 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Niek Linnenbank , Peter Maydell , Paul Zimmerman , Andrew Baumann , Luc Michel Subject: [PATCH 2/7] hw/arm/bcm2835: Add more unimplemented peripherals Date: Sun, 20 Sep 2020 19:58:20 +0200 Message-Id: <20200920175825.417680-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200920175825.417680-1-f4bug@amsat.org> References: <20200920175825.417680-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The bcm2835-v3d is used since Linux 4.7, see commit 49ac67e0c39c ("ARM: bcm2835: Add VC4 to the device tree"), and the bcm2835-txp since Linux 4.19, see commit b7dd29b401f5 ("ARM: dts: bcm283x: Add Transposer block"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/arm/bcm2835_peripherals.h | 2 ++ hw/arm/bcm2835_peripherals.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/hw/arm/bcm2835_peripherals.h b/include/hw/arm/bcm2835_= peripherals.h index b4d3ae121ac..8af8e78f67a 100644 --- a/include/hw/arm/bcm2835_peripherals.h +++ b/include/hw/arm/bcm2835_peripherals.h @@ -47,6 +47,7 @@ struct BCM2835PeripheralState { =20 BCM2835SystemTimerState systmr; BCM2835MphiState mphi; + UnimplementedDeviceState tpx; UnimplementedDeviceState armtmr; UnimplementedDeviceState cprman; UnimplementedDeviceState a2w; @@ -68,6 +69,7 @@ struct BCM2835PeripheralState { UnimplementedDeviceState otp; UnimplementedDeviceState dbus; UnimplementedDeviceState ave0; + UnimplementedDeviceState v3d; UnimplementedDeviceState bscsl; UnimplementedDeviceState smi; DWC2State dwc2; diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index a9d7f53f6e9..4e6c678aa99 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -343,6 +343,7 @@ static void bcm2835_peripherals_realize(DeviceState *de= v, Error **errp) qdev_get_gpio_in_named(DEVICE(&s->ic), BCM2835_IC_GPU_IRQ, INTERRUPT_USB)); =20 + create_unimp(s, &s->tpx, "bcm2835-tpx", TPX_OFFSET, 0x1000); create_unimp(s, &s->armtmr, "bcm2835-sp804", ARMCTRL_TIMER0_1_OFFSET, = 0x40); create_unimp(s, &s->cprman, "bcm2835-cprman", CPRMAN_OFFSET, 0x1000); create_unimp(s, &s->a2w, "bcm2835-a2w", A2W_OFFSET, 0x1000); @@ -356,6 +357,7 @@ static void bcm2835_peripherals_realize(DeviceState *de= v, Error **errp) create_unimp(s, &s->otp, "bcm2835-otp", OTP_OFFSET, 0x80); create_unimp(s, &s->dbus, "bcm2835-dbus", DBUS_OFFSET, 0x8000); create_unimp(s, &s->ave0, "bcm2835-ave0", AVE0_OFFSET, 0x8000); + create_unimp(s, &s->v3d, "bcm2835-v3d", V3D_OFFSET, 0x1000); create_unimp(s, &s->sdramc, "bcm2835-sdramc", SDRAMC_OFFSET, 0x100); } =20 --=20 2.26.2 From nobody Thu May 16 22:50:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) client-ip=209.85.221.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1600624713; cv=none; d=zohomail.com; s=zohoarc; b=XhLtwnIJai9U8WyerpA3lATHlZJcPjC65IzcBjbt7h75oyI6Glr87hpdOLVz8Mv5NMMzOWHstwPsvzah1KKxPfz8jd9YLWIfyTHuX4eI3ZjDAbgP/66PNHtbQGHKz4ijpicc23ZEP2BaUYw2+ntfMTMAWtprKZTxA+Lk+8I48gA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600624713; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dcCXq9EmDF/ND5OQIcbMSYGFUbh9qfqOjQv8VK2LW0A=; b=JM6FvsqKRmJVlonbQYjZOL9diHy0XuA25xZavueht1upUqo3e5Ki3QkTXmc3wTBhQOBkYkuFgCzwB+ZQAQ1lfXA2QbCM6/7IvM6i8QrnrJaYGJ0zTh3YhXh998zlP0SUh1f1WgFG07RZfMnmrTjSnm5vHgMXRdtbGybap3Z5+Co= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.zohomail.com with SMTPS id 1600624713396578.4113124990812; Sun, 20 Sep 2020 10:58:33 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id t10so10447103wrv.1 for ; Sun, 20 Sep 2020 10:58:32 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id u66sm15675781wme.12.2020.09.20.10.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Sep 2020 10:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dcCXq9EmDF/ND5OQIcbMSYGFUbh9qfqOjQv8VK2LW0A=; b=mcw1/4AUz+zjMfM9db6StlM88A312gpLsWvAoOOF83A5evn2GgHGmHQZI4w1ZV1kap tFFyzLN7EOCK5mCxRCf6Z04sEHTcNy7oveBJygH++ZMhBVH5T3WwGoUIRZERRAwUfJVz d1Wo+IZ9+dj4Eq+5JtPJlnkC7+v7JBKJC6DeTtc4sjNctWQ6hgSKe6R1noHwJUYCWrk3 GDuXTlTYnpb9NFQa1uEHhRbOaHSmTYFCQ27tdr8eEfB/OXBOE8h5f+vs1A4kdRzdVp85 T92/S1yZtCVFXl16WH1U6sqOcfPBiZQov9UvLWIrS25iuzKnZcu5Wc5TF44TGTPpa0bh NIcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dcCXq9EmDF/ND5OQIcbMSYGFUbh9qfqOjQv8VK2LW0A=; b=LbwdgMgJLWkDYqe0cBGxgya3wQU4QXKOAj7lrwKevu6FdkIBA2wzY4nBJQNPNiis6N ZaFRzwLa8Lok1ZIiDp/8i7vhDzJdqDEMf7Bfb/k7a7GnguVHx6lX9/jYed2LEXUc2F7r 9wg0D4W9IgsclpMRo5TBBkX8iHx9mXVOBdMIfYP2MxzZHpiVyMI38RN1310SJRyAE5Lj potgQeJg38OuQg38OFoADkV1LXNnIowqxy0n2mt4kT6waXPbrP5zm21qlVlE3za0mXUH h9mm+a2Gr7LkHS8HAnCOVeGLEI4Hz52XNhk99i/q2LPDo9EILQmDblROK/nGIL2OHcNc subQ== X-Gm-Message-State: AOAM530cKTQPRYNAGzUdl9nTJaR7lC71rvsKueHc3wCE2v0SIVwwQMJw UKv6U9h49A90h7B6mMwwNBk= X-Google-Smtp-Source: ABdhPJx8/sLmvqWLL3TJeO5YXXwImvYZb/pxaYZQTv+mQfMKrn0uPW/vUv4Vr14Vxp3D9NVeYI05UQ== X-Received: by 2002:adf:ce01:: with SMTP id p1mr32321632wrn.61.1600624711595; Sun, 20 Sep 2020 10:58:31 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Niek Linnenbank , Peter Maydell , Paul Zimmerman , Andrew Baumann , Luc Michel Subject: [PATCH 3/7] hw/intc/bcm2835_ic: Trace GPU/CPU IRQ handlers Date: Sun, 20 Sep 2020 19:58:21 +0200 Message-Id: <20200920175825.417680-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200920175825.417680-1-f4bug@amsat.org> References: <20200920175825.417680-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Add trace events for GPU and CPU IRQs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/bcm2835_ic.c | 4 +++- hw/intc/trace-events | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/intc/bcm2835_ic.c b/hw/intc/bcm2835_ic.c index 53ab8f58810..9000d995e81 100644 --- a/hw/intc/bcm2835_ic.c +++ b/hw/intc/bcm2835_ic.c @@ -18,6 +18,7 @@ #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" +#include "trace.h" =20 #define GPU_IRQS 64 #define ARM_IRQS 8 @@ -51,7 +52,6 @@ static void bcm2835_ic_update(BCM2835ICState *s) set =3D (s->gpu_irq_level & s->gpu_irq_enable) || (s->arm_irq_level & s->arm_irq_enable); qemu_set_irq(s->irq, set); - } =20 static void bcm2835_ic_set_gpu_irq(void *opaque, int irq, int level) @@ -59,6 +59,7 @@ static void bcm2835_ic_set_gpu_irq(void *opaque, int irq,= int level) BCM2835ICState *s =3D opaque; =20 assert(irq >=3D 0 && irq < 64); + trace_bcm2835_ic_set_gpu_irq(irq, level); s->gpu_irq_level =3D deposit64(s->gpu_irq_level, irq, 1, level !=3D 0); bcm2835_ic_update(s); } @@ -68,6 +69,7 @@ static void bcm2835_ic_set_arm_irq(void *opaque, int irq,= int level) BCM2835ICState *s =3D opaque; =20 assert(irq >=3D 0 && irq < 8); + trace_bcm2835_ic_set_cpu_irq(irq, level); s->arm_irq_level =3D deposit32(s->arm_irq_level, irq, 1, level !=3D 0); bcm2835_ic_update(s); } diff --git a/hw/intc/trace-events b/hw/intc/trace-events index 527c3f76cae..22782b3f089 100644 --- a/hw/intc/trace-events +++ b/hw/intc/trace-events @@ -199,3 +199,7 @@ nvic_sysreg_write(uint64_t addr, uint32_t value, unsign= ed size) "NVIC sysreg wri heathrow_write(uint64_t addr, unsigned int n, uint64_t value) "0x%"PRIx64"= %u: 0x%"PRIx64 heathrow_read(uint64_t addr, unsigned int n, uint64_t value) "0x%"PRIx64" = %u: 0x%"PRIx64 heathrow_set_irq(int num, int level) "set_irq: num=3D0x%02x level=3D%d" + +# bcm2835_ic.c +bcm2835_ic_set_gpu_irq(int irq, int level) "GPU irq #%d level %d" +bcm2835_ic_set_cpu_irq(int irq, int level) "CPU irq #%d level %d" --=20 2.26.2 From nobody Thu May 16 22:50:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) client-ip=209.85.221.68; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f68.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1600624714; cv=none; d=zohomail.com; s=zohoarc; b=Ol/I7/95iS46iws6Zd2x35ozHQO0aEaSM4RDXMzcBn11JHKmvoAPBvTeLrHj0AaiLQla3GeIpFgidzgBXSS55VbopVq88M+WiHNRl8iCJOmjyT7LcJFKOJJqipfphwIF8CFONehFjZu2kiE89MgFOg2mPjuhVPpO8VDCcHITjJE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600624714; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3AjXG5w656FN23Be/Hsok/QAzJiXXjNLyOG7YnfgnNo=; b=kalsD9newI2c+yyg9ZOCHi0gBgzMFflYI+qjAVp1fx0uCN5n0QGO/BwPV5YTFyOYr2EgI1UTMz8y3pQCUu3MBEY3uZG2jaIMTiRhkiKaaTGo5NuarNLY1quGr3QKcH0aFYSJ7+oZoL2bOgiQlszd2mJUNrPFS3zjH+xeMDou8QU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.zohomail.com with SMTPS id 160062471473198.389795725368; Sun, 20 Sep 2020 10:58:34 -0700 (PDT) Received: by mail-wr1-f68.google.com with SMTP id s12so10420607wrw.11 for ; Sun, 20 Sep 2020 10:58:34 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id u66sm15675781wme.12.2020.09.20.10.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Sep 2020 10:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3AjXG5w656FN23Be/Hsok/QAzJiXXjNLyOG7YnfgnNo=; b=ljsR5+zEPNjJbO27y7Q7qhZ1LQUsrhg4fL7Z606vSZcSpwnH+4mnfuev6facTO8M3+ J0LwcDklENnTTm/vJe4s5kwsh1bJyQWS+LWBfFLyggsstbrZ4d++rlFl+hh6lqKszud1 2n3uwkFXyzbdEVgUG/E2FrkZUp+6xyBuYrKQ6UHbYlcoqW0nIkssZHgulwkzMOiDSCax v4hWWFyHhEmM8ZQ6stYFKc/14DmoltbNZQZZCQIyPEI8ghHgCg1dxsQkK4BcpgmLSAQx 9SwEXl3bXYIgSC6W3UXF1tUSYy4sQF7TOBF8T4knZo+pWDg0KG3f4wfdF2C2kVo3c2os RUCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3AjXG5w656FN23Be/Hsok/QAzJiXXjNLyOG7YnfgnNo=; b=MyV2AvtigP7GIDIhAzICDqGzB/yZOQPde8nHSZiF7KpVoO6PkjyA202FIVH7a1AiIq jO+lDgx6Ga7jovTQYFBIDZV974xrImFNaEs5rVbWsniwXld8wy4D+MW66PJoHUeKB2aF JK/qZuXxKidy7KKBX3KCj7BnAkUdX+UYcojdY8/TDwlUue7f3DXMCbdKlXxeoHGsU+aQ EJw16Yz84Z3X2F+WFDS3zqHYGJLWJmqNtThw98tRT2dVetQVN6CFBZDloa9UtZI4/pmR MpXtfgN6cbRVGJcGsPqgYNYfPxK/lKI0pOJf27zAVKRVduHnsFpvKYGh4bV1W7rv/yVP 6tUA== X-Gm-Message-State: AOAM533rjCwijWKpDjzRA8yLz8/nn4tOaBQjaPa0L84DrcpzRGMKF3en zeKGPTifQY2oy7kXa0g6I9YpGEqQ2JM= X-Google-Smtp-Source: ABdhPJxKhDQPvWju88ruAaJaIPIVeSToQmeSh3ct0XSYEFOEu2z6vT6mI9tByBE0otRLL0ebMuY1ig== X-Received: by 2002:adf:eb8f:: with SMTP id t15mr24945019wrn.417.1600624712806; Sun, 20 Sep 2020 10:58:32 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Niek Linnenbank , Peter Maydell , Paul Zimmerman , Andrew Baumann , Luc Michel Subject: [PATCH 4/7] hw/timer/bcm2835: Introduce BCM2835_SYSTIMER_COUNT definition Date: Sun, 20 Sep 2020 19:58:22 +0200 Message-Id: <20200920175825.417680-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200920175825.417680-1-f4bug@amsat.org> References: <20200920175825.417680-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Use the BCM2835_SYSTIMER_COUNT definition instead of the magic '4' value. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/timer/bcm2835_systmr.h | 4 +++- hw/timer/bcm2835_systmr.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/hw/timer/bcm2835_systmr.h b/include/hw/timer/bcm2835_s= ystmr.h index 64166bd7120..11272837a6b 100644 --- a/include/hw/timer/bcm2835_systmr.h +++ b/include/hw/timer/bcm2835_systmr.h @@ -18,6 +18,8 @@ typedef struct BCM2835SystemTimerState BCM2835SystemTimer= State; DECLARE_INSTANCE_CHECKER(BCM2835SystemTimerState, BCM2835_SYSTIMER, TYPE_BCM2835_SYSTIMER) =20 +#define BCM2835_SYSTIMER_COUNT 4 + struct BCM2835SystemTimerState { /*< private >*/ SysBusDevice parent_obj; @@ -28,7 +30,7 @@ struct BCM2835SystemTimerState { =20 struct { uint32_t status; - uint32_t compare[4]; + uint32_t compare[BCM2835_SYSTIMER_COUNT]; } reg; }; =20 diff --git a/hw/timer/bcm2835_systmr.c b/hw/timer/bcm2835_systmr.c index 3387a6214a2..ff8c5536610 100644 --- a/hw/timer/bcm2835_systmr.c +++ b/hw/timer/bcm2835_systmr.c @@ -134,7 +134,8 @@ static const VMStateDescription bcm2835_systmr_vmstate = =3D { .minimum_version_id =3D 1, .fields =3D (VMStateField[]) { VMSTATE_UINT32(reg.status, BCM2835SystemTimerState), - VMSTATE_UINT32_ARRAY(reg.compare, BCM2835SystemTimerState, 4), + VMSTATE_UINT32_ARRAY(reg.compare, BCM2835SystemTimerState, + BCM2835_SYSTIMER_COUNT), VMSTATE_END_OF_LIST() } }; --=20 2.26.2 From nobody Thu May 16 22:50:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) client-ip=209.85.128.65; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f65.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1600624716; cv=none; d=zohomail.com; s=zohoarc; b=dp5OSIFsFZl4deZZWcq2xVC8aT6zHufCjy36F+BTD2N6cfvJUSkw9ABj/YOQ8VSYrXMyC4L1ee9OtG/Oj2zRhZYKXYW0buDWx5QsqeHfwvAbktJuYRkl8Bn8UD6Qfms8JPORemoveJOtC5HV9mSHWqYR2Bgrfoc+x6MWAtruPlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600624716; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ru9JeznwCHjcxiZ+MKIheuMQIUXnKfc2N76bXeVgo8I=; b=Sbqo0ir78yTOmN07Hq7/L6khMyqzDRp3DkOxXdAnB6WuUr8l/k3w2lEHmibrY/lQZh0rCS35Tvcggs9WbQKVURNGKXZJcfkB+84f+6BrdF0IUN62xoZYlQVnb5d/B9ruAk2TScqTSlh3d1HhypItMgO/jJRTPcjiZr0W7kY14xg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.zohomail.com with SMTPS id 1600624716075346.18497211446197; Sun, 20 Sep 2020 10:58:36 -0700 (PDT) Received: by mail-wm1-f65.google.com with SMTP id b79so10304678wmb.4 for ; Sun, 20 Sep 2020 10:58:35 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id u66sm15675781wme.12.2020.09.20.10.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Sep 2020 10:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ru9JeznwCHjcxiZ+MKIheuMQIUXnKfc2N76bXeVgo8I=; b=CAXA9PBD0O4/H3X4XbousjqKShB4hQxlmxM0CgMq6vbvyVoG9vgGrac5Z2GpmLIGxv jIK3tOr2pjmTw5uwDduyf9jY/4YTm8CXOMZAW1k9dgDRH2ZoSc28W2ZBxgWK5sFz+DHK H7qtCCY+LQZkFLIWsY74xXAIdfpB/f83q+3+ENrE1UBVnVp+Bz8LIzwqPh8krGUt/4D7 WMtW+teFpC5ejBJP5II9B2Xe1DEoCEaCywhzqkN7+4MA5BqFc9T8BCr0p3iyIOxPe315 504Amm7/uRd8pv02QjH0dtJOG0F5zRHHcxi2gLub5qpQ+QE51JAUzc4BIWvkne2hYRq2 Ky3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ru9JeznwCHjcxiZ+MKIheuMQIUXnKfc2N76bXeVgo8I=; b=X9kF5L0UM2nEiJDVjfRW8fleM4EXU4vyBIVBeqARPJwSq33L3lrtAJX4hdeEyre6ED o/c0G+MhtM0047Dn8apBRi8WpJkIRtP75lFC8MIQ50cy1jAwmbNpjkYvTB8MHgjcdtzA wPSJN7v5B4Ej36/euRPQcTeKhu7KGXbNHMkvaAl5b3cd1OEgiFm6EcsuKoxWnJqxdIZx JMOuTdHQQm8wAxJKkf/CF4MsJFqoWYXCUgl8tUW85WYxQ5OHU57hnuHE9K+UCgCZggT2 iNRgARb8nSa9o0pz5gfPWek/7ENFYB6XSUXE/Pq4O1K/0CXDPONe8l54XCPG8c9EPl5N AzgQ== X-Gm-Message-State: AOAM533AqJ/OgZN7THkm2j2G3o7jj4sBV5no3UkbQlZIrYvTE+Tml9PQ Q39EQFhl28rJYrSLVsd7irA= X-Google-Smtp-Source: ABdhPJynMvcFSSVbqNfH0yiRC4QjH+hY1zu9hCQgvN5/is0BF6i7e8Yf12uOaMPR0FSpltAlTxGIYw== X-Received: by 2002:a7b:c095:: with SMTP id r21mr27847340wmh.133.1600624714171; Sun, 20 Sep 2020 10:58:34 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Niek Linnenbank , Peter Maydell , Paul Zimmerman , Andrew Baumann , Luc Michel Subject: [PATCH 5/7] hw/timer/bcm2835: Rename variable holding CTRL_STATUS register Date: Sun, 20 Sep 2020 19:58:23 +0200 Message-Id: <20200920175825.417680-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200920175825.417680-1-f4bug@amsat.org> References: <20200920175825.417680-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The variable holding the CTRL_STATUS register is misnamed 'status'. Rename it 'ctrl_status' to make it more obvious this register is also used to control the peripheral. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/timer/bcm2835_systmr.h | 2 +- hw/timer/bcm2835_systmr.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/hw/timer/bcm2835_systmr.h b/include/hw/timer/bcm2835_s= ystmr.h index 11272837a6b..e0db9e9e12b 100644 --- a/include/hw/timer/bcm2835_systmr.h +++ b/include/hw/timer/bcm2835_systmr.h @@ -29,7 +29,7 @@ struct BCM2835SystemTimerState { qemu_irq irq; =20 struct { - uint32_t status; + uint32_t ctrl_status; uint32_t compare[BCM2835_SYSTIMER_COUNT]; } reg; }; diff --git a/hw/timer/bcm2835_systmr.c b/hw/timer/bcm2835_systmr.c index ff8c5536610..b234e83824f 100644 --- a/hw/timer/bcm2835_systmr.c +++ b/hw/timer/bcm2835_systmr.c @@ -30,7 +30,7 @@ REG32(COMPARE3, 0x18) =20 static void bcm2835_systmr_update_irq(BCM2835SystemTimerState *s) { - bool enable =3D !!s->reg.status; + bool enable =3D !!s->reg.ctrl_status; =20 trace_bcm2835_systmr_irq(enable); qemu_set_irq(s->irq, enable); @@ -52,7 +52,7 @@ static uint64_t bcm2835_systmr_read(void *opaque, hwaddr = offset, =20 switch (offset) { case A_CTRL_STATUS: - r =3D s->reg.status; + r =3D s->reg.ctrl_status; break; case A_COMPARE0 ... A_COMPARE3: r =3D s->reg.compare[(offset - A_COMPARE0) >> 2]; @@ -82,7 +82,7 @@ static void bcm2835_systmr_write(void *opaque, hwaddr off= set, trace_bcm2835_systmr_write(offset, value); switch (offset) { case A_CTRL_STATUS: - s->reg.status &=3D ~value; /* Ack */ + s->reg.ctrl_status &=3D ~value; /* Ack */ bcm2835_systmr_update_irq(s); break; case A_COMPARE0 ... A_COMPARE3: @@ -133,7 +133,7 @@ static const VMStateDescription bcm2835_systmr_vmstate = =3D { .version_id =3D 1, .minimum_version_id =3D 1, .fields =3D (VMStateField[]) { - VMSTATE_UINT32(reg.status, BCM2835SystemTimerState), + VMSTATE_UINT32(reg.ctrl_status, BCM2835SystemTimerState), VMSTATE_UINT32_ARRAY(reg.compare, BCM2835SystemTimerState, BCM2835_SYSTIMER_COUNT), VMSTATE_END_OF_LIST() --=20 2.26.2 From nobody Thu May 16 22:50:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.66 as permitted sender) client-ip=209.85.128.66; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f66.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.66 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1600624717; cv=none; d=zohomail.com; s=zohoarc; b=c2sW1tZcRCCvAPXrisl3hM3oGvWaw+wb0Ls3C2vYanvrtnMB7XjrqmsIpQ/wFO0+Zlz4Qpb+2n2S7FayV8GAYIm2WBKZDIbk2r6jQpbYZd0b5vxdS/27cKCgh0XLzrX4NkDfEEtYYASplZIXxuVcNM2WNhWhQrH1tQcgI7jjwS0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600624717; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZsGklvGCCEfAG2C9pvK94uYRWIB54oFE2Bd5BK/jcb8=; b=Sz5004vtprj6lUaNCdbzMMvUt854HclpZbOJOOpjHYq3h2e7f/X78IGnU+wC3iPU6Vnj+9XqeVEKbsimJ05nh2cJ3TQBtGdHLBKBcWc+9QqSZd3DROHmfB7hGNOsGrMmZBD8CbNf+4tJYURJlDoeNssCq7phapr8P3rfZfVwonk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.66 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mx.zohomail.com with SMTPS id 1600624717490420.9841431047955; Sun, 20 Sep 2020 10:58:37 -0700 (PDT) Received: by mail-wm1-f66.google.com with SMTP id e17so9957136wme.0 for ; Sun, 20 Sep 2020 10:58:36 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id u66sm15675781wme.12.2020.09.20.10.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Sep 2020 10:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZsGklvGCCEfAG2C9pvK94uYRWIB54oFE2Bd5BK/jcb8=; b=TkB3zzCeI8YhT2U6WxycJrsinLA87pX1heBznbc6QoAumbTiblsnhocnhiFikIH3v5 DK6JmphQDVPGRuaO40U3eERiPmElnP2CmbwInxA4QbCGsawVQ8IYkf3AcTq+btdh/Xc6 BZDZH4ITChGmXL8o8cwbpJW8VWZWHM2mWNqYtjggk2IVBU0FoUGf/DZRpb1bpkkHxbps 3YnKVP+WbyWQ0W7uBKEUzPyb0I8lyTP4gj8wf0nFpOQTV18Tn8MB9N2ZvcYL9U1PIYay 0bTTBiK1YS0OUMTGQiFdYfKUBMb7Go1ObIvLlWTJiOg6eK5m73Qp+rdEsBCJOeF71kK0 fysw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZsGklvGCCEfAG2C9pvK94uYRWIB54oFE2Bd5BK/jcb8=; b=Y3FtZ5Q2kIfyGRuBYanN+1sNmgW0+/K4FxMQncF5WlNEQ8scxMPCNfDVXTr0n7bk/O TOwNWJhEJlPqAVkSxR/7olFCRSk5R4txGNxs95dCXeVkhlJuwPdRQlhgFVUMHEBOJ0Z4 OnXG/Cw1OUbrEVZrafo6t524Z6Zjm4OkR20eTkNbsDzkK1nlEif+UtC7XvS5w6SQMRyI K6dgxUHxTTFrrOljfqW9+5K8dyHzqcst5T8195BpfFgCq3nSWXgNmPv66Pa+ChwnKZ4U 165K02WWIfXMtofUZQk4BY32gI3BSj940wgesLTE7e0DxwApQ6KfAlL3LUM5kkNMtMGS W0+g== X-Gm-Message-State: AOAM532WMO4Mx+XOJPhlsHCHKr/PN7C0evo1Ran4DTWxCQ/ZuN1F+1x4 HffJ+FAIPBAaY6n0KiGIx1NhV0ruLB8= X-Google-Smtp-Source: ABdhPJy6Vc3n8ekSzzB73iq7sVKYYDnQmUtwP3i5TmEvgsjaoQE29zscia6PUjuhmdI5hMQf5wdrxg== X-Received: by 2002:a1c:7f8b:: with SMTP id a133mr27881664wmd.155.1600624715498; Sun, 20 Sep 2020 10:58:35 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Niek Linnenbank , Peter Maydell , Paul Zimmerman , Andrew Baumann , Luc Michel Subject: [PATCH 6/7] hw/timer/bcm2835: Support the timer COMPARE registers Date: Sun, 20 Sep 2020 19:58:24 +0200 Message-Id: <20200920175825.417680-7-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200920175825.417680-1-f4bug@amsat.org> References: <20200920175825.417680-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) This peripheral has 1 free-running timer and 4 compare registers. Only the free-running timer is implemented. Add support the COMPARE registers (each register is wired to an IRQ). Reference: "BCM2835 ARM Peripherals" datasheet [*] chapter 12 "System Timer": The System Timer peripheral provides four 32-bit timer channels and a single 64-bit free running counter. Each channel has an output compare register, which is compared against the 32 least significant bits of the free running counter values. When the two values match, the system timer peripheral generates a signal to indicate a match for the appropriate channel. The match signal is then fed into the interrupt controller. This peripheral is used since Linux 3.7, commit ee4af5696720 ("ARM: bcm2835: add system timer"). [*] https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals= .pdf Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/timer/bcm2835_systmr.h | 11 +++++++-- hw/timer/bcm2835_systmr.c | 41 +++++++++++++++++++------------ hw/timer/trace-events | 4 ++- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/include/hw/timer/bcm2835_systmr.h b/include/hw/timer/bcm2835_s= ystmr.h index e0db9e9e12b..17fdd9d67b2 100644 --- a/include/hw/timer/bcm2835_systmr.h +++ b/include/hw/timer/bcm2835_systmr.h @@ -11,6 +11,7 @@ =20 #include "hw/sysbus.h" #include "hw/irq.h" +#include "qemu/timer.h" #include "qom/object.h" =20 #define TYPE_BCM2835_SYSTIMER "bcm2835-sys-timer" @@ -20,18 +21,24 @@ DECLARE_INSTANCE_CHECKER(BCM2835SystemTimerState, BCM28= 35_SYSTIMER, =20 #define BCM2835_SYSTIMER_COUNT 4 =20 +typedef struct { + unsigned id; + QEMUTimer timer; + qemu_irq irq; + BCM2835SystemTimerState *state; +} BCM2835SystemTimerCompare; + struct BCM2835SystemTimerState { /*< private >*/ SysBusDevice parent_obj; =20 /*< public >*/ MemoryRegion iomem; - qemu_irq irq; - struct { uint32_t ctrl_status; uint32_t compare[BCM2835_SYSTIMER_COUNT]; } reg; + BCM2835SystemTimerCompare tmr[BCM2835_SYSTIMER_COUNT]; }; =20 #endif diff --git a/hw/timer/bcm2835_systmr.c b/hw/timer/bcm2835_systmr.c index b234e83824f..43e644f5e45 100644 --- a/hw/timer/bcm2835_systmr.c +++ b/hw/timer/bcm2835_systmr.c @@ -28,20 +28,13 @@ REG32(COMPARE1, 0x10) REG32(COMPARE2, 0x14) REG32(COMPARE3, 0x18) =20 -static void bcm2835_systmr_update_irq(BCM2835SystemTimerState *s) +static void bcm2835_systmr_timer_expire(void *opaque) { - bool enable =3D !!s->reg.ctrl_status; + BCM2835SystemTimerCompare *tmr =3D opaque; =20 - trace_bcm2835_systmr_irq(enable); - qemu_set_irq(s->irq, enable); -} - -static void bcm2835_systmr_update_compare(BCM2835SystemTimerState *s, - unsigned timer_index) -{ - /* TODO fow now, since neither Linux nor U-boot use these timers. */ - qemu_log_mask(LOG_UNIMP, "COMPARE register %u not implemented\n", - timer_index); + trace_bcm2835_systmr_timer_expired(tmr->id); + tmr->state->reg.ctrl_status |=3D 1 << tmr->id; + qemu_set_irq(tmr->irq, 1); } =20 static uint64_t bcm2835_systmr_read(void *opaque, hwaddr offset, @@ -78,16 +71,25 @@ static void bcm2835_systmr_write(void *opaque, hwaddr o= ffset, uint64_t value, unsigned size) { BCM2835SystemTimerState *s =3D BCM2835_SYSTIMER(opaque); + int index; =20 trace_bcm2835_systmr_write(offset, value); switch (offset) { case A_CTRL_STATUS: s->reg.ctrl_status &=3D ~value; /* Ack */ - bcm2835_systmr_update_irq(s); + for (index =3D 0; index < ARRAY_SIZE(s->tmr); index++) { + if (extract32(value, index, 1)) { + trace_bcm2835_systmr_irq_ack(index); + qemu_set_irq(s->tmr[index].irq, 0); + } + } break; case A_COMPARE0 ... A_COMPARE3: - s->reg.compare[(offset - A_COMPARE0) >> 2] =3D value; - bcm2835_systmr_update_compare(s, (offset - A_COMPARE0) >> 2); + index =3D (offset - A_COMPARE0) >> 2; + s->reg.compare[index] =3D value; + timer_mod(&s->tmr[index].timer, value); + trace_bcm2835_systmr_run(index, + value - qemu_clock_get_us(QEMU_CLOCK_VIRT= UAL)); break; case A_COUNTER_LOW: case A_COUNTER_HIGH: @@ -125,7 +127,14 @@ static void bcm2835_systmr_realize(DeviceState *dev, E= rror **errp) memory_region_init_io(&s->iomem, OBJECT(dev), &bcm2835_systmr_ops, s, "bcm2835-sys-timer", 0x20); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq); + + for (size_t i =3D 0; i < ARRAY_SIZE(s->tmr); i++) { + s->tmr[i].id =3D i; + s->tmr[i].state =3D s; + sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->tmr[i].irq); + timer_init_us(&s->tmr[i].timer, QEMU_CLOCK_VIRTUAL, + bcm2835_systmr_timer_expire, &s->tmr[i]); + } } =20 static const VMStateDescription bcm2835_systmr_vmstate =3D { diff --git a/hw/timer/trace-events b/hw/timer/trace-events index b996d992000..f4ca31d4951 100644 --- a/hw/timer/trace-events +++ b/hw/timer/trace-events @@ -77,9 +77,11 @@ nrf51_timer_write(uint8_t timer_id, uint64_t addr, uint3= 2_t value, unsigned size nrf51_timer_set_count(uint8_t timer_id, uint8_t counter_id, uint32_t value= ) "timer %u counter %u count 0x%" PRIx32 =20 # bcm2835_systmr.c -bcm2835_systmr_irq(bool enable) "timer irq state %u" +bcm2835_systmr_timer_expired(unsigned id) "timer #%u expired" +bcm2835_systmr_irq_ack(unsigned id) "timer #%u acked" bcm2835_systmr_read(uint64_t offset, uint64_t data) "timer read: offset 0x= %" PRIx64 " data 0x%" PRIx64 bcm2835_systmr_write(uint64_t offset, uint64_t data) "timer write: offset = 0x%" PRIx64 " data 0x%" PRIx64 +bcm2835_systmr_run(unsigned id, uint64_t delay_us) "timer #%u expiring in = %"PRIu64" us" =20 # avr_timer16.c avr_timer16_read(uint8_t addr, uint8_t value) "timer16 read addr:%u value:= %u" --=20 2.26.2 From nobody Thu May 16 22:50:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) client-ip=209.85.221.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1600624718; cv=none; d=zohomail.com; s=zohoarc; b=l3r/aZZoie+tGrleEwNrMohuK24+IJuGDu76DVp3nxoSx4RxqiAtPBnRNQmyMkEYLy5yeVVNNu8ZtSDlyRPDPtfnypUbvBb+juqVt6jIrCe7oLGLq8wgqamPcEE3p4LEt0nX8G05P6UQSMQEsBidKh5Td/jxXIPDuxi++L/mSrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600624718; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1xZK1vadig9h9dP7jrIfkZesoIogtY0XRXYELyLBf2M=; b=BDE4NG570YUWQbv2rEVlMwCwL+UNlYt7UUtCgwGLDRL8pGFdARhGkOM7Yn6+Vfxvhb3Cw2iRczU+nlJoSsx/HJKa3EUnJpXHY9jDuYyxDvc2JSYVlvAzBh71RhvFOgWMrjVcB5z+qZacUr5qOTotNg954l0AU0ihK7h5V79vQh4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.zohomail.com with SMTPS id 1600624718771230.2475506889857; Sun, 20 Sep 2020 10:58:38 -0700 (PDT) Received: by mail-wr1-f67.google.com with SMTP id j2so10438251wrx.7 for ; Sun, 20 Sep 2020 10:58:38 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id u66sm15675781wme.12.2020.09.20.10.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Sep 2020 10:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1xZK1vadig9h9dP7jrIfkZesoIogtY0XRXYELyLBf2M=; b=U0PK9Eik3JEvu0Sum1qSEdY4uHVbNBMFh9FnCQbiFUIgbVQfR2DoRTPxDOCYKBSEnw k8AkxkWBAiSTC9AKlEEFmhwwdxU/hxnykVbmd+q/52OPW1nuhd/Q116cPu8gxJxcDeOC MsBfa14wpz74rSFOLk5uD1JuQXz37PPCxYZF5dMHG1+Kuxm+n3xex4W3JT88IpylEZs+ IikRLob4iz4H7HbKsYpgmLVde4rq5N6sF8WJIy1EAJi/Xds1HVQllCuzY60F6iDpxLox PnKN9kJ57t/friTdyywiZZqNCEa0HhjHIhxiR05pa7/rNaBwSdqydsAC7rTIRmMOF1Jn +0RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=1xZK1vadig9h9dP7jrIfkZesoIogtY0XRXYELyLBf2M=; b=JVA9fGdzXBKkkViMideCbAKQnbg9tAqEFpzN1fkgNEElV2A3tbZwm2otRgdFUm+P0h sZrAjh5M13AY8BQeA/aAsAKCPVYuX7HV8dHfmhmPq2E1D/iwHAESNMsf1Zywo27PVzBn oSD3CjH6y27XodZ9k4wKptnHQUhmbZ1wMcIbFI7WthEFh23rpXA3yuILaNCmKsNHGR4+ rmehTFa5S/TDevdq8ljUA67NrTLywsUrNjhtHh2QVEIwWmi6s+mwfTzK6cJMveZ9GS74 I18OKyXJAo4EKv9AY0ErVugvZzrzfW8Plc1k3zGMgO5E/7qAtJTMiT9ZETSX8iBR6E9g PRmw== X-Gm-Message-State: AOAM530eXl2ziOGB7cdmCDjRNwR0w0/Qa+sFWOr50K8fbH6T3uGp+Tqe 1ItosL/MlsVSoGBCrCJKM/Y= X-Google-Smtp-Source: ABdhPJwvPUpT893V2jMyyuv+t4itMljSkWTehXE8WAQqLoahv8TFm0MNZCnJR7ExWJlXV0eqspoZdw== X-Received: by 2002:adf:f2d0:: with SMTP id d16mr46647540wrp.332.1600624716675; Sun, 20 Sep 2020 10:58:36 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Niek Linnenbank , Peter Maydell , Paul Zimmerman , Andrew Baumann , Luc Michel Subject: [PATCH 7/7] hw/arm/bcm2835_peripherals: Correctly wire the SYS_timer IRQs Date: Sun, 20 Sep 2020 19:58:25 +0200 Message-Id: <20200920175825.417680-8-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200920175825.417680-1-f4bug@amsat.org> References: <20200920175825.417680-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The SYS_timer is not directly wired to the ARM core, but to the SoC interrupt controller. Fixes: 0e5bbd74064 ("hw/arm/bcm2835_peripherals: Use the SYS_timer") Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/bcm2835_peripherals.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index 4e6c678aa99..d1a1ff0676e 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -171,8 +171,17 @@ static void bcm2835_peripherals_realize(DeviceState *d= ev, Error **errp) memory_region_add_subregion(&s->peri_mr, ST_OFFSET, sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->systmr), 0)); sysbus_connect_irq(SYS_BUS_DEVICE(&s->systmr), 0, - qdev_get_gpio_in_named(DEVICE(&s->ic), BCM2835_IC_ARM_IRQ, - INTERRUPT_ARM_TIMER)); + qdev_get_gpio_in_named(DEVICE(&s->ic), BCM2835_IC_GPU_IRQ, + INTERRUPT_TIMER0)); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->systmr), 1, + qdev_get_gpio_in_named(DEVICE(&s->ic), BCM2835_IC_GPU_IRQ, + INTERRUPT_TIMER1)); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->systmr), 2, + qdev_get_gpio_in_named(DEVICE(&s->ic), BCM2835_IC_GPU_IRQ, + INTERRUPT_TIMER2)); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->systmr), 3, + qdev_get_gpio_in_named(DEVICE(&s->ic), BCM2835_IC_GPU_IRQ, + INTERRUPT_TIMER3)); =20 /* UART0 */ qdev_prop_set_chr(DEVICE(&s->uart0), "chardev", serial_hd(0)); --=20 2.26.2