allwinner: Unify platform.mk files
authorAndre Przywara <andre.przywara@arm.com>
Thu, 27 Sep 2018 23:37:19 +0000 (00:37 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Sat, 20 Oct 2018 15:23:59 +0000 (16:23 +0100)
For the two different platforms we support in the Allwinner port we
mostly rely on header files covering the differences. This leads to the
platform.mk files in the respective directories to be almost identical.

To avoid further divergence and make sure that one platform doesn't
break accidentally, let's create a shared allwinner-common.mk file and
include that from the platform directory.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
plat/allwinner/common/allwinner-common.mk [new file with mode: 0644]
plat/allwinner/sun50i_a64/platform.mk
plat/allwinner/sun50i_h6/platform.mk

diff --git a/plat/allwinner/common/allwinner-common.mk b/plat/allwinner/common/allwinner-common.mk
new file mode 100644 (file)
index 0000000..15888a8
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+include lib/xlat_tables_v2/xlat_tables.mk
+
+AW_PLAT                        :=      plat/allwinner
+
+PLAT_INCLUDES          :=      -Iinclude/plat/arm/common               \
+                               -Iinclude/plat/arm/common/aarch64       \
+                               -I${AW_PLAT}/common/include             \
+                               -I${AW_PLAT}/${PLAT}/include
+
+PLAT_BL_COMMON_SOURCES :=      drivers/console/${ARCH}/console.S       \
+                               drivers/ti/uart/${ARCH}/16550_console.S \
+                               ${XLAT_TABLES_LIB_SRCS}                 \
+                               ${AW_PLAT}/common/plat_helpers.S        \
+                               ${AW_PLAT}/common/sunxi_common.c
+
+BL31_SOURCES           +=      drivers/arm/gic/common/gic_common.c     \
+                               drivers/arm/gic/v2/gicv2_helpers.c      \
+                               drivers/arm/gic/v2/gicv2_main.c         \
+                               drivers/delay_timer/delay_timer.c       \
+                               drivers/delay_timer/generic_delay_timer.c \
+                               lib/cpus/${ARCH}/cortex_a53.S           \
+                               plat/common/plat_gicv2.c                \
+                               plat/common/plat_psci_common.c          \
+                               ${AW_PLAT}/common/sunxi_bl31_setup.c    \
+                               ${AW_PLAT}/common/sunxi_cpu_ops.c       \
+                               ${AW_PLAT}/common/sunxi_pm.c            \
+                               ${AW_PLAT}/${PLAT}/sunxi_power.c        \
+                               ${AW_PLAT}/common/sunxi_security.c      \
+                               ${AW_PLAT}/common/sunxi_topology.c
+
+# The bootloader is guaranteed to only run on CPU 0 by the boot ROM.
+COLD_BOOT_SINGLE_CPU           :=      1
+
+# Enable workarounds for Cortex-A53 errata. Allwinner uses at least r0p4.
+ERRATA_A53_835769              :=      1
+ERRATA_A53_843419              :=      1
+ERRATA_A53_855873              :=      1
+
+MULTI_CONSOLE_API              :=      1
+
+# The reset vector can be changed for each CPU.
+PROGRAMMABLE_RESET_ADDRESS     :=      1
+
+# Allow mapping read-only data as execute-never.
+SEPARATE_CODE_AND_RODATA       :=      1
+
+# BL31 gets loaded alongside BL33 (U-Boot) by U-Boot's SPL
+RESET_TO_BL31                  :=      1
index 221665471ebc9fcdcb1324b7e850c69a4fa5db43..b032499325b2e4447357d26f70182685b7182971 100644 (file)
@@ -4,51 +4,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 #
 
-include lib/xlat_tables_v2/xlat_tables.mk
-
-AW_PLAT                        :=      plat/allwinner
-
-PLAT_INCLUDES          :=      -Iinclude/plat/arm/common/              \
-                               -Iinclude/plat/arm/common/aarch64       \
-                               -I${AW_PLAT}/common/include             \
-                               -I${AW_PLAT}/${PLAT}/include
-
-PLAT_BL_COMMON_SOURCES :=      drivers/console/${ARCH}/console.S       \
-                               drivers/ti/uart/${ARCH}/16550_console.S \
-                               ${XLAT_TABLES_LIB_SRCS}                 \
-                               ${AW_PLAT}/common/plat_helpers.S        \
-                               ${AW_PLAT}/common/sunxi_common.c
-
-BL31_SOURCES           +=      drivers/arm/gic/common/gic_common.c     \
-                               drivers/arm/gic/v2/gicv2_helpers.c      \
-                               drivers/arm/gic/v2/gicv2_main.c         \
-                               drivers/delay_timer/delay_timer.c       \
-                               drivers/delay_timer/generic_delay_timer.c \
-                               lib/cpus/${ARCH}/cortex_a53.S           \
-                               plat/common/plat_gicv2.c                \
-                               plat/common/plat_psci_common.c          \
-                               ${AW_PLAT}/common/sunxi_bl31_setup.c    \
-                               ${AW_PLAT}/common/sunxi_cpu_ops.c       \
-                               ${AW_PLAT}/common/sunxi_pm.c            \
-                               ${AW_PLAT}/sun50i_a64/sunxi_power.c     \
-                               ${AW_PLAT}/common/sunxi_security.c      \
-                               ${AW_PLAT}/common/sunxi_topology.c
-
-# The bootloader is guaranteed to only run on CPU 0 by the boot ROM.
-COLD_BOOT_SINGLE_CPU           :=      1
-
-# Enable workarounds for Cortex-A53 errata. Allwinner uses at least r0p4.
-ERRATA_A53_835769              :=      1
-ERRATA_A53_843419              :=      1
-ERRATA_A53_855873              :=      1
-
-MULTI_CONSOLE_API              :=      1
-
-# The reset vector can be changed for each CPU.
-PROGRAMMABLE_RESET_ADDRESS     :=      1
-
-# Allow mapping read-only data as execute-never.
-SEPARATE_CODE_AND_RODATA       :=      1
-
-# BL31 gets loaded alongside BL33 (U-Boot) by U-Boot's SPL
-RESET_TO_BL31                  :=      1
+# The differences between the platform are covered by the include files.
+include plat/allwinner/common/allwinner-common.mk
index 4fb8986d6776195deee89e89662be42a686bc378..5c21eadb2f898f864f90477706351c3762573478 100644 (file)
@@ -4,53 +4,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 #
 
-include lib/xlat_tables_v2/xlat_tables.mk
+# The differences between the platform are covered by the include files.
+include plat/allwinner/common/allwinner-common.mk
 
-AW_PLAT                        :=      plat/allwinner
-AW_DRIVERS             :=      drivers/allwinner
-
-PLAT_INCLUDES          :=      -Iinclude/plat/arm/common               \
-                               -Iinclude/plat/arm/common/aarch64       \
-                               -I${AW_PLAT}/common/include             \
-                               -I${AW_PLAT}/${PLAT}/include
-
-PLAT_BL_COMMON_SOURCES :=      drivers/console/${ARCH}/console.S       \
-                               drivers/mentor/i2c/mi2cv.c              \
-                               drivers/ti/uart/${ARCH}/16550_console.S \
-                               ${XLAT_TABLES_LIB_SRCS}                 \
-                               ${AW_PLAT}/common/plat_helpers.S        \
-                               ${AW_PLAT}/common/sunxi_common.c
-
-BL31_SOURCES           +=      drivers/arm/gic/common/gic_common.c     \
-                               drivers/arm/gic/v2/gicv2_helpers.c      \
-                               drivers/arm/gic/v2/gicv2_main.c         \
-                               drivers/delay_timer/delay_timer.c       \
-                               drivers/delay_timer/generic_delay_timer.c \
-                               lib/cpus/${ARCH}/cortex_a53.S           \
-                               plat/common/plat_gicv2.c                \
-                               plat/common/plat_psci_common.c          \
-                               ${AW_PLAT}/common/sunxi_bl31_setup.c    \
-                               ${AW_PLAT}/common/sunxi_cpu_ops.c       \
-                               ${AW_PLAT}/common/sunxi_pm.c            \
-                               ${AW_PLAT}/sun50i_h6/sunxi_power.c      \
-                               ${AW_PLAT}/common/sunxi_security.c      \
-                               ${AW_PLAT}/common/sunxi_topology.c
-
-# The bootloader is guaranteed to only run on CPU 0 by the boot ROM.
-COLD_BOOT_SINGLE_CPU           :=      1
-
-# Enable workarounds for Cortex-A53 errata. Allwinner uses at least r0p4.
-ERRATA_A53_835769              :=      1
-ERRATA_A53_843419              :=      1
-ERRATA_A53_855873              :=      1
-
-MULTI_CONSOLE_API              :=      1
-
-# The reset vector can be changed for each CPU.
-PROGRAMMABLE_RESET_ADDRESS     :=      1
-
-# Allow mapping read-only data as execute-never.
-SEPARATE_CODE_AND_RODATA       :=      1
-
-# BL31 gets loaded alongside BL33 (U-Boot) by U-Boot's SPL
-RESET_TO_BL31                  :=      1
+PLAT_BL_COMMON_SOURCES +=      drivers/mentor/i2c/mi2cv.c