5xxx, fdt: move fdt_fixup_memory() to cpu.c file
RFC PATCH 1/1 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
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.
---
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(-)
board/cm5200/cm5200.c +0 -7
@@ -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) */
board/davedenx/aria/aria.c +0 -1
@@ -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) */
board/esd/mecp5123/mecp5123.c +0 -1
@@ -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) */
board/freescale/mpc5121ads/mpc5121ads.c +0 -1
@@ -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) */
board/matrix_vision/mvbc_p/mvbc_p.c +0 -1
@@ -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)
board/mucmc52/mucmc52.c +0 -1
@@ -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) */
board/tqc/tqm5200/tqm5200.c +0 -1
@@ -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) */
board/uc101/uc101.c +0 -1
@@ -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) */
cpu/mpc512x/cpu.c +1 -0
@@ -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
cpu/mpc5xxx/cpu.c +1 -0
@@ -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
Signature · 5 lines
1.6.2.5 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
RFC PATCH 1/1 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
Dear Heiko Schocher,
Quoted 5 lines · In message <[email protected]> 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.cfile for mpc5xxx and mpc512x processors.Signed-off-by Heiko Schocher <[email protected]>
I generally agree with this patch, but...
board/cm5200/cm5200.c static void ft_blob_update(void *blob, bd_t *bd) · line 280
Quoted 13 lines
board/cm5200/cm5200.c +0
-7@@ -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).
Quoted 17 lines
cpu/mpc512x/cpu.c +1
-0@@ -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 cpu/mpc5xxx/cpu.c +0
-0
cpu/mpc5xxx/cpu.c void ft_cpu_setup(void *blob, bd_t *bd) · line 162
Quoted 6 lines
cpu/mpc5xxx/cpu.c +1
-0@@ -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
Signature · 6 lines
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.RFC PATCH 1/1 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
Hello Wolfgang,
Quoted 9 lines · Wolfgang Denk
Quoted 5 lines · In message <[email protected]> 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.cfile for mpc5xxx and mpc512x processors.Signed-off-by Heiko Schocher <[email protected]>I generally agree with this patch, but...
Quoted 15 lines
board/cm5200/cm5200.c static void ft_blob_update(void *blob, bd_t *bd) · line 280
Quoted 13 lines
board/cm5200/cm5200.c +0
-7@@ -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!
Quoted 19 lines
Quoted 19 lines
cpu/mpc512x/cpu.c +1
-0@@ -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 cpu/mpc5xxx/cpu.c +0
-0@@ -157,6 +157,7 @@ void ft_cpu_setup(void *blob, bd_t *bd) }
Quoted 6 lines
cpu/mpc5xxx/cpu.c void ft_cpu_setup(void *blob, bd_t *bd) · line 162
Quoted 4 lines
cpu/mpc5xxx/cpu.c +1
-0#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
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
RFC PATCH 1/1 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
Dear Heiko Schocher,
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 2 lines
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
Signature · 4 lines
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.
Wolfgang Denk
AppliedRFC PATCH 1/1 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
In reply to Heiko SchocherDear Heiko Schocher,
Quoted 9 lines · In message <[email protected]> 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.cfile for mpc5xxx and mpc512x processors.Signed-off-by Heiko Schocher <[email protected]>---
based against
git://git.denx.de/u-boot.gitnext
Quoted 11 lines
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
Signature · 6 lines
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