From 3d1252ff2dc664c4d54921dfbd16c31b93d42e51 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 3 Sep 2018 15:20:14 -0500 Subject: [PATCH] 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 --- CMakeLists.txt | 15 +++++++++++---- Kconfig.zephyr | 2 +- cmake/dts.cmake | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42cbfc88fec..17b272d4c94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index e5d219efef6..942ccb57ca6 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -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" diff --git a/cmake/dts.cmake b/cmake/dts.cmake index 3ce6c66f754..bf556cbc854 100644 --- a/cmake/dts.cmake +++ b/cmake/dts.cmake @@ -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()