x86: linker: add linker script for ish aon section

link aon code into special aon memory region by put aon object files
into aon section.

Signed-off-by: Leifu Zhao <leifu.zhao@intel.com>
This commit is contained in:
Leifu Zhao 2023-05-16 13:59:21 +08:00 committed by Fabio Baltieri
parent 202a8ae5ca
commit 45a4177704
3 changed files with 43 additions and 0 deletions

View file

@ -68,6 +68,13 @@
reg = <0xff200000 DT_SIZE_K(640)>;
};
aon: memory@ff800000 {
device_type = "memory";
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0xff800000 DT_SIZE_K(8)>;
zephyr,memory-region = "AON";
};
soc {
#address-cells = <1>;
#size-cells = <1>;

View file

@ -87,6 +87,10 @@ SECTIONS
*(.iplt)
}
#if defined(CONFIG_SOC_FAMILY_INTEL_ISH) && defined(CONFIG_PM)
#include <zephyr/arch/x86/ia32/scripts/ish_aon.ld>
#endif
#ifdef CONFIG_LINKER_USE_BOOT_SECTION
SECTION_PROLOGUE(boot.text,,)

View file

@ -0,0 +1,32 @@
/*
* Copyright (c) 2023 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#define AON_C_OBJECT_FILE_IN_SECT(lsect, objfile) \
KEEP(*_intel_hal.a:objfile.c.obj(.##lsect)) \
KEEP(*_intel_hal.a:objfile.c.obj(.##lsect##.*))
#define AON_S_OBJECT_FILE_IN_SECT(lsect, objfile) \
KEEP(*_intel_hal.a:objfile.S.obj(.##lsect)) \
KEEP(*_intel_hal.a:objfile.S.obj(.##lsect##.*))
#define AON_IN_SECT(lsect) \
AON_C_OBJECT_FILE_IN_SECT(lsect, aon_task) \
AON_C_OBJECT_FILE_IN_SECT(lsect, ish_dma) \
AON_S_OBJECT_FILE_IN_SECT(lsect, ipapg)
GROUP_START(AON)
SECTION_PROLOGUE(aon,,)
{
aon_start = .;
KEEP(*(.data.aon_share))
AON_IN_SECT(data)
AON_IN_SECT(text)
AON_IN_SECT(bss)
aon_end = .;
} GROUP_LINK_IN(AON)
GROUP_END(AON)