[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/11] hw/arm/virt: Make PL061 GPIO lines pulled low, not high
From: |
Peter Maydell |
Subject: |
[PATCH 08/11] hw/arm/virt: Make PL061 GPIO lines pulled low, not high |
Date: |
Fri, 2 Jul 2021 11:40:15 +0100 |
For the virt board we have two PL061 devices -- one for NonSecure which
is inputs only, and one for Secure which is outputs only. For the former,
we don't care whether its outputs are pulled low or high when the line is
configured as an input, because we don't connect them. For the latter,
we do care, because we wire the lines up to the gpio-pwr device, which
assumes that level 1 means "do the action" and 1 means "do nothing".
For consistency in case we add more outputs in future, configure both
PL061s to pull GPIO lines down to 0.
Reported-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/virt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 4b96f060140..93ab9d21ea0 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -895,6 +895,9 @@ static void create_gpio_devices(const VirtMachineState
*vms, int gpio,
MachineState *ms = MACHINE(vms);
pl061_dev = qdev_new("pl061");
+ /* Pull lines down to 0 if not driven by the PL061 */
+ qdev_prop_set_uint32(pl061_dev, "pullups", 0);
+ qdev_prop_set_uint32(pl061_dev, "pulldowns", 0xff);
s = SYS_BUS_DEVICE(pl061_dev);
sysbus_realize_and_unref(s, &error_fatal);
memory_region_add_subregion(mem, base, sysbus_mmio_get_region(s, 0));
--
2.20.1
- [PATCH 03/11] hw/gpio/pl061: Clean up read/write offset handling logic, (continued)
Re: [PATCH 03/11] hw/gpio/pl061: Clean up read/write offset handling logic, Richard Henderson, 2021/07/06
[PATCH 04/11] hw/gpio/pl061: Add tracepoints for register read and write, Peter Maydell, 2021/07/02
[PATCH 08/11] hw/arm/virt: Make PL061 GPIO lines pulled low, not high,
Peter Maydell <=
[PATCH 07/11] hw/gpio/pl061: Make pullup/pulldown of outputs configurable, Peter Maydell, 2021/07/02
[PATCH 09/11] hw/gpio/pl061: Convert to 3-phase reset and assert GPIO lines correctly on reset, Peter Maydell, 2021/07/02
[PATCH 11/11] hw/arm/stellaris: Expand comment about handling of OLED chipselect, Peter Maydell, 2021/07/02
[PATCH 10/11] hw/gpio/pl061: Document a shortcoming in our implementation, Peter Maydell, 2021/07/02
[PATCH 05/11] hw/gpio/pl061: Document the interface of this device, Peter Maydell, 2021/07/02