On 6 July 2012 00:27, Rob Herring robherring2@gmail.com wrote:
On 07/05/2012 11:48 AM, Peter Maydell wrote:
void __init early_init_dt_add_memory_arch(u64 base, u64 size) {
while (size > 0x80000000) {
arm_add_memory(base, 0x80000000);
base += 0x80000000;
size -= 0x80000000;
} arm_add_memory(base, size);
I would just change arm_add_memory to use phys_addr_t for the size param. This ultimately calls memblock functions which use phys_addr_t for sizes.
I was wondering if somebody would suggest that. It's a bigger patch (since it requires changing struct membank and potentially any function which uses that) but I guess it is the long term right thing. I'll have a go at that next week...
One thing I noticed is ATAGs will be broken for LPAE. That's probably fine because if you can fix your bootloader for new ATAGs, then you can support DT.
Well, it works fine with LPAE assuming you didn't actually need to pass in 4GB of RAM. (I think you could for instance specify 3.5GB RAM starting at 2GB using ATAGS.) But yes, I'm assuming ATAGs boot is 'legacy' now and we can insist on DT for any new platform that can manage 4GB of RAM in the first place.
-- PMM