qemu/hw/gpio
Peter Maydell c1e69e92ae hw/gpio/pl061: Make pullup/pulldown of outputs configurable
The PL061 GPIO does not itself include pullup or pulldown resistors
to set the value of a GPIO line treated as an output when it is
configured as an input (ie when the PL061 itself is not driving it).
In real hardware it is up to the board to add suitable pullups or
pulldowns.  Currently our implementation hardwires this to "outputs
pulled high", which is correct for some boards (eg the realview ones:
see figure 3-29 in the "RealView Platform Baseboard for ARM926EJ-S
User Guide" DUI0224I), but wrong for others.

In particular, the wiring in the 'virt' board and the gpio-pwr device
assumes that wires should be pulled low, because otherwise the
pull-to-high will trigger a shutdown or reset action.  (The only
reason this doesn't happen immediately on startup is due to another
bug in the PL061, where we don't assert the GPIOs to the correct
value on reset, but will do so as soon as the guest touches a
register and pl061_update() gets called.)

Add properties to the pl061 so the board can configure whether it
wants GPIO lines to have pullup, pulldown, or neither.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2021-07-09 16:09:12 +01:00
..
aspeed_gpio.c misc: Correct relative include path 2021-06-05 21:10:42 +02:00
bcm2835_gpio.c qom: Don't handle impossible object_property_get_link() failure 2020-07-10 15:18:08 +02:00
gpio_key.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
gpio_pwr.c hw/gpio/gpio_pwr: use shutdown function for reboot 2021-07-02 11:48:36 +01:00
imx_gpio.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
Kconfig hw: gpio: implement gpio-pwr driver for qemu reset/poweroff 2021-01-29 10:47:28 +00:00
max7310.c Pull request trivial patches 20200919 2020-09-22 15:42:23 +01:00
meson.build Drop the deprecated unicore32 target 2021-05-12 18:20:52 +02:00
mpc8xxx.c nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
npcm7xx_gpio.c hw/gpio: Add GPIO model for Nuvoton NPCM7xx 2020-10-27 11:10:32 +00:00
nrf51_gpio.c
omap_gpio.c hw/gpio/omap_gpio: Replace fprintf() by qemu_log_mask(GUEST_ERROR) 2020-09-09 15:27:48 +02:00
pl061.c hw/gpio/pl061: Make pullup/pulldown of outputs configurable 2021-07-09 16:09:12 +01:00
sifive_gpio.c hw/riscv: Move sifive_gpio model to hw/gpio 2020-09-09 15:54:19 -07:00
trace-events hw/gpio/pl061: Honour Luminary PL061 PUR and PDR registers 2021-07-09 16:09:12 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
zaurus.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00