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 <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2016-04-03 09:37:43 -04:00 committed by Anas Nashif
commit d2f1c76686
8 changed files with 18 additions and 11 deletions

View file

@ -345,19 +345,22 @@ endif
USERINCLUDE := -include $(CURDIR)/include/generated/autoconf.h USERINCLUDE := -include $(CURDIR)/include/generated/autoconf.h
SOC_NAME = $(subst $(DQUOTE),,$(CONFIG_SOC)) SOC_NAME = $(subst $(DQUOTE),,$(CONFIG_SOC))
SOC_SERIES = $(subst $(DQUOTE),,$(CONFIG_SOC_SERIES))
SOC_FAMILY = $(subst $(DQUOTE),,$(CONFIG_SOC_FAMILY)) SOC_FAMILY = $(subst $(DQUOTE),,$(CONFIG_SOC_FAMILY))
override ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH)) override ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH))
BOARD_NAME = $(subst $(DQUOTE),,$(CONFIG_BOARD)) BOARD_NAME = $(subst $(DQUOTE),,$(CONFIG_BOARD))
KERNEL_NAME = $(subst $(DQUOTE),,$(CONFIG_KERNEL_BIN_NAME)) KERNEL_NAME = $(subst $(DQUOTE),,$(CONFIG_KERNEL_BIN_NAME))
KERNEL_ELF_NAME = $(KERNEL_NAME).elf KERNEL_ELF_NAME = $(KERNEL_NAME).elf
KERNEL_BIN_NAME = $(KERNEL_NAME).bin 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. # Use ZEPHYRINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option # Needed to be compatible with the O= option
ZEPHYRINCLUDE = \ ZEPHYRINCLUDE = \
-I$(srctree)/arch/$(ARCH)/include \ -I$(srctree)/arch/$(ARCH)/include \
-I$(srctree)/arch/$(ARCH)/soc/$(SOC_NAME) \ -I$(srctree)/arch/$(ARCH)/soc/$(SOC_PATH) \
-I$(srctree)/boards/$(BOARD_NAME) \ -I$(srctree)/boards/$(BOARD_NAME) \
$(if $(KBUILD_SRC), -I$(srctree)/include) \ $(if $(KBUILD_SRC), -I$(srctree)/include) \
-I$(srctree)/include \ -I$(srctree)/include \
@ -625,6 +628,11 @@ KBUILD_CFLAGS += $(subst $(DQUOTE),,$(CONFIG_COMPILER_OPT))
export LDFLAG_LINKERCMD export LDFLAG_LINKERCMD
ifeq ($(SOC_SERIES),)
SOC_PATH = $(SOC_NAME)
else
SOC_PATH = $(SOC_FAMILY)/$(SOC_SERIES)
endif
include arch/$(ARCH)/Makefile include arch/$(ARCH)/Makefile
KBUILD_CFLAGS += $(CFLAGS) KBUILD_CFLAGS += $(CFLAGS)
@ -705,7 +713,7 @@ KBUILD_LDS := $(srctree)/boards/$(BOARD_NAME)/linker.cmd
# If not available, try an SoC specific linker file # If not available, try an SoC specific linker file
ifeq ($(wildcard $(KBUILD_LDS)),) 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
endif endif

View file

@ -2,5 +2,5 @@ subdir-ccflags-y +=-I$(srctree)/include/drivers
subdir-ccflags-y +=-I$(srctree)/drivers subdir-ccflags-y +=-I$(srctree)/drivers
subdir-asflags-y += $(subdir-ccflags-y) subdir-asflags-y += $(subdir-ccflags-y)
obj-y += soc/$(SOC_NAME)/ obj-y += soc/$(SOC_PATH)/
obj-y += core/ obj-y += core/

View file

@ -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_ARC_STACK_CHECKING) = $(call cc-option,-fomit-frame-pointer)
cflags-$(CONFIG_LTO) = $(call cc-option,-flto,) 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_CFLAGS += $(cflags-y)
KBUILD_CXXFLAGS += $(cflags-y) KBUILD_CXXFLAGS += $(cflags-y)

View file

@ -2,5 +2,5 @@ subdir-ccflags-y +=-I$(srctree)/include/drivers
subdir-ccflags-y +=-I$(srctree)/drivers subdir-ccflags-y +=-I$(srctree)/drivers
subdir-asflags-y := ${subdir-ccflags-y} subdir-asflags-y := ${subdir-ccflags-y}
obj-y += soc/$(SOC_NAME)/ obj-y += soc/$(SOC_PATH)/
obj-y += core/ obj-y += core/

View file

@ -1,6 +1,6 @@
KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-sections,) 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,) cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)

View file

@ -1,5 +1,5 @@
ccflags-y +=-I$(srctree)/include/drivers 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) asflags-y = $(ccflags-y)

View file

@ -1,4 +1,3 @@
obj-y += core/ obj-y += core/
obj-y += soc/$(SOC_NAME)/
obj-$(CONFIG_GDB_SERVER) += debug/ obj-$(CONFIG_GDB_SERVER) += debug/
obj-y += soc/$(SOC_PATH)/

View file

@ -20,7 +20,7 @@ ifneq ($(CONFIG_SSE_FP_MATH),y)
cflags-y += -mno-sse cflags-y += -mno-sse
endif endif
include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
KBUILD_CXXFLAGS += $(cflags-y) KBUILD_CXXFLAGS += $(cflags-y)
KBUILD_CFLAGS += $(cflags-y) KBUILD_CFLAGS += $(cflags-y)