8051 initializing data in external memory
Initialized data in RAM has to come from somewhere - typically from ROM or from disk, or whatever place the program code is coming from.
In a programming environment complex enough to have canned &quot;startup code&quot; typically initialized data designated for RAM will actually be packaged by the linker into flash (or on a larger system, the disk image or structured binary, eg ELF, PE, whatever) along with some collective start/end metadata, and the startup code will do a block copy of this from that initial location to the needed location in RAM.
In your case, you have to do some initial pre-configuration to even be able to use the RAM at all.
That probably means there are two possibilities:

Put the data in flash, then have your own routine which copies it to RAM after performing the necessary configuration to make RAM work

Possibly your toolchain is aware enough of your expanded system configuration that there's already a canned mechanism for doing that


In reality though there's a third choice, too:

Don't use initialized storage in RAM - use constants for things that have initial values (which will probably end up constructed from the most efficient representation) and then use RAM only for values generated an runtime.