From d2f1c76686f546dee33847e789e2492a37452799 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sun, 3 Apr 2016 09:37:43 -0400 Subject: [PATCH] new SoC naming convention Use SOC_FAMILY and SOC_SERIES to identify soc families and series and to point to the correct linker files and files related to a specific SoC. Change-Id: I8b1a7339f37d6ea4161d03073d36557a40c0b4a6 Signed-off-by: Anas Nashif --- Makefile | 14 +++++++++++--- arch/arc/Kbuild | 2 +- arch/arc/Makefile | 2 +- arch/arm/Kbuild | 2 +- arch/arm/Makefile | 2 +- arch/arm/core/cortex_m/Makefile | 2 +- arch/x86/Kbuild | 3 +-- arch/x86/Makefile | 2 +- 8 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index e90321768fd..f729b826733 100644 --- a/Makefile +++ b/Makefile @@ -345,19 +345,22 @@ endif USERINCLUDE := -include $(CURDIR)/include/generated/autoconf.h SOC_NAME = $(subst $(DQUOTE),,$(CONFIG_SOC)) +SOC_SERIES = $(subst $(DQUOTE),,$(CONFIG_SOC_SERIES)) SOC_FAMILY = $(subst $(DQUOTE),,$(CONFIG_SOC_FAMILY)) + override ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH)) BOARD_NAME = $(subst $(DQUOTE),,$(CONFIG_BOARD)) KERNEL_NAME = $(subst $(DQUOTE),,$(CONFIG_KERNEL_BIN_NAME)) KERNEL_ELF_NAME = $(KERNEL_NAME).elf KERNEL_BIN_NAME = $(KERNEL_NAME).bin -export SOC_FAMILY SOC_NAME BOARD_NAME ARCH KERNEL_NAME KERNEL_ELF_NAME KERNEL_BIN_NAME +export SOC_FAMILY SOC_SERIES SOC_PATH SOC_NAME BOARD_NAME +export ARCH KERNEL_NAME KERNEL_ELF_NAME KERNEL_BIN_NAME # Use ZEPHYRINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option ZEPHYRINCLUDE = \ -I$(srctree)/arch/$(ARCH)/include \ - -I$(srctree)/arch/$(ARCH)/soc/$(SOC_NAME) \ + -I$(srctree)/arch/$(ARCH)/soc/$(SOC_PATH) \ -I$(srctree)/boards/$(BOARD_NAME) \ $(if $(KBUILD_SRC), -I$(srctree)/include) \ -I$(srctree)/include \ @@ -625,6 +628,11 @@ KBUILD_CFLAGS += $(subst $(DQUOTE),,$(CONFIG_COMPILER_OPT)) export LDFLAG_LINKERCMD +ifeq ($(SOC_SERIES),) +SOC_PATH = $(SOC_NAME) +else +SOC_PATH = $(SOC_FAMILY)/$(SOC_SERIES) +endif include arch/$(ARCH)/Makefile KBUILD_CFLAGS += $(CFLAGS) @@ -705,7 +713,7 @@ KBUILD_LDS := $(srctree)/boards/$(BOARD_NAME)/linker.cmd # If not available, try an SoC specific linker file ifeq ($(wildcard $(KBUILD_LDS)),) -KBUILD_LDS := $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/linker.cmd +KBUILD_LDS := $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/linker.cmd endif endif diff --git a/arch/arc/Kbuild b/arch/arc/Kbuild index 2eb03ac9543..1573726179d 100644 --- a/arch/arc/Kbuild +++ b/arch/arc/Kbuild @@ -2,5 +2,5 @@ subdir-ccflags-y +=-I$(srctree)/include/drivers subdir-ccflags-y +=-I$(srctree)/drivers subdir-asflags-y += $(subdir-ccflags-y) -obj-y += soc/$(SOC_NAME)/ +obj-y += soc/$(SOC_PATH)/ obj-y += core/ diff --git a/arch/arc/Makefile b/arch/arc/Makefile index a31e5ba8619..42caa6d545e 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile @@ -2,7 +2,7 @@ cflags-y += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-secti cflags-$(CONFIG_ARC_STACK_CHECKING) = $(call cc-option,-fomit-frame-pointer) cflags-$(CONFIG_LTO) = $(call cc-option,-flto,) -include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile +include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile KBUILD_CFLAGS += $(cflags-y) KBUILD_CXXFLAGS += $(cflags-y) diff --git a/arch/arm/Kbuild b/arch/arm/Kbuild index d85de0eea84..07c5074c6ad 100644 --- a/arch/arm/Kbuild +++ b/arch/arm/Kbuild @@ -2,5 +2,5 @@ subdir-ccflags-y +=-I$(srctree)/include/drivers subdir-ccflags-y +=-I$(srctree)/drivers subdir-asflags-y := ${subdir-ccflags-y} -obj-y += soc/$(SOC_NAME)/ +obj-y += soc/$(SOC_PATH)/ obj-y += core/ diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 8a8ef40eac9..ab17000083d 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -1,6 +1,6 @@ KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-sections,) -include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile +include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile cflags-$(CONFIG_LTO) += $(call cc-option,-flto,) diff --git a/arch/arm/core/cortex_m/Makefile b/arch/arm/core/cortex_m/Makefile index 78c03a8e9a3..3659b5e5fc0 100644 --- a/arch/arm/core/cortex_m/Makefile +++ b/arch/arm/core/cortex_m/Makefile @@ -1,5 +1,5 @@ ccflags-y +=-I$(srctree)/include/drivers -ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(SOC_NAME) +ccflags-y +=-I$(srctree)/arch/arm/soc/$(SOC_PATH) asflags-y = $(ccflags-y) diff --git a/arch/x86/Kbuild b/arch/x86/Kbuild index d1e0d388600..29c89e78b5b 100644 --- a/arch/x86/Kbuild +++ b/arch/x86/Kbuild @@ -1,4 +1,3 @@ obj-y += core/ -obj-y += soc/$(SOC_NAME)/ - obj-$(CONFIG_GDB_SERVER) += debug/ +obj-y += soc/$(SOC_PATH)/ diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 0007c8d18c4..b443f6ab704 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -20,7 +20,7 @@ ifneq ($(CONFIG_SSE_FP_MATH),y) cflags-y += -mno-sse endif -include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile +include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile KBUILD_CXXFLAGS += $(cflags-y) KBUILD_CFLAGS += $(cflags-y)