[PATCH resend 0/2] gpio: mpc8xxx: honour shadow register when writing gpdat

Rasmus Villemoes rasmus.villemoes at prevas.dk
Tue Jan 28 13:04:32 CET 2020


[resending with Mario's correct address, sorry for the double post]

The driver correctly uses the shadow register when asked for the
current value of an output gpio. Unfortunately, it does RMW on the
gpdat register both when setting a gpio as input and output. These two
patches fix that.

Aside: Apparently, the mpc8309 also partially suffers from the errata
preventing outputs from being read back - the bits corresponding to
gpios 0-7 are always read as 0, while at least the value of gpio10 is
correctly reflected when reading gpdat. Which is how I noticed these
bugs - I couldn't understand why turning one LED on would turn off
another.

Rasmus Villemoes (2):
  gpio: mpc8xxx: don't modify gpdat when setting gpio as input
  gpio: mpc8xxx: don't do RMW on gpdat register when setting value

 drivers/gpio/mpc8xxx_gpio.c | 41 ++++++++++++++-----------------------
 1 file changed, 15 insertions(+), 26 deletions(-)

-- 
2.23.0



More information about the U-Boot mailing list