Besides adding ARCH_HAS_CODE_DATA_RELOCATION, this patch also adds support for the "sample_controller" SoC (used by qemu_xtensa) as demonstration. As Xtensa lacks a common linker script at the arch level, enabling it for each platform will be a piecemeal effort. This patch adds it to the `soc/xtensa/sample_controller` SoC. Basically, default RAMABLE_REGION is set to be called "RAM", and hooks are inserted so that gen_relocate_app.py can add the relevant linker bits. Also, `tests/application_developent/code_relocation` was tweaked to support the qemu_xtensa platform. Basically, add the relevant linker script and ensure that relevant memory regions have their program header (PHDR) associated. Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
30 lines
556 B
Plaintext
30 lines
556 B
Plaintext
/*
|
|
* Copyright 2022 The Chromium OS Authors
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <zephyr/linker/sections.h>
|
|
#include <zephyr/devicetree.h>
|
|
|
|
#include <zephyr/linker/linker-defs.h>
|
|
#include <zephyr/linker/linker-tool.h>
|
|
|
|
#define SRAM2_ADDR (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2)
|
|
#define RAM_SIZE2 (0x4000000)
|
|
|
|
MEMORY
|
|
{
|
|
SRAM2 (wx) : ORIGIN = (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2), LENGTH = RAM_SIZE2
|
|
}
|
|
|
|
PHDRS
|
|
{
|
|
sram2_phdr PT_LOAD;
|
|
}
|
|
|
|
#define MPU_ALIGN(region_size) \
|
|
. = ALIGN(4)
|
|
|
|
#include <xtensa-sample-controller.ld>
|