[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/14] hw/arm/mps2: Add CMSDK AHB GPIO peripherals as unimplem
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 09/14] hw/arm/mps2: Add CMSDK AHB GPIO peripherals as unimplemented devices |
Date: |
Wed, 17 Jun 2020 07:52:00 +0200 |
Register the GPIO peripherals as unimplemented to better
follow their accesses, for example booting Zephyr:
----------------
IN: arm_mps2_pinmux_init
0x00001160: f64f 0231 movw r2, #0xf831
0x00001164: 4b06 ldr r3, [pc, #0x18]
0x00001166: 2000 movs r0, #0
0x00001168: 619a str r2, [r3, #0x18]
0x0000116a: f24c 426f movw r2, #0xc46f
0x0000116e: f503 5380 add.w r3, r3, #0x1000
0x00001172: 619a str r2, [r3, #0x18]
0x00001174: f44f 529e mov.w r2, #0x13c0
0x00001178: f503 5380 add.w r3, r3, #0x1000
0x0000117c: 619a str r2, [r3, #0x18]
0x0000117e: 4770 bx lr
cmsdk-ahb-gpio: unimplemented device write (size 4, value 0xf831, offset 0x18)
cmsdk-ahb-gpio: unimplemented device write (size 4, value 0xc46f, offset 0x18)
cmsdk-ahb-gpio: unimplemented device write (size 4, value 0x13c0, offset 0x18)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/arm/mps2.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index f7bef20b40..c66c595d4a 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -113,6 +113,7 @@ static void mps2_common_init(MachineState *machine)
MemoryRegion *system_memory = get_system_memory();
MachineClass *mc = MACHINE_GET_CLASS(machine);
DeviceState *armv7m, *sccdev;
+ int i;
if (strcmp(machine->cpu_type, mc->default_cpu_type) != 0) {
error_report("This board can only be used with CPU %s",
@@ -228,7 +229,6 @@ static void mps2_common_init(MachineState *machine)
*/
Object *orgate;
DeviceState *orgate_dev;
- int i;
orgate = object_new(TYPE_OR_IRQ);
object_property_set_int(orgate, 6, "num-lines", &error_fatal);
@@ -265,7 +265,6 @@ static void mps2_common_init(MachineState *machine)
*/
Object *orgate;
DeviceState *orgate_dev;
- int i;
orgate = object_new(TYPE_OR_IRQ);
object_property_set_int(orgate, 10, "num-lines", &error_fatal);
@@ -301,6 +300,11 @@ static void mps2_common_init(MachineState *machine)
default:
g_assert_not_reached();
}
+ for (i = 0; i < 4; i++) {
+ static const hwaddr gpiobase[] = {0x40010000, 0x40011000,
+ 0x40012000, 0x40013000};
+ create_unimplemented_device("cmsdk-ahb-gpio", gpiobase[i], 0x1000);
+ }
/* CMSDK APB subsystem */
cmsdk_apb_timer_create(0x40000000, qdev_get_gpio_in(armv7m, 8),
SYSCLK_FRQ);
--
2.21.3
- [PATCH v2 00/14] mps2: Add few more peripherals, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 02/14] hw/i2c/versatile_i2c: Add definitions for register addresses, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 01/14] hw/watchdog/cmsdk-apb-watchdog: Add trace event for lock status, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 03/14] hw/i2c/versatile_i2c: Add SCL/SDA definitions, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 05/14] hw/arm: Use TYPE_VERSATILE_I2C instead of hardcoded string, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 04/14] hw/i2c: Add header for ARM SBCon two-wire serial bus interface, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 07/14] hw/arm/mps2: Rename CMSDK AHB peripheral region, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 08/14] hw/arm/mps2: Add CMSDK APB watchdog device, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 09/14] hw/arm/mps2: Add CMSDK AHB GPIO peripherals as unimplemented devices,
Philippe Mathieu-Daudé <=
- [PATCH v2 10/14] hw/arm/mps2: Map the FPGA I/O block, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 11/14] hw/arm/mps2: Add SPI devices, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 06/14] hw/arm/mps2: Document CMSDK/FPGA APB subsystem sections, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 12/14] hw/arm/mps2: Add I2C devices, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 13/14] hw/arm/mps2: Add audio I2S interface as unimplemented device, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH v2 14/14] hw/arm/mps2-tz: Use the ARM SBCon two-wire serial bus interface, Philippe Mathieu-Daudé, 2020/06/17
- Re: [PATCH v2 00/14] mps2: Add few more peripherals, no-reply, 2020/06/17