feat(esp_system): allow .bss to spill over into L2MEM above 0x4ff40000

This commit introduce SOC_MEM_NON_CONTIGUOUS_SRAM flag (that enebled for
esp32p4). If SOC_MEM_NON_CONTIGUOUS_SRAM is enabled:

- LDFLAGS+=--enable-non-contiguous-regions
- ldgen.py replaces "arrays[*]" from sections.ld.in with objects under
  SURROUND keyword. (e.g. from linker.lf: data -> dram0_data SURROUND(foo))
- "mapping[*]" - refers to all other data

If SOC_MEM_NON_CONTIGUOUS_SRAM, sections.ld.in file should contain at
least one block of code like this (otherwise it does not make sense):

  .dram0.bss (NOLOAD) :
  {
    arrays[dram0_bss]
    mapping[dram0_bss]
  } > sram_low

  .dram1.bss (NOLOAD) :
  {
    /* do not place here arrays[dram0_bss] because it may be splited
     * between segments */
    mapping[dram0_bss]
  } > sram_high
This commit is contained in:
Alexey Lapshin
2024-02-12 09:51:25 +04:00
parent 4b5b064caf
commit 824c8e0593
47 changed files with 604 additions and 554 deletions

View File

@@ -532,26 +532,53 @@ The linker script template is the skeleton in which the generated placement rule
To reference the placement rules collected under a ``target`` token, the following syntax is used:
.. code-block:: none
.. only:: SOC_MEM_NON_CONTIGUOUS_SRAM
mapping[target]
.. code-block:: none
arrays[target] /* refers to objects under the SURROUND keyword */
mapping[target] /* refers to all other data */
.. only:: not SOC_MEM_NON_CONTIGUOUS_SRAM
.. code-block:: none
mapping[target]
Example:
The example below is an excerpt from a possible linker script template. It defines an output section ``.iram0.text``, and inside is a marker referencing the target ``iram0_text``.
.. code-block:: none
.. only:: SOC_MEM_NON_CONTIGUOUS_SRAM
.iram0.text :
{
/* Code marked as runnning out of IRAM */
_iram_text_start = ABSOLUTE(.);
.. code-block:: none
/* Marker referencing iram0_text */
mapping[iram0_text]
.iram0.text :
{
/* Code marked as runnning out of IRAM */
_iram_text_start = ABSOLUTE(.);
_iram_text_end = ABSOLUTE(.);
} > iram0_0_seg
/* Markers referencing iram0_text */
arrays[iram0_text]
mapping[iram0_text]
_iram_text_end = ABSOLUTE(.);
} > iram0_0_seg
.. only:: not SOC_MEM_NON_CONTIGUOUS_SRAM
.. code-block:: none
.iram0.text :
{
/* Code marked as runnning out of IRAM */
_iram_text_start = ABSOLUTE(.);
/* Marker referencing iram0_text */
mapping[iram0_text]
_iram_text_end = ABSOLUTE(.);
} > iram0_0_seg
Suppose the generator collected the fragment definitions below: