Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36145 )
Change subject: [RFC,POC]arch/arm: Pass cbmem_top to ramstage via calling argument ......................................................................
Patch Set 2:
(1 comment)
Hmmm... in general I agree it would be good to do something here, since this is a problem that annoys us a lot on Arm platforms (have to figure out a new way to pass this stuff for every new SoC). But just passing cbmem_top() wouldn't really solve it, because we still need to know the full DRAM size to write the correct memory tables (with ram_resource()). We can calculate cbmem_top() easily when we know the size of DRAM (it's essentially MIN(4GB, _dram + dram_size)), but not the other way round.
Would it make more sense to instead pass the size of DRAM as an argument?
https://review.coreboot.org/c/coreboot/+/36145/2/src/arch/arm/stages.c File src/arch/arm/stages.c:
https://review.coreboot.org/c/coreboot/+/36145/2/src/arch/arm/stages.c@34 PS2, Line 34: #endif This sort of stuff shouldn't be here. You'll probably want to centralize it in src/lib/imd_cbmem.c somehow, and call a function here that would call into there (or pass it through to main() and call it from there, that would probably be even cleaner).