[U-Boot] [RFC][PATCH] fdt: Remove fdt_fixup_memory function
Wolfgang Denk
wd at denx.de
Wed Apr 9 23:39:10 CEST 2014
Dear Tom,
In message <20140409182426.GV23803 at bill-the-cat> you wrote:
>
> > I understand what you mean and what you want, but I'm not really
> > happy about it.
>
> Code or comment wise?
Both...
> 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
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.
> 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.
> > And is dropping the (u64) not a problem? bd->bi_memstart is just an
> > "unsigned long", but fdt_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.
This should probably best be answered by the MPC85xx experts...
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
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. Roosevelt
More information about the U-Boot
mailing list