xtensa: add support to build HAL as part of build process

This adds the necessary bits to build the Xtensa HAL as
a module, and removes the bits to use the HAL built with
the Zephyr SDK.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2019-12-03 09:59:10 -08:00 committed by Anas Nashif
parent 250041f4c8
commit b61f448a3f
6 changed files with 10 additions and 28 deletions

View file

@ -42,6 +42,7 @@ config XTENSA
select HAS_DTS select HAS_DTS
select USE_SWITCH select USE_SWITCH
select USE_SWITCH_SUPPORTED select USE_SWITCH_SUPPORTED
select XTENSA_HAL if "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "xcc"
config ARCH_POSIX config ARCH_POSIX
bool "POSIX (native) architecture" bool "POSIX (native) architecture"

View file

@ -8,7 +8,7 @@
#include <kernel_structs.h> #include <kernel_structs.h>
#include <inttypes.h> #include <inttypes.h>
#include <kernel_arch_data.h> #include <kernel_arch_data.h>
#include <xtensa/specreg.h> #include <xtensa/config/specreg.h>
#include <xtensa-asm2-context.h> #include <xtensa-asm2-context.h>
#include <logging/log.h> #include <logging/log.h>
LOG_MODULE_DECLARE(os); LOG_MODULE_DECLARE(os);

View file

@ -18,16 +18,6 @@ set(SYSROOT_TARGET ${CROSS_COMPILE_TARGET})
set(CROSS_COMPILE ${TOOLCHAIN_HOME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-) set(CROSS_COMPILE ${TOOLCHAIN_HOME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-)
if("${ARCH}" STREQUAL "xtensa")
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET})
set(TOOLCHAIN_INCLUDES
${SYSROOT_DIR}/include/arch/include
${SYSROOT_DIR}/include
)
LIST(APPEND TOOLCHAIN_LIBS hal)
LIST(APPEND LIB_INCLUDE_DIR -L${SYSROOT_DIR}/lib)
endif()
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET}) set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET})
if("${ARCH}" STREQUAL "x86") if("${ARCH}" STREQUAL "x86")

View file

@ -18,16 +18,6 @@ set(SYSROOT_TARGET ${CROSS_COMPILE_TARGET})
set(CROSS_COMPILE ${TOOLCHAIN_HOME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-) set(CROSS_COMPILE ${TOOLCHAIN_HOME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-)
if("${ARCH}" STREQUAL "xtensa")
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET})
set(TOOLCHAIN_INCLUDES
${SYSROOT_DIR}/include/arch/include
${SYSROOT_DIR}/include
)
LIST(APPEND TOOLCHAIN_LIBS hal)
LIST(APPEND LIB_INCLUDE_DIR -L${SYSROOT_DIR}/lib)
endif()
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET}) set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET})
if("${ARCH}" STREQUAL "x86") if("${ARCH}" STREQUAL "x86")

View file

@ -13,13 +13,6 @@ set(SYSROOT_TARGET ${CROSS_COMPILE_TARGET})
if("${ARCH}" STREQUAL "xtensa") if("${ARCH}" STREQUAL "xtensa")
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/xtensa/${SOC_NAME}/${SYSROOT_TARGET}) set(SYSROOT_DIR ${TOOLCHAIN_HOME}/xtensa/${SOC_NAME}/${SYSROOT_TARGET})
set(TOOLCHAIN_INCLUDES
${SYSROOT_DIR}/include/arch/include
${SYSROOT_DIR}/include
)
LIST(APPEND TOOLCHAIN_LIBS hal)
LIST(APPEND LIB_INCLUDE_DIR -L${SYSROOT_DIR}/lib)
set(CROSS_COMPILE ${TOOLCHAIN_HOME}/xtensa/${SOC_NAME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-) set(CROSS_COMPILE ${TOOLCHAIN_HOME}/xtensa/${SOC_NAME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-)
else() else()
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET}) set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET})

8
modules/Kconfig.xtensa Normal file
View file

@ -0,0 +1,8 @@
# Copyright (c) 2019 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
config XTENSA_HAL
bool
help
Build the Xtensa HAL module during build process.
This is selected by the Xtensa ARCH kconfig automatically.