* [U-Boot] [PATCH V2 1/2] ofnode: Replace of_n_addr_cells with of_n_size_cells
@ 2018-10-01 10:37 Marek Vasut
2018-10-01 10:37 ` [U-Boot] [PATCH V2 2/2] ofnode: Add missing address translation into ofnode_get_addr_size() Marek Vasut
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Marek Vasut @ 2018-10-01 10:37 UTC (permalink / raw)
To: u-boot
The size should be decoded using of_n_size_cells(), make it so.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
---
V2: New patch
---
drivers/core/ofnode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index a7e1927723..2e68f8e873 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -541,7 +541,7 @@ fdt_addr_t ofnode_get_addr_size(ofnode node, const char *property,
if (!prop)
return FDT_ADDR_T_NONE;
na = of_n_addr_cells(np);
- ns = of_n_addr_cells(np);
+ ns = of_n_size_cells(np);
*sizep = of_read_number(prop + na, ns);
return of_read_number(prop, na);
} else {
--
2.18.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH V2 2/2] ofnode: Add missing address translation into ofnode_get_addr_size()
2018-10-01 10:37 [U-Boot] [PATCH V2 1/2] ofnode: Replace of_n_addr_cells with of_n_size_cells Marek Vasut
@ 2018-10-01 10:37 ` Marek Vasut
2018-10-02 11:22 ` Simon Glass
2018-10-09 23:48 ` sjg at google.com
2018-10-02 11:22 ` [U-Boot] [PATCH V2 1/2] ofnode: Replace of_n_addr_cells with of_n_size_cells Simon Glass
2018-10-09 23:48 ` sjg at google.com
2 siblings, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2018-10-01 10:37 UTC (permalink / raw)
To: u-boot
Of CONFIG_OF_TRANSLATE is enabled, this function still returns
untranslated bogus results. Add the missing translation.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
---
V2: - Use np directly
- Drop extra of_n_addr_cells
---
drivers/core/ofnode.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 2e68f8e873..f934116ab5 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -543,7 +543,11 @@ fdt_addr_t ofnode_get_addr_size(ofnode node, const char *property,
na = of_n_addr_cells(np);
ns = of_n_size_cells(np);
*sizep = of_read_number(prop + na, ns);
- return of_read_number(prop, na);
+
+ if (IS_ENABLED(CONFIG_OF_TRANSLATE) && ns > 0)
+ return of_translate_address(np, prop);
+ else
+ return of_read_number(prop, na);
} else {
return fdtdec_get_addr_size(gd->fdt_blob,
ofnode_to_offset(node), property,
--
2.18.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH V2 1/2] ofnode: Replace of_n_addr_cells with of_n_size_cells
2018-10-01 10:37 [U-Boot] [PATCH V2 1/2] ofnode: Replace of_n_addr_cells with of_n_size_cells Marek Vasut
2018-10-01 10:37 ` [U-Boot] [PATCH V2 2/2] ofnode: Add missing address translation into ofnode_get_addr_size() Marek Vasut
@ 2018-10-02 11:22 ` Simon Glass
2018-10-09 23:48 ` sjg at google.com
2 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2018-10-02 11:22 UTC (permalink / raw)
To: u-boot
On 1 October 2018 at 03:37, Marek Vasut <marek.vasut@gmail.com> wrote:
> The size should be decoded using of_n_size_cells(), make it so.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tom Rini <trini@konsulko.com>
> ---
> V2: New patch
> ---
> drivers/core/ofnode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH V2 2/2] ofnode: Add missing address translation into ofnode_get_addr_size()
2018-10-01 10:37 ` [U-Boot] [PATCH V2 2/2] ofnode: Add missing address translation into ofnode_get_addr_size() Marek Vasut
@ 2018-10-02 11:22 ` Simon Glass
2018-10-09 23:48 ` sjg at google.com
1 sibling, 0 replies; 6+ messages in thread
From: Simon Glass @ 2018-10-02 11:22 UTC (permalink / raw)
To: u-boot
On 1 October 2018 at 03:37, Marek Vasut <marek.vasut@gmail.com> wrote:
> Of CONFIG_OF_TRANSLATE is enabled, this function still returns
> untranslated bogus results. Add the missing translation.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tom Rini <trini@konsulko.com>
> ---
> V2: - Use np directly
> - Drop extra of_n_addr_cells
> ---
> drivers/core/ofnode.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH V2 2/2] ofnode: Add missing address translation into ofnode_get_addr_size()
2018-10-01 10:37 ` [U-Boot] [PATCH V2 2/2] ofnode: Add missing address translation into ofnode_get_addr_size() Marek Vasut
2018-10-02 11:22 ` Simon Glass
@ 2018-10-09 23:48 ` sjg at google.com
1 sibling, 0 replies; 6+ messages in thread
From: sjg at google.com @ 2018-10-09 23:48 UTC (permalink / raw)
To: u-boot
On 1 October 2018 at 03:37, Marek Vasut <marek.vasut@gmail.com> wrote:
> Of CONFIG_OF_TRANSLATE is enabled, this function still returns
> untranslated bogus results. Add the missing translation.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tom Rini <trini@konsulko.com>
> ---
> V2: - Use np directly
> - Drop extra of_n_addr_cells
> ---
> drivers/core/ofnode.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot-dm thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH V2 1/2] ofnode: Replace of_n_addr_cells with of_n_size_cells
2018-10-01 10:37 [U-Boot] [PATCH V2 1/2] ofnode: Replace of_n_addr_cells with of_n_size_cells Marek Vasut
2018-10-01 10:37 ` [U-Boot] [PATCH V2 2/2] ofnode: Add missing address translation into ofnode_get_addr_size() Marek Vasut
2018-10-02 11:22 ` [U-Boot] [PATCH V2 1/2] ofnode: Replace of_n_addr_cells with of_n_size_cells Simon Glass
@ 2018-10-09 23:48 ` sjg at google.com
2 siblings, 0 replies; 6+ messages in thread
From: sjg at google.com @ 2018-10-09 23:48 UTC (permalink / raw)
To: u-boot
On 1 October 2018 at 03:37, Marek Vasut <marek.vasut@gmail.com> wrote:
> The size should be decoded using of_n_size_cells(), make it so.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tom Rini <trini@konsulko.com>
> ---
> V2: New patch
> ---
> drivers/core/ofnode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot-dm thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-10-09 23:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-01 10:37 [U-Boot] [PATCH V2 1/2] ofnode: Replace of_n_addr_cells with of_n_size_cells Marek Vasut
2018-10-01 10:37 ` [U-Boot] [PATCH V2 2/2] ofnode: Add missing address translation into ofnode_get_addr_size() Marek Vasut
2018-10-02 11:22 ` Simon Glass
2018-10-09 23:48 ` sjg at google.com
2018-10-02 11:22 ` [U-Boot] [PATCH V2 1/2] ofnode: Replace of_n_addr_cells with of_n_size_cells Simon Glass
2018-10-09 23:48 ` sjg at google.com
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.