Hi Marek,
On 1/18/25 12:15 PM, Marek Vasut wrote:
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+rene...@mailbox.org>
---
Cc: Adam Ford <aford...@gmail.com>
Cc: Biju Das <biju.das...@bp.renesas.com>
Cc: Lad Prabhakar <prabhakar.mahadev-lad...@bp.renesas.com>
Cc: Nobuhiro Iwamatsu <iwama...@nigauri.org>
Cc: Paul Barker <paul.barker...@bp.renesas.com>
Cc: Simon Glass <s...@chromium.org>
Cc: Tom Rini <tr...@konsulko.com>
Cc: u-boot@lists.denx.de
---
NOTE: Depends on
https://patchwork.ozlabs.org/project/uboot/patch/20250112223252.179123-1-marek.vasut+rene...@mailbox.org/
---
V2: - Add paragraph about RZG2L/R-Car Gen2 at the end of commit message
- Add ifdef RCAR_32 around ifdef RCAR_GEN2
- Drop paragraph about non-empty Makefiles which was bogus
- Drop the ifdeferry from board files again
---
board/renesas/common/Makefile | 47 ++++++++++++++++++++++++++++++
board/renesas/common/gen3-common.c | 3 --
board/renesas/condor/Makefile | 13 ---------
board/renesas/draak/Makefile | 6 ++--
board/renesas/eagle/Makefile | 13 ---------
board/renesas/ebisu/Makefile | 13 ---------
board/renesas/falcon/Makefile | 13 ---------
board/renesas/grayhawk/Makefile | 9 ------
board/renesas/salvator-x/Makefile | 6 ++--
board/renesas/spider/Makefile | 9 ------
board/renesas/ulcb/Makefile | 6 ++--
board/renesas/v3hsk/Makefile | 5 +---
board/renesas/v3msk/Makefile | 5 +---
board/renesas/whitehawk/Makefile | 13 ---------
14 files changed, 55 insertions(+), 106 deletions(-)
delete mode 100644 board/renesas/condor/Makefile
delete mode 100644 board/renesas/eagle/Makefile
delete mode 100644 board/renesas/ebisu/Makefile
delete mode 100644 board/renesas/falcon/Makefile
delete mode 100644 board/renesas/grayhawk/Makefile
delete mode 100644 board/renesas/spider/Makefile
delete mode 100644 board/renesas/whitehawk/Makefile
diff --git a/board/renesas/common/Makefile b/board/renesas/common/Makefile
index e69de29bb2d..c531738b22e 100644
--- a/board/renesas/common/Makefile
+++ b/board/renesas/common/Makefile
@@ -0,0 +1,47 @@
+#
+# board/renesas/whitehawk/Makefile
+#
+# Copyright (C) 2024 Marek Vasut <marek.vasut+rene...@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
diff --git a/board/renesas/common/gen3-common.c
b/board/renesas/common/gen3-common.c
index 05b01c846c6..94da00985d3 100644
--- a/board/renesas/common/gen3-common.c
+++ b/board/renesas/common/gen3-common.c
@@ -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
index 3b1756b44cd..00000000000
--- a/board/renesas/condor/Makefile
+++ /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
diff --git a/board/renesas/draak/Makefile b/board/renesas/draak/Makefile
index 6ce05bcd649..0a6a325d761 100644
--- a/board/renesas/draak/Makefile
+++ b/board/renesas/draak/Makefile
@@ -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
index a5c18d81eef..00000000000
--- a/board/renesas/eagle/Makefile
+++ /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
index 72130b76234..00000000000
--- a/board/renesas/ebisu/Makefile
+++ /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
index 949953f6981..00000000000
--- a/board/renesas/falcon/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# board/renesas/falcon/Makefile
-#
-# Copyright (C) 2020 Renesas Electronics Corp.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-ifdef CONFIG_XPL_BUILD
-obj-y := ../common/gen3-spl.o
-else
-obj-y := ../common/gen4-common.o ../common/common.o
-endif
Was this a mistake on Falcon? It used to use the gen3-spl while being a
gen4? If that's the case, please have a separate commit to switch to
gen4-spl before this one. Otherwise, I believe this introduces a change
since Falcon is a gen4 and will thus compile the gen4-spl and not the
gen3-spl like before this commit, so if that's wanted, we need special
handling in the common makefile now.
The rest is fine.
Cheers,
Quentin