Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34921 )
Change subject: arch/non-x86: Replace uses of __PRE_RAM__ ......................................................................
Patch Set 2:
Patch looks good to me functionally, but is this really something we want to do? Is your goal to remove __PRE_RAM__ completely? I agree that a define that needs to be handled with #ifdef (rather than #if or if()) is ugly, but we could fix that by just creating an ENV_PRE_RAM in <rules.h> instead. I do think that the distinction of "are we in a stage that runs from DRAM" is generally useful -- even if ramstage is currently the only stage which that applies to on non-x86 boards, I wouldn't bet that that will never change in the future. Just to hedge against that possibility, I think it makes more sense to have constants that are named directly after the property you're really interested in.
And if we do intend to keep pre-RAM as a separate distinction, some of these cases should keep that rather than checking for the stage.