* [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism
@ 2025-11-28 10:58 Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 1/4] openrisc: drop <config.h> usage Ahmad Fatoum
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2025-11-28 10:58 UTC (permalink / raw)
To: barebox
Generation per-board config.h headers is a left-over from times long
past. For most boards it's no longer possible anyway due to multi-image
suppot, but for legacy boards that still use it, let's switch away
existing users from this magic and remove it.
Ahmad Fatoum (4):
openrisc: drop <config.h> usage
ARM: drop <config.h> usage
ppc: drop <config.h> usage
treewide: drop last remnants of <config.h>
.../migration-guides/migration-master.rst | 7 +++++
Makefile | 19 ++----------
.../boards/at91rm9200ek/{config.h => board.h} | 4 +--
arch/arm/boards/at91rm9200ek/lowlevel.c | 2 +-
.../boards/phytec-phycard-imx27/lowlevel.c | 1 -
arch/arm/cpu/cache-armv8.S | 1 -
arch/arm/cpu/exceptions_32.S | 1 -
arch/arm/cpu/exceptions_64.S | 1 -
arch/arm/lib32/setjmp.S | 1 -
arch/arm/lib64/setjmp.S | 1 -
arch/arm/mach-mxs/lradc-init.c | 1 -
arch/arm/mach-mxs/mem-init.c | 1 -
arch/arm/mach-mxs/power-init.c | 1 -
arch/arm/mach-omap/am33xx_mux.c | 1 -
arch/arm/mach-omap/syslib.c | 1 -
arch/openrisc/Kconfig | 2 +-
arch/openrisc/Makefile | 4 +++
arch/openrisc/boards/generic/config.h | 25 ----------------
arch/openrisc/cpu/barebox.lds.S | 2 +-
arch/openrisc/cpu/start.S | 2 +-
arch/openrisc/include/asm/config.h | 15 ++++++++++
arch/openrisc/lib/board.c | 5 ++--
arch/openrisc/lib/clock.c | 1 +
arch/openrisc/lib/cpuinfo.c | 3 +-
arch/powerpc/boards/freescale-p1010rdb/ddr.c | 1 +
arch/powerpc/boards/freescale-p1010rdb/law.c | 1 +
.../boards/freescale-p1010rdb/p1010rdb.c | 1 +
arch/powerpc/boards/freescale-p1010rdb/tlb.c | 1 +
arch/powerpc/boards/freescale-p1022ds/ddr.c | 1 +
.../boards/freescale-p1022ds/ics307_clk.c | 1 +
arch/powerpc/boards/freescale-p1022ds/law.c | 1 +
.../boards/freescale-p1022ds/p1022ds.c | 1 +
arch/powerpc/boards/freescale-p1022ds/tlb.c | 1 +
arch/powerpc/boards/freescale-p2020rdb/law.c | 1 +
.../boards/freescale-p2020rdb/p2020rdb.c | 1 +
arch/powerpc/boards/freescale-p2020rdb/tlb.c | 1 +
arch/powerpc/boards/owc-da923rc/da923rc.c | 1 +
arch/powerpc/boards/owc-da923rc/ddr.c | 1 +
arch/powerpc/boards/owc-da923rc/tlb.c | 1 +
arch/powerpc/boards/pcm030/config.h | 30 -------------------
arch/powerpc/boards/pcm030/pcm030.c | 1 +
arch/powerpc/cpu-85xx/start.S | 1 -
arch/powerpc/ddr-8xxx/ddr_setctrl.c | 2 +-
arch/powerpc/ddr-8xxx/lc_common_dimm_params.c | 2 +-
arch/powerpc/ddr-8xxx/main.c | 2 +-
.../config.h => include/asm/board-da923rc.h} | 25 +++++-----------
.../config.h => include/asm/board-p1010rdb.h} | 23 +++++---------
.../config.h => include/asm/board-p1022ds.h} | 23 +++++---------
.../config.h => include/asm/board-p2020rdb.h} | 28 +++++------------
arch/powerpc/include/asm/board-pcm030.h | 17 +++++++++++
arch/powerpc/include/asm/config.h | 12 ++++++++
arch/powerpc/include/asm/fsl_ifc.h | 2 +-
arch/powerpc/include/asm/fsl_lbc.h | 2 +-
arch/powerpc/include/asm/status_led.h | 2 ++
arch/powerpc/lib/ticks.S | 2 +-
arch/powerpc/mach-mpc5xxx/reginfo.c | 2 +-
arch/powerpc/mach-mpc5xxx/speed.c | 1 +
arch/powerpc/mach-mpc5xxx/start.S | 2 +-
arch/powerpc/mach-mpc85xx/cpu.c | 2 +-
arch/powerpc/mach-mpc85xx/cpu_init.c | 1 +
arch/powerpc/mach-mpc85xx/cpuid.c | 2 +-
arch/powerpc/mach-mpc85xx/speed.c | 1 +
common/console.c | 1 -
common/console_simple.c | 1 -
common/memsize.c | 1 -
drivers/mci/imx-esdhc.c | 1 -
drivers/mci/imx.c | 1 -
drivers/mci/omap_hsmmc.c | 1 -
drivers/mci/omap_hsmmc_common.c | 1 -
drivers/mtd/nand/raw/nand_fsl_ifc.c | 1 -
drivers/mtd/nor/cfi_flash.c | 18 ++++++-----
drivers/net/gianfar.c | 2 +-
drivers/net/gianfar.h | 2 +-
drivers/serial/serial_mpc5xxx.c | 1 +
drivers/usb/gadget/function/dfu.c | 1 -
include/.gitignore | 3 --
include/common.h | 1 -
include/mach/imx/debug_ll.h | 1 -
lib/image-sparse.c | 1 -
79 files changed, 142 insertions(+), 198 deletions(-)
create mode 100644 Documentation/migration-guides/migration-master.rst
rename arch/arm/boards/at91rm9200ek/{config.h => board.h} (98%)
delete mode 100644 arch/openrisc/boards/generic/config.h
create mode 100644 arch/openrisc/include/asm/config.h
delete mode 100644 arch/powerpc/boards/pcm030/config.h
rename arch/powerpc/{boards/owc-da923rc/config.h => include/asm/board-da923rc.h} (56%)
rename arch/powerpc/{boards/freescale-p1010rdb/config.h => include/asm/board-p1010rdb.h} (64%)
rename arch/powerpc/{boards/freescale-p1022ds/config.h => include/asm/board-p1022ds.h} (62%)
rename arch/powerpc/{boards/freescale-p2020rdb/config.h => include/asm/board-p2020rdb.h} (69%)
create mode 100644 arch/powerpc/include/asm/board-pcm030.h
delete mode 100644 include/.gitignore
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] openrisc: drop <config.h> usage
2025-11-28 10:58 [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Ahmad Fatoum
@ 2025-11-28 10:58 ` Ahmad Fatoum
2025-12-01 10:11 ` Sascha Hauer
2025-11-28 10:58 ` [PATCH 2/4] ARM: " Ahmad Fatoum
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Ahmad Fatoum @ 2025-11-28 10:58 UTC (permalink / raw)
To: barebox
From: Ahmad Fatoum <a.fatoum@barebox.org>
Generation per-board config.h headers is a left-over from times long
past. For most boards it's no longer possible anyway due to multi-image
suppot, but for legacy boards that still use it, let's switch away from
this magic in preparation for removal.
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
arch/openrisc/Kconfig | 2 +-
arch/openrisc/Makefile | 4 ++++
arch/openrisc/boards/generic/config.h | 25 -------------------------
arch/openrisc/cpu/barebox.lds.S | 2 +-
arch/openrisc/cpu/start.S | 2 +-
arch/openrisc/include/asm/config.h | 15 +++++++++++++++
arch/openrisc/lib/board.c | 5 +++--
arch/openrisc/lib/clock.c | 1 +
arch/openrisc/lib/cpuinfo.c | 3 ++-
9 files changed, 28 insertions(+), 31 deletions(-)
delete mode 100644 arch/openrisc/boards/generic/config.h
create mode 100644 arch/openrisc/include/asm/config.h
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index d79743962a42..41a4efc691c7 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -16,7 +16,7 @@ config ARCH_MKIMAGE_NAME
# not used
config ARCH_TEXT_BASE
hex
- default 0x00000000
+ default 0x1f80000
config BUILTIN_DTB
bool "link a DTB into the barebox image"
diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile
index 609b998de98e..b7b84f78392b 100644
--- a/arch/openrisc/Makefile
+++ b/arch/openrisc/Makefile
@@ -31,4 +31,8 @@ dts := arch/openrisc/dts
%.dtb: scripts
$(Q)$(MAKE) $(build)=$(dts) $(dts)/$@
+TEXT_BASE = $(CONFIG_ARCH_TEXT_BASE)
+
+KBUILD_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
+
KBUILD_IMAGE := barebox
diff --git a/arch/openrisc/boards/generic/config.h b/arch/openrisc/boards/generic/config.h
deleted file mode 100644
index 2d836d0063ed..000000000000
--- a/arch/openrisc/boards/generic/config.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef _GENERIC_NAMES_H_
-#define _GENERIC_NAMES_H_
-
-#define CONFIG_SYS_CLK_FREQ 50000000
-
-#define OPENRISC_TIMER_FREQ CONFIG_SYS_CLK_FREQ
-
-#define OPENRISC_SOPC_MEMORY_BASE 0x00000000
-#define OPENRISC_SOPC_MEMORY_SIZE 0x02000000
-
-/* We reserve 512K for barebox */
-#define BAREBOX_RESERVED_SIZE 0x80000
-
-/* Barebox will be at top of main memory */
-#define OPENRISC_SOPC_TEXT_BASE (OPENRISC_SOPC_MEMORY_BASE + OPENRISC_SOPC_MEMORY_SIZE - BAREBOX_RESERVED_SIZE)
-
-/*
-* TEXT_BASE is defined here because STACK_BASE definition
-* in include/asm-generic/memory_layout.h uses this name
-*/
-
-#define TEXT_BASE OPENRISC_SOPC_TEXT_BASE
-
-#endif
diff --git a/arch/openrisc/cpu/barebox.lds.S b/arch/openrisc/cpu/barebox.lds.S
index 26bb622edc27..3473181b0231 100644
--- a/arch/openrisc/cpu/barebox.lds.S
+++ b/arch/openrisc/cpu/barebox.lds.S
@@ -13,7 +13,7 @@
*
*/
-#include <config.h>
+#include <asm/config.h>
#include <asm/barebox.lds.h>
OUTPUT_FORMAT(BAREBOX_OUTPUT_FORMAT)
diff --git a/arch/openrisc/cpu/start.S b/arch/openrisc/cpu/start.S
index c448d3775f37..974eda212139 100644
--- a/arch/openrisc/cpu/start.S
+++ b/arch/openrisc/cpu/start.S
@@ -14,7 +14,7 @@
*
*/
-#include <config.h>
+#include <asm/config.h>
#include <asm-generic/memory_layout.h>
#include <asm/spr-defs.h>
diff --git a/arch/openrisc/include/asm/config.h b/arch/openrisc/include/asm/config.h
new file mode 100644
index 000000000000..85d777db8f63
--- /dev/null
+++ b/arch/openrisc/include/asm/config.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _OPENRISC_ASM_CONFIG_H_
+#define _OPENRISC_ASM_CONFIG_H_
+
+#define CFG_SYS_CLK_FREQ 50000000
+
+#define OPENRISC_TIMER_FREQ CFG_SYS_CLK_FREQ
+
+#define OPENRISC_SOPC_MEMORY_BASE 0x00000000
+#define OPENRISC_SOPC_MEMORY_SIZE 0x02000000
+
+/* We reserve 512K for barebox */
+#define BAREBOX_RESERVED_SIZE 0x80000
+
+#endif
diff --git a/arch/openrisc/lib/board.c b/arch/openrisc/lib/board.c
index c6f34ed412d7..3556f3ecee31 100644
--- a/arch/openrisc/lib/board.c
+++ b/arch/openrisc/lib/board.c
@@ -19,14 +19,15 @@
#include <memory.h>
#include <asm-generic/memory_layout.h>
#include <debug_ll.h>
+#include <asm/config.h>
/* Called from assembly */
void openrisc_start_barebox(void);
void __noreturn openrisc_start_barebox(void)
{
- mem_malloc_init((void *)(OPENRISC_SOPC_TEXT_BASE - MALLOC_SIZE),
- (void *)(OPENRISC_SOPC_TEXT_BASE - 1));
+ mem_malloc_init((void *)(TEXT_BASE - MALLOC_SIZE),
+ (void *)(TEXT_BASE - 1));
putc_ll('>');
diff --git a/arch/openrisc/lib/clock.c b/arch/openrisc/lib/clock.c
index 651b163f13cb..a45de30f9426 100644
--- a/arch/openrisc/lib/clock.c
+++ b/arch/openrisc/lib/clock.c
@@ -16,6 +16,7 @@
#include <common.h>
#include <clock.h>
#include <init.h>
+#include <asm/config.h>
#include <asm/system.h>
#include <asm/openrisc_exc.h>
diff --git a/arch/openrisc/lib/cpuinfo.c b/arch/openrisc/lib/cpuinfo.c
index d94178ea59de..4aa4d35bf91d 100644
--- a/arch/openrisc/lib/cpuinfo.c
+++ b/arch/openrisc/lib/cpuinfo.c
@@ -16,6 +16,7 @@
#include <common.h>
#include <command.h>
+#include <asm/config.h>
#include <asm/system.h>
#include <asm/cache.h>
#include <asm/openrisc_exc.h>
@@ -114,7 +115,7 @@ static int checkcpu(void)
char impl_str[50];
printf("CPU: OpenRISC-%x00 (rev %d) @ %d MHz\n",
- ver, rev, (CONFIG_SYS_CLK_FREQ / 1000000));
+ ver, rev, (CFG_SYS_CLK_FREQ / 1000000));
if (vr2) {
cpu_implementation(vr2, impl_str);
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/4] ARM: drop <config.h> usage
2025-11-28 10:58 [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 1/4] openrisc: drop <config.h> usage Ahmad Fatoum
@ 2025-11-28 10:58 ` Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 3/4] ppc: " Ahmad Fatoum
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2025-11-28 10:58 UTC (permalink / raw)
To: barebox
From: Ahmad Fatoum <a.fatoum@barebox.org>
There are no board-specific config.h on ARM any longer anyway, so drop
inclusion of that header.
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
arch/arm/boards/at91rm9200ek/{config.h => board.h} | 4 ++--
arch/arm/boards/at91rm9200ek/lowlevel.c | 2 +-
arch/arm/boards/phytec-phycard-imx27/lowlevel.c | 1 -
arch/arm/cpu/cache-armv8.S | 1 -
arch/arm/cpu/exceptions_32.S | 1 -
arch/arm/cpu/exceptions_64.S | 1 -
arch/arm/lib32/setjmp.S | 1 -
arch/arm/lib64/setjmp.S | 1 -
arch/arm/mach-mxs/lradc-init.c | 1 -
arch/arm/mach-mxs/mem-init.c | 1 -
arch/arm/mach-mxs/power-init.c | 1 -
arch/arm/mach-omap/am33xx_mux.c | 1 -
arch/arm/mach-omap/syslib.c | 1 -
drivers/mci/imx-esdhc.c | 1 -
drivers/mci/imx.c | 1 -
drivers/mci/omap_hsmmc.c | 1 -
drivers/mci/omap_hsmmc_common.c | 1 -
drivers/mtd/nand/raw/nand_fsl_ifc.c | 1 -
include/mach/imx/debug_ll.h | 1 -
19 files changed, 3 insertions(+), 20 deletions(-)
rename arch/arm/boards/at91rm9200ek/{config.h => board.h} (98%)
diff --git a/arch/arm/boards/at91rm9200ek/config.h b/arch/arm/boards/at91rm9200ek/board.h
similarity index 98%
rename from arch/arm/boards/at91rm9200ek/config.h
rename to arch/arm/boards/at91rm9200ek/board.h
index a3a0be18ec91..45e0c8268d6d 100644
--- a/arch/arm/boards/at91rm9200ek/config.h
+++ b/arch/arm/boards/at91rm9200ek/board.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __CONFIG_H
-#define __CONFIG_H
+#ifndef __BOARD_H
+#define __BOARD_H
#define MASTER_PLL_MUL 39
#define MASTER_PLL_DIV 4
diff --git a/arch/arm/boards/at91rm9200ek/lowlevel.c b/arch/arm/boards/at91rm9200ek/lowlevel.c
index f412de7d4a6d..c8c252a31f89 100644
--- a/arch/arm/boards/at91rm9200ek/lowlevel.c
+++ b/arch/arm/boards/at91rm9200ek/lowlevel.c
@@ -15,7 +15,7 @@
#include <mach/at91/at91_pmc.h>
#include <mach/at91/hardware.h>
-#include "config.h"
+#include "board.h"
void static inline access_sdram(void)
{
diff --git a/arch/arm/boards/phytec-phycard-imx27/lowlevel.c b/arch/arm/boards/phytec-phycard-imx27/lowlevel.c
index a43406e1a20b..8e16edfb994b 100644
--- a/arch/arm/boards/phytec-phycard-imx27/lowlevel.c
+++ b/arch/arm/boards/phytec-phycard-imx27/lowlevel.c
@@ -9,7 +9,6 @@
#include <common.h>
#include <init.h>
#include <io.h>
-#include <config.h>
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
#include <mach/imx/imx27-regs.h>
diff --git a/arch/arm/cpu/cache-armv8.S b/arch/arm/cpu/cache-armv8.S
index 3e21b3591389..9d9e0fb585a1 100644
--- a/arch/arm/cpu/cache-armv8.S
+++ b/arch/arm/cpu/cache-armv8.S
@@ -7,7 +7,6 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-#include <config.h>
#include <linux/linkage.h>
#include <init.h>
diff --git a/arch/arm/cpu/exceptions_32.S b/arch/arm/cpu/exceptions_32.S
index 235996f7ec29..dc3d42663cbe 100644
--- a/arch/arm/cpu/exceptions_32.S
+++ b/arch/arm/cpu/exceptions_32.S
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <config.h>
#include <linux/linkage.h>
#include <asm-generic/memory_layout.h>
diff --git a/arch/arm/cpu/exceptions_64.S b/arch/arm/cpu/exceptions_64.S
index 22034eaef975..18c535ecd41f 100644
--- a/arch/arm/cpu/exceptions_64.S
+++ b/arch/arm/cpu/exceptions_64.S
@@ -5,7 +5,6 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-#include <config.h>
#include <asm/ptrace.h>
#include <asm/assembler64.h>
#include <linux/linkage.h>
diff --git a/arch/arm/lib32/setjmp.S b/arch/arm/lib32/setjmp.S
index cc6cafa4af3e..d5ecd127a426 100644
--- a/arch/arm/lib32/setjmp.S
+++ b/arch/arm/lib32/setjmp.S
@@ -3,7 +3,6 @@
* (C) 2017 Theobroma Systems Design und Consulting GmbH
*/
-#include <config.h>
#include <asm/assembler.h>
#include <linux/linkage.h>
diff --git a/arch/arm/lib64/setjmp.S b/arch/arm/lib64/setjmp.S
index 80be8cb0f201..6cd00415e03a 100644
--- a/arch/arm/lib64/setjmp.S
+++ b/arch/arm/lib64/setjmp.S
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/* SPDX-FileCopyrightText: 2017 Theobroma Systems Design und Consulting GmbH */
-#include <config.h>
#include <linux/linkage.h>
.pushsection .text.setjmp, "ax"
diff --git a/arch/arm/mach-mxs/lradc-init.c b/arch/arm/mach-mxs/lradc-init.c
index 10d0be77fdff..7f48893474ad 100644
--- a/arch/arm/mach-mxs/lradc-init.c
+++ b/arch/arm/mach-mxs/lradc-init.c
@@ -8,7 +8,6 @@
*/
#include <common.h>
-#include <config.h>
#include <asm/io.h>
#include <mach/mxs/imx-regs.h>
#include <mach/mxs/regs-lradc.h>
diff --git a/arch/arm/mach-mxs/mem-init.c b/arch/arm/mach-mxs/mem-init.c
index 0d289266d0e0..14d9c1411a4d 100644
--- a/arch/arm/mach-mxs/mem-init.c
+++ b/arch/arm/mach-mxs/mem-init.c
@@ -10,7 +10,6 @@
*/
#include <common.h>
-#include <config.h>
#include <io.h>
#include <mach/mxs/imx-regs.h>
#include <linux/compiler.h>
diff --git a/arch/arm/mach-mxs/power-init.c b/arch/arm/mach-mxs/power-init.c
index 408ff8ba9961..bed4052375b5 100644
--- a/arch/arm/mach-mxs/power-init.c
+++ b/arch/arm/mach-mxs/power-init.c
@@ -8,7 +8,6 @@
*/
#include <common.h>
-#include <config.h>
#include <io.h>
#include <mach/mxs/imx-regs.h>
diff --git a/arch/arm/mach-omap/am33xx_mux.c b/arch/arm/mach-omap/am33xx_mux.c
index 3192e332c6e6..c89cc15bb699 100644
--- a/arch/arm/mach-omap/am33xx_mux.c
+++ b/arch/arm/mach-omap/am33xx_mux.c
@@ -13,7 +13,6 @@
* GNU General Public License for more details.
*/
#include <common.h>
-#include <config.h>
#include <asm/io.h>
#include <mach/omap/am33xx-mux.h>
#include <mach/omap/am33xx-silicon.h>
diff --git a/arch/arm/mach-omap/syslib.c b/arch/arm/mach-omap/syslib.c
index f8fad243c637..cbc08efce9aa 100644
--- a/arch/arm/mach-omap/syslib.c
+++ b/arch/arm/mach-omap/syslib.c
@@ -22,7 +22,6 @@
* GNU General Public License for more details.
*/
-#include <config.h>
#include <common.h>
#include <io.h>
#include <mach/omap/syslib.h>
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index ae02d804430e..6dd3bef45756 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -6,7 +6,6 @@
* Andy Fleming
*/
-#include <config.h>
#include <common.h>
#include <dma.h>
#include <driver.h>
diff --git a/drivers/mci/imx.c b/drivers/mci/imx.c
index 480b758ba3ec..d462cb884325 100644
--- a/drivers/mci/imx.c
+++ b/drivers/mci/imx.c
@@ -12,7 +12,6 @@
* Derived from pxamci.c by Russell King
*/
-#include <config.h>
#include <common.h>
#include <command.h>
#include <mci.h>
diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index 9101b4c30a2c..03f71eb453f1 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -2,7 +2,6 @@
// SPDX-FileCopyrightText: 2008 Texas Instruments (http://www.ti.com/, Sukumar Ghorai <s-ghorai@ti.com>)
/* #define DEBUG */
-#include <config.h>
#include <common.h>
#include <init.h>
#include <driver.h>
diff --git a/drivers/mci/omap_hsmmc_common.c b/drivers/mci/omap_hsmmc_common.c
index 329908a6e4bd..ce146170d920 100644
--- a/drivers/mci/omap_hsmmc_common.c
+++ b/drivers/mci/omap_hsmmc_common.c
@@ -2,7 +2,6 @@
// SPDX-FileCopyrightText: 2008 Texas Instruments (http://www.ti.com/, Sukumar Ghorai <s-ghorai@ti.com>)
/* #define DEBUG */
-#include <config.h>
#include <common.h>
#include <init.h>
#include <driver.h>
diff --git a/drivers/mtd/nand/raw/nand_fsl_ifc.c b/drivers/mtd/nand/raw/nand_fsl_ifc.c
index 1905e7b508d1..5eaa0533e8e1 100644
--- a/drivers/mtd/nand/raw/nand_fsl_ifc.c
+++ b/drivers/mtd/nand/raw/nand_fsl_ifc.c
@@ -7,7 +7,6 @@
*
*/
-#include <config.h>
#include <common.h>
#include <driver.h>
#include <init.h>
diff --git a/include/mach/imx/debug_ll.h b/include/mach/imx/debug_ll.h
index 618cbc784ea7..05e16a8f0248 100644
--- a/include/mach/imx/debug_ll.h
+++ b/include/mach/imx/debug_ll.h
@@ -4,7 +4,6 @@
#define __MACH_IMX_DEBUG_LL_H__
#include <io.h>
-#include <config.h>
#include <common.h>
#include <mach/imx/imx1-regs.h>
#include <mach/imx/imx21-regs.h>
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/4] ppc: drop <config.h> usage
2025-11-28 10:58 [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 1/4] openrisc: drop <config.h> usage Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 2/4] ARM: " Ahmad Fatoum
@ 2025-11-28 10:58 ` Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 4/4] treewide: drop last remnants of <config.h> Ahmad Fatoum
2025-12-01 10:11 ` [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Sascha Hauer
4 siblings, 0 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2025-11-28 10:58 UTC (permalink / raw)
To: barebox
From: Ahmad Fatoum <a.fatoum@barebox.org>
Generating per-board config.h headers is a left-over from times long
past. For most boards it's no longer possible anyway due to multi-image
suppot, but for legacy boards that still use it, let's switch away from
this magic in preparation for removal.
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
arch/powerpc/boards/freescale-p1010rdb/ddr.c | 1 +
arch/powerpc/boards/freescale-p1010rdb/law.c | 1 +
.../boards/freescale-p1010rdb/p1010rdb.c | 1 +
arch/powerpc/boards/freescale-p1010rdb/tlb.c | 1 +
arch/powerpc/boards/freescale-p1022ds/ddr.c | 1 +
.../boards/freescale-p1022ds/ics307_clk.c | 1 +
arch/powerpc/boards/freescale-p1022ds/law.c | 1 +
.../boards/freescale-p1022ds/p1022ds.c | 1 +
arch/powerpc/boards/freescale-p1022ds/tlb.c | 1 +
arch/powerpc/boards/freescale-p2020rdb/law.c | 1 +
.../boards/freescale-p2020rdb/p2020rdb.c | 1 +
arch/powerpc/boards/freescale-p2020rdb/tlb.c | 1 +
arch/powerpc/boards/owc-da923rc/da923rc.c | 1 +
arch/powerpc/boards/owc-da923rc/ddr.c | 1 +
arch/powerpc/boards/owc-da923rc/tlb.c | 1 +
arch/powerpc/boards/pcm030/config.h | 30 -------------------
arch/powerpc/boards/pcm030/pcm030.c | 1 +
arch/powerpc/cpu-85xx/start.S | 1 -
arch/powerpc/ddr-8xxx/ddr_setctrl.c | 2 +-
arch/powerpc/ddr-8xxx/lc_common_dimm_params.c | 2 +-
arch/powerpc/ddr-8xxx/main.c | 2 +-
.../config.h => include/asm/board-da923rc.h} | 25 +++++-----------
.../config.h => include/asm/board-p1010rdb.h} | 23 +++++---------
.../config.h => include/asm/board-p1022ds.h} | 23 +++++---------
.../config.h => include/asm/board-p2020rdb.h} | 28 +++++------------
arch/powerpc/include/asm/board-pcm030.h | 17 +++++++++++
arch/powerpc/include/asm/config.h | 12 ++++++++
arch/powerpc/include/asm/fsl_ifc.h | 2 +-
arch/powerpc/include/asm/fsl_lbc.h | 2 +-
arch/powerpc/include/asm/status_led.h | 2 ++
arch/powerpc/lib/ticks.S | 2 +-
arch/powerpc/mach-mpc5xxx/reginfo.c | 2 +-
arch/powerpc/mach-mpc5xxx/speed.c | 1 +
arch/powerpc/mach-mpc5xxx/start.S | 2 +-
arch/powerpc/mach-mpc85xx/cpu.c | 2 +-
arch/powerpc/mach-mpc85xx/cpu_init.c | 1 +
arch/powerpc/mach-mpc85xx/cpuid.c | 2 +-
arch/powerpc/mach-mpc85xx/speed.c | 1 +
drivers/mtd/nor/cfi_flash.c | 18 ++++++-----
drivers/net/gianfar.c | 2 +-
drivers/net/gianfar.h | 2 +-
drivers/serial/serial_mpc5xxx.c | 1 +
42 files changed, 102 insertions(+), 121 deletions(-)
delete mode 100644 arch/powerpc/boards/pcm030/config.h
rename arch/powerpc/{boards/owc-da923rc/config.h => include/asm/board-da923rc.h} (56%)
rename arch/powerpc/{boards/freescale-p1010rdb/config.h => include/asm/board-p1010rdb.h} (64%)
rename arch/powerpc/{boards/freescale-p1022ds/config.h => include/asm/board-p1022ds.h} (62%)
rename arch/powerpc/{boards/freescale-p2020rdb/config.h => include/asm/board-p2020rdb.h} (69%)
create mode 100644 arch/powerpc/include/asm/board-pcm030.h
diff --git a/arch/powerpc/boards/freescale-p1010rdb/ddr.c b/arch/powerpc/boards/freescale-p1010rdb/ddr.c
index 14fa426726e9..59a4c9027ff0 100644
--- a/arch/powerpc/boards/freescale-p1010rdb/ddr.c
+++ b/arch/powerpc/boards/freescale-p1010rdb/ddr.c
@@ -11,6 +11,7 @@
#include <mach/fsl_i2c.h>
#include <mach/immap_85xx.h>
#include <mach/clock.h>
+#include <asm/config.h>
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/fsl_lbc.h>
diff --git a/arch/powerpc/boards/freescale-p1010rdb/law.c b/arch/powerpc/boards/freescale-p1010rdb/law.c
index 6edfbc2fb8b1..b74e255a6049 100644
--- a/arch/powerpc/boards/freescale-p1010rdb/law.c
+++ b/arch/powerpc/boards/freescale-p1010rdb/law.c
@@ -14,6 +14,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <asm/fsl_law.h>
struct law_entry law_table[] = {
diff --git a/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c b/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c
index 023fb32bf3b1..3fe29edfd3ab 100644
--- a/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c
+++ b/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c
@@ -24,6 +24,7 @@
#include <gpio.h>
#include <envfs.h>
#include <memory.h>
+#include <asm/config.h>
#include <asm/cache.h>
#include <asm/fsl_ddr_sdram.h>
#include <asm/fsl_law.h>
diff --git a/arch/powerpc/boards/freescale-p1010rdb/tlb.c b/arch/powerpc/boards/freescale-p1010rdb/tlb.c
index 23ef0f2ade50..5c2262dd4a6c 100644
--- a/arch/powerpc/boards/freescale-p1010rdb/tlb.c
+++ b/arch/powerpc/boards/freescale-p1010rdb/tlb.c
@@ -14,6 +14,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <mach/mmu.h>
struct fsl_e_tlb_entry tlb_table[] = {
diff --git a/arch/powerpc/boards/freescale-p1022ds/ddr.c b/arch/powerpc/boards/freescale-p1022ds/ddr.c
index 3a8298f9287c..e8efcee4b328 100644
--- a/arch/powerpc/boards/freescale-p1022ds/ddr.c
+++ b/arch/powerpc/boards/freescale-p1022ds/ddr.c
@@ -11,6 +11,7 @@
#include <mach/fsl_i2c.h>
#include <mach/immap_85xx.h>
#include <mach/clock.h>
+#include <asm/config.h>
#include <asm/io.h>
#include <asm/fsl_lbc.h>
#include <asm/fsl_ddr_sdram.h>
diff --git a/arch/powerpc/boards/freescale-p1022ds/ics307_clk.c b/arch/powerpc/boards/freescale-p1022ds/ics307_clk.c
index f7c5bbde9907..14fdf4be0faa 100644
--- a/arch/powerpc/boards/freescale-p1022ds/ics307_clk.c
+++ b/arch/powerpc/boards/freescale-p1022ds/ics307_clk.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <asm/io.h>
/* decode S[0-2] to Output Divider (OD) */
diff --git a/arch/powerpc/boards/freescale-p1022ds/law.c b/arch/powerpc/boards/freescale-p1022ds/law.c
index 79cc20dd6e52..339b7f59ad01 100644
--- a/arch/powerpc/boards/freescale-p1022ds/law.c
+++ b/arch/powerpc/boards/freescale-p1022ds/law.c
@@ -14,6 +14,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <asm/fsl_law.h>
struct law_entry law_table[] = {
diff --git a/arch/powerpc/boards/freescale-p1022ds/p1022ds.c b/arch/powerpc/boards/freescale-p1022ds/p1022ds.c
index e3591454f831..1b89d9dd3e3b 100644
--- a/arch/powerpc/boards/freescale-p1022ds/p1022ds.c
+++ b/arch/powerpc/boards/freescale-p1022ds/p1022ds.c
@@ -23,6 +23,7 @@
#include <i2c/i2c.h>
#include <memory.h>
#include <envfs.h>
+#include <asm/config.h>
#include <asm/cache.h>
#include <asm/fsl_ddr_sdram.h>
#include <asm/fsl_law.h>
diff --git a/arch/powerpc/boards/freescale-p1022ds/tlb.c b/arch/powerpc/boards/freescale-p1022ds/tlb.c
index 86ab43aec0e4..d2b5b8109e04 100644
--- a/arch/powerpc/boards/freescale-p1022ds/tlb.c
+++ b/arch/powerpc/boards/freescale-p1022ds/tlb.c
@@ -14,6 +14,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <mach/mmu.h>
struct fsl_e_tlb_entry tlb_table[] = {
diff --git a/arch/powerpc/boards/freescale-p2020rdb/law.c b/arch/powerpc/boards/freescale-p2020rdb/law.c
index e76b9cb0f599..a6b581432ff2 100644
--- a/arch/powerpc/boards/freescale-p2020rdb/law.c
+++ b/arch/powerpc/boards/freescale-p2020rdb/law.c
@@ -14,6 +14,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <asm/fsl_law.h>
#include <asm/mmu.h>
diff --git a/arch/powerpc/boards/freescale-p2020rdb/p2020rdb.c b/arch/powerpc/boards/freescale-p2020rdb/p2020rdb.c
index ba4f58be10e7..c960703093c4 100644
--- a/arch/powerpc/boards/freescale-p2020rdb/p2020rdb.c
+++ b/arch/powerpc/boards/freescale-p2020rdb/p2020rdb.c
@@ -22,6 +22,7 @@
#include <i2c/i2c.h>
#include <memory.h>
#include <envfs.h>
+#include <asm/config.h>
#include <asm/cache.h>
#include <asm/fsl_ddr_sdram.h>
#include <asm/fsl_law.h>
diff --git a/arch/powerpc/boards/freescale-p2020rdb/tlb.c b/arch/powerpc/boards/freescale-p2020rdb/tlb.c
index e5b1789b28ca..b117d07f5529 100644
--- a/arch/powerpc/boards/freescale-p2020rdb/tlb.c
+++ b/arch/powerpc/boards/freescale-p2020rdb/tlb.c
@@ -14,6 +14,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <mach/mmu.h>
struct fsl_e_tlb_entry tlb_table[] = {
diff --git a/arch/powerpc/boards/owc-da923rc/da923rc.c b/arch/powerpc/boards/owc-da923rc/da923rc.c
index baede439b15b..ad95db8576d6 100644
--- a/arch/powerpc/boards/owc-da923rc/da923rc.c
+++ b/arch/powerpc/boards/owc-da923rc/da923rc.c
@@ -27,6 +27,7 @@
#include <platform_data/serial-ns16550.h>
#include <environment.h>
#include <i2c/i2c.h>
+#include <asm/config.h>
#include <asm/fsl_ddr_sdram.h>
#include <asm/cache.h>
#include <mach/mmu.h>
diff --git a/arch/powerpc/boards/owc-da923rc/ddr.c b/arch/powerpc/boards/owc-da923rc/ddr.c
index fc0c50cdcd31..b2512d249dd5 100644
--- a/arch/powerpc/boards/owc-da923rc/ddr.c
+++ b/arch/powerpc/boards/owc-da923rc/ddr.c
@@ -15,6 +15,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <mach/fsl_i2c.h>
#include <mach/immap_85xx.h>
#include <mach/clock.h>
diff --git a/arch/powerpc/boards/owc-da923rc/tlb.c b/arch/powerpc/boards/owc-da923rc/tlb.c
index 889e2743b7d5..1937d5560081 100644
--- a/arch/powerpc/boards/owc-da923rc/tlb.c
+++ b/arch/powerpc/boards/owc-da923rc/tlb.c
@@ -13,6 +13,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <mach/mmu.h>
struct fsl_e_tlb_entry tlb_table[] = {
diff --git a/arch/powerpc/boards/pcm030/config.h b/arch/powerpc/boards/pcm030/config.h
deleted file mode 100644
index 24cf9dc4ff42..000000000000
--- a/arch/powerpc/boards/pcm030/config.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * (C) Copyright 2003-2005
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2006
- * Eric Schumann, Phytec Messatechnik GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <mach/mpc5xxx.h>
-
-#define CFG_MPC5XXX_CLKIN 33333000 /* ... running at 33.333MHz */
-
-#define CFG_HID0_INIT HID0_ICE | HID0_ICFI
-#define CFG_HID0_FINAL HID0_ICE
-
-#endif /* __CONFIG_H */
diff --git a/arch/powerpc/boards/pcm030/pcm030.c b/arch/powerpc/boards/pcm030/pcm030.c
index 8da683898fa0..80b2a23de4d8 100644
--- a/arch/powerpc/boards/pcm030/pcm030.c
+++ b/arch/powerpc/boards/pcm030/pcm030.c
@@ -29,6 +29,7 @@
#include <envfs.h>
#include <linux/sizes.h>
#include <linux/stat.h>
+#include <asm/config.h>
#include <asm/io.h>
#include <fs.h>
#include <i2c/i2c.h>
diff --git a/arch/powerpc/cpu-85xx/start.S b/arch/powerpc/cpu-85xx/start.S
index 82c2c0ad8c0c..217c42f99fd5 100644
--- a/arch/powerpc/cpu-85xx/start.S
+++ b/arch/powerpc/cpu-85xx/start.S
@@ -12,7 +12,6 @@
* last 4K page(0xfffff000-0xffffffff) in flash/rom.
*/
-#include <config.h>
#include <asm/config.h>
#include <asm/processor.h>
diff --git a/arch/powerpc/ddr-8xxx/ddr_setctrl.c b/arch/powerpc/ddr-8xxx/ddr_setctrl.c
index 115fb4207009..ee54042b1730 100644
--- a/arch/powerpc/ddr-8xxx/ddr_setctrl.c
+++ b/arch/powerpc/ddr-8xxx/ddr_setctrl.c
@@ -7,7 +7,7 @@
*/
#include <common.h>
-#include <config.h>
+#include <asm/config.h>
#include <asm/io.h>
#include <asm/fsl_ddr_sdram.h>
#include <asm/processor.h>
diff --git a/arch/powerpc/ddr-8xxx/lc_common_dimm_params.c b/arch/powerpc/ddr-8xxx/lc_common_dimm_params.c
index 9d90fb76dbdf..c6dfaad157b5 100644
--- a/arch/powerpc/ddr-8xxx/lc_common_dimm_params.c
+++ b/arch/powerpc/ddr-8xxx/lc_common_dimm_params.c
@@ -7,7 +7,7 @@
*/
#include <common.h>
-#include <config.h>
+#include <asm/config.h>
#include <asm/fsl_ddr_sdram.h>
#include "ddr.h"
diff --git a/arch/powerpc/ddr-8xxx/main.c b/arch/powerpc/ddr-8xxx/main.c
index 99b877b5cadd..f361aa6942ac 100644
--- a/arch/powerpc/ddr-8xxx/main.c
+++ b/arch/powerpc/ddr-8xxx/main.c
@@ -13,7 +13,7 @@
*/
#include <common.h>
-#include <config.h>
+#include <asm/config.h>
#include <asm/fsl_law.h>
#include <asm/fsl_ddr_sdram.h>
#include "ddr.h"
diff --git a/arch/powerpc/boards/owc-da923rc/config.h b/arch/powerpc/include/asm/board-da923rc.h
similarity index 56%
rename from arch/powerpc/boards/owc-da923rc/config.h
rename to arch/powerpc/include/asm/board-da923rc.h
index 3895324e9553..adea98a42a24 100644
--- a/arch/powerpc/boards/owc-da923rc/config.h
+++ b/arch/powerpc/include/asm/board-da923rc.h
@@ -1,21 +1,10 @@
-/*
- * Copyright 2013 GE Intelligent Platforms, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * DA923RC board configuration file.
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2013 GE Intelligent Platforms, Inc.
-#ifndef __CONFIG_H
-#define __CONFIG_H
+/* Don't include directly, include <asm/config.h> instead. */
+
+#ifndef __BOARD_DA923RC_H
+#define __BOARD_DA923RC_H
#define CFG_SYS_CLK_FREQ 66666666
@@ -50,4 +39,4 @@
#define BOARD_TYPE_DA923 1
#define BOARD_TYPE_GBX460 2
-#endif /* __CONFIG_H */
+#endif /* __BOARD_DA923RC_H */
diff --git a/arch/powerpc/boards/freescale-p1010rdb/config.h b/arch/powerpc/include/asm/board-p1010rdb.h
similarity index 64%
rename from arch/powerpc/boards/freescale-p1010rdb/config.h
rename to arch/powerpc/include/asm/board-p1010rdb.h
index 4f671835072d..d58c78bb6bb4 100644
--- a/arch/powerpc/boards/freescale-p1010rdb/config.h
+++ b/arch/powerpc/include/asm/board-p1010rdb.h
@@ -1,19 +1,10 @@
-/*
- * Copyright 2009-2011 Freescale Semiconductor, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
- * GNU General Public License for more details.
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2009-2011 Freescale Semiconductor, Inc.
-#ifndef __CONFIG_H
-#define __CONFIG_H
+/* Don't include directly, include <asm/config.h> instead. */
+
+#ifndef __BOARD_P1010RDB_H
+#define __BOARD_P1010RDB_H
#define CFG_SYS_CLK_FREQ 66666666
#define CFG_DDR_CLK_FREQ 66666666
@@ -55,4 +46,4 @@
#define CFG_IFC_CSOR0 CSOR_NOR_ADM_SHIFT(7)
#define CFG_IFC_AMASK0 IFC_AMASK(32*1024*1024)
-#endif /* __CONFIG_H */
+#endif /* __BOARD_P1010RDB_H */
diff --git a/arch/powerpc/boards/freescale-p1022ds/config.h b/arch/powerpc/include/asm/board-p1022ds.h
similarity index 62%
rename from arch/powerpc/boards/freescale-p1022ds/config.h
rename to arch/powerpc/include/asm/board-p1022ds.h
index 666b9ff987ec..c0798c7c489a 100644
--- a/arch/powerpc/boards/freescale-p1022ds/config.h
+++ b/arch/powerpc/include/asm/board-p1022ds.h
@@ -1,19 +1,10 @@
-/*
- * Copyright 2009-2011 Freescale Semiconductor, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
- * GNU General Public License for more details.
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2009-2011 Freescale Semiconductor, Inc.
-#ifndef __CONFIG_H
-#define __CONFIG_H
+/* Don't include directly, include <asm/config.h> instead. */
+
+#ifndef __BOARD_P1022DS_H
+#define __BOARD_P1022DS_H
#ifndef __ASSEMBLY__
extern unsigned long ics307_clk_freq(unsigned int reg);
@@ -52,4 +43,4 @@ extern unsigned long ics307_clk_freq(unsigned int reg);
#define CFG_PIXIS_BASE 0xffdf0000
#define CFG_PIXIS_BASE_PHYS CFG_PIXIS_BASE
-#endif /* __CONFIG_H */
+#endif /* __BOARD_P1022DS_H */
diff --git a/arch/powerpc/boards/freescale-p2020rdb/config.h b/arch/powerpc/include/asm/board-p2020rdb.h
similarity index 69%
rename from arch/powerpc/boards/freescale-p2020rdb/config.h
rename to arch/powerpc/include/asm/board-p2020rdb.h
index 0d3e095016a1..c4ad592ff8be 100644
--- a/arch/powerpc/boards/freescale-p2020rdb/config.h
+++ b/arch/powerpc/include/asm/board-p2020rdb.h
@@ -1,25 +1,11 @@
-/*
- * Copyright 2012 GE Intelligent Platforms, Inc.
- * Copyright 2009-2011 Freescale Semiconductor, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2012 GE Intelligent Platforms, Inc.
+// SPDX-FileCopyrightText: 2009-2011 Freescale Semiconductor, Inc.
-/*
- * P2020RDB board configuration file
- */
+/* Don't include directly, include <asm/config.h> instead. */
-#ifndef __CONFIG_H
-#define __CONFIG_H
+#ifndef __BOARD_P2020RDB_H
+#define __BOARD_P2020RDB_H
#ifndef __ASSEMBLY__
extern unsigned long get_board_sys_clk(unsigned long dummy);
@@ -82,4 +68,4 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
/* Leave 256 bytes for global data */
#define CFG_INIT_SP_OFFSET (0x00004000 - 256)
-#endif /* __CONFIG_H */
+#endif /* __BOARD_P2020RDB_H */
diff --git a/arch/powerpc/include/asm/board-pcm030.h b/arch/powerpc/include/asm/board-pcm030.h
new file mode 100644
index 000000000000..bd7f2766265b
--- /dev/null
+++ b/arch/powerpc/include/asm/board-pcm030.h
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2003-2005 Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+// SPDX-FileCopyrightText: 2006 Eric Schumann, Phytec Messatechnik GmbH
+
+/* Don't include directly, include <asm/config.h> instead. */
+
+#ifndef __BOARD_PCM030_H
+#define __BOARD_PCM030_H
+
+#include <mach/mpc5xxx.h>
+
+#define CFG_MPC5XXX_CLKIN 33333000 /* ... running at 33.333MHz */
+
+#define CFG_HID0_INIT HID0_ICE | HID0_ICFI
+#define CFG_HID0_FINAL HID0_ICE
+
+#endif /* __BOARD_PCM030_H */
diff --git a/arch/powerpc/include/asm/config.h b/arch/powerpc/include/asm/config.h
index ce6581a83f60..727daa872f20 100644
--- a/arch/powerpc/include/asm/config.h
+++ b/arch/powerpc/include/asm/config.h
@@ -37,4 +37,16 @@
#endif
#endif
+#ifdef CONFIG_MACH_PHYCORE_MPC5200B_TINY
+#include <asm/board-pcm030.h>
+#elif defined(CONFIG_P1010RDB)
+#include <asm/board-p1010rdb.h>
+#elif defined(CONFIG_P2020RDB)
+#include <asm/board-p2020rdb.h>
+#elif defined(CONFIG_P1022DS)
+#include <asm/board-p1022ds.h>
+#elif defined(CONFIG_DA923RC)
+#include <asm/board-da923rc.h>
+#endif
+
#endif /* _ASM_CONFIG_H_ */
diff --git a/arch/powerpc/include/asm/fsl_ifc.h b/arch/powerpc/include/asm/fsl_ifc.h
index 8faff7503343..459138fd6a10 100644
--- a/arch/powerpc/include/asm/fsl_ifc.h
+++ b/arch/powerpc/include/asm/fsl_ifc.h
@@ -8,7 +8,7 @@
#ifndef __FSL_IFC_H
#define __FSL_IFC_H
-#include <config.h>
+#include <asm/config.h>
#include <common.h>
/* Big-Endian */
diff --git a/arch/powerpc/include/asm/fsl_lbc.h b/arch/powerpc/include/asm/fsl_lbc.h
index cde0864378c8..4e94ff6953bf 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -11,7 +11,7 @@
#ifndef __ASM_PPC_FSL_LBC_H
#define __ASM_PPC_FSL_LBC_H
-#include <config.h>
+#include <asm/config.h>
#include <common.h>
/*
diff --git a/arch/powerpc/include/asm/status_led.h b/arch/powerpc/include/asm/status_led.h
index 129aa6614ab6..a51b6b34ea65 100644
--- a/arch/powerpc/include/asm/status_led.h
+++ b/arch/powerpc/include/asm/status_led.h
@@ -9,6 +9,8 @@
#ifndef __ASM_STATUS_LED_H__
#define __ASM_STATUS_LED_H__
+#include <asm/config.h>
+
/* if not overriden */
#ifndef CONFIG_BOARD_SPECIFIC_LED
# if defined(CONFIG_8xx)
diff --git a/arch/powerpc/lib/ticks.S b/arch/powerpc/lib/ticks.S
index e923f17b6328..cea184474ecc 100644
--- a/arch/powerpc/lib/ticks.S
+++ b/arch/powerpc/lib/ticks.S
@@ -18,7 +18,7 @@
#include <asm/ppc_asm.tmpl>
#include <asm/ppc_defs.h>
-#include <config.h>
+#include <asm/config.h>
/*
* unsigned long long get_ticks(void);
diff --git a/arch/powerpc/mach-mpc5xxx/reginfo.c b/arch/powerpc/mach-mpc5xxx/reginfo.c
index dd33a82601ac..086ae6f0d1a9 100644
--- a/arch/powerpc/mach-mpc5xxx/reginfo.c
+++ b/arch/powerpc/mach-mpc5xxx/reginfo.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <common.h>
-#include <config.h>
+#include <asm/config.h>
#include <mach/mpc5xxx.h>
#include <command.h>
#include <complete.h>
diff --git a/arch/powerpc/mach-mpc5xxx/speed.c b/arch/powerpc/mach-mpc5xxx/speed.c
index 760d923bcf60..8d304e995d22 100644
--- a/arch/powerpc/mach-mpc5xxx/speed.c
+++ b/arch/powerpc/mach-mpc5xxx/speed.c
@@ -15,6 +15,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <mach/mpc5xxx.h>
#include <init.h>
#include <asm/processor.h>
diff --git a/arch/powerpc/mach-mpc5xxx/start.S b/arch/powerpc/mach-mpc5xxx/start.S
index 31648a652947..aaa19d6be807 100644
--- a/arch/powerpc/mach-mpc5xxx/start.S
+++ b/arch/powerpc/mach-mpc5xxx/start.S
@@ -18,7 +18,7 @@
/*
* barebox - Startup Code for MPC5xxx CPUs
*/
-#include <config.h>
+#include <asm/config.h>
#include <asm/ppc_asm.tmpl>
#include <asm/ppc_defs.h>
diff --git a/arch/powerpc/mach-mpc85xx/cpu.c b/arch/powerpc/mach-mpc85xx/cpu.c
index 23da0eac4c39..e8ed7fc01901 100644
--- a/arch/powerpc/mach-mpc85xx/cpu.c
+++ b/arch/powerpc/mach-mpc85xx/cpu.c
@@ -19,7 +19,7 @@
*
*/
-#include <config.h>
+#include <asm/config.h>
#include <common.h>
#include <memory.h>
#include <init.h>
diff --git a/arch/powerpc/mach-mpc85xx/cpu_init.c b/arch/powerpc/mach-mpc85xx/cpu_init.c
index 3259945fda64..c5ae2b62d131 100644
--- a/arch/powerpc/mach-mpc85xx/cpu_init.c
+++ b/arch/powerpc/mach-mpc85xx/cpu_init.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <init.h>
+#include <asm/config.h>
#include <asm/processor.h>
#include <asm/cache.h>
#include <asm/fsl_law.h>
diff --git a/arch/powerpc/mach-mpc85xx/cpuid.c b/arch/powerpc/mach-mpc85xx/cpuid.c
index 28f08ca29247..7871369345c3 100644
--- a/arch/powerpc/mach-mpc85xx/cpuid.c
+++ b/arch/powerpc/mach-mpc85xx/cpuid.c
@@ -17,7 +17,7 @@
*
*/
-#include <config.h>
+#include <asm/config.h>
#include <common.h>
#include <command.h>
#include <asm/cache.h>
diff --git a/arch/powerpc/mach-mpc85xx/speed.c b/arch/powerpc/mach-mpc85xx/speed.c
index 16ce72d84678..4a69de3dc81a 100644
--- a/arch/powerpc/mach-mpc85xx/speed.c
+++ b/arch/powerpc/mach-mpc85xx/speed.c
@@ -22,6 +22,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <asm/processor.h>
#include <mach/clock.h>
#include <mach/immap_85xx.h>
diff --git a/drivers/mtd/nor/cfi_flash.c b/drivers/mtd/nor/cfi_flash.c
index b68c36841031..7a7767ff86a4 100644
--- a/drivers/mtd/nor/cfi_flash.c
+++ b/drivers/mtd/nor/cfi_flash.c
@@ -30,6 +30,17 @@
#include <linux/mtd/concat.h>
#include "cfi_flash.h"
+#ifdef CONFIG_PPC
+#include <asm/config.h>
+#endif
+
+/*
+ * Check if chip width is defined. If not, start detecting with 8bit.
+ */
+#ifndef CFG_FLASH_CFI_WIDTH
+#define CFG_FLASH_CFI_WIDTH FLASH_CFI_8BIT
+#endif
+
/*
* This file implements a Common Flash Interface (CFI) driver for barebox.
* The width of the port and the width of the chips are determined at initialization.
@@ -50,13 +61,6 @@ static unsigned int flash_offset_cfi[2] = {
FLASH_OFFSET_CFI,FLASH_OFFSET_CFI_ALT
};
-/*
- * Check if chip width is defined. If not, start detecting with 8bit.
- */
-#ifndef CFG_FLASH_CFI_WIDTH
-#define CFG_FLASH_CFI_WIDTH FLASH_CFI_8BIT
-#endif
-
struct cfi_priv {
struct flash_info *infos;
int num_devs;
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 35cd6e7f0a6e..18b3c8849c6e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -8,7 +8,7 @@
* based on work by Andy Fleming
*/
-#include <config.h>
+#include <asm/config.h>
#include <common.h>
#include <malloc.h>
#include <net.h>
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 8a60c7f38eca..8ccbbe14738b 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -14,7 +14,7 @@
#define __GIANFAR_H
#include <net.h>
-#include <config.h>
+#include <asm/config.h>
#include <mach/gianfar.h>
#define MAC_ADDR_LEN 6
diff --git a/drivers/serial/serial_mpc5xxx.c b/drivers/serial/serial_mpc5xxx.c
index 4408de9e910a..921693188cdf 100644
--- a/drivers/serial/serial_mpc5xxx.c
+++ b/drivers/serial/serial_mpc5xxx.c
@@ -17,6 +17,7 @@
*/
#include <common.h>
+#include <asm/config.h>
#include <mach/mpc5xxx.h>
#include <driver.h>
#include <init.h>
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/4] treewide: drop last remnants of <config.h>
2025-11-28 10:58 [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Ahmad Fatoum
` (2 preceding siblings ...)
2025-11-28 10:58 ` [PATCH 3/4] ppc: " Ahmad Fatoum
@ 2025-11-28 10:58 ` Ahmad Fatoum
2025-12-01 10:11 ` [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Sascha Hauer
4 siblings, 0 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2025-11-28 10:58 UTC (permalink / raw)
To: barebox
From: Ahmad Fatoum <a.fatoum@barebox.org>
With all architectures migrated away from config.h use, let's remove
generation logic and remaining includes.
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
.../migration-guides/migration-master.rst | 7 +++++++
Makefile | 19 ++-----------------
common/console.c | 1 -
common/console_simple.c | 1 -
common/memsize.c | 1 -
drivers/usb/gadget/function/dfu.c | 1 -
include/.gitignore | 3 ---
include/common.h | 1 -
lib/image-sparse.c | 1 -
9 files changed, 9 insertions(+), 26 deletions(-)
create mode 100644 Documentation/migration-guides/migration-master.rst
delete mode 100644 include/.gitignore
diff --git a/Documentation/migration-guides/migration-master.rst b/Documentation/migration-guides/migration-master.rst
new file mode 100644
index 000000000000..bb9a24bc06ab
--- /dev/null
+++ b/Documentation/migration-guides/migration-master.rst
@@ -0,0 +1,7 @@
+<config.h> removal for PowerPC
+------------------------------
+
+PowerPC was the last remaining user of per-board ``<config.h>`` files.
+The alternative for out-of-tree boards is now to patch
+``arch/powerpc/include/asm/config.h`` to include the board's config.h,
+like the in-tree boards are already doing.
diff --git a/Makefile b/Makefile
index f958114480f9..4b35b9561059 100644
--- a/Makefile
+++ b/Makefile
@@ -1143,7 +1143,7 @@ scripts: scripts_basic scripts_dtc include/generated/utsrelease.h
PHONY += prepare archprepare prepare0
archprepare: outputmakefile scripts_basic include/config/kernel.release \
- $(version_h) include/generated/utsrelease.h include/config.h \
+ $(version_h) include/generated/utsrelease.h \
include/generated/autoconf.h
prepare0: archprepare FORCE
@@ -1161,21 +1161,6 @@ prepare: prepare0
export CPPFLAGS_barebox.lds += -C -U$(SRCARCH)
-define symlink-config-h
- if [ -f $(srctree)/$(BOARD)/config.h ]; then \
- $(kecho) ' SYMLINK $@ -> $(BOARD)/config.h'; \
- ln -fsn $(srctree)/$(BOARD)/config.h $@; \
- else \
- [ -h $@ ] && rm -f $@; \
- $(kecho) ' CREATE $@'; \
- touch -a $@; \
- fi
-endef
-
-PHONY += include/config.h
-include/config.h:
- $(Q)$(symlink-config-h)
-
# Create $(FIRMWARE_DIR) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a
# leading /, it's relative to $(srctree).
FIRMWARE_DIR := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR))
@@ -1400,7 +1385,7 @@ CLEAN_FILES += scripts/bareboxenv-target scripts/kernel-install-target \
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config usr/include include/generated Documentation/commands
MRPROPER_FILES += .config .config.old .security_config .version .old_version \
- include/config.h *.sconfig.old \
+ *.sconfig.old \
Module.symvers tags TAGS cscope*
# clean - Delete most, but leave enough to build external modules
diff --git a/common/console.c b/common/console.c
index aa2013c51522..8a55fd1a1dc6 100644
--- a/common/console.c
+++ b/common/console.c
@@ -4,7 +4,6 @@
* Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
*/
-#include <config.h>
#include <security/config.h>
#include <common.h>
#include <stdarg.h>
diff --git a/common/console_simple.c b/common/console_simple.c
index c5f554bbee9b..25fe6217448c 100644
--- a/common/console_simple.c
+++ b/common/console_simple.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
-#include <config.h>
#include <common.h>
#include <fs.h>
#include <errno.h>
diff --git a/common/memsize.c b/common/memsize.c
index de4d8df18afb..f2e720798eb1 100644
--- a/common/memsize.c
+++ b/common/memsize.c
@@ -5,7 +5,6 @@
*/
#include <common.h>
-#include <config.h>
#if defined (__PPC__) && !defined (__SANDBOX__)
/*
* At least on G2 PowerPC cores, sequential accesses to non-existent
diff --git a/drivers/usb/gadget/function/dfu.c b/drivers/usb/gadget/function/dfu.c
index 893dcc7f7007..4d7001e48d85 100644
--- a/drivers/usb/gadget/function/dfu.c
+++ b/drivers/usb/gadget/function/dfu.c
@@ -35,7 +35,6 @@
#include <linux/err.h>
#include <linux/usb/ch9.h>
#include <linux/usb/dfu.h>
-#include <config.h>
#include <common.h>
#include <malloc.h>
#include <errno.h>
diff --git a/include/.gitignore b/include/.gitignore
deleted file mode 100644
index 3ac630625dc7..000000000000
--- a/include/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-
-/config.h
diff --git a/include/common.h b/include/common.h
index 16a08fe293af..96670ca3abee 100644
--- a/include/common.h
+++ b/include/common.h
@@ -10,7 +10,6 @@
#include <stdio.h>
#include <barebox.h>
#include <module.h>
-#include <config.h>
#include <clock.h>
#include <linux/bitops.h>
#include <linux/types.h>
diff --git a/lib/image-sparse.c b/lib/image-sparse.c
index eb5242e25ada..67f3b4b11dc3 100644
--- a/lib/image-sparse.c
+++ b/lib/image-sparse.c
@@ -35,7 +35,6 @@
*/
#define pr_fmt(fmt) "image-sparse: " fmt
-#include <config.h>
#include <common.h>
#include <image-sparse.h>
#include <unistd.h>
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism
2025-11-28 10:58 [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Ahmad Fatoum
` (3 preceding siblings ...)
2025-11-28 10:58 ` [PATCH 4/4] treewide: drop last remnants of <config.h> Ahmad Fatoum
@ 2025-12-01 10:11 ` Sascha Hauer
4 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2025-12-01 10:11 UTC (permalink / raw)
To: barebox, Ahmad Fatoum
On Fri, 28 Nov 2025 11:58:40 +0100, Ahmad Fatoum wrote:
> Generation per-board config.h headers is a left-over from times long
> past. For most boards it's no longer possible anyway due to multi-image
> suppot, but for legacy boards that still use it, let's switch away
> existing users from this magic and remove it.
>
> Ahmad Fatoum (4):
> openrisc: drop <config.h> usage
> ARM: drop <config.h> usage
> ppc: drop <config.h> usage
> treewide: drop last remnants of <config.h>
>
> [...]
Applied, thanks!
[1/4] openrisc: drop <config.h> usage
https://git.pengutronix.de/cgit/barebox/commit/?id=5f9f86027928 (link may not be stable)
[2/4] ARM: drop <config.h> usage
https://git.pengutronix.de/cgit/barebox/commit/?id=fa1e14784549 (link may not be stable)
[3/4] ppc: drop <config.h> usage
https://git.pengutronix.de/cgit/barebox/commit/?id=1a4b2f568d63 (link may not be stable)
[4/4] treewide: drop last remnants of <config.h>
https://git.pengutronix.de/cgit/barebox/commit/?id=80428a121189 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] openrisc: drop <config.h> usage
2025-11-28 10:58 ` [PATCH 1/4] openrisc: drop <config.h> usage Ahmad Fatoum
@ 2025-12-01 10:11 ` Sascha Hauer
0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2025-12-01 10:11 UTC (permalink / raw)
To: Ahmad Fatoum; +Cc: barebox
On Fri, Nov 28, 2025 at 11:58:41AM +0100, Ahmad Fatoum wrote:
> From: Ahmad Fatoum <a.fatoum@barebox.org>
>
> Generation per-board config.h headers is a left-over from times long
> past. For most boards it's no longer possible anyway due to multi-image
> suppot, but for legacy boards that still use it, let's switch away from
> this magic in preparation for removal.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
> ---
> arch/openrisc/Kconfig | 2 +-
> arch/openrisc/Makefile | 4 ++++
> arch/openrisc/boards/generic/config.h | 25 -------------------------
> arch/openrisc/cpu/barebox.lds.S | 2 +-
> arch/openrisc/cpu/start.S | 2 +-
> arch/openrisc/include/asm/config.h | 15 +++++++++++++++
> arch/openrisc/lib/board.c | 5 +++--
> arch/openrisc/lib/clock.c | 1 +
> arch/openrisc/lib/cpuinfo.c | 3 ++-
> 9 files changed, 28 insertions(+), 31 deletions(-)
> delete mode 100644 arch/openrisc/boards/generic/config.h
> create mode 100644 arch/openrisc/include/asm/config.h
>
> diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
> index d79743962a42..41a4efc691c7 100644
> --- a/arch/openrisc/Kconfig
> +++ b/arch/openrisc/Kconfig
> @@ -16,7 +16,7 @@ config ARCH_MKIMAGE_NAME
> # not used
This is no longer true. Removed while applying.
Sascha
> config ARCH_TEXT_BASE
> hex
> - default 0x00000000
> + default 0x1f80000
>
> config BUILTIN_DTB
> bool "link a DTB into the barebox image"
> diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile
> index 609b998de98e..b7b84f78392b 100644
> --- a/arch/openrisc/Makefile
> +++ b/arch/openrisc/Makefile
> @@ -31,4 +31,8 @@ dts := arch/openrisc/dts
> %.dtb: scripts
> $(Q)$(MAKE) $(build)=$(dts) $(dts)/$@
>
> +TEXT_BASE = $(CONFIG_ARCH_TEXT_BASE)
> +
> +KBUILD_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
> +
> KBUILD_IMAGE := barebox
> diff --git a/arch/openrisc/boards/generic/config.h b/arch/openrisc/boards/generic/config.h
> deleted file mode 100644
> index 2d836d0063ed..000000000000
> --- a/arch/openrisc/boards/generic/config.h
> +++ /dev/null
> @@ -1,25 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -#ifndef _GENERIC_NAMES_H_
> -#define _GENERIC_NAMES_H_
> -
> -#define CONFIG_SYS_CLK_FREQ 50000000
> -
> -#define OPENRISC_TIMER_FREQ CONFIG_SYS_CLK_FREQ
> -
> -#define OPENRISC_SOPC_MEMORY_BASE 0x00000000
> -#define OPENRISC_SOPC_MEMORY_SIZE 0x02000000
> -
> -/* We reserve 512K for barebox */
> -#define BAREBOX_RESERVED_SIZE 0x80000
> -
> -/* Barebox will be at top of main memory */
> -#define OPENRISC_SOPC_TEXT_BASE (OPENRISC_SOPC_MEMORY_BASE + OPENRISC_SOPC_MEMORY_SIZE - BAREBOX_RESERVED_SIZE)
> -
> -/*
> -* TEXT_BASE is defined here because STACK_BASE definition
> -* in include/asm-generic/memory_layout.h uses this name
> -*/
> -
> -#define TEXT_BASE OPENRISC_SOPC_TEXT_BASE
> -
> -#endif
> diff --git a/arch/openrisc/cpu/barebox.lds.S b/arch/openrisc/cpu/barebox.lds.S
> index 26bb622edc27..3473181b0231 100644
> --- a/arch/openrisc/cpu/barebox.lds.S
> +++ b/arch/openrisc/cpu/barebox.lds.S
> @@ -13,7 +13,7 @@
> *
> */
>
> -#include <config.h>
> +#include <asm/config.h>
> #include <asm/barebox.lds.h>
>
> OUTPUT_FORMAT(BAREBOX_OUTPUT_FORMAT)
> diff --git a/arch/openrisc/cpu/start.S b/arch/openrisc/cpu/start.S
> index c448d3775f37..974eda212139 100644
> --- a/arch/openrisc/cpu/start.S
> +++ b/arch/openrisc/cpu/start.S
> @@ -14,7 +14,7 @@
> *
> */
>
> -#include <config.h>
> +#include <asm/config.h>
> #include <asm-generic/memory_layout.h>
> #include <asm/spr-defs.h>
>
> diff --git a/arch/openrisc/include/asm/config.h b/arch/openrisc/include/asm/config.h
> new file mode 100644
> index 000000000000..85d777db8f63
> --- /dev/null
> +++ b/arch/openrisc/include/asm/config.h
> @@ -0,0 +1,15 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef _OPENRISC_ASM_CONFIG_H_
> +#define _OPENRISC_ASM_CONFIG_H_
> +
> +#define CFG_SYS_CLK_FREQ 50000000
> +
> +#define OPENRISC_TIMER_FREQ CFG_SYS_CLK_FREQ
> +
> +#define OPENRISC_SOPC_MEMORY_BASE 0x00000000
> +#define OPENRISC_SOPC_MEMORY_SIZE 0x02000000
> +
> +/* We reserve 512K for barebox */
> +#define BAREBOX_RESERVED_SIZE 0x80000
> +
> +#endif
> diff --git a/arch/openrisc/lib/board.c b/arch/openrisc/lib/board.c
> index c6f34ed412d7..3556f3ecee31 100644
> --- a/arch/openrisc/lib/board.c
> +++ b/arch/openrisc/lib/board.c
> @@ -19,14 +19,15 @@
> #include <memory.h>
> #include <asm-generic/memory_layout.h>
> #include <debug_ll.h>
> +#include <asm/config.h>
>
> /* Called from assembly */
> void openrisc_start_barebox(void);
>
> void __noreturn openrisc_start_barebox(void)
> {
> - mem_malloc_init((void *)(OPENRISC_SOPC_TEXT_BASE - MALLOC_SIZE),
> - (void *)(OPENRISC_SOPC_TEXT_BASE - 1));
> + mem_malloc_init((void *)(TEXT_BASE - MALLOC_SIZE),
> + (void *)(TEXT_BASE - 1));
>
> putc_ll('>');
>
> diff --git a/arch/openrisc/lib/clock.c b/arch/openrisc/lib/clock.c
> index 651b163f13cb..a45de30f9426 100644
> --- a/arch/openrisc/lib/clock.c
> +++ b/arch/openrisc/lib/clock.c
> @@ -16,6 +16,7 @@
> #include <common.h>
> #include <clock.h>
> #include <init.h>
> +#include <asm/config.h>
> #include <asm/system.h>
> #include <asm/openrisc_exc.h>
>
> diff --git a/arch/openrisc/lib/cpuinfo.c b/arch/openrisc/lib/cpuinfo.c
> index d94178ea59de..4aa4d35bf91d 100644
> --- a/arch/openrisc/lib/cpuinfo.c
> +++ b/arch/openrisc/lib/cpuinfo.c
> @@ -16,6 +16,7 @@
>
> #include <common.h>
> #include <command.h>
> +#include <asm/config.h>
> #include <asm/system.h>
> #include <asm/cache.h>
> #include <asm/openrisc_exc.h>
> @@ -114,7 +115,7 @@ static int checkcpu(void)
> char impl_str[50];
>
> printf("CPU: OpenRISC-%x00 (rev %d) @ %d MHz\n",
> - ver, rev, (CONFIG_SYS_CLK_FREQ / 1000000));
> + ver, rev, (CFG_SYS_CLK_FREQ / 1000000));
>
> if (vr2) {
> cpu_implementation(vr2, impl_str);
> --
> 2.47.3
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-12-01 10:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-28 10:58 [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 1/4] openrisc: drop <config.h> usage Ahmad Fatoum
2025-12-01 10:11 ` Sascha Hauer
2025-11-28 10:58 ` [PATCH 2/4] ARM: " Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 3/4] ppc: " Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 4/4] treewide: drop last remnants of <config.h> Ahmad Fatoum
2025-12-01 10:11 ` [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox