Commit 45a41777 authored by Leifu Zhao's avatar Leifu Zhao Committed by Fabio Baltieri
Browse files

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: default avatarLeifu Zhao <leifu.zhao@intel.com>
parent 202a8ae5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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>;
+4 −0
Original line number Diff line number Diff line
@@ -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,,)
+32 −0
Original line number Diff line number Diff line
/*
 * 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)