From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 5/6] ARM: i.MX: External Nand boot: remove ifdefs
Date: Tue, 9 Jul 2013 11:54:41 +0200 [thread overview]
Message-ID: <1373363682-24449-6-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1373363682-24449-1-git-send-email-s.hauer@pengutronix.de>
Instead of ifdeffing out the correct NFC base address just pass
it to imx_nand_load_image which is called from SoC specific
context anyway.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-imx/external-nand-boot.c | 30 ++++++++----------------------
1 file changed, 8 insertions(+), 22 deletions(-)
diff --git a/arch/arm/mach-imx/external-nand-boot.c b/arch/arm/mach-imx/external-nand-boot.c
index c91ed2e..7280b5b 100644
--- a/arch/arm/mach-imx/external-nand-boot.c
+++ b/arch/arm/mach-imx/external-nand-boot.c
@@ -129,11 +129,12 @@ static noinline void __bare_init imx_nandboot_get_page(void *regs,
imx_nandboot_send_page(regs, NFC_OUTPUT, pagesize_2k);
}
-void __bare_init imx_nand_load_image(void *dest, int size, int pagesize_2k)
+void __bare_init imx_nand_load_image(void *dest, int size, void __iomem *base,
+ int pagesize_2k)
{
u32 tmp, page, block, blocksize, pagesize, badblocks;
int bbt = 0;
- void *regs, *base, *spare0;
+ void *regs, *spare0;
if (pagesize_2k) {
pagesize = 2048;
@@ -143,21 +144,6 @@ void __bare_init imx_nand_load_image(void *dest, int size, int pagesize_2k)
blocksize = 16 * 1024;
}
-#ifdef CONFIG_ARCH_IMX21
- base = (void __iomem *)MX21_NFC_BASE_ADDR;
-#endif
-#ifdef CONFIG_ARCH_IMX25
- base = (void __iomem *)MX25_NFC_BASE_ADDR;
-#endif
-#ifdef CONFIG_ARCH_IMX27
- base = (void __iomem *)MX27_NFC_BASE_ADDR;
-#endif
-#ifdef CONFIG_ARCH_IMX31
- base = (void __iomem *)MX31_NFC_BASE_ADDR;
-#endif
-#ifdef CONFIG_ARCH_IMX35
- base = (void __iomem *)MX35_NFC_BASE_ADDR;
-#endif
if (nfc_is_v21()) {
regs = base + 0x1e00;
spare0 = base + 0x1000;
@@ -312,7 +298,7 @@ void __bare_init __noreturn imx21_barebox_boot_nand_external(void)
imx_nand_load_image((void *)ld_var(_text),
ld_var(barebox_image_size),
- pagesize_2k);
+ (void *)nfc_base, pagesize_2k);
}
imx21_barebox_entry(0);
@@ -335,7 +321,7 @@ void __bare_init __noreturn imx25_barebox_boot_nand_external(void)
imx_nand_load_image((void *)ld_var(_text),
ld_var(_barebox_image_size),
- pagesize_2k);
+ (void *)nfc_base, pagesize_2k);
}
imx25_barebox_entry(0);
@@ -358,7 +344,7 @@ void __bare_init __noreturn imx27_barebox_boot_nand_external(void)
imx_nand_load_image((void *)ld_var(_text),
ld_var(_barebox_image_size),
- pagesize_2k);
+ (void *)nfc_base, pagesize_2k);
}
imx27_barebox_entry(0);
@@ -381,7 +367,7 @@ void __bare_init __noreturn imx31_barebox_boot_nand_external(void)
imx_nand_load_image((void *)ld_var(_text),
ld_var(_barebox_image_size),
- pagesize_2k);
+ (void *)nfc_base, pagesize_2k);
}
imx31_barebox_entry(0);
@@ -404,7 +390,7 @@ void __bare_init __noreturn imx35_barebox_boot_nand_external(void)
imx_nand_load_image((void *)ld_var(_text),
ld_var(_barebox_image_size),
- pagesize_2k);
+ (void *)nfc_base, pagesize_2k);
}
imx35_barebox_entry(0);
--
1.8.3.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev 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 ` Sascha Hauer [this message]
2013-07-09 9:54 ` [PATCH 6/6] ARM: i.MX: External Nand boot: remove ifdefs around SoC functions 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=1373363682-24449-6-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