quark_d2000: Add shared GDT memory to linker

A new shared memory area has been added to the QMSI bootloader in
order to store the GDT in RAM reliably.

Add the new entry to the QUARK D2000 linker script and new
kconfig options:

 * CONFIG_BSP_SHARED_GDT_RAM_ADDR to set the address location
   of the GDT in RAM.

 * CONFIG_BSP_SHARED_GDT_RAM_SIZE to set the size used by the
   GDT in RAM.

This is only enabled when  CONFIG_SET_GDT is NOT set.

Change-Id: Ie084079475853dce153dd9f3e88ad4a9784bdedf
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
This commit is contained in:
Jesus Sanchez-Palencia 2017-01-05 16:01:07 -08:00 committed by Anas Nashif
commit a19d4ad041
2 changed files with 48 additions and 2 deletions

View file

@ -0,0 +1,36 @@
# Kconfig - Quark D2000 configuration options
#
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
if X86 && SOC_QUARK_D2000
config BSP_SHARED_GDT_RAM_ADDR
hex "Address of the shared RAM with the QMSI Bootloader"
default 0x00281FE0
help
Address of the memory shared between the BSP and the Bootloader in order
to store the GDT.
config BSP_SHARED_GDT_RAM_SIZE
hex "Size of the shared RAM with the QMSI Bootloader"
depends on !SET_GDT
default 0x20
help
Size of the memory shared between the BSP and the Bootloader in order
to store the GDT.
endif #SOC_QUARK_D2000_X86

View file

@ -23,14 +23,24 @@
#define PHYS_LOAD_ADDR CONFIG_PHYS_RAM_ADDR #define PHYS_LOAD_ADDR CONFIG_PHYS_RAM_ADDR
#endif /* CONFIG_XIP */ #endif /* CONFIG_XIP */
#ifdef CONFIG_SET_GDT
#define PHYS_RAM_SIZE CONFIG_RAM_SIZE*1K
#else /* !CONFIG_SET_GDT */
#define PHYS_RAM_SIZE CONFIG_RAM_SIZE*1K - CONFIG_BSP_SHARED_GDT_RAM_SIZE
#endif
MEMORY MEMORY
{ {
#ifdef CONFIG_XIP #ifdef CONFIG_XIP
ROM (rx) : ORIGIN = PHYS_LOAD_ADDR, LENGTH = CONFIG_ROM_SIZE*1K ROM (rx) : ORIGIN = PHYS_LOAD_ADDR, LENGTH = CONFIG_ROM_SIZE*1K
RAM (wx) : ORIGIN = PHYS_RAM_ADDR, LENGTH = CONFIG_RAM_SIZE*1K RAM (wx) : ORIGIN = PHYS_RAM_ADDR, LENGTH = PHYS_RAM_SIZE
#else /* !CONFIG_XIP */ #else /* !CONFIG_XIP */
RAM (wx) : ORIGIN = PHYS_LOAD_ADDR, LENGTH = CONFIG_RAM_SIZE*1K RAM (wx) : ORIGIN = PHYS_LOAD_ADDR, LENGTH = PHYS_RAM_SIZE
#endif /* CONFIG_XIP */ #endif /* CONFIG_XIP */
#ifndef CONFIG_SET_GDT
BSP_SHARED_GDT_RAM (rw) : ORIGIN = CONFIG_BSP_SHARED_GDT_RAM_ADDR,
LENGTH = CONFIG_BSP_SHARED_GDT_RAM_SIZE
#endif /* !CONFIG_SET_GDT */
/* /*
* It doesn't matter where this region goes as it is stripped from the * It doesn't matter where this region goes as it is stripped from the