mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 6/6] ARM: i.MX: External Nand boot: remove ifdefs around SoC functions
Date: Tue,  9 Jul 2013 11:54:42 +0200	[thread overview]
Message-ID: <1373363682-24449-7-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1373363682-24449-1-git-send-email-s.hauer@pengutronix.de>

The ifdefs around the SoC specific boot_nand_external functions
can be removed when all functions go into their own sections so
that the linker can discard the unused functions.

This also adds a #ifdef BROKEN around the i.MX21 code which currently
does not have the imx21_barebox_entry function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/external-nand-boot.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-imx/external-nand-boot.c b/arch/arm/mach-imx/external-nand-boot.c
index 7280b5b..b0aeb43 100644
--- a/arch/arm/mach-imx/external-nand-boot.c
+++ b/arch/arm/mach-imx/external-nand-boot.c
@@ -276,14 +276,18 @@ int __bare_init imx_barebox_boot_nand_external(unsigned long nfc_base)
 	return 1;
 }
 
+#define BARE_INIT_FUNCTION(name)  \
+	void __noreturn __section(.text_bare_init_##name) \
+		name
+
 /*
  * SoC specific entries for booting in external NAND mode. To be called from
  * the board specific entry code. This is safe to call even if not booting from
  * NAND. In this case the booting is continued without loading an image from
  * NAND. This function needs a stack to be set up.
  */
-#ifdef CONFIG_ARCH_IMX21
-void __bare_init __noreturn imx21_barebox_boot_nand_external(void)
+#ifdef BROKEN
+BARE_INIT_FUNCTION(imx21_barebox_boot_nand_external)(void)
 {
 	unsigned long nfc_base = MX21_NFC_BASE_ADDR;
 	int pagesize_2k;
@@ -301,12 +305,12 @@ void __bare_init __noreturn imx21_barebox_boot_nand_external(void)
 				(void *)nfc_base, pagesize_2k);
 	}
 
+	/* This function doesn't exist yet */
 	imx21_barebox_entry(0);
 }
 #endif
 
-#ifdef CONFIG_ARCH_IMX25
-void __bare_init __noreturn imx25_barebox_boot_nand_external(void)
+BARE_INIT_FUNCTION(imx25_barebox_boot_nand_external)(void)
 {
 	unsigned long nfc_base = MX25_NFC_BASE_ADDR;
 	int pagesize_2k;
@@ -326,10 +330,8 @@ void __bare_init __noreturn imx25_barebox_boot_nand_external(void)
 
 	imx25_barebox_entry(0);
 }
-#endif
 
-#ifdef CONFIG_ARCH_IMX27
-void __bare_init __noreturn imx27_barebox_boot_nand_external(void)
+BARE_INIT_FUNCTION(imx27_barebox_boot_nand_external)(void)
 {
 	unsigned long nfc_base = MX27_NFC_BASE_ADDR;
 	int pagesize_2k;
@@ -349,10 +351,8 @@ void __bare_init __noreturn imx27_barebox_boot_nand_external(void)
 
 	imx27_barebox_entry(0);
 }
-#endif
 
-#ifdef CONFIG_ARCH_IMX31
-void __bare_init __noreturn imx31_barebox_boot_nand_external(void)
+BARE_INIT_FUNCTION(imx31_barebox_boot_nand_external)(void)
 {
 	unsigned long nfc_base = MX31_NFC_BASE_ADDR;
 	int pagesize_2k;
@@ -372,10 +372,8 @@ void __bare_init __noreturn imx31_barebox_boot_nand_external(void)
 
 	imx31_barebox_entry(0);
 }
-#endif
 
-#ifdef CONFIG_ARCH_IMX35
-void __bare_init __noreturn imx35_barebox_boot_nand_external(void)
+BARE_INIT_FUNCTION(imx35_barebox_boot_nand_external)(void)
 {
 	unsigned long nfc_base = MX35_NFC_BASE_ADDR;
 	int pagesize_2k;
@@ -395,4 +393,3 @@ void __bare_init __noreturn imx35_barebox_boot_nand_external(void)
 
 	imx35_barebox_entry(0);
 }
-#endif
-- 
1.8.3.2


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

      parent reply	other threads:[~2013-07-09  9:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09  9:54 [PATCH] i.MX external nand boot Sascha Hauer
2013-07-09  9:54 ` [PATCH 1/6] Revert "ARM: i.MX27 pcm038: switch to multi image" Sascha Hauer
2013-07-09  9:54 ` [PATCH 2/6] ARM: i.MX: External Nand boot: make 2k support nonoptional Sascha Hauer
2013-07-09  9:54 ` [PATCH 3/6] ARM: i.MX: External Nand boot: move pagesize detection into SoC specific code Sascha Hauer
2013-07-09  9:54 ` [PATCH 4/6] ARM: i.MX: External Nand boot: remove debug command Sascha Hauer
2013-07-09  9:54 ` [PATCH 5/6] ARM: i.MX: External Nand boot: remove ifdefs Sascha Hauer
2013-07-09  9:54 ` Sascha Hauer [this message]

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=1373363682-24449-7-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@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