pinctrl: single: Fix probe failure getting register area size
Subsystems (2)
PATCH 1/1 pinctrl: single: Fix probe failure getting register area size
If reg property of pinctrl-single node requires address translation then probe fails with following message:
single-pinctrl pinctrl at 4301c000: failed to get base register size
This is because driver uses dev_read_addr_size() to get size which also tries to fetch untranslated addr and fails.
Fix this by using dev_read_addr_size_index() which takes care of address translation and also makes following dev_read_addr() call redundant.
This fixes Ethernet failures on TI's AM654 based EVMs due to lack of pinmux configuration.
--- drivers/pinctrl/pinctrl-single.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/pinctrl/pinctrl-single.c +2 -8
@@ -509,19 +509,13 @@ static int single_of_to_plat(struct udevice *dev)return -EINVAL ; } - addr =dev_read_addr_size (dev,"reg" , &size); + addr =dev_read_addr_size_index (dev,0 , &size);if (addr ==FDT_ADDR_T_NONE ) { -dev_err (dev,"failed to get base register size\n" ); +dev_err (dev,"failed to get base register address\n" );return -EINVAL ; } pdata->offset = size - pdata->width /BITS_PER_BYTE ; - - addr =dev_read_addr (dev); -if (addr ==FDT_ADDR_T_NONE ) { -dev_dbg (dev,"no valid base register address\n" ); -return -EINVAL ; - } pdata->base = addr; ret =dev_read_u32 (dev,"pinctrl-single,function-mask" , &pdata->mask);
Signature · 1 line
2.31.1
PATCH 1/1 pinctrl: single: Fix probe failure getting register area size
Quoted 35 lines · Vignesh Raghavendra
If reg property of pinctrl-single node requires address translation then probe fails with following message:
single-pinctrl pinctrl at
4301c000: failed to get base register sizeThis is because driver uses
dev_read_addr_size()to get size which also tries to fetch untranslated addr and fails.
Fix this by usingdev_read_addr_size_index()which takes care of address translation and also makes followingdev_read_addr()call redundant.This fixes Ethernet failures on TI's AM654 based EVMs due to lack of pinmux configuration.
Fixes 9fd8a430f3 ("pinctrl: single: get register area size by device API")Signed-off-by Vignesh Raghavendra <[email protected]>--- drivers/pinctrl/pinctrl-single.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)drivers/pinctrl/pinctrl-single.c +2
-2@@ -509,19 +509,13 @@ static int single_of_to_plat(struct udevice *dev)return -EINVAL ; } - addr =dev_read_addr_size (dev,"reg" , &size); + addr =dev_read_addr_size_index (dev,0 , &size);if (addr ==FDT_ADDR_T_NONE ) { -dev_err (dev,"failed to get base register size\n" ); +dev_err (dev,"failed to get base register address\n" );return -EINVAL ; }
drivers/pinctrl/pinctrl-single.c static int single_of_to_plat(struct udevice *dev) · line 521
Quoted 10 lines
drivers/pinctrl/pinctrl-single.c +0
-6pdata->offset = size - pdata->width /BITS_PER_BYTE ; - - addr =dev_read_addr (dev); -if (addr ==FDT_ADDR_T_NONE ) { -dev_dbg (dev,"no valid base register address\n" ); -return -EINVAL ; - } pdata->base = addr; ret =dev_read_u32 (dev,"pinctrl-single,function-mask" , &pdata->mask);
Dario, since this has a fixes tag for a commit of yours, comments? Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210517/b91caa00/attachment.sig>
PATCH 1/1 pinctrl: single: Fix probe failure getting register area size
Hi,
Quoted 49 lines
Il 17/05/2021 22:15 Tom Rini <[email protected]> ha scritto:
Quoted 44 lines · Vignesh Raghavendra
If reg property of pinctrl-single node requires address translation then probe fails with following message:
single-pinctrl pinctrl at
4301c000: failed to get base register sizeThis is because driver uses
dev_read_addr_size()to get size which also tries to fetch untranslated addr and fails.
Fix this by usingdev_read_addr_size_index()which takes care of address translation and also makes followingdev_read_addr()call redundant.This fixes Ethernet failures on TI's AM654 based EVMs due to lack of pinmux configuration.
Fixes 9fd8a430f3 ("pinctrl: single: get register area size by device API")Signed-off-by Vignesh Raghavendra <[email protected]>--- drivers/pinctrl/pinctrl-single.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)drivers/pinctrl/pinctrl-single.c +2
-8@@ -509,19 +509,13 @@ static int single_of_to_plat(struct udevice *dev)return -EINVAL ; } - addr =dev_read_addr_size (dev,"reg" , &size); + addr =dev_read_addr_size_index (dev,0 , &size);if (addr ==FDT_ADDR_T_NONE ) { -dev_err (dev,"failed to get base register size\n" ); +dev_err (dev,"failed to get base register address\n" );return -EINVAL ; } pdata->offset = size - pdata->width /BITS_PER_BYTE ; - - addr =dev_read_addr (dev); -if (addr ==FDT_ADDR_T_NONE ) { -dev_dbg (dev,"no valid base register address\n" ); -return -EINVAL ; - } pdata->base = addr;
Quoted 5 lines
drivers/pinctrl/pinctrl-single.c static int single_of_to_plat(struct udevice *dev) · line 521
Quoted 1 line
drivers/pinctrl/pinctrl-single.c +0
-0ret =dev_read_u32 (dev,"pinctrl-single,function-mask" , &pdata->mask);Dario, since this has a fixes tag for a commit of yours, comments? Thanks!
I applied the patch and tested it on my beaglebone black.
It is OK. As well the tests I had developed in the sandbox configuration for pinmux passed.
Thanks and regards,
Dario
Quoted 2 lines
Signature · 1 line
Tom
Quoted 10 lines · Vignesh Raghavendra
If reg property of pinctrl-single node requires address translation then probe fails with following message:
single-pinctrl pinctrl@4301c000: failed to get base register size
This is because driver uses
dev_read_addr_size()to get size which also tries to fetch untranslated addr and fails.
Fix this by usingdev_read_addr_size_index()which takes care of address translation and also makes followingdev_read_addr()call redundant.
Quoted 5 lines
This fixes Ethernet failures on TI's AM654 based EVMs due to lack of pinmux configuration.
Fixes 9fd8a430f3 ("pinctrl: single: get register area size by device API")Signed-off-by Vignesh Raghavendra <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom