Skip to content

Commit c512796

Browse files
author
Wayne Ren
committed
board: emsdp: optimize the core_configs.mk
* load core_config.mk if it exists * use core_hardware.h to get the name of config * makefile cleanup Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
1 parent 3fa0285 commit c512796

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

board/emsdp/rev1/configs/core_configs.mk

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Current Supported Core Configurations
2-
CORE_DIRS = $(sort $(dir $(wildcard $(BOARD_EMSDP_DIR)/$(VALID_BD_VER)/configs/*/*.h)))
2+
CORE_DIRS = $(sort $(dir $(wildcard $(BOARD_EMSDP_DIR)/$(VALID_BD_VER)/configs/*/core_hardware.h)))
33
SUPPORTED_CORES := $(patsubst $(BOARD_EMSDP_DIR)/$(VALID_BD_VER)/configs/%/, %,$(CORE_DIRS))
44

55
CUR_CORE ?= $(firstword $(SUPPORTED_CORES))
@@ -11,7 +11,20 @@ VALID_CUR_CORE = $(call check_item_exist, $(CUR_CORE), $(SUPPORTED_CORES))
1111

1212
BOARD_CORE_DIR = $(BOARD_EMSDP_DIR)/$(VALID_BD_VER)/configs/$(VALID_CUR_CORE)
1313

14-
ONCHIP_IP_LIST ?= . designware/spi designware/uart designware/gpio designware/sdio designware/trng designware/pwm_timer subsystem/spi subsystem/gpio subsystem/uart subsystem/iic subsystem/i2s
14+
CORE_CONFIG_MK = $(BOARD_CORE_DIR)/core_config.mk
15+
16+
##
17+
# load core specific makefie if exist
18+
##
19+
ifneq ($(wildcard $(CORE_CONFIG_MK)),)
20+
COMMON_COMPILE_PREREQUISITES += $(CORE_CONFIG_MK)
21+
include $(CORE_CONFIG_MK)
22+
endif
23+
24+
ONCHIP_IP_LIST ?= . designware/spi designware/uart designware/gpio \
25+
designware/sdio designware/trng designware/pwm_timer \
26+
subsystem/spi subsystem/gpio subsystem/uart subsystem/iic \
27+
subsystem/i2s
1528

1629
## Check TCF file existence
1730
ifneq ($(TCFFILE_IS_VALID),1)
@@ -27,7 +40,7 @@ endif
2740
endif
2841

2942
## Check Core Configuration Supported
30-
ifeq ($(TCFFILE_IS_VALID),1)
43+
ifneq ($(TCFFILE_IS_VALID),1)
3144
ifeq ($(VALID_CUR_CORE),)
3245
$(info BOARD $(BOARD)-$(BD_VER) Core Configurations - $(SUPPORTED_CORES) are supported)
3346
$(error $(CUR_CORE) is not supported in $(BOARD)-$(BD_VER), please check it!)

board/emsdp/rev2/configs/core_configs.mk

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Current Supported Core Configurations
2-
CORE_DIRS = $(sort $(dir $(wildcard $(BOARD_EMSDP_DIR)/$(VALID_BD_VER)/configs/*/*.h)))
2+
CORE_DIRS = $(sort $(dir $(wildcard $(BOARD_EMSDP_DIR)/$(VALID_BD_VER)/configs/*/core_hardware.h)))
33
SUPPORTED_CORES := $(patsubst $(BOARD_EMSDP_DIR)/$(VALID_BD_VER)/configs/%/, %,$(CORE_DIRS))
44

55
CUR_CORE ?= $(firstword $(SUPPORTED_CORES))
@@ -11,7 +11,20 @@ VALID_CUR_CORE = $(call check_item_exist, $(CUR_CORE), $(SUPPORTED_CORES))
1111

1212
BOARD_CORE_DIR = $(BOARD_EMSDP_DIR)/$(VALID_BD_VER)/configs/$(VALID_CUR_CORE)
1313

14-
ONCHIP_IP_LIST ?= . designware/spi designware/uart designware/gpio designware/sdio designware/trng designware/pwm_timer subsystem/spi subsystem/gpio subsystem/uart subsystem/iic subsystem/i2s
14+
CORE_CONFIG_MK = $(BOARD_CORE_DIR)/core_config.mk
15+
16+
##
17+
# load core specific makefie if exist
18+
##
19+
ifneq ($(wildcard $(CORE_CONFIG_MK)),)
20+
COMMON_COMPILE_PREREQUISITES += $(CORE_CONFIG_MK)
21+
include $(CORE_CONFIG_MK)
22+
endif
23+
24+
ONCHIP_IP_LIST ?= . designware/spi designware/uart designware/gpio \
25+
designware/sdio designware/trng designware/pwm_timer \
26+
subsystem/spi subsystem/gpio subsystem/uart subsystem/iic \
27+
subsystem/i2s
1528

1629
## Check TCF file existence
1730
ifneq ($(TCFFILE_IS_VALID),1)
@@ -27,7 +40,7 @@ endif
2740
endif
2841

2942
## Check Core Configuration Supported
30-
ifeq ($(TCFFILE_IS_VALID),1)
43+
ifneq ($(TCFFILE_IS_VALID),1)
3144
ifeq ($(VALID_CUR_CORE),)
3245
$(info BOARD $(BOARD)-$(BD_VER) Core Configurations - $(SUPPORTED_CORES) are supported)
3346
$(error $(CUR_CORE) is not supported in $(BOARD)-$(BD_VER), please check it!)

0 commit comments

Comments
 (0)