mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 05/10] lds: introduce <asm/barebox.lds.h>
Date: Mon, 10 Oct 2022 08:11:17 +0200	[thread overview]
Message-ID: <20221010061122.2084009-6-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20221010061122.2084009-1-a.fatoum@pengutronix.de>

We have a separate linker script for each architecture and one more for
PBL if supported. All linker scripts include <asm-generic/barebox.lds.h>.

In future, we may want to use a linker script common to more than one
architecture. Prepare for this by having each architecture define a
<asm/barebox.lds.h>. Currently, these files contain little more than
1-2 #include directives, but this will change in later commits.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/include/asm/barebox.lds.h       | 7 +++++++
 arch/arm/lib/pbl.lds.S                   | 2 +-
 arch/arm/lib32/barebox.lds.S             | 2 +-
 arch/arm/lib64/barebox.lds.S             | 2 +-
 arch/kvx/cpu/barebox.lds.S               | 2 +-
 arch/kvx/include/asm/barebox.lds.h       | 3 +++
 arch/mips/include/asm/barebox.lds.h      | 3 +++
 arch/mips/lib/barebox.lds.S              | 2 +-
 arch/mips/lib/pbl.lds.S                  | 2 +-
 arch/mips/pbl/zbarebox.lds.S             | 2 +-
 arch/openrisc/cpu/barebox.lds.S          | 2 +-
 arch/openrisc/include/asm/barebox.lds.h  | 3 +++
 arch/powerpc/boards/pcm030/barebox.lds.S | 2 +-
 arch/powerpc/include/asm/barebox.lds.h   | 3 +++
 arch/powerpc/mach-mpc85xx/barebox.lds.S  | 2 +-
 arch/riscv/include/asm/barebox.lds.h     | 3 +++
 arch/riscv/lib/barebox.lds.S             | 2 +-
 arch/riscv/lib/pbl.lds.S                 | 2 +-
 arch/sandbox/board/barebox.lds.S         | 2 +-
 arch/sandbox/include/asm/barebox.lds.h   | 3 +++
 arch/x86/include/asm/barebox.lds.h       | 3 +++
 arch/x86/mach-efi/elf_ia32_efi.lds.S     | 2 +-
 arch/x86/mach-efi/elf_x86_64_efi.lds.S   | 2 +-
 common/module.lds.S                      | 2 +-
 include/asm-generic/barebox.lds.h        | 4 ----
 lib/logo/Makefile                        | 2 +-
 scripts/Makefile.lib                     | 4 ++--
 scripts/gen-dtb-s                        | 2 +-
 28 files changed, 48 insertions(+), 24 deletions(-)
 create mode 100644 arch/arm/include/asm/barebox.lds.h
 create mode 100644 arch/kvx/include/asm/barebox.lds.h
 create mode 100644 arch/mips/include/asm/barebox.lds.h
 create mode 100644 arch/openrisc/include/asm/barebox.lds.h
 create mode 100644 arch/powerpc/include/asm/barebox.lds.h
 create mode 100644 arch/riscv/include/asm/barebox.lds.h
 create mode 100644 arch/sandbox/include/asm/barebox.lds.h
 create mode 100644 arch/x86/include/asm/barebox.lds.h

diff --git a/arch/arm/include/asm/barebox.lds.h b/arch/arm/include/asm/barebox.lds.h
new file mode 100644
index 000000000000..327beaf4bfb8
--- /dev/null
+++ b/arch/arm/include/asm/barebox.lds.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#if defined CONFIG_ARCH_EP93XX
+#include <mach/barebox.lds.h>
+#endif
+
+#include <asm-generic/barebox.lds.h>
diff --git a/arch/arm/lib/pbl.lds.S b/arch/arm/lib/pbl.lds.S
index d48f27bc43b5..cc4b12f44893 100644
--- a/arch/arm/lib/pbl.lds.S
+++ b/arch/arm/lib/pbl.lds.S
@@ -2,7 +2,7 @@
 /* SPDX-FileCopyrightText: 2012 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix */
 
 #include <linux/sizes.h>
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 #include <asm-generic/memory_layout.h>
 
 #ifdef CONFIG_PBL_RELOCATABLE
diff --git a/arch/arm/lib32/barebox.lds.S b/arch/arm/lib32/barebox.lds.S
index 77a5c525c5ae..2bf66657a367 100644
--- a/arch/arm/lib32/barebox.lds.S
+++ b/arch/arm/lib32/barebox.lds.S
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 /* SPDX-FileCopyrightText: 2000-2004 Wolfgang Denk <wd@denx.de>, DENX Software Engineering */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 #include <asm/secure.h>
 
 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
diff --git a/arch/arm/lib64/barebox.lds.S b/arch/arm/lib64/barebox.lds.S
index 2ebaabef0f1d..c1069c896f27 100644
--- a/arch/arm/lib64/barebox.lds.S
+++ b/arch/arm/lib64/barebox.lds.S
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 /* SPDX-FileCopyrightText: 2000-2004 Wolfgang Denk <wd@denx.de>, DENX Software Engineering */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
 OUTPUT_ARCH(aarch64)
diff --git a/arch/kvx/cpu/barebox.lds.S b/arch/kvx/cpu/barebox.lds.S
index 77ebaf0aeac0..a22998190f78 100644
--- a/arch/kvx/cpu/barebox.lds.S
+++ b/arch/kvx/cpu/barebox.lds.S
@@ -5,7 +5,7 @@
 
 #include <asm/common.h>
 #include <asm/sys_arch.h>
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 OUTPUT_FORMAT("elf64-kvx")
 OUTPUT_ARCH("kvx:kv3-1:64")
diff --git a/arch/kvx/include/asm/barebox.lds.h b/arch/kvx/include/asm/barebox.lds.h
new file mode 100644
index 000000000000..540d740959ff
--- /dev/null
+++ b/arch/kvx/include/asm/barebox.lds.h
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm-generic/barebox.lds.h>
diff --git a/arch/mips/include/asm/barebox.lds.h b/arch/mips/include/asm/barebox.lds.h
new file mode 100644
index 000000000000..540d740959ff
--- /dev/null
+++ b/arch/mips/include/asm/barebox.lds.h
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm-generic/barebox.lds.h>
diff --git a/arch/mips/lib/barebox.lds.S b/arch/mips/lib/barebox.lds.S
index c954df41f3cc..87668c7a7320 100644
--- a/arch/mips/lib/barebox.lds.S
+++ b/arch/mips/lib/barebox.lds.S
@@ -4,7 +4,7 @@
  */
 
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 OUTPUT_ARCH(mips)
 ENTRY(_start)
diff --git a/arch/mips/lib/pbl.lds.S b/arch/mips/lib/pbl.lds.S
index 413f24b9ab05..521333df0be0 100644
--- a/arch/mips/lib/pbl.lds.S
+++ b/arch/mips/lib/pbl.lds.S
@@ -4,7 +4,7 @@
  * (C) Copyright 2012 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
  */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 #include <asm-generic/memory_layout.h>
 #include <linux/sizes.h>
 
diff --git a/arch/mips/pbl/zbarebox.lds.S b/arch/mips/pbl/zbarebox.lds.S
index 04b5b8680f27..2d82065bce08 100644
--- a/arch/mips/pbl/zbarebox.lds.S
+++ b/arch/mips/pbl/zbarebox.lds.S
@@ -3,7 +3,7 @@
  * (C) Copyright 2012 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
  */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 #include <asm-generic/memory_layout.h>
 
 OUTPUT_ARCH("mips")
diff --git a/arch/openrisc/cpu/barebox.lds.S b/arch/openrisc/cpu/barebox.lds.S
index 45c5f2553951..f6999a113438 100644
--- a/arch/openrisc/cpu/barebox.lds.S
+++ b/arch/openrisc/cpu/barebox.lds.S
@@ -14,7 +14,7 @@
  */
 
 #include <config.h>
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 OUTPUT_FORMAT("elf32-or1k", "elf32-or1k", "elf32-or1k")
 ENTRY(__reset)
diff --git a/arch/openrisc/include/asm/barebox.lds.h b/arch/openrisc/include/asm/barebox.lds.h
new file mode 100644
index 000000000000..540d740959ff
--- /dev/null
+++ b/arch/openrisc/include/asm/barebox.lds.h
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm-generic/barebox.lds.h>
diff --git a/arch/powerpc/boards/pcm030/barebox.lds.S b/arch/powerpc/boards/pcm030/barebox.lds.S
index 2536db745cf8..b90e88058113 100644
--- a/arch/powerpc/boards/pcm030/barebox.lds.S
+++ b/arch/powerpc/boards/pcm030/barebox.lds.S
@@ -14,7 +14,7 @@
  *
  */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 OUTPUT_ARCH("powerpc")
 ENTRY(_start)
diff --git a/arch/powerpc/include/asm/barebox.lds.h b/arch/powerpc/include/asm/barebox.lds.h
new file mode 100644
index 000000000000..540d740959ff
--- /dev/null
+++ b/arch/powerpc/include/asm/barebox.lds.h
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm-generic/barebox.lds.h>
diff --git a/arch/powerpc/mach-mpc85xx/barebox.lds.S b/arch/powerpc/mach-mpc85xx/barebox.lds.S
index 2b73fda4e6b8..253fd3735e48 100644
--- a/arch/powerpc/mach-mpc85xx/barebox.lds.S
+++ b/arch/powerpc/mach-mpc85xx/barebox.lds.S
@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 #ifdef CONFIG_RESET_VECTOR_ADDRESS
 #define RESET_VECTOR_ADDRESS    CONFIG_RESET_VECTOR_ADDRESS
diff --git a/arch/riscv/include/asm/barebox.lds.h b/arch/riscv/include/asm/barebox.lds.h
new file mode 100644
index 000000000000..540d740959ff
--- /dev/null
+++ b/arch/riscv/include/asm/barebox.lds.h
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm-generic/barebox.lds.h>
diff --git a/arch/riscv/lib/barebox.lds.S b/arch/riscv/lib/barebox.lds.S
index 7856b57a5220..5de32a47e7c0 100644
--- a/arch/riscv/lib/barebox.lds.S
+++ b/arch/riscv/lib/barebox.lds.S
@@ -11,7 +11,7 @@
  *
  */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 OUTPUT_ARCH(riscv)
 ENTRY(start)
diff --git a/arch/riscv/lib/pbl.lds.S b/arch/riscv/lib/pbl.lds.S
index ccf64fc6d3aa..ba59024ae037 100644
--- a/arch/riscv/lib/pbl.lds.S
+++ b/arch/riscv/lib/pbl.lds.S
@@ -2,7 +2,7 @@
 /* SPDX-FileCopyrightText: 2012 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix */
 
 #include <linux/sizes.h>
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 #include <asm-generic/memory_layout.h>
 
 OUTPUT_ARCH(riscv)
