Revert changes to __of_translate_address()
Subsystems (2)
cover Revert changes to __of_translate_address()
Globally enabled CONFIG_OF_TRANSLATE causes, that function dev_get_addr() returns a different result for a node with: 'size-cells = <0>'.
The above change, breaks the Exynos boards for a long time, because of GPIO driver, which uses the fdt in a non standard way.
After sending few approaches with adding support for that case, the one was appllied for a temporary fix for the release:
"fdt: fix address cell count checking in fdt_translate_address()"
However, after discussion on the list, we found that this way can't be accepted because the function __of_translate_address() as a backend of dev_get_addr(), shouldn't be used for translating a non-MMIO addresses.
Updating some device tree files with '#size-cells = 1' and by extending the 'reg' property by address length - fixes the problem.
This applies on u-boot-dm/master:
c5a7533 net: Fix delay in net_retry test
Przemyslaw Marczak (2):
dts:exynos:update pinctrl size-cells and fix child regs Revert "fdt: fix address cell count checking in
fdt_translate_address()"
arch/arm/dts/exynos4210-pinctrl-uboot.dtsi | 8 ++++---- arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi | 18 +++++++++--------- arch/arm/dts/exynos5250-pinctrl-uboot.dtsi | 16 ++++++++-------- arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi | 12 ++++++------ arch/arm/dts/s5pc110-pinctrl.dtsi | 4 ++-- common/fdt_support.c | 7 ++++--- 6 files changed, 33 insertions(+), 32 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/2 dts:exynos:update pinctrl size-cells and fix child regs
This change is required to avoid warnings about invalid size-cells defined in device-tree pinctrl nodes for Exynos.
Tested on:
- Odroid U3
- Odroid XU3
--- arch/arm/dts/exynos4210-pinctrl-uboot.dtsi | 8 ++++---- arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi | 18 +++++++++--------- arch/arm/dts/exynos5250-pinctrl-uboot.dtsi | 16 ++++++++-------- arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi | 12 ++++++------ arch/arm/dts/s5pc110-pinctrl.dtsi | 4 ++-- 5 files changed, 29 insertions(+), 29 deletions(-)
arch/arm/dts/exynos4210-pinctrl-uboot.dtsi +4 -4
@@ -9,21 +9,21 @@ /{ pinctrl_0: pinctrl at 11400000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; compatible = "samsung,exynos4210-pinctrl"; }; pinctrl_1: pinctrl at 11000000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; gpx0: gpx0 { - reg = <0xc00>; + reg = <0xc00 0x20>; }; }; pinctrl_2: pinctrl at 03860000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; }; };
arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi +9 -9
@@ -9,37 +9,37 @@ /{ pinctrl_0: pinctrl at 11400000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; gpf0: gpf0 { - reg = <0x180>; + reg = <0x180 0x20>; }; gpj0: gpj0 { - reg = <0x240>; + reg = <0x240 0x20>; }; }; pinctrl_1: pinctrl at 11000000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; gpk0: gpk0 { - reg = <0x40>; + reg = <0x40 0x20>; }; gpm0: gpm0 { - reg = <0x260>; + reg = <0x260 0x20>; }; gpx0: gpx0 { - reg = <0xc00>; + reg = <0xc00 0x20>; }; }; pinctrl_2: pinctrl at 03860000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; }; pinctrl_3: pinctrl at 106E0000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; }; };
arch/arm/dts/exynos5250-pinctrl-uboot.dtsi +8 -8
@@ -9,34 +9,34 @@ /{ pinctrl_0: pinctrl at 11400000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; gpc4: gpc4 { - reg = <0x2e0>; + reg = <0x2e0 0x20>; }; gpx0: gpx0 { - reg = <0xc00>; + reg = <0xc00 0x20>; }; }; pinctrl_1: pinctrl at 13400000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; }; pinctrl_2: pinctrl at 10d10000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; gpv2: gpv2 { - reg = <0x060>; + reg = <0x060 0x20>; }; gpv4: gpv4 { - reg = <0xc0>; + reg = <0xc0 0x20>; }; }; pinctrl_3: pinctrl at 03860000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; }; };
arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi +6 -6
@@ -14,29 +14,29 @@ */ pinctrl at 14010000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; }; pinctrl at 13400000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; gpy7 { }; gpx0 { - reg = <0xc00>; + reg = <0xc00 0x0>; }; }; pinctrl at 13410000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; }; pinctrl at 14000000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; }; pinctrl at 03860000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; }; };
arch/arm/dts/s5pc110-pinctrl.dtsi +2 -2
@@ -9,7 +9,7 @@ / { pinctrl at e0200000 { #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; gpa0: gpa0 { gpio-controller; #gpio-cells = <2>;
@@ -251,7 +251,7 @@ }; gph0: gph0 { - reg = <0xc00>; + reg = <0xc00 0x20>; gpio-controller; #gpio-cells = <2>; };
Signature · 1 line
1.9.1
PATCH 1/2 dts:exynos:update pinctrl size-cells and fix child regs
Quoted 13 lines · Przemyslaw Marczak
This change is required to avoid warnings about invalid size-cells defined in device-tree pinctrl nodes for Exynos.
Tested on:
- Odroid U3
- Odroid XU3Signed-off-by Przemyslaw Marczak <[email protected]>Cc Stefan Roese <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>Cc Stephen Warren <[email protected]>Cc Stephen Warren <[email protected]>
Quoted 7 lines
--- arch/arm/dts/exynos4210-pinctrl-uboot.dtsi | 8 ++++---- arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi | 18 +++++++++--------- arch/arm/dts/exynos5250-pinctrl-uboot.dtsi | 16 ++++++++-------- arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi | 12 ++++++------ arch/arm/dts/s5pc110-pinctrl.dtsi | 4 ++-- 5 files changed, 29 insertions(+), 29 deletions(-)
Tested on snow:
Stephen, I plan to pick this up so please sing out if there is a problem.
PATCH 1/2 dts:exynos:update pinctrl size-cells and fix child regs
Quoted 22 lines · Simon Glass
Quoted 13 lines · Przemyslaw Marczak
This change is required to avoid warnings about invalid size-cells defined in device-tree pinctrl nodes for Exynos.
Tested on:
- Odroid U3
- Odroid XU3Signed-off-by Przemyslaw Marczak <[email protected]>Cc Stefan Roese <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>Cc Stephen Warren <[email protected]>Cc Stephen Warren <[email protected]>Quoted 7 lines
--- arch/arm/dts/exynos4210-pinctrl-uboot.dtsi | 8 ++++---- arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi | 18 +++++++++--------- arch/arm/dts/exynos5250-pinctrl-uboot.dtsi | 16 ++++++++-------- arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi | 12 ++++++------ arch/arm/dts/s5pc110-pinctrl.dtsi | 4 ++-- 5 files changed, 29 insertions(+), 29 deletions(-)
Quoted 7 lines
Tested on snow:
Tested-by Simon Glass <[email protected]>Acked-by Simon Glass <[email protected]>Stephen, I plan to pick this up so please sing out if there is a problem.
Thanks,
Minkyu Kang.
PATCH 1/2 dts:exynos:update pinctrl size-cells and fix child regs
Quoted 27 lines · Minkyu Kang
Quoted 26 lines · Simon Glass
Quoted 13 lines · Przemyslaw Marczak
This change is required to avoid warnings about invalid size-cells defined in device-tree pinctrl nodes for Exynos.
Tested on:
- Odroid U3
- Odroid XU3Signed-off-by Przemyslaw Marczak <[email protected]>Cc Stefan Roese <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>Cc Stephen Warren <[email protected]>Cc Stephen Warren <[email protected]>Quoted 7 lines
--- arch/arm/dts/exynos4210-pinctrl-uboot.dtsi | 8 ++++---- arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi | 18 +++++++++--------- arch/arm/dts/exynos5250-pinctrl-uboot.dtsi | 16 ++++++++-------- arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi | 12 ++++++------ arch/arm/dts/s5pc110-pinctrl.dtsi | 4 ++-- 5 files changed, 29 insertions(+), 29 deletions(-)Tested on snow:
Tested-by Simon Glass <[email protected]>Acked-by Simon Glass <[email protected]>
Quoted 5 lines
Quoted 3 lines
Stephen, I plan to pick this up so please sing out if there is a problem.
Acked-by Minkyu Kang <[email protected]>
Applied to u-boot-dm/next, thanks!
PATCH 2/2 Revert "fdt: fix address cell count checking in fdt_translate_address()"
In reply to Przemyslaw MarczakThis reverts commit 71105f50fedddfa5b0535d102c3d5078671721ad.
The reverted commit was applied for a temporary to unbreak few Exynos boards on the release.
After the discussion about the change, this commit should be avoided. Fixed device-tree for Exynos, allows reverting it without any issues.
--- common/fdt_support.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
common/fdt_support.c +4 -3
@@ -952,7 +952,8 @@ void fdt_del_node_and_alias(void *blob, const char *alias)/* Max address size we deal with */ #define OF_MAX_ADDR_CELLS 4#define OF_BAD_ADDR FDT_ADDR_T_NONE -#define OF_CHECK_COUNTS (na) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS) +#define OF_CHECK_COUNTS (na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \ + (ns) > 0)/* Debug utility */ #ifdef DEBUG
@@ -1120,7 +1121,7 @@ static u64 __of_translate_address(void *blob, int node_offset, const fdt32_t *in/* Cound address cells & copy address locally */ bus->count_cells (blob, parent, &na, &ns); -if (!OF_CHECK_COUNTS (na)) { +if (!OF_CHECK_COUNTS (na, ns)) {printf ("%s: Bad cell count for %s\n" , __FUNCTION__,fdt_get_name (blob, node_offset,NULL )); goto bail;
@@ -1147,7 +1148,7 @@ static u64 __of_translate_address(void *blob, int node_offset, const fdt32_t *in/* Get new parent bus and counts */ pbus = &of_busses[0 ]; pbus->count_cells (blob, parent, &pna, &pns); -if (!OF_CHECK_COUNTS (pna)) { +if (!OF_CHECK_COUNTS (pna, pns)) {printf ("%s: Bad cell count for %s\n" , __FUNCTION__,fdt_get_name (blob, node_offset,NULL ));break ;
Signature · 1 line
1.9.1
PATCH 2/2 Revert "fdt: fix address cell count checking in fdt_translate_address()"
Quoted 14 lines · Przemyslaw Marczak
This reverts commit
71105f50fedddfa5b0535d102c3d5078671721ad.The reverted commit was applied for a temporary to unbreak few Exynos boards on the release.
After the discussion about the change, this commit should be avoided. Fixed device-tree for Exynos, allows reverting it without any issues.
Signed-off-by Przemyslaw Marczak <[email protected]>Cc Stefan Roese <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>Cc Stephen Warren <[email protected]>Cc Stephen Warren <[email protected]>
Quoted 3 lines
--- common/fdt_support.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Tested on snow:
PATCH 2/2 Revert "fdt: fix address cell count checking in fdt_translate_address()"
Quoted 19 lines · Simon Glass
Quoted 14 lines · Przemyslaw Marczak
This reverts commit
71105f50fedddfa5b0535d102c3d5078671721ad.The reverted commit was applied for a temporary to unbreak few Exynos boards on the release.
After the discussion about the change, this commit should be avoided. Fixed device-tree for Exynos, allows reverting it without any issues.
Signed-off-by Przemyslaw Marczak <[email protected]>Cc Stefan Roese <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>Cc Stephen Warren <[email protected]>Cc Stephen Warren <[email protected]>Quoted 3 lines
--- common/fdt_support.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Quoted 3 lines
Tested on snow:
Tested-by Simon Glass <[email protected]>Acked-by Simon Glass <[email protected]>
Applied to u-boot-dm/next, thanks!