Skip to content

Commit

Permalink
xtensa: add support to build HAL as part of build process
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dcpleung authored and nashif committed Dec 19, 2019
1 parent 250041f commit b61f448
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 28 deletions.
1 change: 1 addition & 0 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ config XTENSA
select HAS_DTS
select USE_SWITCH
select USE_SWITCH_SUPPORTED
select XTENSA_HAL if "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "xcc"

config ARCH_POSIX
bool "POSIX (native) architecture"
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/core/fatal.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <kernel_structs.h>
#include <inttypes.h>
#include <kernel_arch_data.h>
#include <xtensa/specreg.h>
#include <xtensa/config/specreg.h>
#include <xtensa-asm2-context.h>
#include <logging/log.h>
LOG_MODULE_DECLARE(os);
Expand Down
10 changes: 0 additions & 10 deletions cmake/toolchain/xtools/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ set(SYSROOT_TARGET ${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})

if("${ARCH}" STREQUAL "x86")
Expand Down
10 changes: 0 additions & 10 deletions cmake/toolchain/zephyr/0.10/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ set(SYSROOT_TARGET ${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})

if("${ARCH}" STREQUAL "x86")
Expand Down
7 changes: 0 additions & 7 deletions cmake/toolchain/zephyr/0.11/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ set(SYSROOT_TARGET ${CROSS_COMPILE_TARGET})

if("${ARCH}" STREQUAL "xtensa")
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}-)
else()
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET})
Expand Down
8 changes: 8 additions & 0 deletions modules/Kconfig.xtensa
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit b61f448

Please sign in to comment.