Would it make more sense to instead pass the size of DRAM as an argument?

You can pass on every information you want from romstage (I assume you can compute the total amount of dram more easily here?) to ramstage via cbmem, but for that you need to know where cbmem is in ramstage. So all you'd need to pass from romstage to ramstage(s) is the pointer to cbmem.

Well, it just seems unnecessarily complicated. Pretty much every non-x86 platform calculates cbmem_top() in the same way based on the end of DRAM. If you're passing something anyway, you might as well pass the DRAM size and then implement cbmem_top() with a common one-liner for all of them. If you're passing cbmem_top(), then they all need to add this extra CBMEM section to pass the DRAM size as well. If we're standardizing on something, I believe standardizing on DRAM size would just work better for those architectures.

View Change

To view, visit change 36145. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If31f0f1de17ffc92c9397f32b26db25aff4b7cab
Gerrit-Change-Number: 36145
Gerrit-PatchSet: 3
Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Julius Werner <jwerner@chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Comment-Date: Wed, 23 Oct 2019 21:17:39 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment