]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
ARM: renesas: Simplify board Makefiles
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Wed, 29 Jan 2025 17:04:28 +0000 (18:04 +0100)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Wed, 29 Jan 2025 21:52:35 +0000 (22:52 +0100)
Introduce board/renesas/common/Makefile and remove the multiple
duplicate copies of obj := ../common/*.o from board Makefiles.
Let the build system include the common Makefile using the
HAVE_VENDOR_COMMON_LIB and build the common objects that are
shared by all the boards that way. No functional change intended.

Some of the remaining board files which include board specific
settings have been updated to use obj-y += to avoid rewriting
the board obj-y target and avoid dropping object files from the
build.

The board/renesas/common/Makefile is now also used when building
RZG2L targets which also set CONFIG_RCAR_64 symbol and 32bit R-Car
Gen2 targets, however, this common code is specific to 64bit R-Car
only. Inhibit the build of this common code for RZG2L using extra
ifndef CONFIG_RZG2L and do not include any code for R-Car Gen2 so
far.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
15 files changed:
board/renesas/common/Makefile
board/renesas/common/common.c
board/renesas/common/gen3-common.c
board/renesas/condor/Makefile [deleted file]
board/renesas/draak/Makefile
board/renesas/eagle/Makefile [deleted file]
board/renesas/ebisu/Makefile [deleted file]
board/renesas/falcon/Makefile [deleted file]
board/renesas/grayhawk/Makefile [deleted file]
board/renesas/salvator-x/Makefile
board/renesas/spider/Makefile [deleted file]
board/renesas/ulcb/Makefile
board/renesas/v3hsk/Makefile
board/renesas/v3msk/Makefile
board/renesas/whitehawk/Makefile [deleted file]

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c531738b22e481f486cef13b425326eea29e3b9a 100644 (file)
@@ -0,0 +1,47 @@
+#
+# board/renesas/whitehawk/Makefile
+#
+# Copyright (C) 2024 Marek Vasut <marek.vasut+renesas@mailbox.org>
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+# R-Car SoCs
+ifndef CONFIG_RZG2L
+
+# 32 bit SoCs
+ifdef CONFIG_RCAR_32
+ifdef CONFIG_RCAR_GEN2
+endif
+endif
+
+# 64 bit SoCs
+ifdef CONFIG_RCAR_64
+ifndef CONFIG_XPL_BUILD
+obj-y  += common.o
+endif
+
+ifdef CONFIG_RCAR_GEN3
+ifdef CONFIG_XPL_BUILD
+obj-y  += gen3-spl.o
+else
+obj-y  += gen3-common.o
+ifdef CONFIG_R8A77970
+obj-y  += v3-common.o
+endif
+ifdef CONFIG_R8A77980
+obj-y  += v3-common.o
+endif
+endif
+endif
+
+ifdef CONFIG_RCAR_GEN4
+ifdef CONFIG_XPL_BUILD
+obj-y  += gen4-spl.o
+else
+obj-y  += gen4-common.o
+endif
+endif
+endif
+
+endif
index 7fba8d10ff59d224edd1ebbd57f10ce63e4d490f..74ec0a46e6f793ef98c9ad68d5136c3d73329e21 100644 (file)
@@ -18,8 +18,6 @@
 #include <asm/system.h>
 #include <linux/libfdt.h>
 
-#ifdef CONFIG_RCAR_64
-
 DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
@@ -67,5 +65,3 @@ int __weak board_init(void)
 {
        return 0;
 }
-
-#endif
index 05b01c846c613b51a89ac3bcf0ec16fbf3f2b64a..94da00985d34049222a2c5aaec650d03dc2aec85 100644 (file)
@@ -18,8 +18,6 @@
 #include <asm/arch/renesas.h>
 #include <linux/libfdt.h>
 
-#ifdef CONFIG_RCAR_64
-
 DECLARE_GLOBAL_DATA_PTR;
 
 /* If the firmware passed a device tree use it for e.g. U-Boot DRAM setup. */
@@ -178,4 +176,3 @@ int ft_board_setup(void *blob, struct bd_info *bd)
        return 0;
 }
 #endif
-#endif
diff --git a/board/renesas/condor/Makefile b/board/renesas/condor/Makefile
deleted file mode 100644 (file)
index 3b1756b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# board/renesas/condor/Makefile
-#
-# Copyright (C) 2019 Renesas Electronics Corporation
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-ifdef CONFIG_XPL_BUILD
-obj-y  := ../common/gen3-spl.o
-else
-obj-y  := ../common/gen3-common.o ../common/common.o
-endif
index 6ce05bcd6494ec633e3d01de209baa6e796b2051..0a6a325d761da0b287a956083c3cd72e76bcb90b 100644 (file)
@@ -6,8 +6,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef CONFIG_XPL_BUILD
-obj-y  := ../common/gen3-spl.o
-else
-obj-y  := draak.o ../common/gen3-common.o ../common/common.o
+ifndef CONFIG_XPL_BUILD
+obj-y  += draak.o
 endif
