amlogic: Introduce directory parameters in the makefiles
authorCarlo Caione <ccaione@baylibre.com>
Fri, 23 Aug 2019 18:34:44 +0000 (19:34 +0100)
committerCarlo Caione <ccaione@baylibre.com>
Thu, 5 Sep 2019 09:39:30 +0000 (10:39 +0100)
Make the platform name a parameter for the source directories. Besides a
cosmetic fix, this is going to be helpful when reusing the same Makefile
for different SoCs.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Change-Id: I307897a21800cca8ad68a5ab8972d27e9356ff2a

plat/amlogic/gxbb/platform.mk
plat/amlogic/gxl/platform.mk

index 06aaaba3fbec58113f316d110509ded3bece4296..5ab4d52794fb72463d5f1becbfce879b804acb72 100644 (file)
@@ -6,29 +6,32 @@
 
 include lib/xlat_tables_v2/xlat_tables.mk
 
-PLAT_INCLUDES          :=      -Iplat/amlogic/gxbb/include
+AML_PLAT               :=      plat/amlogic
+AML_PLAT_SOC           :=      ${AML_PLAT}/${PLAT}
 
-GXBB_GIC_SOURCES       :=      drivers/arm/gic/common/gic_common.c     \
+PLAT_INCLUDES          :=      -I${AML_PLAT_SOC}/include
+
+GIC_SOURCES            :=      drivers/arm/gic/common/gic_common.c     \
                                drivers/arm/gic/v2/gicv2_main.c         \
                                drivers/arm/gic/v2/gicv2_helpers.c      \
                                plat/common/plat_gicv2.c
 
 PLAT_BL_COMMON_SOURCES :=      drivers/amlogic/console/aarch64/meson_console.S \
-                               plat/amlogic/gxbb/gxbb_common.c         \
-                               plat/amlogic/gxbb/gxbb_topology.c               \
+                               ${AML_PLAT_SOC}/gxbb_common.c           \
+                               ${AML_PLAT_SOC}/gxbb_topology.c         \
                                ${XLAT_TABLES_LIB_SRCS}
 
 BL31_SOURCES           +=      lib/cpus/aarch64/cortex_a53.S           \
                                plat/common/plat_psci_common.c          \
-                               plat/amlogic/gxbb/aarch64/gxbb_helpers.S        \
-                               plat/amlogic/gxbb/gxbb_bl31_setup.c     \
-                               plat/amlogic/gxbb/gxbb_efuse.c          \
-                               plat/amlogic/gxbb/gxbb_mhu.c            \
-                               plat/amlogic/gxbb/gxbb_pm.c             \
-                               plat/amlogic/gxbb/gxbb_scpi.c           \
-                               plat/amlogic/gxbb/gxbb_sip_svc.c                \
-                               plat/amlogic/gxbb/gxbb_thermal.c                \
-                               ${GXBB_GIC_SOURCES}
+                               ${AML_PLAT_SOC}/aarch64/gxbb_helpers.S  \
+                               ${AML_PLAT_SOC}/gxbb_bl31_setup.c       \
+                               ${AML_PLAT_SOC}/gxbb_efuse.c            \
+                               ${AML_PLAT_SOC}/gxbb_mhu.c              \
+                               ${AML_PLAT_SOC}/gxbb_pm.c               \
+                               ${AML_PLAT_SOC}/gxbb_scpi.c             \
+                               ${AML_PLAT_SOC}/gxbb_sip_svc.c          \
+                               ${AML_PLAT_SOC}/gxbb_thermal.c          \
+                               ${GIC_SOURCES}
 
 # Tune compiler for Cortex-A53
 ifeq ($(notdir $(CC)),armclang)
@@ -61,9 +64,9 @@ USE_COHERENT_MEM              := 1
 # -------------------
 
 ifneq (${RESET_TO_BL31}, 0)
-  $(error Error: gxbb needs RESET_TO_BL31=0)
+  $(error Error: ${PLAT} needs RESET_TO_BL31=0)
 endif
 
 ifeq (${ARCH},aarch32)
-  $(error Error: AArch32 not supported on gxbb)
+  $(error Error: AArch32 not supported on ${PLAT})
 endif
