soc: adapt Kconfig/CMake for soc in top /

Change build system to point to soc/ in the top directory rather than
under arch/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2018-09-03 15:20:14 -05:00
commit 3d1252ff2d
3 changed files with 14 additions and 7 deletions

View file

@ -50,9 +50,9 @@ zephyr_library_named(zephyr)
zephyr_include_directories(
kernel/include
arch/${ARCH}/include
arch/${ARCH}/soc/${SOC_PATH}
arch/${ARCH}/soc/${SOC_PATH}/include
arch/${ARCH}/soc/${SOC_FAMILY}/include
soc/${ARCH}/${SOC_PATH}
soc/${ARCH}/${SOC_PATH}/include
soc/${ARCH}/${SOC_FAMILY}/include
${BOARD_DIR}
include
include/drivers
@ -295,7 +295,7 @@ else()
set(LINKER_SCRIPT ${BOARD_DIR}/linker.ld)
if(NOT EXISTS ${LINKER_SCRIPT})
# If not available, try an SoC specific linker file
set(LINKER_SCRIPT ${ZEPHYR_BASE}/arch/${ARCH}/soc/${SOC_PATH}/linker.ld)
set(LINKER_SCRIPT ${ZEPHYR_BASE}/soc/${ARCH}/${SOC_PATH}/linker.ld)
endif()
endif()
@ -335,6 +335,13 @@ add_subdirectory(misc)
# This is because source file properties are directory scoped, including the GENERATED
# property which is set implicitly for custom command outputs
include(misc/generated/CMakeLists.txt)
if(EXISTS soc/${ARCH}/CMakeLists.txt)
add_subdirectory(soc/${ARCH})
else()
add_subdirectory(soc/${ARCH}/${SOC_PATH})
endif()
add_subdirectory(boards)
add_subdirectory(ext)
add_subdirectory(subsys)

View file

@ -17,8 +17,8 @@
#
# Note: $ARCH and $BOARD_DIR might be glob patterns.
source "$(BOARD_DIR)/Kconfig.defconfig"
source "arch/$(ARCH)/soc/*/Kconfig.defconfig"
source "soc/$(ARCH)/*/Kconfig.defconfig"
source "arch/Kconfig"

View file

@ -51,7 +51,7 @@ if(CONFIG_HAS_DTS)
COMMAND ${CMAKE_C_COMPILER}
-x assembler-with-cpp
-nostdinc
-I${ZEPHYR_BASE}/arch/${ARCH}/soc
-I${ZEPHYR_BASE}/soc/${ARCH}
-isystem ${ZEPHYR_BASE}/include
-isystem ${ZEPHYR_BASE}/dts/${ARCH}
-isystem ${ZEPHYR_BASE}/dts
@ -90,7 +90,7 @@ if(CONFIG_HAS_DTS)
if(EXISTS ${DTS_BOARD_FIXUP_FILE})
set(DTS_BOARD_FIXUP ${DTS_BOARD_FIXUP_FILE})
endif()
set_ifndef(DTS_SOC_FIXUP_FILE ${ZEPHYR_BASE}/arch/${ARCH}/soc/${SOC_PATH}/dts.fixup)
set_ifndef(DTS_SOC_FIXUP_FILE ${ZEPHYR_BASE}/soc/${ARCH}/${SOC_PATH}/dts.fixup)
if(EXISTS ${DTS_SOC_FIXUP_FILE})
set(DTS_SOC_FIXUP ${DTS_SOC_FIXUP_FILE})
endif()