Hi *Arthur*,
Hardcode it with a Kconfig constant is good enough I think.
That's also what I guessed and this is what I did. I actually reused the existing `CONFIG_GFX_GMA_DEFAULT_MMIO' Kconfig for that purpose. I had to make a twist in the Makefile to convert to ADA number representation though (see [drivers/intel/gma/Makefile.inc#65]).
I'd would have the option to run libgfxinit in romstage at the soc level but still depend on MAINBOARD_USE_LIBGFXINIT.
Could you clarify your thought ? I could not make sense of this.
if you are going to have the linker use .data in .bss try to only do that for those symbols and not the whole data section as the illegal globals check is a good one to keep.
I also have exactly that (see [arch/x86/car.ld#70]).
One trick you could use is to put a backup of the .data section in .rodata with objcopy and copy it back at runtime very early in the stage. This would make it possible to have a .data section on CAR stages in general.
This is something I have not explored. I thought about trying something like that but I could not even find any `.rodata' section in the romstage binary or `car.ld' script. But this is good suggestion, if my current proposal is not accepted or lead to too many issues I'll have a look into this.
Instead of involving objcpy, I I could try to create a region in `.car.data' of the size of the `.data' section, make the linker script move all the `.data' symbols to a `.init_data' section and modify `src/arch/x86/assembly_entry.S' to perform the copy at runtime before jumping into `car_stage_entry' after clearing the `.bss' section.