* [U-Boot] [PATCH][RFC][for next] 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
@ 2009-12-03 10:20 Heiko Schocher
2009-12-07 21:50 ` Wolfgang Denk
2009-12-08 21:13 ` Wolfgang Denk
0 siblings, 2 replies; 5+ messages in thread
From: Heiko Schocher @ 2009-12-03 10:20 UTC (permalink / raw)
To: u-boot
u-boot updates, before starting Linux, the memory node in the
DTS. As this is a "standard" feature, move this functionality
to the cpu.c file for mpc5xxx and mpc512x processors.
Signed-off-by: Heiko Schocher <hs@denx.de>
---
based against git://git.denx.de/u-boot.git next
board/cm5200/cm5200.c | 7 -------
board/davedenx/aria/aria.c | 1 -
board/esd/mecp5123/mecp5123.c | 1 -
board/freescale/mpc5121ads/mpc5121ads.c | 1 -
board/matrix_vision/mvbc_p/mvbc_p.c | 1 -
board/mucmc52/mucmc52.c | 1 -
board/tqc/tqm5200/tqm5200.c | 1 -
board/uc101/uc101.c | 1 -
cpu/mpc512x/cpu.c | 1 +
cpu/mpc5xxx/cpu.c | 1 +
10 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/board/cm5200/cm5200.c b/board/cm5200/cm5200.c
index 9e2f1a5..33bf9c4 100644
--- a/board/cm5200/cm5200.c
+++ b/board/cm5200/cm5200.c
@@ -271,13 +271,6 @@ static void ft_blob_update(void *blob, bd_t *bd)
if (ret < 0)
printf("ft_blob_update(): cannot set /model property err:%s\n",
fdt_strerror(ret));
-
- ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
- if (ret < 0) {
- printf("ft_blob_update(): cannot set /memory/reg "
- "property err:%s\n", fdt_strerror(ret));
- }
}
#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
diff --git a/board/davedenx/aria/aria.c b/board/davedenx/aria/aria.c
index cc69c9d..f17df60 100644
--- a/board/davedenx/aria/aria.c
+++ b/board/davedenx/aria/aria.c
@@ -196,6 +196,5 @@ int checkboard (void)
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
- fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/board/esd/mecp5123/mecp5123.c b/board/esd/mecp5123/mecp5123.c
index 5139358..748ad7c 100644
--- a/board/esd/mecp5123/mecp5123.c
+++ b/board/esd/mecp5123/mecp5123.c
@@ -273,6 +273,5 @@ int checkboard(void)
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
- fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/board/freescale/mpc5121ads/mpc5121ads.c b/board/freescale/mpc5121ads/mpc5121ads.c
index 2fa3650..2e13ea8 100644
--- a/board/freescale/mpc5121ads/mpc5121ads.c
+++ b/board/freescale/mpc5121ads/mpc5121ads.c
@@ -350,6 +350,5 @@ int checkboard (void)
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
- fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/board/matrix_vision/mvbc_p/mvbc_p.c b/board/matrix_vision/mvbc_p/mvbc_p.c
index 0cbe900..4392176 100644
--- a/board/matrix_vision/mvbc_p/mvbc_p.c
+++ b/board/matrix_vision/mvbc_p/mvbc_p.c
@@ -262,7 +262,6 @@ void show_boot_progress(int val)
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
- fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
int board_eth_init(bd_t *bis)
diff --git a/board/mucmc52/mucmc52.c b/board/mucmc52/mucmc52.c
index b4ed735..66973f0 100644
--- a/board/mucmc52/mucmc52.c
+++ b/board/mucmc52/mucmc52.c
@@ -404,6 +404,5 @@ void pci_init_board (void)
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
- fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c
index 5a091c4..d90bae8 100644
--- a/board/tqc/tqm5200/tqm5200.c
+++ b/board/tqc/tqm5200/tqm5200.c
@@ -745,7 +745,6 @@ int board_get_height (void)
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
- fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/board/uc101/uc101.c b/board/uc101/uc101.c
index 1485c02..c7dfb7b 100644
--- a/board/uc101/uc101.c
+++ b/board/uc101/uc101.c
@@ -377,6 +377,5 @@ void hw_watchdog_reset(void)
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
- fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
index 42ccd81..dac48db 100644
--- a/cpu/mpc512x/cpu.c
+++ b/cpu/mpc512x/cpu.c
@@ -197,6 +197,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#ifdef CONFIG_HAS_ETH0
fdt_fixup_ethernet(blob);
#endif
+ fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif
diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c
index efa64c7..2a28df4 100644
--- a/cpu/mpc5xxx/cpu.c
+++ b/cpu/mpc5xxx/cpu.c
@@ -157,6 +157,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
}
#endif
+ fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif
--
1.6.2.5
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply related [flat|nested] 5+ messages in thread* [U-Boot] [PATCH][RFC][for next] 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
2009-12-03 10:20 [U-Boot] [PATCH][RFC][for next] 5xxx, fdt: move fdt_fixup_memory() to cpu.c file Heiko Schocher
@ 2009-12-07 21:50 ` Wolfgang Denk
2009-12-08 7:01 ` Heiko Schocher
2009-12-08 21:13 ` Wolfgang Denk
1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2009-12-07 21:50 UTC (permalink / raw)
To: u-boot
Dear Heiko Schocher,
In message <4B1790D6.6030303@denx.de> you wrote:
> u-boot updates, before starting Linux, the memory node in the
> DTS. As this is a "standard" feature, move this functionality
> to the cpu.c file for mpc5xxx and mpc512x processors.
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
I generally agree with this patch, but...
> --- a/board/cm5200/cm5200.c
> +++ b/board/cm5200/cm5200.c
> @@ -271,13 +271,6 @@ static void ft_blob_update(void *blob, bd_t *bd)
> if (ret < 0)
> printf("ft_blob_update(): cannot set /model property err:%s\n",
> fdt_strerror(ret));
> -
> - ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
> -
> - if (ret < 0) {
> - printf("ft_blob_update(): cannot set /memory/reg "
> - "property err:%s\n", fdt_strerror(ret));
> - }
Here we do some error checking, which is always a Good Thing (TM).
> diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
> index 42ccd81..dac48db 100644
> --- a/cpu/mpc512x/cpu.c
> +++ b/cpu/mpc512x/cpu.c
> @@ -197,6 +197,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
> #ifdef CONFIG_HAS_ETH0
> fdt_fixup_ethernet(blob);
> #endif
> + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
> }
> #endif
>
> diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c
> index efa64c7..2a28df4 100644
> --- a/cpu/mpc5xxx/cpu.c
> +++ b/cpu/mpc5xxx/cpu.c
> @@ -157,6 +157,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
> }
>
> #endif
> + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
> }
> #endif
May I suggest to add the same error checking in these two files, then?
Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Text processing has made it possible to right-justify any idea, even
one which cannot be justified on any other grounds."
-- J. Finnegan, USC.
^ permalink raw reply [flat|nested] 5+ messages in thread* [U-Boot] [PATCH][RFC][for next] 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
2009-12-07 21:50 ` Wolfgang Denk
@ 2009-12-08 7:01 ` Heiko Schocher
2009-12-08 21:07 ` Wolfgang Denk
0 siblings, 1 reply; 5+ messages in thread
From: Heiko Schocher @ 2009-12-08 7:01 UTC (permalink / raw)
To: u-boot
Hello Wolfgang,
Wolfgang Denk wrote:
> In message <4B1790D6.6030303@denx.de> you wrote:
>> u-boot updates, before starting Linux, the memory node in the
>> DTS. As this is a "standard" feature, move this functionality
>> to the cpu.c file for mpc5xxx and mpc512x processors.
>>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>
> I generally agree with this patch, but...
>
>> --- a/board/cm5200/cm5200.c
>> +++ b/board/cm5200/cm5200.c
>> @@ -271,13 +271,6 @@ static void ft_blob_update(void *blob, bd_t *bd)
>> if (ret < 0)
>> printf("ft_blob_update(): cannot set /model property err:%s\n",
>> fdt_strerror(ret));
>> -
>> - ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
>> -
>> - if (ret < 0) {
>> - printf("ft_blob_update(): cannot set /memory/reg "
>> - "property err:%s\n", fdt_strerror(ret));
>> - }
>
> Here we do some error checking, which is always a Good Thing (TM).
Yep!
>> diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
>> index 42ccd81..dac48db 100644
>> --- a/cpu/mpc512x/cpu.c
>> +++ b/cpu/mpc512x/cpu.c
>> @@ -197,6 +197,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
>> #ifdef CONFIG_HAS_ETH0
>> fdt_fixup_ethernet(blob);
>> #endif
>> + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
>> }
>> #endif
>>
>> diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c
>> index efa64c7..2a28df4 100644
>> --- a/cpu/mpc5xxx/cpu.c
>> +++ b/cpu/mpc5xxx/cpu.c
>> @@ -157,6 +157,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
>> }
>>
>> #endif
>> + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
>> }
>> #endif
>
> May I suggest to add the same error checking in these two files, then?
Hmm.. fdt_fixup_memory() does this error checking (Also in a much
stricter way, than in the board code). So I think, this is not
necessary here ...
bye
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread* [U-Boot] [PATCH][RFC][for next] 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
2009-12-08 7:01 ` Heiko Schocher
@ 2009-12-08 21:07 ` Wolfgang Denk
0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2009-12-08 21:07 UTC (permalink / raw)
To: u-boot
Dear Heiko Schocher,
In message <4B1DF9B6.3040400@denx.de> you wrote:
>
> > May I suggest to add the same error checking in these two files, then?
>
> Hmm.. fdt_fixup_memory() does this error checking (Also in a much
> stricter way, than in the board code). So I think, this is not
> necessary here ...
Ah, ok. Thanks for the explanation.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Lead me not into temptation... I can find it myself.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH][RFC][for next] 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
2009-12-03 10:20 [U-Boot] [PATCH][RFC][for next] 5xxx, fdt: move fdt_fixup_memory() to cpu.c file Heiko Schocher
2009-12-07 21:50 ` Wolfgang Denk
@ 2009-12-08 21:13 ` Wolfgang Denk
1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2009-12-08 21:13 UTC (permalink / raw)
To: u-boot
Dear Heiko Schocher,
In message <4B1790D6.6030303@denx.de> you wrote:
> u-boot updates, before starting Linux, the memory node in the
> DTS. As this is a "standard" feature, move this functionality
> to the cpu.c file for mpc5xxx and mpc512x processors.
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> ---
>
> based against git://git.denx.de/u-boot.git next
>
> board/cm5200/cm5200.c | 7 -------
> board/davedenx/aria/aria.c | 1 -
> board/esd/mecp5123/mecp5123.c | 1 -
> board/freescale/mpc5121ads/mpc5121ads.c | 1 -
> board/matrix_vision/mvbc_p/mvbc_p.c | 1 -
> board/mucmc52/mucmc52.c | 1 -
> board/tqc/tqm5200/tqm5200.c | 1 -
> board/uc101/uc101.c | 1 -
> cpu/mpc512x/cpu.c | 1 +
> cpu/mpc5xxx/cpu.c | 1 +
> 10 files changed, 2 insertions(+), 14 deletions(-)
Applied to "next" branch, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Genius doesn't work on an assembly line basis. You can't simply say,
"Today I will be brilliant."
-- Kirk, "The Ultimate Computer", stardate 4731.3
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-12-08 21:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-03 10:20 [U-Boot] [PATCH][RFC][for next] 5xxx, fdt: move fdt_fixup_memory() to cpu.c file Heiko Schocher
2009-12-07 21:50 ` Wolfgang Denk
2009-12-08 7:01 ` Heiko Schocher
2009-12-08 21:07 ` Wolfgang Denk
2009-12-08 21:13 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox