From nobody Wed Apr 2 02:02:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1569520083; cv=none; d=zoho.com; s=zohoarc; b=BNo0oONDvUlGO/6KOdsgWshRGsYTpb+Kj4IAv3xDUSgfZp/b2/ekzDwsj3QvVo7GIii0EpgqHOlJQJGCUkTMD5BFgNNDcVodSjvc0S/J9/v1LBjxOgUhM98D99gPtNvOiSW800ySAotw+7x1sS14WEy407UeohtgWsisQTMiRLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569520083; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=/8xcNneZ2/qvbDmM1OKk4z67N/LkpAUXIQ5kG5a96Wc=; b=b8LicZMGD/sgg6fbso6FfB+pbk0qzP+0NZaYFkFkulKMtl6b+m1rbdMpmU31MSRHZGoKH9O42xpAgb86WAP5TT5rHYexi8GGDNv7xGSKpchUUZo6xMZ0Jqzio0hRa5igwLYcb8eXWs5n8EcwhXgGx/vqamFLgBstcwJrmD0siws= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569520083177264.30796808557227; Thu, 26 Sep 2019 10:48:03 -0700 (PDT) Received: from localhost ([::1]:41862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDXrw-0007Qo-SV for importer@patchew.org; Thu, 26 Sep 2019 13:47:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58809) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDXgB-0004M8-AV for qemu-devel@nongnu.org; Thu, 26 Sep 2019 13:35:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDXg9-0002qH-OQ for qemu-devel@nongnu.org; Thu, 26 Sep 2019 13:35:47 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38862) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDXg9-0002p0-Fi; Thu, 26 Sep 2019 13:35:45 -0400 Received: by mail-wr1-f66.google.com with SMTP id w12so3030319wro.5; Thu, 26 Sep 2019 10:35:45 -0700 (PDT) Received: from x1w.redhat.com (240.red-88-21-68.staticip.rima-tde.net. [88.21.68.240]) by smtp.gmail.com with ESMTPSA id b186sm9918980wmd.16.2019.09.26.10.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:34:43 -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=/8xcNneZ2/qvbDmM1OKk4z67N/LkpAUXIQ5kG5a96Wc=; b=TwNnoiFM7EJNzS+NQNIFxuyhk4QbIaOBCgsNgCY6waK+qwWJlJraWMcsPvYzeW4IqD 1yKNf9NU/5tX/ObAztYMZmC7Tvz+/Rl+Pf3fcIEO+px0//XWxod1vKlJOcy9VeFin6v2 9t5pL2izNG7VKmrT4eTh5mc/ryQoFzwImMYxGkEKmB79ZpN6mckyBeXNr/qWgwO8csyj RDV3Le1Xf0UlEYk0S2nBdGJVB0PkSRC6wPM7nHQaj8DXtMXtFKfiGD7yUTdmAXgXcrHL HC2hpb4T7RS1x/nHomNmtHoBTVMA/PyTNHS1AcO0jmKI7tImXBAEdtE5TAYwDqy2iS1S sClQ== 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=/8xcNneZ2/qvbDmM1OKk4z67N/LkpAUXIQ5kG5a96Wc=; b=X+yxSt0O3Sr2nW5eV62merqIaJqh/xmItm6fyDorxRZ3EH1Mz8BzXhwUg5bRvCkxSh NYjZvDBayT96OjHm2aOpl+nLD/4rMWWSFfgpOMsvrs6ZwpSe5wcuhkUZlRmrOwMR9VYy VBkWKoXjOmgRnJeTuz2KPvgt65Zob1JRm3SZBV+14JrJkXvwAzmqSJEKQik4mMiGQdpT rt0n6SuIz4nOQE+iPNPGA/vnKyw99RHRbiYHTnFr63qBTtSpI68eCJsG/D9pkBmY1lbW y5ece+TtpuAuAVxEjbw0qH0soXbhi6EbbDi29ve4Gfh0ckYqKQIZ3i2i4qna2P4nLlNw QEyg== X-Gm-Message-State: APjAAAV3epPCqnY2GarO+x3zxSo1CbS+oVEL2sv8UQ2wlfFeMFHyaBqp gOO9cPApFrPzEJdbW87iDI0Y6pDBQ6c= X-Google-Smtp-Source: APXvYqwRla+cPsLh/Qgqpz/qU/JFJJLJe2vqqDTqnFwTn5ku946P2NzbzWXSpZ6TM0QuYc6tJwM9HQ== X-Received: by 2002:adf:ce05:: with SMTP id p5mr2398368wrn.48.1569519284264; Thu, 26 Sep 2019 10:34:44 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 05/19] hw/arm/bcm2835: Add various unimplemented peripherals Date: Thu, 26 Sep 2019 19:34:13 +0200 Message-Id: <20190926173428.10713-6-f4bug@amsat.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190926173428.10713-1-f4bug@amsat.org> References: <20190926173428.10713-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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.66 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?UTF-8?q?Zolt=C3=A1n=20Baldaszti?= , Laurent Bonnans , Esteban Bosse , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrew Baumann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-arm@nongnu.org, Clement Deschamps , Cleber Rosa , Paolo Bonzini , Cheng Xiang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pekka Enberg , Guenter Roeck , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Base addresses and sizes taken from the "BCM2835 ARM Peripherals" datasheet from February 06 2012: https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Alistair Francis --- hw/arm/bcm2835_peripherals.c | 31 ++++++++++++++++++++++++++++ include/hw/arm/bcm2835_peripherals.h | 15 ++++++++++++++ include/hw/arm/raspi_platform.h | 8 +++++++ 3 files changed, 54 insertions(+) diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index 1bd2ff41d5..fdcf616c56 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -22,6 +22,20 @@ /* Capabilities for SD controller: no DMA, high-speed, default clocks etc.= */ #define BCM2835_SDHC_CAPAREG 0x52134b4 =20 +static void create_unimp(BCM2835PeripheralState *ps, + UnimplementedDeviceState *uds, + const char *name, hwaddr ofs, hwaddr size) +{ + sysbus_init_child_obj(OBJECT(ps), name, uds, + sizeof(UnimplementedDeviceState), + TYPE_UNIMPLEMENTED_DEVICE); + qdev_prop_set_string(DEVICE(uds), "name", name); + qdev_prop_set_uint64(DEVICE(uds), "size", size); + object_property_set_bool(OBJECT(uds), true, "realized", &error_fatal); + memory_region_add_subregion_overlap(&ps->peri_mr, ofs, + sysbus_mmio_get_region(SYS_BUS_DEVICE(uds), 0), -1000); +} + static void bcm2835_peripherals_init(Object *obj) { BCM2835PeripheralState *s =3D BCM2835_PERIPHERALS(obj); @@ -323,6 +337,23 @@ static void bcm2835_peripherals_realize(DeviceState *d= ev, Error **errp) error_propagate(errp, err); return; } + + create_unimp(s, &s->armtmr, "bcm2835-sp804", ARMCTRL_TIMER0_1_OFFSET, = 0x40); + create_unimp(s, &s->systmr, "bcm2835-systimer", ST_OFFSET, 0x20); + create_unimp(s, &s->cprman, "bcm2835-cprman", CPRMAN_OFFSET, 0x1000); + create_unimp(s, &s->a2w, "bcm2835-a2w", A2W_OFFSET, 0x1000); + create_unimp(s, &s->i2s, "bcm2835-i2s", I2S_OFFSET, 0x100); + create_unimp(s, &s->smi, "bcm2835-smi", SMI_OFFSET, 0x100); + create_unimp(s, &s->spi[0], "bcm2835-spi0", SPI0_OFFSET, 0x20); + create_unimp(s, &s->bscsl, "bcm2835-spis", BSC_SL_OFFSET, 0x100); + create_unimp(s, &s->i2c[0], "bcm2835-i2c0", BSC0_OFFSET, 0x20); + create_unimp(s, &s->i2c[1], "bcm2835-i2c1", BSC1_OFFSET, 0x20); + create_unimp(s, &s->i2c[2], "bcm2835-i2c2", BSC2_OFFSET, 0x20); + 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->dwc2, "dwc-usb2", USB_OTG_OFFSET, 0x1000); + create_unimp(s, &s->sdramc, "bcm2835-sdramc", SDRAMC_OFFSET, 0x100); } =20 static void bcm2835_peripherals_class_init(ObjectClass *oc, void *data) diff --git a/include/hw/arm/bcm2835_peripherals.h b/include/hw/arm/bcm2835_= peripherals.h index 6b17f6a382..62a4c7b559 100644 --- a/include/hw/arm/bcm2835_peripherals.h +++ b/include/hw/arm/bcm2835_peripherals.h @@ -23,6 +23,7 @@ #include "hw/sd/sdhci.h" #include "hw/sd/bcm2835_sdhost.h" #include "hw/gpio/bcm2835_gpio.h" +#include "hw/misc/unimp.h" =20 #define TYPE_BCM2835_PERIPHERALS "bcm2835-peripherals" #define BCM2835_PERIPHERALS(obj) \ @@ -37,6 +38,10 @@ typedef struct BCM2835PeripheralState { MemoryRegion ram_alias[4]; qemu_irq irq, fiq; =20 + UnimplementedDeviceState systmr; + UnimplementedDeviceState armtmr; + UnimplementedDeviceState cprman; + UnimplementedDeviceState a2w; PL011State uart0; BCM2835AuxState aux; BCM2835FBState fb; @@ -48,6 +53,16 @@ typedef struct BCM2835PeripheralState { SDHCIState sdhci; BCM2835SDHostState sdhost; BCM2835GpioState gpio; + UnimplementedDeviceState i2s; + UnimplementedDeviceState spi[1]; + UnimplementedDeviceState i2c[3]; + UnimplementedDeviceState otp; + UnimplementedDeviceState dbus; + UnimplementedDeviceState ave0; + UnimplementedDeviceState bscsl; + UnimplementedDeviceState smi; + UnimplementedDeviceState dwc2; + UnimplementedDeviceState sdramc; } BCM2835PeripheralState; =20 #endif /* BCM2835_PERIPHERALS_H */ diff --git a/include/hw/arm/raspi_platform.h b/include/hw/arm/raspi_platfor= m.h index 66969fac5d..cdcbca943f 100644 --- a/include/hw/arm/raspi_platform.h +++ b/include/hw/arm/raspi_platform.h @@ -38,6 +38,8 @@ * Doorbells & Mailbo= xes */ #define CPRMAN_OFFSET 0x100000 /* Power Management, Watchdog */ #define CM_OFFSET 0x101000 /* Clock Management */ +#define A2W_OFFSET 0x102000 /* Reset controller */ +#define AVS_OFFSET 0x103000 /* Audio Video Standard */ #define RNG_OFFSET 0x104000 #define GPIO_OFFSET 0x200000 #define UART0_OFFSET 0x201000 @@ -45,11 +47,17 @@ #define I2S_OFFSET 0x203000 #define SPI0_OFFSET 0x204000 #define BSC0_OFFSET 0x205000 /* BSC0 I2C/TWI */ +#define OTP_OFFSET 0x20f000 +#define BSC_SL_OFFSET 0x214000 /* SPI slave */ #define AUX_OFFSET 0x215000 /* AUX: UART1/SPI1/SPI2 */ #define EMMC1_OFFSET 0x300000 #define SMI_OFFSET 0x600000 #define BSC1_OFFSET 0x804000 /* BSC1 I2C/TWI */ +#define BSC2_OFFSET 0x805000 /* BSC2 I2C/TWI */ +#define DBUS_OFFSET 0x900000 +#define AVE0_OFFSET 0x910000 #define USB_OTG_OFFSET 0x980000 /* DTC_OTG USB controller */ +#define SDRAMC_OFFSET 0xe00000 #define DMA15_OFFSET 0xE05000 /* DMA controller, channel 15 */ =20 /* GPU interrupts */ --=20 2.20.1