[PATCH v2 1/2] mips: dts: Fix PIC32MZDA GPIO register definitions

Daniel Schwierzeck daniel.schwierzeck at gmail.com
Sat Sep 19 21:34:01 CEST 2020


Am Dienstag, den 01.09.2020, 18:02 +0000 schrieb John Robertson:
> GPIO state cannot be changed via the device tree (e.g. with gpio-hog) or
> using the 'gpio' command from the console.
> 
> The root cause is a discrepancy between the driver and the device tree:
> the driver code expects an absolute I/O address in the <reg> property,
> while the device tree defines the address relative to a declaration in
> the parent pinctrl node.
> 
> Changing the device tree to fix a driver issue would normally be wrong,
> however:
> - I have run the first version of U-Boot in which this driver appears
>   (v2016.03) and the same problem exists, so this is not a regression;
> - There is no code that references a parent device tree node that might
>   suggest the intent of the author was to parse the DT as it exists now;
> - The equivalent Linux PIC32 GPIO driver also uses absolute addresses
>   for the GPIO <reg> property. This change brings the U-Boot DT more
>   into line with Linux.
> 
> Additionally, the data sheet (Microchip ref. 60001361H) shows that the
> register set to control a GPIO bank spans 0xE0 bytes, but the device
> tree specified size is only 0x48 bytes.
> 
> Signed-off-by: John Robertson <john.robertson at simiatec.com>
> ---
> Changes in v2
> - Split patch
> - Document change more fully
> 
>  arch/mips/dts/pic32mzda.dtsi | 45 ++++++++++++++++++------------------
>  1 file changed, 22 insertions(+), 23 deletions(-)
> 

applied to u-boot-mips/fixes, thanks.

-- 
- Daniel



More information about the U-Boot mailing list