diff --git a/board/renesas/eagle/Makefile b/board/renesas/eagle/Makefile
deleted file mode 100644 (file)
index a5c18d8..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# board/renesas/eagle/Makefile
-#
-# Copyright (C) 2015 Renesas Electronics Corporation
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-ifdef CONFIG_XPL_BUILD
-obj-y  := ../common/gen3-spl.o
-else
-obj-y  := ../common/v3-common.o ../common/gen3-common.o ../common/common.o
-endif
diff --git a/board/renesas/ebisu/Makefile b/board/renesas/ebisu/Makefile
deleted file mode 100644 (file)
index 72130b7..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# board/renesas/ebisu/Makefile
-#
-# Copyright (C) 2018 Renesas Electronics Corporation
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-ifdef CONFIG_XPL_BUILD
-obj-y  := ../common/gen3-spl.o
-else
-obj-y  := ../common/gen3-common.o ../common/common.o
-endif
diff --git a/board/renesas/falcon/Makefile b/board/renesas/falcon/Makefile
deleted file mode 100644 (file)
index 430a842..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# board/renesas/falcon/Makefile
-#
-# Copyright (C) 2020 Renesas Electronics Corp.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-ifndef CONFIG_XPL_BUILD
-obj-y  := ../common/gen4-common.o ../common/common.o
-endif
diff --git a/board/renesas/grayhawk/Makefile b/board/renesas/grayhawk/Makefile
deleted file mode 100644 (file)
index a70bd37..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# board/renesas/grayhawk/Makefile
-#
-# Copyright (C) 2023 Renesas Electronics Corp.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-obj-y  := ../common/gen4-common.o ../common/common.o
index fe53366829cdade10f6f7add94afdeb74730eebf..538bbdddf767592a2429fa8e6f326db0e94987c4 100644 (file)
@@ -6,8 +6,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef CONFIG_XPL_BUILD
-obj-y  := ../common/gen3-spl.o
-else
-obj-y  := salvator-x.o ../common/gen3-common.o ../common/common.o
+ifndef CONFIG_XPL_BUILD
+obj-y  += salvator-x.o
 endif
diff --git a/board/renesas/spider/Makefile b/board/renesas/spider/Makefile
deleted file mode 100644 (file)
index e0f403d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# board/renesas/spider/Makefile
-#
-# Copyright (C) 2020 Renesas Electronics Corp.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-obj-y  := ../common/gen4-common.o ../common/common.o
index 6b2aa8c29f63649e25da2ae815bb5446291da2e1..4f2dd1ca2117453affd74d2ef0527c0111293ae7 100644 (file)
@@ -6,8 +6,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef CONFIG_XPL_BUILD
-obj-y  := ../common/gen3-spl.o
-else
-obj-y  := ulcb.o cpld.o ../common/gen3-common.o ../common/common.o
+ifndef CONFIG_XPL_BUILD
+obj-y  += ulcb.o cpld.o
 endif
index 936047cb3d56beb5c0acd30f47abdbce87d9daf9..e6db77468e6cf44b46fcfa11d5d13505872945e0 100644 (file)
@@ -7,9 +7,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef CONFIG_XPL_BUILD
-obj-y  := ../common/gen3-spl.o
-else
-obj-y  := ../common/v3-common.o ../common/gen3-common.o ../common/common.o
+ifndef CONFIG_XPL_BUILD
 obj-$(CONFIG_SYSRESET) += cpld.o
 endif
index 21eaddb6c287c3f836945744d816b9559f4c96b2..211b8a32489bab9a32100bb93fd83a23bb583dc6 100644 (file)
@@ -7,9 +7,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef CONFIG_XPL_BUILD
-obj-y  := ../common/gen3-spl.o
-else
-obj-y  := ../common/v3-common.o ../common/gen3-common.o ../common/common.o
+ifndef CONFIG_XPL_BUILD
 obj-$(CONFIG_SYSRESET) += cpld.o
 endif
diff --git a/board/renesas/whitehawk/Makefile b/board/renesas/whitehawk/Makefile
deleted file mode 100644 (file)
index f10eb82..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# board/renesas/whitehawk/Makefile
-#
-# Copyright (C) 2021 Renesas Electronics Corp.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-ifdef CONFIG_SPL_BUILD
-obj-y  := ../common/gen4-spl.o
-else
-obj-y  := ../common/gen4-common.o ../common/common.o
-endif