-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
RFC: memory regions from devicetree & explicit code locations #33656
Changes from 1 commit
52b5311
cdfea7c
0279ba0
ba76b22
9f999e0
8ea65e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -13,14 +13,15 @@ | |||
|
||||
#include <autoconf.h> | ||||
#include <linker/sections.h> | ||||
#include <linker/devicetree_regions.h> | ||||
#include <devicetree.h> | ||||
|
||||
#include <linker/linker-defs.h> | ||||
#include <linker/linker-tool.h> | ||||
|
||||
/* physical address of RAM */ | ||||
#ifdef CONFIG_XIP | ||||
#define ROMABLE_REGION FLASH | ||||
#define ROMABLE_REGION DT_CODE_PARITION() | ||||
#define RAMABLE_REGION SRAM | ||||
#else | ||||
#define ROMABLE_REGION SRAM | ||||
|
@@ -33,25 +34,6 @@ | |||
#define _DATA_IN_ROM | ||||
#endif | ||||
|
||||
#if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) | ||||
#define ROM_ADDR RAM_ADDR | ||||
#else | ||||
#define ROM_ADDR (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET) | ||||
#endif | ||||
|
||||
#ifdef CONFIG_HAS_TI_CCFG | ||||
#define CCFG_SIZE 88 | ||||
#define ROM_SIZE (CONFIG_FLASH_SIZE*1K - CONFIG_FLASH_LOAD_OFFSET - \ | ||||
CCFG_SIZE) | ||||
#define CCFG_ADDR (ROM_ADDR + ROM_SIZE) | ||||
#else | ||||
#if CONFIG_FLASH_LOAD_SIZE > 0 | ||||
#define ROM_SIZE CONFIG_FLASH_LOAD_SIZE | ||||
#else | ||||
#define ROM_SIZE (CONFIG_FLASH_SIZE*1K - CONFIG_FLASH_LOAD_OFFSET) | ||||
#endif | ||||
#endif | ||||
|
||||
#if defined(CONFIG_XIP) | ||||
#if defined(CONFIG_IS_BOOTLOADER) | ||||
#define RAM_SIZE (CONFIG_BOOTLOADER_SRAM_SIZE * 1K) | ||||
|
@@ -106,7 +88,6 @@ _region_min_align = 4; | |||
|
||||
MEMORY | ||||
{ | ||||
FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE | ||||
#ifdef CONFIG_HAS_TI_CCFG | ||||
FLASH_CCFG (rwx): ORIGIN = CCFG_ADDR, LENGTH = CCFG_SIZE | ||||
#endif | ||||
|
@@ -135,6 +116,10 @@ MEMORY | |||
#ifdef CONFIG_STM32_BACKUP_SRAM | ||||
BACKUP_SRAM (rw) : ORIGIN = DT_REG_ADDR(DT_NODELABEL(backup_sram)), LENGTH = DT_REG_SIZE(DT_NODELABEL(backup_sram)) | ||||
#endif | ||||
|
||||
/* Add custom memory regions specified by devicetree partitions */ | ||||
DT_REGIONS_FROM_CHOSEN_FLASH(zephyr_flash) | ||||
|
||||
/* Used by and documented in include/linker/intlist.ld */ | ||||
IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K | ||||
} | ||||
|
@@ -162,7 +147,7 @@ SECTIONS | |||
|
||||
GROUP_START(ROMABLE_REGION) | ||||
|
||||
_image_rom_start = ROM_ADDR; | ||||
_image_rom_start = .; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is changing the value of This means that code that refers to This also results in:
being calculated wrongly. As example, building hello world for
but with this PR:
so any code relying on those two symbols will fail. |
||||
|
||||
SECTION_PROLOGUE(rom_start,,) | ||||
{ | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CCFG_ADDR
is still being used in the code below:causing:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be corrected in: #34185
So assume this is now pending a rebase after #34185 is merged.