2015-12-17 13:03:40 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2011-2014, Wind River Systems, Inc.
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2015-12-17 13:03:40 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Linker command/script file
|
|
|
|
*
|
|
|
|
* This is the linker script for both standard images and XIP images.
|
2019-09-10 15:41:08 +08:00
|
|
|
*
|
|
|
|
* If XIP is turned on, board-level DTS must specify a flash region
|
|
|
|
* that doesn't overlap with sram0, so that DT_PHYS_LOAD_ADDR is set.
|
2015-12-17 13:03:40 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <autoconf.h>
|
2017-09-08 02:07:36 +08:00
|
|
|
#include <generated_dts_board.h>
|
2015-12-17 13:03:40 +08:00
|
|
|
|
|
|
|
/* physical address where the kernel is loaded */
|
|
|
|
/* physical address of RAM */
|
|
|
|
#ifdef CONFIG_XIP
|
2019-09-10 15:41:08 +08:00
|
|
|
#define PHYS_LOAD_ADDR DT_PHYS_LOAD_ADDR
|
|
|
|
#define PHYS_RAM_ADDR DT_PHYS_RAM_ADDR
|
2015-12-17 13:03:40 +08:00
|
|
|
#else /* !CONFIG_XIP */
|
2019-09-10 15:41:08 +08:00
|
|
|
#define PHYS_LOAD_ADDR DT_PHYS_RAM_ADDR
|
|
|
|
#define PHYS_RAM_ADDR DT_PHYS_RAM_ADDR
|
2015-12-17 13:03:40 +08:00
|
|
|
#endif /* CONFIG_XIP */
|
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_XIP
|
2018-11-13 22:15:23 +08:00
|
|
|
ROM (rx) : ORIGIN = PHYS_LOAD_ADDR, LENGTH = DT_ROM_SIZE*1K
|
2019-09-10 15:41:08 +08:00
|
|
|
RAM (wx) : ORIGIN = PHYS_RAM_ADDR, LENGTH = DT_RAM_SIZE*1K
|
2015-12-17 13:03:40 +08:00
|
|
|
#else /* !CONFIG_XIP */
|
2019-09-10 15:41:08 +08:00
|
|
|
RAM (wx) : ORIGIN = PHYS_RAM_ADDR, LENGTH = DT_RAM_SIZE*1K
|
2015-12-17 13:03:40 +08:00
|
|
|
#endif /* CONFIG_XIP */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* It doesn't matter where this region goes as it is stripped from the
|
|
|
|
* final ELF image. The address doesn't even have to be valid on the
|
|
|
|
* target. However, it shouldn't overlap any other regions.
|
|
|
|
*/
|
|
|
|
|
2017-07-06 04:59:14 +08:00
|
|
|
IDT_LIST : ORIGIN = 0xFFFF1000, LENGTH = 2K
|
2015-12-17 13:03:40 +08:00
|
|
|
}
|
|
|
|
|
2019-07-23 06:49:25 +08:00
|
|
|
#ifdef CONFIG_X86_LONGMODE
|
|
|
|
#include <arch/x86/intel64/linker.ld>
|
|
|
|
#else
|
2019-06-29 00:41:39 +08:00
|
|
|
#include <arch/x86/ia32/linker.ld>
|
2019-07-23 06:49:25 +08:00
|
|
|
#endif
|