index 9cdf37ac9b0c79fd9d9d1d158482bfc0b63b95c2..41a62618baf64c267b96fbb6e0489cf7c6190d4b 100644 (file)
@@ -6,35 +6,38 @@
 
 include lib/xlat_tables_v2/xlat_tables.mk
 
+AML_PLAT               :=      plat/amlogic
+AML_PLAT_SOC           :=      ${AML_PLAT}/${PLAT}
+
 DOIMAGEPATH            ?=      tools/amlogic
 DOIMAGETOOL            ?=      ${DOIMAGEPATH}/doimage
 
 PLAT_INCLUDES          :=      -Iinclude/drivers/amlogic/              \
-                               -Iinclude/drivers/amlogic/gxl           \
-                               -Iplat/amlogic/gxl/include
+                               -Iinclude/drivers/amlogic/${PLAT}       \
+                               -I${AML_PLAT_SOC}/include
 
-GXBB_GIC_SOURCES       :=      drivers/arm/gic/common/gic_common.c     \
+GIC_SOURCES            :=      drivers/arm/gic/common/gic_common.c     \
                                drivers/arm/gic/v2/gicv2_main.c         \
                                drivers/arm/gic/v2/gicv2_helpers.c      \
                                plat/common/plat_gicv2.c
 
-PLAT_BL_COMMON_SOURCES :=      drivers/amlogic/console/aarch64/meson_console.S \
-                               plat/amlogic/gxl/gxl_common.c           \
-                               plat/amlogic/gxl/gxl_topology.c         \
+PLAT_BL_COMMON_SOURCES :=      drivers/amlogic/console/aarch64/meson_console.S \
+                               ${AML_PLAT_SOC}/gxl_common.c            \
+                               ${AML_PLAT_SOC}/gxl_topology.c          \
                                ${XLAT_TABLES_LIB_SRCS}
 
 BL31_SOURCES           +=      lib/cpus/aarch64/cortex_a53.S           \
                                plat/common/plat_psci_common.c          \
-                               plat/amlogic/gxl/aarch64/gxl_helpers.S  \
-                               plat/amlogic/gxl/gxl_bl31_setup.c               \
-                               plat/amlogic/gxl/gxl_efuse.c            \
-                               plat/amlogic/gxl/gxl_mhu.c              \
-                               plat/amlogic/gxl/gxl_pm.c                       \
-                               plat/amlogic/gxl/gxl_scpi.c             \
-                               plat/amlogic/gxl/gxl_sip_svc.c          \
-                               plat/amlogic/gxl/gxl_thermal.c          \
-                               drivers/amlogic/gxl/crypto/sha_dma.c    \
-                               ${GXBB_GIC_SOURCES}
+                               ${AML_PLAT_SOC}/aarch64/gxl_helpers.S   \
+                               ${AML_PLAT_SOC}/gxl_bl31_setup.c        \
+                               ${AML_PLAT_SOC}/gxl_efuse.c             \
+                               ${AML_PLAT_SOC}/gxl_mhu.c               \
+                               ${AML_PLAT_SOC}/gxl_pm.c                \
+                               ${AML_PLAT_SOC}/gxl_scpi.c              \
+                               ${AML_PLAT_SOC}/gxl_sip_svc.c           \
+                               ${AML_PLAT_SOC}/gxl_thermal.c           \
+                               drivers/amlogic/${PLAT}/crypto/sha_dma.c        \
+                               ${GIC_SOURCES}
 
 # Tune compiler for Cortex-A53
 ifeq ($(notdir $(CC)),armclang)
@@ -66,11 +69,11 @@ USE_COHERENT_MEM            := 1
 # -------------------
 
 ifneq (${RESET_TO_BL31}, 0)
-  $(error Error: gxl needs RESET_TO_BL31=0)
+  $(error Error: ${PLAT} needs RESET_TO_BL31=0)
 endif
 
 ifeq (${ARCH},aarch32)
-  $(error Error: AArch32 not supported on gxl)
+  $(error Error: AArch32 not supported on ${PLAT})
 endif
 
 all: ${BUILD_PLAT}/bl31.img