* [PATCH] i.MX external nand boot
@ 2013-07-09 9:54 Sascha Hauer
2013-07-09 9:54 ` [PATCH 1/6] Revert "ARM: i.MX27 pcm038: switch to multi image" Sascha Hauer
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Sascha Hauer @ 2013-07-09 9:54 UTC (permalink / raw)
To: barebox
The following gets rid of several ifdefs in the i.MX external
nand boot code. Also we have to revert the pcm038 conversion
to multiimage support for now as it turned out to be incompatible
with external nand boot mode. This is fixable, but for now to
get the master branch working revert it.
Sascha
----------------------------------------------------------------
Sascha Hauer (6):
Revert "ARM: i.MX27 pcm038: switch to multi image"
ARM: i.MX: External Nand boot: make 2k support nonoptional
ARM: i.MX: External Nand boot: move pagesize detection into SoC specific code
ARM: i.MX: External Nand boot: remove debug command
ARM: i.MX: External Nand boot: remove ifdefs
ARM: i.MX: External Nand boot: remove ifdefs around SoC functions
arch/arm/boards/pcm038/lowlevel.c | 4 +-
arch/arm/mach-imx/Kconfig | 17 ----
arch/arm/mach-imx/external-nand-boot.c | 171 ++++++++++++---------------------
images/Makefile.imx | 5 -
4 files changed, 61 insertions(+), 136 deletions(-)
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/6] Revert "ARM: i.MX27 pcm038: switch to multi image"
2013-07-09 9:54 [PATCH] i.MX external nand boot Sascha Hauer
@ 2013-07-09 9:54 ` Sascha Hauer
2013-07-09 9:54 ` [PATCH 2/6] ARM: i.MX: External Nand boot: make 2k support nonoptional Sascha Hauer
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2013-07-09 9:54 UTC (permalink / raw)
To: barebox
This reverts commit 08c0e206b3614eeecc1c3cee63665077360212e5.
The external NAND boot code currently uses the _text linker variable
to determine a place for the image. This doesn't work with multi image
support which will link the binary at 0x0. Revert multi image support
for the pcm038 for now until a solution is found.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/pcm038/lowlevel.c | 4 +---
arch/arm/mach-imx/Kconfig | 1 -
images/Makefile.imx | 5 -----
3 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/arch/arm/boards/pcm038/lowlevel.c b/arch/arm/boards/pcm038/lowlevel.c
index a3b2d13..0ea2939 100644
--- a/arch/arm/boards/pcm038/lowlevel.c
+++ b/arch/arm/boards/pcm038/lowlevel.c
@@ -33,13 +33,11 @@
#define ESDCTL0_VAL (ESDCTL0_SDE | ESDCTL0_ROW13 | ESDCTL0_COL10)
-ENTRY_FUNCTION(start_imx27_pcm038)(void)
+void __bare_init __naked barebox_arm_reset_vector(void)
{
uint32_t r;
int i;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
/* ahb lite ip interface */
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 9297a21..aedefe2 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -335,7 +335,6 @@ config MACH_PCM038
select DRIVER_SPI_IMX
select MFD_MC13XXX
select HAVE_DEFAULT_ENVIRONMENT_NEW
- select HAVE_PBL_MULTI_IMAGES
help
Say Y here if you are using Phytec's phyCORE-i.MX27 (pcm038) equipped
with a Freescale i.MX27 Processor
diff --git a/images/Makefile.imx b/images/Makefile.imx
index 788800e..e54be06 100644
--- a/images/Makefile.imx
+++ b/images/Makefile.imx
@@ -9,11 +9,6 @@ $(obj)/%.imximg: $(obj)/% FORCE
board = $(srctree)/arch/$(ARCH)/boards
-# ----------------------- i.MX27 based boards ---------------------------
-pblx-$(CONFIG_MACH_PCM038) += start_imx27_pcm038
-FILE_barebox-phytec-phycore-imx27.img = start_imx27_pcm038.pblx
-image-$(CONFIG_MACH_PCM038) += barebox-phytec-phycore-imx27.img
-
# ----------------------- i.MX51 based boards ---------------------------
pblx-$(CONFIG_MACH_FREESCALE_MX51_PDK) += start_imx51_babbage
CFG_start_imx51_babbage.pblx.imximg = $(board)/freescale-mx51-pdk/flash-header-imx51-babbage.imxcfg
--
1.8.3.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/6] ARM: i.MX: External Nand boot: make 2k support nonoptional
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 ` 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
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2013-07-09 9:54 UTC (permalink / raw)
To: barebox
All boards using the external nand boot code autodetect the
pagesize, so make this nonoptional to make the code simpler.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-imx/Kconfig | 16 ----------------
arch/arm/mach-imx/external-nand-boot.c | 6 ------
2 files changed, 22 deletions(-)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index aedefe2..e9c375b 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -141,22 +141,6 @@ config ARCH_IMX_EXTERNAL_BOOT_NAND
prompt "Support Starting barebox from NAND"
depends on ARCH_IMX_EXTERNAL_BOOT
-choice
- depends on ARCH_IMX_EXTERNAL_BOOT_NAND
- default NAND_IMX_BOOT_512_2K
- prompt "select nand pagesize you want to support booting from"
-
-config NAND_IMX_BOOT_512
- bool "512 byte page size"
-
-config NAND_IMX_BOOT_2K
- bool "2048 byte page size"
-
-config NAND_IMX_BOOT_512_2K
- bool "512 byte and 2048 byte pagesize"
-
-endchoice
-
config BAREBOX_UPDATE_IMX_EXTERNAL_NAND
bool
depends on ARCH_IMX_EXTERNAL_BOOT_NAND
diff --git a/arch/arm/mach-imx/external-nand-boot.c b/arch/arm/mach-imx/external-nand-boot.c
index cb2aa0b..1f35e72 100644
--- a/arch/arm/mach-imx/external-nand-boot.c
+++ b/arch/arm/mach-imx/external-nand-boot.c
@@ -169,13 +169,7 @@ void __bare_init imx_nand_load_image(void *dest, int size)
int pagesize_2k = 1, bbt = 0;
void *regs, *base, *spare0;
-#if defined(CONFIG_NAND_IMX_BOOT_512)
- pagesize_2k = 0;
-#elif defined(CONFIG_NAND_IMX_BOOT_2K)
- pagesize_2k = 1;
-#else
pagesize_2k = is_pagesize_2k();
-#endif
if (pagesize_2k) {
pagesize = 2048;
--
1.8.3.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/6] ARM: i.MX: External Nand boot: move pagesize detection into SoC specific code
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 ` Sascha Hauer
2013-07-09 9:54 ` [PATCH 4/6] ARM: i.MX: External Nand boot: remove debug command Sascha Hauer
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2013-07-09 9:54 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-imx/external-nand-boot.c | 90 ++++++++++++++++++----------------
1 file changed, 47 insertions(+), 43 deletions(-)
diff --git a/arch/arm/mach-imx/external-nand-boot.c b/arch/arm/mach-imx/external-nand-boot.c
index 1f35e72..2e4e4d0 100644
--- a/arch/arm/mach-imx/external-nand-boot.c
+++ b/arch/arm/mach-imx/external-nand-boot.c
@@ -121,40 +121,6 @@ static void __bare_init __memcpy32(void *trg, const void *src, int size)
*t++ = *s++;
}
-static int __maybe_unused is_pagesize_2k(void)
-{
-#ifdef CONFIG_ARCH_IMX21
- if (readl(MX21_SYSCTRL_BASE_ADDR + 0x14) & (1 << 5))
- return 1;
- else
- return 0;
-#endif
-#if defined(CONFIG_ARCH_IMX25)
- if (readl(MX25_CCM_BASE_ADDR + MX25_CCM_RCSR) & (1 << 8))
- return 1;
- else
- return 0;
-#endif
-#ifdef CONFIG_ARCH_IMX27
- if (readl(MX27_SYSCTRL_BASE_ADDR + 0x14) & (1 << 5))
- return 1;
- else
- return 0;
-#endif
-#ifdef CONFIG_ARCH_IMX31
- if (readl(MX31_CCM_BASE_ADDR + MX31_CCM_RCSR) & MX31_RCSR_NFMS)
- return 1;
- else
- return 0;
-#endif
-#if defined(CONFIG_ARCH_IMX35)
- if (readl(MX35_CCM_BASE_ADDR + MX35_CCM_RCSR) & (1 << 8))
- return 1;
- else
- return 0;
-#endif
-}
-
static noinline void __bare_init imx_nandboot_get_page(void *regs,
u32 offs, int pagesize_2k)
{
@@ -163,14 +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)
+void __bare_init imx_nand_load_image(void *dest, int size, int pagesize_2k)
{
u32 tmp, page, block, blocksize, pagesize, badblocks;
- int pagesize_2k = 1, bbt = 0;
+ int bbt = 0;
void *regs, *base, *spare0;
- pagesize_2k = is_pagesize_2k();
-
if (pagesize_2k) {
pagesize = 2048;
blocksize = 128 * 1024;
@@ -336,11 +300,19 @@ int __bare_init imx_barebox_boot_nand_external(unsigned long nfc_base)
void __bare_init __noreturn imx21_barebox_boot_nand_external(void)
{
unsigned long nfc_base = MX21_NFC_BASE_ADDR;
+ int pagesize_2k;
if (imx_barebox_boot_nand_external(nfc_base)) {
jump_sdram(nfc_base - ld_var(_text));
+
+ if (readl(MX21_SYSCTRL_BASE_ADDR + 0x14) & (1 << 5))
+ pagesize_2k = 1;
+ else
+ pagesize_2k = 0;
+
imx_nand_load_image((void *)ld_var(_text),
- ld_var(barebox_image_size));
+ ld_var(barebox_image_size),
+ pagesize_2k);
}
imx21_barebox_entry(0);
@@ -351,11 +323,19 @@ void __bare_init __noreturn imx21_barebox_boot_nand_external(void)
void __bare_init __noreturn imx25_barebox_boot_nand_external(void)
{
unsigned long nfc_base = MX25_NFC_BASE_ADDR;
+ int pagesize_2k;
if (imx_barebox_boot_nand_external(nfc_base)) {
jump_sdram(nfc_base - ld_var(_text));
+
+ if (readl(MX25_CCM_BASE_ADDR + MX25_CCM_RCSR) & (1 << 8))
+ pagesize_2k = 1;
+ else
+ pagesize_2k = 0;
+
imx_nand_load_image((void *)ld_var(_text),
- ld_var(_barebox_image_size));
+ ld_var(_barebox_image_size),
+ pagesize_2k);
}
imx25_barebox_entry(0);
@@ -366,11 +346,19 @@ void __bare_init __noreturn imx25_barebox_boot_nand_external(void)
void __bare_init __noreturn imx27_barebox_boot_nand_external(void)
{
unsigned long nfc_base = MX27_NFC_BASE_ADDR;
+ int pagesize_2k;
if (imx_barebox_boot_nand_external(nfc_base)) {
jump_sdram(nfc_base - ld_var(_text));
+
+ if (readl(MX27_SYSCTRL_BASE_ADDR + 0x14) & (1 << 5))
+ pagesize_2k = 1;
+ else
+ pagesize_2k = 0;
+
imx_nand_load_image((void *)ld_var(_text),
- ld_var(_barebox_image_size));
+ ld_var(_barebox_image_size),
+ pagesize_2k);
}
imx27_barebox_entry(0);
@@ -381,11 +369,19 @@ void __bare_init __noreturn imx27_barebox_boot_nand_external(void)
void __bare_init __noreturn imx31_barebox_boot_nand_external(void)
{
unsigned long nfc_base = MX31_NFC_BASE_ADDR;
+ int pagesize_2k;
if (imx_barebox_boot_nand_external(nfc_base)) {
jump_sdram(nfc_base - ld_var(_text));
+
+ if (readl(MX31_CCM_BASE_ADDR + MX31_CCM_RCSR) & MX31_RCSR_NFMS)
+ pagesize_2k = 1;
+ else
+ pagesize_2k = 0;
+
imx_nand_load_image((void *)ld_var(_text),
- ld_var(_barebox_image_size));
+ ld_var(_barebox_image_size),
+ pagesize_2k);
}
imx31_barebox_entry(0);
@@ -396,11 +392,19 @@ void __bare_init __noreturn imx31_barebox_boot_nand_external(void)
void __bare_init __noreturn imx35_barebox_boot_nand_external(void)
{
unsigned long nfc_base = MX35_NFC_BASE_ADDR;
+ int pagesize_2k;
if (imx_barebox_boot_nand_external(nfc_base)) {
jump_sdram(nfc_base - ld_var(_text));
+
+ if (readl(MX35_CCM_BASE_ADDR + MX35_CCM_RCSR) & (1 << 8))
+ pagesize_2k = 1;
+ else
+ pagesize_2k = 0;
+
imx_nand_load_image((void *)ld_var(_text),
- ld_var(_barebox_image_size));
+ ld_var(_barebox_image_size),
+ pagesize_2k);
}
imx35_barebox_entry(0);
--
1.8.3.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/6] ARM: i.MX: External Nand boot: remove debug command
2013-07-09 9:54 [PATCH] i.MX external nand boot Sascha Hauer
` (2 preceding siblings ...)
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 ` 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 ` [PATCH 6/6] ARM: i.MX: External Nand boot: remove ifdefs around SoC functions Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2013-07-09 9:54 UTC (permalink / raw)
To: barebox
The debug command does not work with SoC specific entry points.
remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-imx/external-nand-boot.c | 32 --------------------------------
1 file changed, 32 deletions(-)
diff --git a/arch/arm/mach-imx/external-nand-boot.c b/arch/arm/mach-imx/external-nand-boot.c
index 2e4e4d0..c91ed2e 100644
--- a/arch/arm/mach-imx/external-nand-boot.c
+++ b/arch/arm/mach-imx/external-nand-boot.c
@@ -410,35 +410,3 @@ void __bare_init __noreturn imx35_barebox_boot_nand_external(void)
imx35_barebox_entry(0);
}
#endif
-
-#define CONFIG_NAND_IMX_BOOT_DEBUG
-#ifdef CONFIG_NAND_IMX_BOOT_DEBUG
-#include <command.h>
-
-static int do_nand_boot_test(int argc, char *argv[])
-{
- void *dest;
- int size;
-
- if (argc < 3)
- return COMMAND_ERROR_USAGE;
-
- dest = (void *)strtoul_suffix(argv[1], NULL, 0);
- size = strtoul_suffix(argv[2], NULL, 0);
-
- imx_nand_load_image(dest, size);
-
- return 0;
-}
-
-static const __maybe_unused char cmd_nand_boot_test_help[] =
-"Usage: nand_boot_test <dest> <size>\n"
-"This command loads the booloader from the NAND memory like the reset\n"
-"routine does. Its intended for development tests only";
-
-BAREBOX_CMD_START(nand_boot_test)
- .cmd = do_nand_boot_test,
- .usage = "load bootloader from NAND",
- BAREBOX_CMD_HELP(cmd_nand_boot_test_help)
-BAREBOX_CMD_END
-#endif
--
1.8.3.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 5/6] ARM: i.MX: External Nand boot: remove ifdefs
2013-07-09 9:54 [PATCH] i.MX external nand boot Sascha Hauer
` (3 preceding siblings ...)
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
2013-07-09 9:54 ` [PATCH 6/6] ARM: i.MX: External Nand boot: remove ifdefs around SoC functions Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2013-07-09 9:54 UTC (permalink / raw)
To: barebox
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 6/6] ARM: i.MX: External Nand boot: remove ifdefs around SoC functions
2013-07-09 9:54 [PATCH] i.MX external nand boot Sascha Hauer
` (4 preceding siblings ...)
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
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2013-07-09 9:54 UTC (permalink / raw)
To: barebox
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-07-09 9:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 6/6] ARM: i.MX: External Nand boot: remove ifdefs around SoC functions Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox