Skip to content

Commit 59c2b33

Browse files
tw4452852wenlingz
authored andcommitted
Makefile: separate PLATFORM into BOARD+FIRMWARE
Combination of BOARD and FIRMWARE is a more precious definition. And we decide PLATFORM_XXX based on FIRMWARE, remove relative one in board config. We reserve PLATFORM for backward compatibility. Tracked-On: #1995 Signed-off-by: Tw <wei.tan@intel.com> Reviewed-by: Yin Fengwei < fengwei.yin@intel.com> Reviewed-by: Binbin Wu <binbin.wu@intel.com>
1 parent 064a310 commit 59c2b33

File tree

4 files changed

+40
-20
lines changed

4 files changed

+40
-20
lines changed

Makefile

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
11

22
# global helper variables
33
T := $(CURDIR)
4+
5+
# PLATFORM is now deprecated, just reserve for compatability
6+
ifdef PLATFORM
7+
$(warning PLATFORM is deprecated, pls use BOARD instead)
8+
endif
49
PLATFORM ?= uefi
10+
11+
# Backward-compatibility for PLATFORM=(sbl|uefi)
12+
# * PLATFORM=sbl is equivalent to BOARD=apl-mrb
13+
# * PLATFORM=uefi is equivalent to BOARD=apl-nuc (i.e. NUC6CAYH)
14+
ifeq ($(PLATFORM),sbl)
15+
BOARD ?= apl-mrb
16+
else ifeq ($(PLATFORM),uefi)
17+
BOARD ?= apl-nuc
18+
endif
19+
20+
ifndef BOARD
21+
$(error BOARD must be set (apl-mrb, apl-nuc, cb2_dnv, nuc6cayh)
22+
endif
23+
24+
ifeq ($(BOARD),apl-nuc)
25+
FIRMWARE ?= uefi
26+
else ifeq ($(BOARD),nuc6cayh)
27+
FIRMWARE ?= uefi
28+
endif
29+
FIRMWARE ?= sbl
30+
531
RELEASE ?= 0
632

733
O ?= build
@@ -18,13 +44,13 @@ export TOOLS_OUT
1844
all: hypervisor devicemodel tools
1945

2046
hypervisor:
21-
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) PLATFORM=$(PLATFORM) RELEASE=$(RELEASE) clean
22-
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) PLATFORM=$(PLATFORM) RELEASE=$(RELEASE)
47+
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) clean
48+
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE)
2349

2450
sbl-hypervisor:
2551
@mkdir -p $(HV_OUT)-sbl
26-
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl PLATFORM=sbl RELEASE=$(RELEASE) clean
27-
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl PLATFORM=sbl RELEASE=$(RELEASE)
52+
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl BOARD=apl-mrb FIRMWARE=sbl RELEASE=$(RELEASE) clean
53+
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl BOARD=apl-mrb FIRMWARE=sbl RELEASE=$(RELEASE)
2854

2955
devicemodel: tools
3056
make -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) clean
@@ -47,10 +73,10 @@ clean:
4773
install: hypervisor-install devicemodel-install tools-install
4874

4975
hypervisor-install:
50-
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) PLATFORM=$(PLATFORM) RELEASE=$(RELEASE) install
76+
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) install
5177

5278
sbl-hypervisor-install:
53-
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl PLATFORM=sbl RELEASE=$(RELEASE) install
79+
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) install
5480

5581
devicemodel-install:
5682
make -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) install
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
2-
CONFIG_PLATFORM_UEFI=y
32
CONFIG_BOARD="NUC6CAYH"
43
CONFIG_SERIAL_LEGACY=y
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
2-
CONFIG_PLATFORM_UEFI=y
32
CONFIG_BOARD="UP2"
43
CONFIG_SERIAL_PCI=y
54
CONFIG_SERIAL_PCI_BDF=0x00C1

hypervisor/scripts/kconfig/kconfig.mk

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ override RELEASE := n
2929
endif
3030
endif
3131

32+
OVERWRITTEN := ""
33+
ifeq ($(FIRMWARE),sbl)
34+
OVERWRITTEN += "PLATFORM_SBL=y"
35+
else ifeq ($(FIRMWARE),uefi)
36+
OVERWRITTEN += "PLATFORM_UEFI=y"
37+
endif
38+
3239
-include $(HV_OBJDIR)/$(HV_CONFIG_MK)
3340
ifeq ($(shell [ $(HV_OBJDIR)/$(HV_CONFIG) -nt $(HV_OBJDIR)/$(HV_CONFIG_MK) ] && echo 1),1)
3441
# config.mk may be outdated if .config has been overwritten. To update config.mk
@@ -37,17 +44,6 @@ ifeq ($(shell [ $(HV_OBJDIR)/$(HV_CONFIG) -nt $(HV_OBJDIR)/$(HV_CONFIG_MK) ] &&
3744
-include $(HV_OBJDIR)/$(HV_CONFIG)
3845
endif
3946

40-
# Backward-compatibility for PLATFORM=(sbl|uefi)
41-
# * PLATFORM=sbl is equivalent to BOARD=apl-mrb
42-
# * PLATFORM=uefi is equivalent to BOARD=apl-nuc (i.e. NUC6CAYH)
43-
ifndef BOARD
44-
ifeq ($(PLATFORM),sbl)
45-
BOARD=apl-mrb
46-
else ifeq ($(PLATFORM),uefi)
47-
BOARD=apl-nuc
48-
endif
49-
endif
50-
5147
$(eval $(call override_config,BOARD,apl-mrb))
5248
$(eval $(call override_config,RELEASE,n))
5349

@@ -97,7 +93,7 @@ oldconfig: $(KCONFIG_DEPS)
9793
@BOARD=$(TARGET_BOARD) \
9894
python3 $(KCONFIG_DIR)/silentoldconfig.py Kconfig \
9995
$(HV_OBJDIR)/$(HV_CONFIG) \
100-
RELEASE=$(RELEASE)
96+
RELEASE=$(RELEASE) $(OVERWRITTEN)
10197

10298
# Minimize the current .config. This target can be used to generate a defconfig
10399
# for future use.

0 commit comments

Comments
 (0)