1/*
2 * Copyright 2022 The Chromium OS Authors
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <zephyr/linker/sections.h>
8#include <zephyr/devicetree.h>
9
10#include <zephyr/linker/linker-defs.h>
11#include <zephyr/linker/linker-tool.h>
12
13/** enable CONFIG_SRAM2 or any other partition in soc Kconfig,
14 * this is just an example to show relocation of code/data/bss script
15 */
16#define _SRAM2_DATA_SECTION_NAME  .sram2_data
17#define _SRAM2_BSS_SECTION_NAME   .sram2_bss
18#define _SRAM2_TEXT_SECTION_NAME  .sram2_text
19#define SRAM2_ADDR  (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2)
20
21#define RAM_SIZE2 (CONFIG_SRAM_SIZE * 512)
22MEMORY
23    {
24    SRAM2                  (wx) : ORIGIN = (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2), LENGTH = RAM_SIZE2
25    }
26
27#include <zephyr/arch/riscv/common/linker.ld>
28