diff --git a/arch/sandbox/board/barebox.lds.S b/arch/sandbox/board/barebox.lds.S
index 84d085a25911..ab2801f3d207 100644
--- a/arch/sandbox/board/barebox.lds.S
+++ b/arch/sandbox/board/barebox.lds.S
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 SECTIONS
 {
diff --git a/arch/sandbox/include/asm/barebox.lds.h b/arch/sandbox/include/asm/barebox.lds.h
new file mode 100644
index 000000000000..540d740959ff
--- /dev/null
+++ b/arch/sandbox/include/asm/barebox.lds.h
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm-generic/barebox.lds.h>
diff --git a/arch/x86/include/asm/barebox.lds.h b/arch/x86/include/asm/barebox.lds.h
new file mode 100644
index 000000000000..540d740959ff
--- /dev/null
+++ b/arch/x86/include/asm/barebox.lds.h
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm-generic/barebox.lds.h>
diff --git a/arch/x86/mach-efi/elf_ia32_efi.lds.S b/arch/x86/mach-efi/elf_ia32_efi.lds.S
index ac89fd89a4d3..14ae702e5049 100644
--- a/arch/x86/mach-efi/elf_ia32_efi.lds.S
+++ b/arch/x86/mach-efi/elf_ia32_efi.lds.S
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
 OUTPUT_ARCH(i386)
diff --git a/arch/x86/mach-efi/elf_x86_64_efi.lds.S b/arch/x86/mach-efi/elf_x86_64_efi.lds.S
index b620ba5b3797..8c666235ce1a 100644
--- a/arch/x86/mach-efi/elf_x86_64_efi.lds.S
+++ b/arch/x86/mach-efi/elf_x86_64_efi.lds.S
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 /* Same as elf_x86_64_fbsd_efi.lds, except for OUTPUT_FORMAT below - KEEP IN SYNC */
 
diff --git a/common/module.lds.S b/common/module.lds.S
index 76f3b6d1bba1..b2d685670bb0 100644
--- a/common/module.lds.S
+++ b/common/module.lds.S
@@ -15,7 +15,7 @@
  *
  */
 
-#include <asm-generic/barebox.lds.h>
+#include <asm/barebox.lds.h>
 
 SECTIONS
 {
diff --git a/include/asm-generic/barebox.lds.h b/include/asm-generic/barebox.lds.h
index 48c10b173852..d3736ebaed59 100644
--- a/include/asm-generic/barebox.lds.h
+++ b/include/asm-generic/barebox.lds.h
@@ -8,10 +8,6 @@
 #define STRUCT_ALIGNMENT 32
 #define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT)
 
-#if defined CONFIG_ARCH_EP93XX
-#include <mach/barebox.lds.h>
-#endif
-
 #ifndef PRE_IMAGE
 #define PRE_IMAGE
 #endif
diff --git a/lib/logo/Makefile b/lib/logo/Makefile
index d076a19a7657..382701fb365c 100644
--- a/lib/logo/Makefile
+++ b/lib/logo/Makefile
@@ -25,7 +25,7 @@ obj-$(CONFIG_BAREBOX_LOGO) += logo.o
 quiet_cmd_logo_S = LOGO.S  $@
 cmd_logo_S =							\
 (								\
-	echo '\#include <asm-generic/barebox.lds.h>';		\
+	echo '\#include <asm/barebox.lds.h>';			\
 	echo '.section .bblogo.rodata.$(subst -,_,$(*F)),"a"';	\
 	echo '.balign STRUCT_ALIGNMENT';			\
 	echo '.global __bblogo_$(subst -,_,$(*F))_start';	\
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 16308497b845..85d18f07a2b6 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -379,7 +379,7 @@ dtc-tmp = $(subst $(comma),_,$(dot-target).dts)
 quiet_cmd_env_S = ENV.S   $@
 cmd_env_S =							\
 (								\
-	echo '\#include <asm-generic/barebox.lds.h>';		\
+	echo '\#include <asm/barebox.lds.h>';			\
 	echo '.section .bbenv.rodata.$(subst -,_,$(*F)),"a"';	\
 	echo '.balign STRUCT_ALIGNMENT';			\
 	echo '.global __bbenv_$(subst -,_,$(*F))_start';	\
@@ -528,7 +528,7 @@ quiet_cmd_check_file_size = CHKFILESIZE $2
 quiet_cmd_imximage__S_dcd= DCD_S   $@
 cmd_imximage_S_dcd=						\
 (								\
-	echo '\#include <asm-generic/barebox.lds.h>';		\
+	echo '\#include <asm/barebox.lds.h>';			\
 	echo '.balign STRUCT_ALIGNMENT';			\
 	echo '.global $(subst -,_,$(*F))_start';		\
 	echo '$(subst -,_,$(*F))_start:';			\
diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s
index eadf4d76f313..c5c46a4d8675 100755
--- a/scripts/gen-dtb-s
+++ b/scripts/gen-dtb-s
@@ -4,7 +4,7 @@ name=$1
 dtb=$2
 imd=$3
 
-echo "#include <asm-generic/barebox.lds.h>"
+echo "#include <asm/barebox.lds.h>"
 
 le32() {
 	printf ".byte 0x%02x, 0x%02x, 0x%02x, 0x%02x\n" \
-- 
2.30.2




  parent reply	other threads:[~2022-10-10  6:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10  6:11 [PATCH 00/10] treewide: misc cleanup for efiloader prep Ahmad Fatoum
2022-10-10  6:11 ` [PATCH 01/10] block: have cdev_get_block_device accept const cdev Ahmad Fatoum
2022-10-10  6:11 ` [PATCH 02/10] treewide: replace errno_str() with %m printf format specifier Ahmad Fatoum
2022-10-10  6:11 ` [PATCH 03/10] common: misc: remove now unused errno_str Ahmad Fatoum
2022-10-10  6:11 ` [PATCH 04/10] driver: don't crash when dev_name/dev_id is called with NULL dev Ahmad Fatoum
2022-10-10  6:11 ` Ahmad Fatoum [this message]
2022-10-10  6:11 ` [PATCH 06/10] lds: move OUTPUT_FORMAT/ARCH definition into header Ahmad Fatoum
2022-10-10  6:11 ` [PATCH 07/10] ARM: lds: define and use BAREBOX_RELOCATION_TABLE Ahmad Fatoum
2022-10-10  6:11 ` [PATCH 08/10] lib: random: add hwrng_get_crypto_bytes Ahmad Fatoum
2022-10-10  6:11 ` [PATCH 09/10] common: bootm: factor out FIT parsing code into bootm_open_bit Ahmad Fatoum
2022-10-10  6:11 ` [PATCH 10/10] common: bootm: use switch-case Ahmad Fatoum
2022-10-11 14:46 ` [PATCH 00/10] treewide: misc cleanup for efiloader prep Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221010061122.2084009-6-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox