mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/8] mips: remove bare_init
@ 2020-02-18 15:39 Sascha Hauer
  2020-02-18 15:39 ` [PATCH 2/8] nios2: " Sascha Hauer
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Sascha Hauer @ 2020-02-18 15:39 UTC (permalink / raw)
  To: Barebox List

bare_init is only meaningful when we initially only have parts of
the barebox binary available. This is not the case on MIPS, so remove
the unnecessary __bare_init attributes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/mips/boot/main_entry.c  | 2 +-
 arch/mips/lib/barebox.lds.S  | 3 ---
 arch/mips/lib/pbl.lds.S      | 3 ---
 arch/mips/pbl/zbarebox.lds.S | 3 ---
 4 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/arch/mips/boot/main_entry.c b/arch/mips/boot/main_entry.c
index 2c18bc81c3..dd8ab6a5b3 100644
--- a/arch/mips/boot/main_entry.c
+++ b/arch/mips/boot/main_entry.c
@@ -69,7 +69,7 @@ extern unsigned long mips_stack_top;
  *
  * @note The C environment isn't initialized yet
  */
-void __bare_init main_entry(void *fdt, u32 fdt_size)
+void main_entry(void *fdt, u32 fdt_size)
 {
 	unsigned long malloc_start, malloc_end;
 	/* clear the BSS first */
diff --git a/arch/mips/lib/barebox.lds.S b/arch/mips/lib/barebox.lds.S
index c954df41f3..5992946af5 100644
--- a/arch/mips/lib/barebox.lds.S
+++ b/arch/mips/lib/barebox.lds.S
@@ -20,9 +20,6 @@ SECTIONS
 		_stext = .;
 		_text = .;
 		*(.text_entry*)
-		__bare_init_start = .;
-		*(.text_bare_init*)
-		__bare_init_end = .;
 		*(.text*)
 	}
 	BAREBOX_BARE_INIT_SIZE
diff --git a/arch/mips/lib/pbl.lds.S b/arch/mips/lib/pbl.lds.S
index 75069b0c50..64cbd1f23f 100644
--- a/arch/mips/lib/pbl.lds.S
+++ b/arch/mips/lib/pbl.lds.S
@@ -23,9 +23,6 @@ SECTIONS
 		_stext = .;
 		_text = .;
 		*(.text_head_entry*)
-		__bare_init_start = .;
-		*(.text_bare_init*)
-		__bare_init_end = .;
 		*(.text*)
 	}
 
diff --git a/arch/mips/pbl/zbarebox.lds.S b/arch/mips/pbl/zbarebox.lds.S
index 04b5b8680f..dbea020d3f 100644
--- a/arch/mips/pbl/zbarebox.lds.S
+++ b/arch/mips/pbl/zbarebox.lds.S
@@ -20,9 +20,6 @@ SECTIONS
 		_stext = .;
 		_text = .;
 		*(.text_head_entry*)
-		__bare_init_start = .;
-		*(.text_bare_init*)
-		__bare_init_end = .;
 		*(.text*)
 	}
 
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/8] nios2: remove bare_init
  2020-02-18 15:39 [PATCH 1/8] mips: remove bare_init Sascha Hauer
@ 2020-02-18 15:39 ` Sascha Hauer
  2020-02-18 15:39 ` [PATCH 3/8] ARM: arm64: " Sascha Hauer
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2020-02-18 15:39 UTC (permalink / raw)
  To: Barebox List

bare_init is only meaningful when we initially only have parts of
the barebox binary available. This is not the case on nios2, so remove
the unnecessary __bare_init attributes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/nios2/cpu/barebox.lds.S | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/nios2/cpu/barebox.lds.S b/arch/nios2/cpu/barebox.lds.S
index 8d82aa59e7..426f072f74 100644
--- a/arch/nios2/cpu/barebox.lds.S
+++ b/arch/nios2/cpu/barebox.lds.S
@@ -40,9 +40,7 @@ SECTIONS
 		_stext = .;
 		__text = .;
 		_text = .;
-		__bare_init_start = .;
 		*(.text_entry)
-		__bare_init_end = .;
 		*(.text)
 	}
 	BAREBOX_BARE_INIT_SIZE
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/8] ARM: arm64: remove bare_init
  2020-02-18 15:39 [PATCH 1/8] mips: remove bare_init Sascha Hauer
  2020-02-18 15:39 ` [PATCH 2/8] nios2: " Sascha Hauer
@ 2020-02-18 15:39 ` Sascha Hauer
  2020-02-18 15:39 ` [PATCH 4/8] x86: " Sascha Hauer
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2020-02-18 15:39 UTC (permalink / raw)
  To: Barebox List

bare_init is only meaningful when we initially only have parts of
the barebox binary available. This is not the case on ARM64, so remove
the unnecessary __bare_init attributes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/lowlevel_64.S      | 2 +-
 arch/arm/lib64/barebox.lds.S    | 3 ---
 arch/arm/lib64/runtime-offset.S | 2 +-
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/lowlevel_64.S b/arch/arm/cpu/lowlevel_64.S
index 6a23132ed1..4a3ab7e683 100644
--- a/arch/arm/cpu/lowlevel_64.S
+++ b/arch/arm/cpu/lowlevel_64.S
@@ -3,7 +3,7 @@
 #include <asm/system.h>
 #include <asm/assembler64.h>
 
-.section ".text_bare_init_","ax"
+.section ".text.arm_cpu_lowlevel_init","ax"
 ENTRY(arm_cpu_lowlevel_init)
 	switch_el x1, 3f, 2f, 1f
 
diff --git a/arch/arm/lib64/barebox.lds.S b/arch/arm/lib64/barebox.lds.S
index cf6ef18895..cfafa5311c 100644
--- a/arch/arm/lib64/barebox.lds.S
+++ b/arch/arm/lib64/barebox.lds.S
@@ -42,9 +42,6 @@ SECTIONS
 	{
 		_stext = .;
 		*(.text_entry*)
-		__bare_init_start = .;
-		*(.text_bare_init*)
-		__bare_init_end = .;
 		__exceptions_start = .;
 		KEEP(*(.text_exceptions*))
 		__exceptions_stop = .;
diff --git a/arch/arm/lib64/runtime-offset.S b/arch/arm/lib64/runtime-offset.S
index 5e5ab9a8d1..d6f0c10c46 100644
--- a/arch/arm/lib64/runtime-offset.S
+++ b/arch/arm/lib64/runtime-offset.S
@@ -1,7 +1,7 @@
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 
-.section ".text_bare_init","ax"
+.section ".text.get_runtime_offset","ax"
 
 /*
  * Get the offset between the link address and the address
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/8] x86: remove bare_init
  2020-02-18 15:39 [PATCH 1/8] mips: remove bare_init Sascha Hauer
  2020-02-18 15:39 ` [PATCH 2/8] nios2: " Sascha Hauer
  2020-02-18 15:39 ` [PATCH 3/8] ARM: arm64: " Sascha Hauer
@ 2020-02-18 15:39 ` Sascha Hauer
  2020-02-18 15:39 ` [PATCH 5/8] ARM: remove unnecessary __bare_init attributes Sascha Hauer
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2020-02-18 15:39 UTC (permalink / raw)
  To: Barebox List

bare_init is only meaningful when we initially only have parts of
the barebox binary available. This is not the case on x86, so remove
the unnecessary __bare_init attributes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/x86/lib/barebox.lds.S | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S
index 71251642dc..722953f7e4 100644
--- a/arch/x86/lib/barebox.lds.S
+++ b/arch/x86/lib/barebox.lds.S
@@ -143,9 +143,6 @@ SECTIONS
 		_stext = .;
 		_text = .;
 		*(.text_entry*)
-		__bare_init_start = .;
-		*(.text_bare_init*)
-		__bare_init_end = .;
 		*(.text*)
 		. = ALIGN(4);
 		*(.rodata*)
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/8] ARM: remove unnecessary __bare_init attributes
  2020-02-18 15:39 [PATCH 1/8] mips: remove bare_init Sascha Hauer
                   ` (2 preceding siblings ...)
  2020-02-18 15:39 ` [PATCH 4/8] x86: " Sascha Hauer
@ 2020-02-18 15:39 ` Sascha Hauer
  2020-02-18 15:39 ` [PATCH 6/8] ARM: Use function specific sections in assembly functions Sascha Hauer
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2020-02-18 15:39 UTC (permalink / raw)
  To: Barebox List

__bare_init is only meaningful when we initially only have parts of
the barebox image available. This is not the case on most boards
__bare_init is used. Remove it where it's not necessary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 Documentation/boards/at91.rst                      | 2 +-
 arch/arm/boards/animeo_ip/lowlevel.c               | 2 +-
 arch/arm/boards/archosg9/lowlevel.c                | 2 +-
 arch/arm/boards/at91rm9200ek/lowlevel.c            | 2 +-
 arch/arm/boards/at91sam9260ek/lowlevel.c           | 2 +-
 arch/arm/boards/at91sam9261ek/lowlevel_init.c      | 6 +++---
 arch/arm/boards/at91sam9263ek/lowlevel_init.c      | 4 ++--
 arch/arm/boards/at91sam9m10g45ek/lowlevel.c        | 2 +-
 arch/arm/boards/at91sam9m10ihd/lowlevel.c          | 2 +-
 arch/arm/boards/at91sam9n12ek/lowlevel.c           | 2 +-
 arch/arm/boards/clep7212/lowlevel.c                | 2 +-
 arch/arm/boards/dss11/lowlevel.c                   | 2 +-
 arch/arm/boards/haba-knx/lowlevel.c                | 2 +-
 arch/arm/boards/kindle3/lowlevel.c                 | 2 +-
 arch/arm/boards/lubbock/lowlevel.c                 | 2 +-
 arch/arm/boards/mainstone/lowlevel.c               | 2 +-
 arch/arm/boards/module-mb7707/lowlevel.c           | 2 +-
 arch/arm/boards/mx31moboard/lowlevel.c             | 2 +-
 arch/arm/boards/omap343xdsp/lowlevel.c             | 2 +-
 arch/arm/boards/omap3evm/lowlevel.c                | 2 +-
 arch/arm/boards/panda/lowlevel.c                   | 2 +-
 arch/arm/boards/phytec-phycard-omap3/lowlevel.c    | 2 +-
 arch/arm/boards/phytec-phycard-omap4/lowlevel.c    | 2 +-
 arch/arm/boards/phytec-phycore-omap4460/lowlevel.c | 2 +-
 arch/arm/boards/pm9261/lowlevel_init.c             | 6 +++---
 arch/arm/boards/pm9263/lowlevel_init.c             | 6 +++---
 arch/arm/boards/pm9g45/lowlevel.c                  | 2 +-
 arch/arm/boards/qil-a926x/lowlevel.c               | 2 +-
 arch/arm/boards/sama5d3_xplained/lowlevel.c        | 2 +-
 arch/arm/boards/sama5d3xek/lowlevel.c              | 2 +-
 arch/arm/boards/sama5d4_xplained/lowlevel.c        | 2 +-
 arch/arm/boards/sama5d4ek/lowlevel.c               | 2 +-
 arch/arm/boards/telit-evk-pro3/lowlevel.c          | 2 +-
 arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c     | 2 +-
 arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c     | 6 +++---
 arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c     | 2 +-
 arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c     | 6 +++---
 arch/arm/boards/virt2real/lowlevel.c               | 2 +-
 arch/arm/mach-clps711x/lowlevel.c                  | 2 +-
 39 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/Documentation/boards/at91.rst b/Documentation/boards/at91.rst
index f25cb01bb1..edf3141a85 100644
--- a/Documentation/boards/at91.rst
+++ b/Documentation/boards/at91.rst
@@ -39,7 +39,7 @@ This is a list of AT91 specific TODO items, listed in no particular order.
 
 .. code-block:: c
 
-  void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+  void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 
 
 This will unify the prototype for the reset vector for multi image and standalone images
diff --git a/arch/arm/boards/animeo_ip/lowlevel.c b/arch/arm/boards/animeo_ip/lowlevel.c
index 7f52f824df..f5439218db 100644
--- a/arch/arm/boards/animeo_ip/lowlevel.c
+++ b/arch/arm/boards/animeo_ip/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/archosg9/lowlevel.c b/arch/arm/boards/archosg9/lowlevel.c
index 2a93428462..729fa5e18c 100644
--- a/arch/arm/boards/archosg9/lowlevel.c
+++ b/arch/arm/boards/archosg9/lowlevel.c
@@ -66,7 +66,7 @@ static noinline void archosg9_init_lowlevel(void)
 	omap4_ddr_init(&ddr_regs_400_mhz_2cs, &core);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	omap4_save_bootinfo((void *)r0);
 
diff --git a/arch/arm/boards/at91rm9200ek/lowlevel.c b/arch/arm/boards/at91rm9200ek/lowlevel.c
index b132ccc084..521873e5b3 100644
--- a/arch/arm/boards/at91rm9200ek/lowlevel.c
+++ b/arch/arm/boards/at91rm9200ek/lowlevel.c
@@ -21,7 +21,7 @@ void static inline access_sdram(void)
 	writel(0x00000000, AT91_CHIPSELECT_1);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	u32 r;
 	int i;
diff --git a/arch/arm/boards/at91sam9260ek/lowlevel.c b/arch/arm/boards/at91sam9260ek/lowlevel.c
index 7f52f824df..f5439218db 100644
--- a/arch/arm/boards/at91sam9260ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9260ek/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9261ek/lowlevel_init.c b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
index bb9b905c65..af63dfd7f4 100644
--- a/arch/arm/boards/at91sam9261ek/lowlevel_init.c
+++ b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
@@ -19,7 +19,7 @@
 #define MASTER_PLL_DIV		1
 #endif
 
-static void __bare_init at91sam9261ek_board_config(struct at91sam926x_board_cfg *cfg)
+static void at91sam9261ek_board_config(struct at91sam926x_board_cfg *cfg)
 {
 	/* Disable Watchdog */
 	cfg->wdt_mr =
@@ -101,7 +101,7 @@ static void __bare_init at91sam9261ek_board_config(struct at91sam926x_board_cfg
 		AT91_RSTC_RSTTYP_WATCHDOG;
 }
 
-static void __bare_init at91sam9261ek_init(void)
+static void at91sam9261ek_init(void)
 {
 	struct at91sam926x_board_cfg cfg;
 
@@ -117,7 +117,7 @@ static void __bare_init at91sam9261ek_init(void)
 	                  NULL);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9263ek/lowlevel_init.c b/arch/arm/boards/at91sam9263ek/lowlevel_init.c
index 0bf0e0fb4e..e2dc9c1abd 100644
--- a/arch/arm/boards/at91sam9263ek/lowlevel_init.c
+++ b/arch/arm/boards/at91sam9263ek/lowlevel_init.c
@@ -14,7 +14,7 @@
 #define MASTER_PLL_MUL		171
 #define MASTER_PLL_DIV		14
 
-static void __bare_init at91sam9263ek_board_config(struct at91sam926x_board_cfg *cfg)
+static void at91sam9263ek_board_config(struct at91sam926x_board_cfg *cfg)
 {
 	/* Disable Watchdog */
 	cfg->wdt_mr =
@@ -99,7 +99,7 @@ static void __bare_init at91sam9263ek_board_config(struct at91sam926x_board_cfg
 		AT91_RSTC_RSTTYP_WATCHDOG;
 }
 
-static void __bare_init at91sam9263ek_init(void *fdt)
+static void at91sam9263ek_init(void *fdt)
 {
 	struct at91sam926x_board_cfg cfg;
 
diff --git a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
index 0f3a035d1d..72ff3d4d54 100644
--- a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
@@ -13,7 +13,7 @@
 #include <mach/hardware.h>
 #include <mach/at91sam9_ddrsdr.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9m10ihd/lowlevel.c b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
index e07ff892cd..bbe5887bd5 100644
--- a/arch/arm/boards/at91sam9m10ihd/lowlevel.c
+++ b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9g45.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9n12ek/lowlevel.c b/arch/arm/boards/at91sam9n12ek/lowlevel.c
index 5bc18f8fca..1fbca843c5 100644
--- a/arch/arm/boards/at91sam9n12ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9n12ek/lowlevel.c
@@ -13,7 +13,7 @@
 #include <mach/at91sam9_ddrsdr.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/clep7212/lowlevel.c b/arch/arm/boards/clep7212/lowlevel.c
index 231329025b..4f5e440762 100644
--- a/arch/arm/boards/clep7212/lowlevel.c
+++ b/arch/arm/boards/clep7212/lowlevel.c
@@ -20,7 +20,7 @@
 # define CLPS711X_CPU_PLL_MULT	40
 #endif
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/dss11/lowlevel.c b/arch/arm/boards/dss11/lowlevel.c
index 7f52f824df..f5439218db 100644
--- a/arch/arm/boards/dss11/lowlevel.c
+++ b/arch/arm/boards/dss11/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/haba-knx/lowlevel.c b/arch/arm/boards/haba-knx/lowlevel.c
index 7f52f824df..f5439218db 100644
--- a/arch/arm/boards/haba-knx/lowlevel.c
+++ b/arch/arm/boards/haba-knx/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/kindle3/lowlevel.c b/arch/arm/boards/kindle3/lowlevel.c
index 19b95fc376..a2d2fdb2e1 100644
--- a/arch/arm/boards/kindle3/lowlevel.c
+++ b/arch/arm/boards/kindle3/lowlevel.c
@@ -31,7 +31,7 @@
 #include <asm-generic/memory_layout.h>
 #include <asm/system.h>
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	uint32_t r, s;
 	unsigned long ccm_base = MX35_CCM_BASE_ADDR;
diff --git a/arch/arm/boards/lubbock/lowlevel.c b/arch/arm/boards/lubbock/lowlevel.c
index abf9e7a98a..80c280bd6b 100644
--- a/arch/arm/boards/lubbock/lowlevel.c
+++ b/arch/arm/boards/lubbock/lowlevel.c
@@ -169,7 +169,7 @@ static inline void pxa2xx_dram_init(void)
 	}
 }
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	unsigned long pssr = PSPR;
 	unsigned long pc = get_pc();
diff --git a/arch/arm/boards/mainstone/lowlevel.c b/arch/arm/boards/mainstone/lowlevel.c
index 31f9d76513..13bc75e6c7 100644
--- a/arch/arm/boards/mainstone/lowlevel.c
+++ b/arch/arm/boards/mainstone/lowlevel.c
@@ -241,7 +241,7 @@ static inline void pxa2xx_dram_init(void)
 	}
 }
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	unsigned long pssr = PSPR;
 	unsigned long pc = get_pc();
diff --git a/arch/arm/boards/module-mb7707/lowlevel.c b/arch/arm/boards/module-mb7707/lowlevel.c
index fc102e26e1..229e357ffa 100644
--- a/arch/arm/boards/module-mb7707/lowlevel.c
+++ b/arch/arm/boards/module-mb7707/lowlevel.c
@@ -28,7 +28,7 @@
 
 extern char __dtb_module_mb7707_start[];
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/boards/mx31moboard/lowlevel.c b/arch/arm/boards/mx31moboard/lowlevel.c
index 307975d78c..b51bbff08f 100644
--- a/arch/arm/boards/mx31moboard/lowlevel.c
+++ b/arch/arm/boards/mx31moboard/lowlevel.c
@@ -102,7 +102,7 @@ static noinline __noreturn void mx31moboard_startup(void)
 
 }
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/omap343xdsp/lowlevel.c b/arch/arm/boards/omap343xdsp/lowlevel.c
index fb99ea9278..3ae7c00389 100644
--- a/arch/arm/boards/omap343xdsp/lowlevel.c
+++ b/arch/arm/boards/omap343xdsp/lowlevel.c
@@ -548,7 +548,7 @@ static int sdp343x_board_init(void)
 	return 0;
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	omap3_save_bootinfo((void *)r0);
 
diff --git a/arch/arm/boards/omap3evm/lowlevel.c b/arch/arm/boards/omap3evm/lowlevel.c
index e06ece2560..27992196c1 100644
--- a/arch/arm/boards/omap3evm/lowlevel.c
+++ b/arch/arm/boards/omap3evm/lowlevel.c
@@ -161,7 +161,7 @@ static int omap3_evm_board_init(void)
 	return 0;
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	omap3_save_bootinfo((void *)r0);
 
diff --git a/arch/arm/boards/panda/lowlevel.c b/arch/arm/boards/panda/lowlevel.c
index 006fb627dd..9c31615c34 100644
--- a/arch/arm/boards/panda/lowlevel.c
+++ b/arch/arm/boards/panda/lowlevel.c
@@ -79,7 +79,7 @@ static void noinline panda_init_lowlevel(void)
 		omap4460_scale_vcores(TPS62361_VSEL0_GPIO, 1210);
 }
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	omap4_save_bootinfo((void *)r0);
 
diff --git a/arch/arm/boards/phytec-phycard-omap3/lowlevel.c b/arch/arm/boards/phytec-phycard-omap3/lowlevel.c
index 54d8eaaddf..408c1407e6 100644
--- a/arch/arm/boards/phytec-phycard-omap3/lowlevel.c
+++ b/arch/arm/boards/phytec-phycard-omap3/lowlevel.c
@@ -252,7 +252,7 @@ static int pcaal1_board_init(void)
 	return 0;
 }
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	omap3_save_bootinfo((void *)r0);
 
diff --git a/arch/arm/boards/phytec-phycard-omap4/lowlevel.c b/arch/arm/boards/phytec-phycard-omap4/lowlevel.c
index c49c4ca841..f0b1e4e682 100644
--- a/arch/arm/boards/phytec-phycard-omap4/lowlevel.c
+++ b/arch/arm/boards/phytec-phycard-omap4/lowlevel.c
@@ -89,7 +89,7 @@ static noinline void pcaaxl2_init_lowlevel(void)
 	sr32(0x4A30a110, 2, 2, 0x3);  /* enable clocks */
 }
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	omap4_save_bootinfo((void *)r0);
 
diff --git a/arch/arm/boards/phytec-phycore-omap4460/lowlevel.c b/arch/arm/boards/phytec-phycore-omap4460/lowlevel.c
index 6511dae9d4..8397b449ee 100644
--- a/arch/arm/boards/phytec-phycore-omap4460/lowlevel.c
+++ b/arch/arm/boards/phytec-phycore-omap4460/lowlevel.c
@@ -139,7 +139,7 @@ static void noinline pcm049_init_lowlevel(void)
 	sr32(OMAP44XX_SCRM_ALTCLKSRC, 2, 2, 0x3);  /* enable clocks */
 }
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	omap4_save_bootinfo((void *)r0);
 
diff --git a/arch/arm/boards/pm9261/lowlevel_init.c b/arch/arm/boards/pm9261/lowlevel_init.c
index b18cd067b7..e3f47679e5 100644
--- a/arch/arm/boards/pm9261/lowlevel_init.c
+++ b/arch/arm/boards/pm9261/lowlevel_init.c
@@ -13,7 +13,7 @@
 #define MASTER_PLL_MUL		162
 #define MAIN_PLL_DIV		2
 
-static void __bare_init pm9261_board_config(struct at91sam926x_board_cfg *cfg)
+static void pm9261_board_config(struct at91sam926x_board_cfg *cfg)
 {
 	/* Disable Watchdog */
 	cfg->wdt_mr =
@@ -95,7 +95,7 @@ static void __bare_init pm9261_board_config(struct at91sam926x_board_cfg *cfg)
 		AT91_RSTC_RSTTYP_WATCHDOG;
 }
 
-static void __bare_init pm9261_init(void)
+static void pm9261_init(void)
 {
 	struct at91sam926x_board_cfg cfg;
 
@@ -111,7 +111,7 @@ static void __bare_init pm9261_init(void)
 	                  NULL);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9263/lowlevel_init.c b/arch/arm/boards/pm9263/lowlevel_init.c
index 8f44adee99..a8b55c73bd 100644
--- a/arch/arm/boards/pm9263/lowlevel_init.c
+++ b/arch/arm/boards/pm9263/lowlevel_init.c
@@ -15,7 +15,7 @@
 #define MASTER_PLL_MUL		65
 #define MAIN_PLL_DIV		2	/* 2 or 4 */
 
-static void __bare_init pm9263_board_config(struct at91sam926x_board_cfg *cfg)
+static void pm9263_board_config(struct at91sam926x_board_cfg *cfg)
 {
 	/* Disable Watchdog */
 	cfg->wdt_mr =
@@ -116,7 +116,7 @@ static void __bare_init pm9263_board_config(struct at91sam926x_board_cfg *cfg)
 		AT91_RSTC_RSTTYP_WATCHDOG;
 }
 
-static void __bare_init pm9263_board_init(void)
+static void pm9263_board_init(void)
 {
 	struct at91sam926x_board_cfg cfg;
 
@@ -132,7 +132,7 @@ static void __bare_init pm9263_board_init(void)
 	                  NULL);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9g45/lowlevel.c b/arch/arm/boards/pm9g45/lowlevel.c
index fc0bfe405b..e13d8c992a 100644
--- a/arch/arm/boards/pm9g45/lowlevel.c
+++ b/arch/arm/boards/pm9g45/lowlevel.c
@@ -13,7 +13,7 @@
 #include <mach/at91sam9_ddrsdr.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/qil-a926x/lowlevel.c b/arch/arm/boards/qil-a926x/lowlevel.c
index 7f52f824df..f5439218db 100644
--- a/arch/arm/boards/qil-a926x/lowlevel.c
+++ b/arch/arm/boards/qil-a926x/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/sama5d3_xplained/lowlevel.c b/arch/arm/boards/sama5d3_xplained/lowlevel.c
index 8653c48c69..3edc15f400 100644
--- a/arch/arm/boards/sama5d3_xplained/lowlevel.c
+++ b/arch/arm/boards/sama5d3_xplained/lowlevel.c
@@ -13,7 +13,7 @@
 #include <mach/at91sam9_ddrsdr.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/sama5d3xek/lowlevel.c b/arch/arm/boards/sama5d3xek/lowlevel.c
index 8653c48c69..3edc15f400 100644
--- a/arch/arm/boards/sama5d3xek/lowlevel.c
+++ b/arch/arm/boards/sama5d3xek/lowlevel.c
@@ -13,7 +13,7 @@
 #include <mach/at91sam9_ddrsdr.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/sama5d4_xplained/lowlevel.c b/arch/arm/boards/sama5d4_xplained/lowlevel.c
index 9a6a767e5f..26dfdad921 100644
--- a/arch/arm/boards/sama5d4_xplained/lowlevel.c
+++ b/arch/arm/boards/sama5d4_xplained/lowlevel.c
@@ -13,7 +13,7 @@
 #include <mach/at91sam9_ddrsdr.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/sama5d4ek/lowlevel.c b/arch/arm/boards/sama5d4ek/lowlevel.c
index 9a6a767e5f..26dfdad921 100644
--- a/arch/arm/boards/sama5d4ek/lowlevel.c
+++ b/arch/arm/boards/sama5d4ek/lowlevel.c
@@ -13,7 +13,7 @@
 #include <mach/at91sam9_ddrsdr.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/telit-evk-pro3/lowlevel.c b/arch/arm/boards/telit-evk-pro3/lowlevel.c
index 7f52f824df..f5439218db 100644
--- a/arch/arm/boards/telit-evk-pro3/lowlevel.c
+++ b/arch/arm/boards/telit-evk-pro3/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
index 7f52f824df..f5439218db 100644
--- a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
+++ b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
index 565ba438d2..278dacdb02 100644
--- a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
+++ b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
@@ -18,7 +18,7 @@
 #define MASTER_PLL_MUL		90
 #define MASTER_PLL_DIV		6
 
-static void __bare_init tny_a9263_board_config(struct at91sam926x_board_cfg *cfg)
+static void tny_a9263_board_config(struct at91sam926x_board_cfg *cfg)
 {
 	/* Disable Watchdog */
 	cfg->wdt_mr =
@@ -100,7 +100,7 @@ static void __bare_init tny_a9263_board_config(struct at91sam926x_board_cfg *cfg
 		AT91_RSTC_RSTTYP_WATCHDOG;
 }
 
-static void __bare_init tny_a9263_init(void)
+static void tny_a9263_init(void)
 {
 	struct at91sam926x_board_cfg cfg;
 
@@ -118,7 +118,7 @@ static void __bare_init tny_a9263_init(void)
 	                  NULL);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
index 7f52f824df..f5439218db 100644
--- a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
index 2ad88d7f22..188a08890f 100644
--- a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
@@ -20,7 +20,7 @@
 #endif
 #define MASTER_PLL_DIV		6
 
-static void __bare_init usb_a9263_board_config(struct at91sam926x_board_cfg *cfg)
+static void usb_a9263_board_config(struct at91sam926x_board_cfg *cfg)
 {
 	/* Disable Watchdog */
 	cfg->wdt_mr =
@@ -106,7 +106,7 @@ static void __bare_init usb_a9263_board_config(struct at91sam926x_board_cfg *cfg
 		AT91_RSTC_RSTTYP_WATCHDOG;
 }
 
-static void __bare_init usb_a9263_init(void)
+static void usb_a9263_init(void)
 {
 	struct at91sam926x_board_cfg cfg;
 
@@ -122,7 +122,7 @@ static void __bare_init usb_a9263_init(void)
 	                  NULL);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/virt2real/lowlevel.c b/arch/arm/boards/virt2real/lowlevel.c
index a72334bb0e..1a020fdcf1 100644
--- a/arch/arm/boards/virt2real/lowlevel.c
+++ b/arch/arm/boards/virt2real/lowlevel.c
@@ -28,7 +28,7 @@
 
 extern char __dtb_virt2real_start[];
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/mach-clps711x/lowlevel.c b/arch/arm/mach-clps711x/lowlevel.c
index 35b8b35e87..4d1fdb7e1c 100644
--- a/arch/arm/mach-clps711x/lowlevel.c
+++ b/arch/arm/mach-clps711x/lowlevel.c
@@ -17,7 +17,7 @@
 
 #include <mach/clps711x.h>
 
-void __naked __bare_init clps711x_barebox_entry(u32 pllmult, void *data)
+void __naked clps711x_barebox_entry(u32 pllmult, void *data)
 {
 	u32 cpu, bus;
 
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 6/8] ARM: Use function specific sections in assembly functions
  2020-02-18 15:39 [PATCH 1/8] mips: remove bare_init Sascha Hauer
                   ` (3 preceding siblings ...)
  2020-02-18 15:39 ` [PATCH 5/8] ARM: remove unnecessary __bare_init attributes Sascha Hauer
@ 2020-02-18 15:39 ` Sascha Hauer
  2020-02-18 15:39 ` [PATCH 7/8] Remove unused __BARE_INIT Sascha Hauer
  2020-02-18 15:39 ` [PATCH 8/8] Put bare_init functions in separate sections Sascha Hauer
  6 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2020-02-18 15:39 UTC (permalink / raw)
  To: Barebox List

To let the linker remove unused functions we have to make sure all
functions are in separate sections. Fix this for several forgotten
functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S    | 2 +-
 arch/arm/boards/freescale-mx21-ads/lowlevel_init.S | 2 +-
 arch/arm/boards/freescale-mx25-3ds/lowlevel_init.S | 2 +-
 arch/arm/boards/freescale-mx35-3ds/lowlevel_init.S | 2 +-
 arch/arm/cpu/lowlevel.S                            | 3 ++-
 arch/arm/lib32/runtime-offset.S                    | 2 +-
 6 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S b/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
index b3504832d7..308d38a3a6 100644
--- a/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
+++ b/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
@@ -69,7 +69,7 @@
 			MX27_ESDCTL_BASE_ADDR + IMX_ESDCTL0)
 .endm
 
-	.section ".text_bare_init","ax"
+	.section ".text_bare_init.barebox_arm_reset_vector","ax"
 
 .globl barebox_arm_reset_vector
 barebox_arm_reset_vector:
diff --git a/arch/arm/boards/freescale-mx21-ads/lowlevel_init.S b/arch/arm/boards/freescale-mx21-ads/lowlevel_init.S
index 16739b5577..3719f90733 100644
--- a/arch/arm/boards/freescale-mx21-ads/lowlevel_init.S
+++ b/arch/arm/boards/freescale-mx21-ads/lowlevel_init.S
@@ -19,7 +19,7 @@
 #include <mach/imx21-regs.h>
 #include <asm/barebox-arm-head.h>
 
-	.section ".text_bare_init","ax"
+	.section ".text_bare_init.barebox_arm_reset_vector","ax"
 
 .globl barebox_arm_reset_vector
 barebox_arm_reset_vector:
diff --git a/arch/arm/boards/freescale-mx25-3ds/lowlevel_init.S b/arch/arm/boards/freescale-mx25-3ds/lowlevel_init.S
index bf3830d8d6..5dbcfccca5 100644
--- a/arch/arm/boards/freescale-mx25-3ds/lowlevel_init.S
+++ b/arch/arm/boards/freescale-mx25-3ds/lowlevel_init.S
@@ -38,7 +38,7 @@
 #define MPCTL_PARAM_532_MX25 \
 	(IMX_PLL_PD(1) | IMX_PLL_MFD(0) | IMX_PLL_MFI(11) | IMX_PLL_MFN(1))
 
-.section ".text_bare_init","ax"
+.section ".text_bare_init.barebox_arm_reset_vector","ax"
 
 ARM_PPMRR:              .word   0x40000015
 L2CACHE_PARAM:          .word   0x00030024
diff --git a/arch/arm/boards/freescale-mx35-3ds/lowlevel_init.S b/arch/arm/boards/freescale-mx35-3ds/lowlevel_init.S
index 011de6dadf..e39cd8495e 100644
--- a/arch/arm/boards/freescale-mx35-3ds/lowlevel_init.S
+++ b/arch/arm/boards/freescale-mx35-3ds/lowlevel_init.S
@@ -40,7 +40,7 @@
 	ldr		r1,	=val;	\
 	strb		r1,	[r0];
 
-	.section ".text_bare_init","ax"
+	.section ".text_bare_init.barebox_arm_reset_vector","ax"
 
 ARM_PPMRR:		.word	0x40000015
 L2CACHE_PARAM:		.word	0x00030024
diff --git a/arch/arm/cpu/lowlevel.S b/arch/arm/cpu/lowlevel.S
index 203a4afc47..be1938de7f 100644
--- a/arch/arm/cpu/lowlevel.S
+++ b/arch/arm/cpu/lowlevel.S
@@ -3,7 +3,7 @@
 #include <asm/system.h>
 #include <asm/opcodes-virt.h>
 
-.section ".text_bare_init_","ax"
+.section ".text_bare_init.arm_cpu_lowlevel_init","ax"
 ENTRY(arm_cpu_lowlevel_init)
 	/* save lr, since it may be banked away with a processor mode change */
 	mov	r2, lr
@@ -78,6 +78,7 @@ THUMB(	orr	r12, r12, #PSR_T_BIT	)
 	mov	pc, r2
 ENDPROC(arm_cpu_lowlevel_init)
 
+.section ".text_bare_init.cortex_a7_lowlevel_init","ax"
 ENTRY(cortex_a7_lowlevel_init)
 	mrc	p15, 0, r12, c1, c0, 1
 	orr	r12, r12, #(1 << 6)	/* Enable SMP for cortex-a7 to make caches work */
diff --git a/arch/arm/lib32/runtime-offset.S b/arch/arm/lib32/runtime-offset.S
index f86ca7865e..7b1c4fb95c 100644
--- a/arch/arm/lib32/runtime-offset.S
+++ b/arch/arm/lib32/runtime-offset.S
@@ -1,7 +1,7 @@
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 
-.section ".text_bare_init","ax"
+.section ".text_bare_init.get_runtime_offset","ax"
 
 /*
  * Get the offset between the link address and the address
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 7/8] Remove unused __BARE_INIT
  2020-02-18 15:39 [PATCH 1/8] mips: remove bare_init Sascha Hauer
                   ` (4 preceding siblings ...)
  2020-02-18 15:39 ` [PATCH 6/8] ARM: Use function specific sections in assembly functions Sascha Hauer
@ 2020-02-18 15:39 ` Sascha Hauer
  2020-02-18 15:39 ` [PATCH 8/8] Put bare_init functions in separate sections Sascha Hauer
  6 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2020-02-18 15:39 UTC (permalink / raw)
  To: Barebox List

__BARE_INIT is only used in one place where it doesn't need to be.
Remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/hyp.S | 2 --
 include/init.h     | 3 ---
 2 files changed, 5 deletions(-)

diff --git a/arch/arm/cpu/hyp.S b/arch/arm/cpu/hyp.S
index 1314b56eab..423113c281 100644
--- a/arch/arm/cpu/hyp.S
+++ b/arch/arm/cpu/hyp.S
@@ -6,8 +6,6 @@
 .arch_extension sec
 .arch_extension virt
 
-__BARE_INIT
-
 .data
 	.align  2
 ENTRY(__boot_cpu_mode)
diff --git a/include/init.h b/include/init.h
index d1cef14b07..1c0e3f090a 100644
--- a/include/init.h
+++ b/include/init.h
@@ -11,9 +11,6 @@
 #define __exit
 #define __exitdata
 
-/* For assembly routines */
-#define __BARE_INIT	.section ".text_bare_init.text","ax"
-
 #ifndef __ASSEMBLY__
 typedef int (*initcall_t)(void);
 typedef void (*exitcall_t)(void);
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 8/8] Put bare_init functions in separate sections
  2020-02-18 15:39 [PATCH 1/8] mips: remove bare_init Sascha Hauer
                   ` (5 preceding siblings ...)
  2020-02-18 15:39 ` [PATCH 7/8] Remove unused __BARE_INIT Sascha Hauer
@ 2020-02-18 15:39 ` Sascha Hauer
  6 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2020-02-18 15:39 UTC (permalink / raw)
  To: Barebox List

Functions with the __bare_init attribute all go into the same section
which means the linker can't discard any unused functions. Replace
the __bare_init macro with a new BARE_INIT_FUNCTION() macro which adds
the function name to the section name. With this the linker can remove
unused functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/eukrea_cpuimx25/lowlevel.c    |  4 +++-
 arch/arm/boards/eukrea_cpuimx35/lowlevel.c    |  4 +++-
 .../arm/boards/friendlyarm-tiny210/lowlevel.c | 11 +++++----
 arch/arm/boards/guf-cupid/lowlevel.c          |  7 ++++--
 arch/arm/boards/guf-neso/lowlevel.c           |  4 +++-
 arch/arm/boards/karo-tx25/lowlevel.c          |  4 ++--
 .../boards/phytec-phycard-imx27/lowlevel.c    |  2 +-
 .../boards/phytec-phycore-imx27/lowlevel.c    |  2 +-
 .../boards/phytec-phycore-imx31/lowlevel.c    |  4 +++-
 .../boards/phytec-phycore-imx35/lowlevel.c    |  4 +++-
 arch/arm/mach-imx/external-nand-boot.c        | 23 ++++++++----------
 arch/arm/mach-samsung/lowlevel-s5pcxx.c       |  2 +-
 arch/arm/mach-samsung/mem-s5pcxx.c            | 24 +++++++++++--------
 include/init.h                                |  4 +++-
 14 files changed, 58 insertions(+), 41 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx25/lowlevel.c b/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
index 95159bbbb1..1a86f70f52 100644
--- a/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
+++ b/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
@@ -30,7 +30,9 @@
 #include <asm-generic/memory_layout.h>
 #include <asm/system.h>
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked BARE_INIT_FUNCTION(barebox_arm_reset_vector)(uint32_t r0,
+							  uint32_t r1,
+							  uint32_t r2)
 {
 	uint32_t r;
 	register uint32_t loops = 0x20000;
diff --git a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
index 4bb41b0f42..1a6ced3b12 100644
--- a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
+++ b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
@@ -30,7 +30,9 @@
 #include <asm-generic/memory_layout.h>
 #include <asm/system.h>
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked BARE_INIT_FUNCTION(barebox_arm_reset_vector)(uint32_t r0,
+							  uint32_t r1,
+							  uint32_t r2)
 {
 	uint32_t r, s;
 	unsigned long ccm_base = MX35_CCM_BASE_ADDR;
diff --git a/arch/arm/boards/friendlyarm-tiny210/lowlevel.c b/arch/arm/boards/friendlyarm-tiny210/lowlevel.c
index 17a7cf1591..a0e7e7dec3 100644
--- a/arch/arm/boards/friendlyarm-tiny210/lowlevel.c
+++ b/arch/arm/boards/friendlyarm-tiny210/lowlevel.c
@@ -30,7 +30,7 @@
 #define IRAM_CODE_BASE		0xD0020010
 
 /* Tiny210 has 4 leds numbered from 0 to 3 at GPJ2 */
-static inline void __bare_init debug_led(int led, bool state)
+static inline void BARE_INIT_FUNCTION(debug_led)(int led, bool state)
 {
 	uint32_t r;
 	/* GPJ2CON: mode 0001=output */
@@ -53,7 +53,7 @@ static inline void __bare_init debug_led(int led, bool state)
 #define ADDR_V210_SDMMC_BASE	0xD0037488
 #define ADDR_CopySDMMCtoMem	0xD0037F98
 
-static int __bare_init s5p_irom_load_mmc(void *dest, uint32_t start_block,
+static int BARE_INIT_FUNCTION(s5p_irom_load_mmc)(void *dest, uint32_t start_block,
 					 uint16_t block_count)
 {
 	typedef uint32_t (*func_t) (int32_t, uint32_t, uint16_t, uint32_t*, int8_t);
@@ -65,7 +65,7 @@ static int __bare_init s5p_irom_load_mmc(void *dest, uint32_t start_block,
 	return func(chan, start_block, block_count, (uint32_t*)dest, 0) ? 1 : 0;
 }
 
-static __bare_init __naked void jump_sdram(unsigned long offset)
+static __naked void BARE_INIT_FUNCTION(jump_sdram)(unsigned long offset)
 {
 	__asm__ __volatile__ (
 			"sub lr, lr, %0;"
@@ -73,13 +73,14 @@ static __bare_init __naked void jump_sdram(unsigned long offset)
 			);
 }
 
-static __bare_init bool load_stage2(void *dest, size_t size)
+static bool BARE_INIT_FUNCTION(load_stage2)(void *dest, size_t size)
 {
 	/* TODO add other ways to boot */
 	return s5p_irom_load_mmc(dest, 1, (size+ 511) / 512);
 }
 
-void __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void BARE_INIT_FUNCTION(barebox_arm_reset_vector)(uint32_t r0, uint32_t r1,
+						  uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/guf-cupid/lowlevel.c b/arch/arm/boards/guf-cupid/lowlevel.c
index 60dd567298..9d222a7c4c 100644
--- a/arch/arm/boards/guf-cupid/lowlevel.c
+++ b/arch/arm/boards/guf-cupid/lowlevel.c
@@ -37,7 +37,8 @@
 #define SDRAM_COMPARE_CONST1	0x55555555
 #define SDRAM_COMPARE_CONST2	0xaaaaaaaa
 
-static void __bare_init noinline setup_sdram(u32 memsize, u32 mode, u32 sdram_addr)
+static void noinline BARE_INIT_FUNCTION(setup_sdram)(u32 memsize, u32 mode,
+						     u32 sdram_addr)
 {
 	volatile int loop;
 	void *r9 = (void *)MX35_CSD0_BASE_ADDR;
@@ -158,7 +159,9 @@ static void __bare_init noinline setup_sdram(u32 memsize, u32 mode, u32 sdram_ad
 #define UNALIGNED_ACCESS_ENABLE
 #define LOW_INT_LATENCY_ENABLE
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked BARE_INIT_FUNCTION(barebox_arm_reset_vector)(uint32_t r0,
+							  uint32_t r1,
+							  uint32_t r2)
 {
 	void *iomuxc_base = (void *)MX35_IOMUXC_BASE_ADDR;
 	int i;
diff --git a/arch/arm/boards/guf-neso/lowlevel.c b/arch/arm/boards/guf-neso/lowlevel.c
index 3ae70eca30..47eb4ea1d5 100644
--- a/arch/arm/boards/guf-neso/lowlevel.c
+++ b/arch/arm/boards/guf-neso/lowlevel.c
@@ -32,7 +32,9 @@
 
 #define ESDCTL0_VAL (ESDCTL0_SDE | ESDCTL0_ROW13 | ESDCTL0_COL10)
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked BARE_INIT_FUNCTION(barebox_arm_reset_vector)(uint32_t r0,
+							  uint32_t r1,
+							  uint32_t r2)
 {
 	uint32_t r;
 	int i;
diff --git a/arch/arm/boards/karo-tx25/lowlevel.c b/arch/arm/boards/karo-tx25/lowlevel.c
index 6c34944f74..d44418a735 100644
--- a/arch/arm/boards/karo-tx25/lowlevel.c
+++ b/arch/arm/boards/karo-tx25/lowlevel.c
@@ -50,7 +50,7 @@ static inline void setup_uart(void)
 	putc_ll('>');
 }
 
-static inline void __bare_init  setup_sdram(uint32_t base, uint32_t esdctl,
+static inline void BARE_INIT_FUNCTION(setup_sdram)(uint32_t base, uint32_t esdctl,
 		uint32_t esdcfg)
 {
 	uint32_t esdctlreg = MX25_ESDCTL_BASE_ADDR + IMX_ESDCTL0;
@@ -91,7 +91,7 @@ static void __noreturn karo_tx25_load_nand(void)
 	karo_tx25_start();
 }
 
-static void __bare_init karo_tx25_common_init(void)
+static void BARE_INIT_FUNCTION(karo_tx25_common_init)(void)
 {
 	uint32_t r;
 
diff --git a/arch/arm/boards/phytec-phycard-imx27/lowlevel.c b/arch/arm/boards/phytec-phycard-imx27/lowlevel.c
index 40d39680fd..ff348cba14 100644
--- a/arch/arm/boards/phytec-phycard-imx27/lowlevel.c
+++ b/arch/arm/boards/phytec-phycard-imx27/lowlevel.c
@@ -94,7 +94,7 @@ static void __noreturn phytec_phycard_imx27_load_nand(void)
 	phytec_phycard_imx27_start();
 }
 
-static noinline void __bare_init phytec_phycard_imx27_common_init(int sdram)
+static noinline void BARE_INIT_FUNCTION(phytec_phycard_imx27_common_init)(int sdram)
 {
 	unsigned long r;
 
diff --git a/arch/arm/boards/phytec-phycore-imx27/lowlevel.c b/arch/arm/boards/phytec-phycore-imx27/lowlevel.c
index b3bebdb6df..780f0ca508 100644
--- a/arch/arm/boards/phytec-phycore-imx27/lowlevel.c
+++ b/arch/arm/boards/phytec-phycore-imx27/lowlevel.c
@@ -50,7 +50,7 @@ static void __noreturn phytec_phycore_imx27_load_nand(void)
 	phytec_phycore_imx27_start();
 }
 
-static void __bare_init noinline phytec_phycore_imx27_common_init(void)
+static void noinline BARE_INIT_FUNCTION(phytec_phycore_imx27_common_init)(void)
 {
 	uint32_t r;
 	int i;
diff --git a/arch/arm/boards/phytec-phycore-imx31/lowlevel.c b/arch/arm/boards/phytec-phycore-imx31/lowlevel.c
index 98e1e8711d..0c7bd6b5ed 100644
--- a/arch/arm/boards/phytec-phycore-imx31/lowlevel.c
+++ b/arch/arm/boards/phytec-phycore-imx31/lowlevel.c
@@ -31,7 +31,9 @@
 
 #define ESDCTL0_VAL (ESDCTL0_SDE | ESDCTL0_ROW13 | ESDCTL0_COL10)
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked BARE_INIT_FUNCTION(barebox_arm_reset_vector)(uint32_t r0,
+							  uint32_t r1,
+							  uint32_t r2)
 {
 	uint32_t r;
 	volatile int v;
diff --git a/arch/arm/boards/phytec-phycore-imx35/lowlevel.c b/arch/arm/boards/phytec-phycore-imx35/lowlevel.c
index 9768009be8..685dbe68d1 100644
--- a/arch/arm/boards/phytec-phycore-imx35/lowlevel.c
+++ b/arch/arm/boards/phytec-phycore-imx35/lowlevel.c
@@ -35,7 +35,9 @@
 #define CCM_PDR0_399	0x00011000
 #define CCM_PDR0_532	0x00001000
 
-void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+void __naked BARE_INIT_FUNCTION(barebox_arm_reset_vector)(uint32_t r0,
+							  uint32_t r1,
+							  uint32_t r2)
 {
 	uint32_t r, s;
 	unsigned long ccm_base = MX35_CCM_BASE_ADDR;
diff --git a/arch/arm/mach-imx/external-nand-boot.c b/arch/arm/mach-imx/external-nand-boot.c
index 123589c071..26db8ed142 100644
--- a/arch/arm/mach-imx/external-nand-boot.c
+++ b/arch/arm/mach-imx/external-nand-boot.c
@@ -28,11 +28,7 @@
 #include <mach/imx31-regs.h>
 #include <mach/imx35-regs.h>
 
-#define BARE_INIT_FUNCTION(name)  \
-	__section(.text_bare_init_##name) \
-		name
-
-static void __bare_init noinline imx_nandboot_wait_op_done(void __iomem *regs)
+static void BARE_INIT_FUNCTION(imx_nandboot_wait_op_done)(void __iomem *regs)
 {
 	u32 r;
 
@@ -53,7 +49,7 @@ static void __bare_init noinline imx_nandboot_wait_op_done(void __iomem *regs)
  *
  * @param       cmd     command for NAND Flash
  */
-static void __bare_init imx_nandboot_send_cmd(void *regs, u16 cmd)
+static void BARE_INIT_FUNCTION(imx_nandboot_send_cmd)(void *regs, u16 cmd)
 {
 	writew(cmd, regs + NFC_V1_V2_FLASH_CMD);
 	writew(NFC_CMD, regs + NFC_V1_V2_CONFIG2);
@@ -69,7 +65,7 @@ static void __bare_init imx_nandboot_send_cmd(void *regs, u16 cmd)
  * @param       addr    address to be written to NFC.
  * @param       islast  True if this is the last address cycle for command
  */
-static void __bare_init noinline imx_nandboot_send_addr(void *regs, u16 addr)
+static void noinline BARE_INIT_FUNCTION(imx_nandboot_send_addr)(void *regs, u16 addr)
 {
 	writew(addr, regs + NFC_V1_V2_FLASH_ADDR);
 	writew(NFC_ADDR, regs + NFC_V1_V2_CONFIG2);
@@ -78,7 +74,7 @@ static void __bare_init noinline imx_nandboot_send_addr(void *regs, u16 addr)
 	imx_nandboot_wait_op_done(regs);
 }
 
-static void __bare_init imx_nandboot_nfc_addr(void *regs, u32 offs, int pagesize_2k)
+static void BARE_INIT_FUNCTION(imx_nandboot_nfc_addr)(void *regs, u32 offs, int pagesize_2k)
 {
 	imx_nandboot_send_addr(regs, offs & 0xff);
 
@@ -95,7 +91,7 @@ static void __bare_init imx_nandboot_nfc_addr(void *regs, u32 offs, int pagesize
 	}
 }
 
-static void __bare_init imx_nandboot_send_page(void *regs, int v1,
+static void BARE_INIT_FUNCTION(imx_nandboot_send_page)(void *regs, int v1,
 		unsigned int ops, int pagesize_2k)
 {
 	int bufs, i;
@@ -116,7 +112,7 @@ static void __bare_init imx_nandboot_send_page(void *regs, int v1,
 	}
 }
 
-static void __bare_init __memcpy32(void *trg, const void *src, int size)
+static void BARE_INIT_FUNCTION(__memcpy32)(void *trg, const void *src, int size)
 {
 	int i;
 	unsigned int *t = trg;
@@ -126,7 +122,7 @@ static void __bare_init __memcpy32(void *trg, const void *src, int size)
 		*t++ = *s++;
 }
 
-static noinline void __bare_init imx_nandboot_get_page(void *regs, int v1,
+static noinline void BARE_INIT_FUNCTION(imx_nandboot_get_page)(void *regs, int v1,
 		u32 offs, int pagesize_2k)
 {
 	imx_nandboot_send_cmd(regs, NAND_CMD_READ0);
@@ -134,8 +130,9 @@ static noinline void __bare_init imx_nandboot_get_page(void *regs, int v1,
 	imx_nandboot_send_page(regs, v1, NFC_OUTPUT, pagesize_2k);
 }
 
-static void __bare_init imx_nand_load_image(void *dest, int v1,
-					    void __iomem *base, int pagesize_2k)
+static void BARE_INIT_FUNCTION(imx_nand_load_image)(void *dest, int v1,
+						    void __iomem *base,
+						    int pagesize_2k)
 {
 	u32 tmp, page, block, blocksize, pagesize, badblocks;
 	int bbt = 0;
diff --git a/arch/arm/mach-samsung/lowlevel-s5pcxx.c b/arch/arm/mach-samsung/lowlevel-s5pcxx.c
index 15afa47ce3..7a366eb3f1 100644
--- a/arch/arm/mach-samsung/lowlevel-s5pcxx.c
+++ b/arch/arm/mach-samsung/lowlevel-s5pcxx.c
@@ -24,7 +24,7 @@
 #include <mach/s3c-generic.h>
 
 #ifdef CONFIG_S3C_PLL_INIT
-void  __bare_init s5p_init_pll(void)
+void  BARE_INIT_FUNCTION(s5p_init_pll)(void)
 {
     uint32_t reg;
     int i;
diff --git a/arch/arm/mach-samsung/mem-s5pcxx.c b/arch/arm/mach-samsung/mem-s5pcxx.c
index 943f691769..26cab8db40 100644
--- a/arch/arm/mach-samsung/mem-s5pcxx.c
+++ b/arch/arm/mach-samsung/mem-s5pcxx.c
@@ -104,7 +104,7 @@
  */
 #define dcmd(x) writel((x) | CHIP(chip), base + S5P_DMC_DIRECTCMD)
 
-static void __bare_init s5p_dram_init_seq_lpddr(phys_addr_t base, unsigned chip)
+static void BARE_INIT_FUNCTION(s5p_dram_init_seq_lpddr)(phys_addr_t base, unsigned chip)
 {
 	const uint32_t emr = 0x400; /* DQS disable */
 	const uint32_t mr = (((S5P_DRAM_WR) - 1) << 9)
@@ -116,7 +116,7 @@ static void __bare_init s5p_dram_init_seq_lpddr(phys_addr_t base, unsigned chip)
 	dcmd(EMRS1 | ADDR(emr));
 }
 
-static void __bare_init s5p_dram_init_seq_lpddr2(phys_addr_t base, unsigned chip)
+static void BARE_INIT_FUNCTION(s5p_dram_init_seq_lpddr2)(phys_addr_t base, unsigned chip)
 {
 	const uint32_t mr = (((S5P_DRAM_WR) - 1) << 9)
 			  | ((S5P_DRAM_CAS) << 4)
@@ -129,7 +129,7 @@ static void __bare_init s5p_dram_init_seq_lpddr2(phys_addr_t base, unsigned chip
 	} while (readl(base + S5P_DMC_MRSTATUS) & 0x01); /* poll DAI */
 }
 
-static void __bare_init s5p_dram_init_seq_ddr2(phys_addr_t base, unsigned chip)
+static void BARE_INIT_FUNCTION(s5p_dram_init_seq_ddr2)(phys_addr_t base, unsigned chip)
 {
 	const uint32_t emr = 0x400; /* DQS disable */
 	const uint32_t mr = (((S5P_DRAM_WR) - 1) << 9)
@@ -148,7 +148,7 @@ static void __bare_init s5p_dram_init_seq_ddr2(phys_addr_t base, unsigned chip)
 
 #undef dcmd
 
-static inline void __bare_init s5p_dram_start_dll(phys_addr_t base, uint32_t phycon1)
+static inline void BARE_INIT_FUNCTION(s5p_dram_start_dll)(phys_addr_t base, uint32_t phycon1)
 {
 	uint32_t pc0 = 0x00101000; /* the only legal initial value */
 	uint32_t lv;
@@ -176,8 +176,9 @@ static inline void __bare_init s5p_dram_start_dll(phys_addr_t base, uint32_t phy
 	writel(pc0, base + S5P_DMC_PHYCONTROL0); /* force value locking */
 }
 
-static inline void __bare_init s5p_dram_setup(phys_addr_t base, uint32_t mc0, uint32_t mc1,
-				       int bus16, uint32_t mcon)
+static inline void BARE_INIT_FUNCTION(s5p_dram_setup)(phys_addr_t base,
+						      uint32_t mc0, uint32_t mc1,
+						      int bus16, uint32_t mcon)
 {
 	mcon |= (S5P_DRAM_BURST) << 20;
 	/* 16 or 32-bit bus ? */
@@ -202,7 +203,7 @@ static inline void __bare_init s5p_dram_setup(phys_addr_t base, uint32_t mc0, ui
 	writel(DMC_TIMING_PWR,  base + S5P_DMC_TIMINGPOWER);
 }
 
-static inline void __bare_init s5p_dram_start(phys_addr_t base)
+static inline void BARE_INIT_FUNCTION(s5p_dram_start)(phys_addr_t base)
 {
 	/* Reasonable defaults and auto-refresh on */
 	writel(0x0FFF1070, base + S5P_DMC_CONCONTROL);
@@ -214,7 +215,8 @@ static inline void __bare_init s5p_dram_start(phys_addr_t base)
  * Initialize LPDDR memory bank
  * TODO: this function is untested, see also init_seq function
  */
-void __bare_init s5p_init_dram_bank_lpddr(phys_addr_t base, uint32_t mc0, uint32_t mc1, int bus16)
+void BARE_INIT_FUNCTION(s5p_init_dram_bank_lpddr)(phys_addr_t base, uint32_t mc0,
+						  uint32_t mc1, int bus16)
 {
 	/* refcount 8, 90 deg. shift */
 	s5p_dram_start_dll(base, 0x00000085);
@@ -233,7 +235,8 @@ void __bare_init s5p_init_dram_bank_lpddr(phys_addr_t base, uint32_t mc0, uint32
  * Initialize LPDDR2 memory bank
  * TODO: this function is untested, see also init_seq function
  */
-void __bare_init s5p_init_dram_bank_lpddr2(phys_addr_t base, uint32_t mc0, uint32_t mc1, int bus16)
+void BARE_INIT_FUNCTION(s5p_init_dram_bank_lpddr2)(phys_addr_t base, uint32_t mc0,
+						   uint32_t mc1, int bus16)
 {
 	/* refcount 8, 90 deg. shift */
 	s5p_dram_start_dll(base, 0x00000085);
@@ -251,7 +254,8 @@ void __bare_init s5p_init_dram_bank_lpddr2(phys_addr_t base, uint32_t mc0, uint3
 /*
  * Initialize DDR2 memory bank
  */
-void __bare_init s5p_init_dram_bank_ddr2(phys_addr_t base, uint32_t mc0, uint32_t mc1, int bus16)
+void BARE_INIT_FUNCTION(s5p_init_dram_bank_ddr2)(phys_addr_t base, uint32_t mc0,
+						 uint32_t mc1, int bus16)
 {
 	/* refcount 8, 180 deg. shift */
 	s5p_dram_start_dll(base, 0x00000086);
diff --git a/include/init.h b/include/init.h
index 1c0e3f090a..a05026ef4e 100644
--- a/include/init.h
+++ b/include/init.h
@@ -62,7 +62,9 @@ typedef void (*exitcall_t)(void);
  *
  * Mainly useful for booting from NAND Controllers
  */
-#define __bare_init          __section(.text_bare_init.text)
+#define BARE_INIT_FUNCTION(name)  \
+	__section(.text_bare_init_##name) \
+		name
 
 #endif
 
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-18 15:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 15:39 [PATCH 1/8] mips: remove bare_init Sascha Hauer
2020-02-18 15:39 ` [PATCH 2/8] nios2: " Sascha Hauer
2020-02-18 15:39 ` [PATCH 3/8] ARM: arm64: " Sascha Hauer
2020-02-18 15:39 ` [PATCH 4/8] x86: " Sascha Hauer
2020-02-18 15:39 ` [PATCH 5/8] ARM: remove unnecessary __bare_init attributes Sascha Hauer
2020-02-18 15:39 ` [PATCH 6/8] ARM: Use function specific sections in assembly functions Sascha Hauer
2020-02-18 15:39 ` [PATCH 7/8] Remove unused __BARE_INIT Sascha Hauer
2020-02-18 15:39 ` [PATCH 8/8] Put bare_init functions in separate sections Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox