Skip to content

Commit

Permalink
x86: linker: add linker script for ish aon section
Browse files Browse the repository at this point in the history
link aon code into special aon memory region by put aon object files
into aon section.

Signed-off-by: Leifu Zhao <[email protected]>
  • Loading branch information
leifuzhao authored and fabiobaltieri committed Aug 18, 2023
1 parent 202a8ae commit 45a4177
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dts/x86/intel/intel_ish5.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
4 changes: 4 additions & 0 deletions include/zephyr/arch/x86/ia32/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -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,,)
Expand Down
32 changes: 32 additions & 0 deletions include/zephyr/arch/x86/ia32/scripts/ish_aon.ld
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 45a4177

Please sign in to comment.