amlogic: Introduce directory parameters in the makefiles

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
diff --git a/plat/amlogic/gxbb/platform.mk b/plat/amlogic/gxbb/platform.mk
index 06aaaba..5ab4d52 100644
--- a/plat/amlogic/gxbb/platform.mk
+++ b/plat/amlogic/gxbb/platform.mk
@@ -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 @@
 # -------------------
 
 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