fdt: Remove fdt_fixup_memory function
RFC PATCH 1/1 fdt: Remove fdt_fixup_memory function
The fdt_fixup_memory function is only used on PowerPC where we only claim one memory bank in U-Boot (and then in the device tree) so we can call a function that just calls fdt_fixup_memory_banks(..., 1). Call this directly for consistency with other architectures.
--- arch/powerpc/cpu/74xx_7xx/cpu.c | 2 +- arch/powerpc/cpu/mpc512x/cpu.c | 2 +- arch/powerpc/cpu/mpc5xxx/cpu.c | 2 +- arch/powerpc/cpu/mpc8260/cpu.c | 2 +- arch/powerpc/cpu/mpc83xx/fdt.c | 2 +- arch/powerpc/cpu/mpc85xx/fdt.c | 2 +- arch/powerpc/cpu/mpc86xx/fdt.c | 2 +- arch/powerpc/cpu/mpc8xx/fdt.c | 2 +- arch/powerpc/cpu/ppc4xx/fdt.c | 2 +- arch/powerpc/lib/bootm.c | 2 +- board/exmeritus/hww1u1a/hww1u1a.c | 2 +- board/freescale/b4860qds/b4860qds.c | 2 +- board/freescale/bsc9131rdb/bsc9131rdb.c | 2 +- board/freescale/bsc9132qds/bsc9132qds.c | 2 +- board/freescale/c29xpcie/c29xpcie.c | 2 +- board/freescale/corenet_ds/corenet_ds.c | 2 +- board/freescale/mpc7448hpc2/mpc7448hpc2.c | 2 +- board/freescale/mpc8572ds/mpc8572ds.c | 2 +- board/freescale/p1010rdb/p1010rdb.c | 2 +- board/freescale/p1022ds/p1022ds.c | 2 +- board/freescale/p1023rdb/p1023rdb.c | 2 +- board/freescale/p1023rds/p1023rds.c | 2 +- board/freescale/p1_p2_rdb/p1_p2_rdb.c | 2 +- board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 2 +- board/freescale/p1_twr/p1_twr.c | 2 +- board/freescale/p2020come/p2020come.c | 2 +- board/freescale/p2020ds/p2020ds.c | 2 +- board/freescale/p2041rdb/p2041rdb.c | 2 +- board/freescale/t1040qds/t1040qds.c | 2 +- board/freescale/t104xrdb/t104xrdb.c | 2 +- board/freescale/t208xqds/t208xqds.c | 2 +- board/freescale/t208xrdb/t208xrdb.c | 2 +- board/freescale/t4qds/t4240emu.c | 2 +- board/freescale/t4qds/t4240qds.c | 2 +- board/gdsys/p1022/controlcenterd.c | 2 +- board/keymile/kmp204x/kmp204x.c | 2 +- common/cmd_fdt.c | 2 +- common/fdt_support.c | 5 ----- include/fdt_support.h | 1 - 39 files changed, 37 insertions(+), 43 deletions(-)
arch/powerpc/cpu/74xx_7xx/cpu.c +1 -1
@@ -292,7 +292,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)do_fixup_by_prop_u32 (blob,"device_type" ,"cpu" ,4 ,"clock-frequency" , bd->bi_intfreq,1 ); -fdt_fixup_memory (blob, (u64 )bd->bi_memstart, (u64 )bd->bi_memsize); +fdt_fixup_memory_banks (blob, &bd->bi_memstart, &bd->bi_memsize,1 );fdt_fixup_ethernet (blob); }
arch/powerpc/cpu/mpc512x/cpu.c +1 -1
@@ -183,7 +183,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); + fdt_fixup_memory_banks(blob, &bd->bi_memstart, &bd->bi_memsize, 1); }#endif
arch/powerpc/cpu/mpc5xxx/cpu.c +1 -1
@@ -133,7 +133,7 @@ void ft_cpu_setup(void *blob, bd_t *bd) }#endif -fdt_fixup_memory (blob, (u64 )bd->bi_memstart, (u64 )bd->bi_memsize); +fdt_fixup_memory_banks (blob, &bd->bi_memstart, &bd->bi_memsize,1 ); }#endif
arch/powerpc/cpu/mpc8260/cpu.c +1 -1
@@ -301,7 +301,7 @@ void ft_cpu_setup (void *blob, bd_t *bd) "timebase-frequency", OF_TBCLK, 1);do_fixup_by_prop_u32 (blob,"device_type" ,"cpu" ,4 ,"clock-frequency" , bd->bi_intfreq,1 ); - fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); + fdt_fixup_memory_banks(blob, &bd->bi_memstart, &bd->bi_memsize, 1); }#endif /* CONFIG_OF_LIBFDT */
arch/powerpc/cpu/mpc83xx/fdt.c +1 -1
@@ -122,7 +122,7 @@ void ft_cpu_setup(void *blob, bd_t *bd) "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);#endif -fdt_fixup_memory (blob, (u64 )bd->bi_memstart, (u64 )bd->bi_memsize); +fdt_fixup_memory_banks (blob, &bd->bi_memstart, &bd->bi_memsize,1 );#if defined(CONFIG_BOOTCOUNT_LIMIT )fdt_fixup_muram (blob);
arch/powerpc/cpu/mpc85xx/fdt.c +1 -1
@@ -661,7 +661,7 @@ void ft_cpu_setup(void *blob, bd_t *bd) "clock-frequency", get_bus_freq(0), 1);#endif -fdt_fixup_memory (blob, (u64 )bd->bi_memstart, (u64 )bd->bi_memsize); +fdt_fixup_memory_banks (blob, &bd->bi_memstart, &bd->bi_memsize,1 );#ifdef CONFIG_MP ft_fixup_cpu (blob, (u64 )bd->bi_memstart + (u64 )bd->bi_memsize);
arch/powerpc/cpu/mpc86xx/fdt.c +1 -1
@@ -39,7 +39,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)do_fixup_by_compat_u32 (blob,"fsl,elbc" ,"bus-frequency" , gd->arch.lbc_clk,1 ); -fdt_fixup_memory (blob, (u64 )bd->bi_memstart, (u64 )bd->bi_memsize); +fdt_fixup_memory_banks (blob, &bd->bi_memstart, &bd->bi_memsize,1 );#if defined(CONFIG_HAS_ETH0 ) || defined(CONFIG_HAS_ETH1 ) \ || defined(CONFIG_HAS_ETH2 ) || defined(CONFIG_HAS_ETH3 )
arch/powerpc/cpu/mpc8xx/fdt.c +1 -1
@@ -26,5 +26,5 @@ void ft_cpu_setup(void *blob, bd_t *bd)/* Fixup ethernet MAC addresses */ fdt_fixup_ethernet (blob); -fdt_fixup_memory (blob, (u64 )bd->bi_memstart, (u64 )bd->bi_memsize); +fdt_fixup_memory_banks (blob, &bd->bi_memstart, &bd->bi_memsize,1 ); }
arch/powerpc/cpu/ppc4xx/fdt.c +1 -1
@@ -120,7 +120,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)do_fixup_by_path_u32 (blob,"/plb/ebc" ,"clock-frequency" , sys_info.freqEBC,1 ); -fdt_fixup_memory (blob, (u64 )bd->bi_memstart, (u64 )bd->bi_memsize); +fdt_fixup_memory_banks (blob, &bd->bi_memstart, &bd->bi_memsize,1 );/* * Fixup all UART clocks for CPU internal UARTs
arch/powerpc/lib/bootm.c +1 -1
@@ -300,7 +300,7 @@ void boot_prep_vxworks(bootm_headers_t *images) off =fdt_path_offset (images->ft_addr,"/memory" );if (off <0 ) -fdt_fixup_memory (images->ft_addr, base, size); +fdt_fixup_memory_banks (images->ft_addr, &base, &size,1 );#if defined(CONFIG_MP )#if defined(CONFIG_MPC85xx)
board/exmeritus/hww1u1a/hww1u1a.c +1 -1
@@ -256,7 +256,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );FT_FSL_PCI_SETUP ; }
board/freescale/b4860qds/b4860qds.c +1 -1
@@ -868,7 +868,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_PCI pci_of_setup (blob, bd);
board/freescale/bsc9131rdb/bsc9131rdb.c +1 -1
@@ -60,7 +60,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );fdt_fixup_dr_usb (blob, bd); }
board/freescale/bsc9132qds/bsc9132qds.c +1 -1
@@ -362,7 +362,7 @@ void ft_board_setup(void *blob, bd_t *bd)FT_FSL_PCI_SETUP ;#endif -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);u32 porbmsr =in_be32 (&gur->porbmsr);
board/freescale/c29xpcie/c29xpcie.c +1 -1
@@ -139,7 +139,7 @@ void ft_board_setup(void *blob, bd_t *bd)FT_FSL_PCI_SETUP ;#endif -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );if (cpu->soc_ver ==SVR_C291 )fdt_del_sec (blob,1 );else if (cpu->soc_ver ==SVR_C292 )
board/freescale/corenet_ds/corenet_ds.c +1 -1
@@ -194,7 +194,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_PCI pci_of_setup (blob, bd);
board/freescale/mpc7448hpc2/mpc7448hpc2.c +1 -1
@@ -74,7 +74,7 @@ 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); +fdt_fixup_memory_banks (blob, &bd->bi_memstart, &bd->bi_memsize,1 ); }#endif
board/freescale/mpc8572ds/mpc8572ds.c +1 -1
@@ -236,7 +236,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );FT_FSL_PCI_SETUP ;
board/freescale/p1010rdb/p1010rdb.c +1 -1
@@ -455,7 +455,7 @@ void ft_board_setup(void *blob, bd_t *bd)FT_FSL_PCI_SETUP ;#endif -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#if defined(CONFIG_HAS_FSL_DR_USB )fdt_fixup_dr_usb (blob, bd);
board/freescale/p1022ds/p1022ds.c +1 -1
@@ -336,7 +336,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_HAS_FSL_DR_USB fdt_fixup_dr_usb (blob, bd);
board/freescale/p1023rdb/p1023rdb.c +1 -1
@@ -134,7 +134,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_HAS_FSL_DR_USB fdt_fixup_dr_usb (blob, bd);
board/freescale/p1023rds/p1023rds.c +1 -1
@@ -180,7 +180,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );/* By default NOR is on, and NAND is disabled */ #ifdef CONFIG_NAND_U_BOOT
board/freescale/p1_p2_rdb/p1_p2_rdb.c +1 -1
@@ -244,7 +244,7 @@ void ft_board_setup(void *blob, bd_t *bd)ft_pci_board_setup (blob);#endif /* #if defined(CONFIG_PCI) */ -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#if defined(CONFIG_HAS_FSL_DR_USB )fdt_fixup_dr_usb (blob, bd);
board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c +1 -1
@@ -430,7 +430,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );FT_FSL_PCI_SETUP ;
board/freescale/p1_twr/p1_twr.c +1 -1
@@ -265,7 +265,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );FT_FSL_PCI_SETUP ;
board/freescale/p2020come/p2020come.c +1 -1
@@ -264,7 +264,7 @@ void ft_board_setup(void *blob, bd_t *bd)ft_pci_board_setup (blob);#endif -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_HAS_FSL_DR_USB fdt_fixup_dr_usb (blob, bd);
board/freescale/p2020ds/p2020ds.c +1 -1
@@ -240,7 +240,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_HAS_FSL_DR_USB fdt_fixup_dr_usb (blob, bd);
board/freescale/p2041rdb/p2041rdb.c +1 -1
@@ -219,7 +219,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#if defined(CONFIG_HAS_FSL_DR_USB ) || defined(CONFIG_HAS_FSL_MPH_USB )fdt_fixup_dr_usb (blob, bd);
board/freescale/t1040qds/t1040qds.c +1 -1
@@ -209,7 +209,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_PCI pci_of_setup (blob, bd);
board/freescale/t104xrdb/t104xrdb.c +1 -1
@@ -75,7 +75,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_PCI pci_of_setup (blob, bd);
board/freescale/t208xqds/t208xqds.c +1 -1
@@ -443,7 +443,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_PCI pci_of_setup (blob, bd);
board/freescale/t208xrdb/t208xrdb.c +1 -1
@@ -108,7 +108,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_PCI pci_of_setup (blob, bd);
board/freescale/t4qds/t4240emu.c +1 -1
@@ -73,7 +73,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );fdt_fixup_liodn (blob);fdt_fixup_dr_usb (blob, bd);
board/freescale/t4qds/t4240qds.c +1 -1
@@ -658,7 +658,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_PCI pci_of_setup (blob, bd);
board/gdsys/p1022/controlcenterd.c +1 -1
@@ -340,7 +340,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#ifdef CONFIG_HAS_FSL_DR_USB fdt_fixup_dr_usb (blob, bd);
board/keymile/kmp204x/kmp204x.c +1 -1
@@ -216,7 +216,7 @@ void ft_board_setup(void *blob, bd_t *bd) base =getenv_bootm_low (); size =getenv_bootm_size (); -fdt_fixup_memory (blob, (u64 )base, (u64 )size); +fdt_fixup_memory_banks (blob, &base, &size,1 );#if defined(CONFIG_HAS_FSL_DR_USB ) || defined(CONFIG_HAS_FSL_MPH_USB )fdt_fixup_dr_usb (blob, bd);
common/cmd_fdt.c +1 -1
@@ -510,7 +510,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])int err; addr =simple_strtoull (argv[2 ],NULL ,16 ); size =simple_strtoull (argv[3 ],NULL ,16 ); - err =fdt_fixup_memory (working_fdt, addr, size); + err =fdt_fixup_memory_banks (working_fdt, &addr, &size,1 );if (err <0 )return err;
common/fdt_support.c +0 -5
@@ -436,11 +436,6 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)return 0 ; } -int fdt_fixup_memory (void *blob,u64 start,u64 size) -{ -return fdt_fixup_memory_banks (blob, &start, &size,1 ); -} -void fdt_fixup_ethernet (void *fdt) {int node, i, j;
include/fdt_support.h +0 -1
@@ -38,7 +38,6 @@ void do_fixup_by_compat(void *fdt, const char *compat, const char *prop, const void *val, int len, int create);void do_fixup_by_compat_u32 (void *fdt,const char *compat,const char *prop,u32 val,int create); -int fdt_fixup_memory (void *blob,u64 start,u64 size);int fdt_fixup_memory_banks (void *blob,u64 start[],u64 size[],int banks);void fdt_fixup_ethernet (void *fdt); int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
Signature · 1 line
1.7.9.5
RFC PATCH 1/1 fdt: Remove fdt_fixup_memory function
Dear Tom Rini,
Quoted 4 lines · In message <[email protected]> you wrote:
The
fdt_fixup_memoryfunction is only used on PowerPC where we only claim one memory bank in U-Boot (and then in the device tree) so we can call a function that just callsfdt_fixup_memory_banks(..., 1). Call this directly for consistency with other architectures.
I understand what you mean and what you want, but I'm not really happy about it.
First, the description is not correct. In my understanding a "bank" of memory is some memory device which, on the hardware level, is addressed using one specific chip select signal. On PPC, we usually have flexible memory controllers, so e can always map all existing memory banks such that they for a single, contiguous region.
It is causing me some creepes to introduce code that claims it is fixing memory for only one bank - I feel this is wrong.
And is dropping the (u64) not a problem? bd->bi_memstart is just an "unsigned long", but fdt_fixup_memory_banks() expects a u64 ?
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 All these theories, diverse as they are, have two things in common: they explain the observed facts, and they are completeley and utterly wrong. - Terry Pratchett, _The Light Fantastic_
RFC PATCH 1/1 fdt: Remove fdt_fixup_memory function
Quoted 10 lines · Wolfgang Denk
Dear Tom Rini,
Quoted 4 lines · In message <[email protected]> you wrote:
The
fdt_fixup_memoryfunction is only used on PowerPC where we only claim one memory bank in U-Boot (and then in the device tree) so we can call a function that just callsfdt_fixup_memory_banks(..., 1). Call this directly for consistency with other architectures.I understand what you mean and what you want, but I'm not really happy about it.
Code or comment wise?
Quoted 5 lines
First, the description is not correct. In my understanding a "bank" of memory is some memory device which, on the hardware level, is addressed using one specific chip select signal. On PPC, we usually have flexible memory controllers, so e can always map all existing memory banks such that they for a single, contiguous region.
Right, so we have a mismatch between function name (fdt_fixup_memory_bank) and function of the node (Documentation/devicetree/booting-without-of.txt in the kernel is, sadly, the best description I can find of the memory node bindings). We itterate over the number of "banks" passed in (1 on PowerPC, CONFIG_NR_DRAM_BANKS on ARM, which is between 1 and 4) and do, as the binding expects, set the reg property correctly (base, size) for each "bank". It would be more correct to call this "ranges" rather than "banks", or perhaps "nr_ranges".
Quoted 5 lines
It is causing me some creepes to introduce code that claims it is fixing memory for only one bank - I feel this is wrong.
And is dropping the (u64) not a problem?
bd->bi_memstartis just an "unsigned long", butfdt_fixup_memory_banks()expects a u64 ?
Oops, I don't know how I missed that. Or rather, what the hell is up with calling fdt_fixup_memory() in two places on PowerPC? I just changed the call in board/freescale/t1040qds/t1040qds.c::ft_board_setup, which uses phy_addr_t/phy_size_t on getenv_lowmem_... and this is fine, but arch/powerpc/cpu/mpc85xx/fdt.c::ft_cpu_setup calls bd->bi_mem* and needs a cast.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140409/a2b99876/attachment.pgp>
RFC PATCH 1/1 fdt: Remove fdt_fixup_memory function
Dear Tom,
Quoted 5 lines · In message <20140409182426.GV23803@bill-the-cat> you wrote:
Quoted 3 lines
I understand what you mean and what you want, but I'm not really happy about it.
Code or comment wise?
Both...
Quoted 6 lines
Right, so we have a mismatch between function name (
fdt_fixup_memory_bank) and function of the node (Documentation/devicetree/booting-without-of.txtin the kernel is, sadly, the best description I can find of the memory node bindings). We itterate over the number of "banks" passed in (1 on PowerPC,CONFIG_NR_DRAM_BANKSon ARM, which is between 1 and 4) and do, as the
If I u nderstand correctly, CONFIG_NR_DRAM_BANKS gives only the maximum possible number of banks. On the actual system less banks may be present.
Quoted 3 lines
binding expects, set the reg property correctly (base, size) for each "bank". It would be more correct to call this "ranges" rather than "banks", or perhaps "
nr_ranges".
Yes, ture. But then, AFAICT ARM has never made such clear definition of terms, and for the tyical ARM memory controllers "range" and "bank" are actually synonyms, so this never bothered anybody.
Quoted 9 lines
Quoted 2 lines
And is dropping the (u64) not a problem?
bd->bi_memstartis just an "unsigned long", butfdt_fixup_memory_banks()expects a u64 ?Oops, I don't know how I missed that. Or rather, what the hell is up with calling
fdt_fixup_memory()in two places on PowerPC? I just changed the call in board/freescale/t1040qds/t1040qds.c::ft_board_setup, which uses phy_addr_t/phy_size_t ongetenv_lowmem_... and this is fine, but arch/powerpc/cpu/mpc85xx/fdt.c::ft_cpu_setup calls bd->bi_mem* and needs a cast.
This should probably best be answered by the MPC85xx experts...
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
It is common sense to take a method and try it. If it fails, admit it
frankly and try another. But above all, try something.
- Franklin D. RooseveltRFC PATCH 1/1 fdt: Remove fdt_fixup_memory function
Quoted 10 lines · Wolfgang Denk
Dear Tom,
Quoted 5 lines · In message <20140409182426.GV23803@bill-the-cat> you wrote:
Quoted 3 lines
I understand what you mean and what you want, but I'm not really happy about it.
Code or comment wise?
Both...
OK, concept wise?
Quoted 10 lines
Quoted 6 lines
Right, so we have a mismatch between function name (
fdt_fixup_memory_bank) and function of the node (Documentation/devicetree/booting-without-of.txtin the kernel is, sadly, the best description I can find of the memory node bindings). We itterate over the number of "banks" passed in (1 on PowerPC,CONFIG_NR_DRAM_BANKSon ARM, which is between 1 and 4) and do, as theIf I u nderstand correctly,
CONFIG_NR_DRAM_BANKSgives only the maximum possible number of banks. On the actual system less banks may be present.
If I recall correctly, when we have less populated banks than CONFIG_NR_DRAM_BANKS we set size to 0, but I'll have to double check the omap3 sdrc and emif code.
Quoted 7 lines
Quoted 3 lines
binding expects, set the reg property correctly (base, size) for each "bank". It would be more correct to call this "ranges" rather than "banks", or perhaps "
nr_ranges".Yes, ture. But then, AFAICT ARM has never made such clear definition of terms, and for the tyical ARM memory controllers "range" and "bank" are actually synonyms, so this never bothered anybody.
Well, the binding means "range" not "bank". The usage of CONFIG_NR_DRAM_BANKS within U-Boot is used to check for actual banks. I'm not aware off-hand, but it's not impossible that we have discontiguous DRAM chunks. I know on omap3 we make sure to map them contiguously.
The high level point here is to get things to the point of having a single call we use for setting the /memory node for the kernel so that we can then easily enough change things so that this depends on CONFIG_something_or_another so that cases where we know we don't want to modify the /memory node (it contains more memory than we can probe or discontiguous ranges that again, we can't probe), we don't.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140409/1057f3c5/attachment.pgp>