Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add direct boot support for C6 #2

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions esp32c6-hal/ld/db-esp32c6-link.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ SECTIONS
{
LONG(0xaedb041d)
LONG(0xaedb041d)
} > IROM
} > ROM
}

_stext = ORIGIN(IROM) + 8;
_stext = ORIGIN(ROM) + 8;

INCLUDE riscv-link.x
25 changes: 10 additions & 15 deletions esp32c6-hal/ld/db-esp32c6-memory.x
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,23 @@ MEMORY

/* 512K of on soc RAM, 32K reserved for cache */
ICACHE : ORIGIN = 0x40800000, LENGTH = 32K
/* Instruction RAM */
IRAM : ORIGIN = 0x40800000 + 32K, LENGTH = 512K - 32K
/* Data RAM */
DRAM : ORIGIN = 0x40800000 + 32K, LENGTH = 512K - 32K

RAM : ORIGIN = 0x40800000 + 32K, LENGTH = 512K - 32K

/* External flash */
/* Instruction ROM */
IROM : ORIGIN = 0x42000000, LENGTH = 0x400000
/* Data ROM */
DROM : ORIGIN = 0x42800000, LENGTH = 0x400000
ROM : ORIGIN = 0x42000000, LENGTH = 0x400000

/* RTC fast memory (executable). Persists over deep sleep. */
RTC_FAST : ORIGIN = 0x50000000, LENGTH = 16K /*- ESP_BOOTLOADER_RESERVE_RTC*/
}

REGION_ALIAS("REGION_TEXT", IROM);
REGION_ALIAS("REGION_RODATA", DROM);
REGION_ALIAS("REGION_TEXT", ROM);
REGION_ALIAS("REGION_RODATA", ROM);

REGION_ALIAS("REGION_DATA", DRAM);
REGION_ALIAS("REGION_BSS", DRAM);
REGION_ALIAS("REGION_HEAP", DRAM);
REGION_ALIAS("REGION_STACK", DRAM);
REGION_ALIAS("REGION_DATA", RAM);
REGION_ALIAS("REGION_BSS", RAM);
REGION_ALIAS("REGION_HEAP", RAM);
REGION_ALIAS("REGION_STACK", RAM);

REGION_ALIAS("REGION_RWTEXT", IRAM);
REGION_ALIAS("REGION_RWTEXT", RAM);
REGION_ALIAS("REGION_RTC_FAST", RTC_FAST);
10 changes: 5 additions & 5 deletions esp32c6-hal/ld/db-riscv-link.x
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ SECTIONS
} > REGION_TEXT

_text_size = _etext - _stext + 8;
.rodata ORIGIN(DROM) + _text_size : AT(_text_size)
.rodata ORIGIN(ROM) + _text_size : AT(_text_size)
{
_srodata = .;
*(.srodata .srodata.*);
Expand All @@ -75,7 +75,7 @@ SECTIONS
} > REGION_RODATA

_rodata_size = _erodata - _srodata + 8;
.data ORIGIN(DRAM) : AT(_text_size + _rodata_size)
.data ORIGIN(RAM) : AT(_text_size + _rodata_size)
{
_sdata = .;
/* Must be called __global_pointer$ for linker relaxations to work. */
Expand Down Expand Up @@ -182,9 +182,9 @@ SECTIONS
}

PROVIDE(_sidata = _erodata + 8);
PROVIDE(_irwtext = ORIGIN(DROM) + _text_size + _rodata_size + _data_size);
PROVIDE(_irtc_fast_text = ORIGIN(DROM) + _text_size + _rodata_size + _data_size + _rwtext_size);
PROVIDE(_irtc_fast_data = ORIGIN(DROM) + _text_size + _rodata_size + _data_size + _rwtext_size + _fast_text_size);
PROVIDE(_irwtext = ORIGIN(ROM) + _text_size + _rodata_size + _data_size);
PROVIDE(_irtc_fast_text = ORIGIN(ROM) + _text_size + _rodata_size + _data_size + _rwtext_size);
PROVIDE(_irtc_fast_data = ORIGIN(ROM) + _text_size + _rodata_size + _data_size + _rwtext_size + _fast_text_size);

/* Do not exceed this mark in the error messages above | */
ASSERT(ORIGIN(REGION_TEXT) % 4 == 0, "
Expand Down