From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 10/12] ARM: i.MX53 Vincell: Add NAND xload support
Date: Mon, 4 Jul 2016 11:27:37 +0200 [thread overview]
Message-ID: <1467624459-16448-11-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1467624459-16448-1-git-send-email-s.hauer@pengutronix.de>
The Vincell boards do the SDRAM setup from board init code, so the
image size is limited to the internal SRAM size. To overcome this
limitation use the NAND xload support.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/guf-vincell/lowlevel.c | 25 ++++++++++++++++++++++---
arch/arm/mach-imx/Kconfig | 9 +++++++++
images/Makefile.imx | 14 ++++++++++----
3 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/arch/arm/boards/guf-vincell/lowlevel.c b/arch/arm/boards/guf-vincell/lowlevel.c
index f4bd44e..34c28f7 100644
--- a/arch/arm/boards/guf-vincell/lowlevel.c
+++ b/arch/arm/boards/guf-vincell/lowlevel.c
@@ -11,6 +11,7 @@
#include <mach/generic.h>
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
+#include <mach/xload.h>
#define IOMUX_PADCTL_DDRI_DDR (1 << 9)
@@ -127,8 +128,9 @@ static noinline void imx53_guf_vincell_init(void *fdt)
{
void __iomem *ccm = (void *)MX53_CCM_BASE_ADDR;
u32 r;
+ enum bootsource src;
+ int instance;
- imx5_cpu_lowlevel_init();
arm_setup_stack(0xf8020000 - 8);
writel(0x0088494c, ccm + MX5_CCM_CBCDR);
@@ -149,11 +151,28 @@ static noinline void imx53_guf_vincell_init(void *fdt)
disable_watchdog();
configure_dram_iomux();
imx_esdctlv4_init();
+
+ imx53_get_boot_source(&src, &instance);
+
+ if (src == BOOTSOURCE_NAND &&
+ is_enabled(CONFIG_MACH_GUF_VINCELL_XLOAD))
+ imx53_nand_start_image();
}
imx53_barebox_entry(fdt);
}
+static noinline void __imx53_guf_vincell_init(void *fdt)
+{
+ imx5_cpu_lowlevel_init();
+
+ relocate_to_current_adr();
+ setup_c();
+ barrier();
+
+ imx53_guf_vincell_init(fdt);
+}
+
extern char __dtb_imx53_guf_vincell_lt_start[];
ENTRY_FUNCTION(start_imx53_guf_vincell_lt, r0, r1, r2)
@@ -162,7 +181,7 @@ ENTRY_FUNCTION(start_imx53_guf_vincell_lt, r0, r1, r2)
fdt = __dtb_imx53_guf_vincell_lt_start - get_runtime_offset();
- imx53_guf_vincell_init(fdt);
+ __imx53_guf_vincell_init(fdt);
}
extern char __dtb_imx53_guf_vincell_start[];
@@ -173,5 +192,5 @@ ENTRY_FUNCTION(start_imx53_guf_vincell, r0, r1, r2)
fdt = __dtb_imx53_guf_vincell_start - get_runtime_offset();
- imx53_guf_vincell_init(fdt);
+ __imx53_guf_vincell_init(fdt);
}
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 5b648ac..d61d545 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -217,6 +217,15 @@ config MACH_GUF_VINCELL
bool "Garz-Fricke Vincell"
select ARCH_IMX53
+config MACH_GUF_VINCELL_XLOAD
+ depends on MACH_GUF_VINCELL
+ bool "Garz-Fricke Vincell NAND xload support"
+ help
+ The Vincell initializes SDRAM from board code. This normally limits
+ the image size to the size of the SoC internal SRAM. Enable this
+ option to be able to use bigger images when booting from NAND. Images
+ built with this option are no longer bootable from USB though.
+
config MACH_TQMA53
bool "TQ i.MX53 TQMa53"
select ARCH_IMX53
diff --git a/images/Makefile.imx b/images/Makefile.imx
index 0ff317b..98ddcb8 100644
--- a/images/Makefile.imx
+++ b/images/Makefile.imx
@@ -97,14 +97,20 @@ CFG_start_imx53_vmx53.pblx.imximg = $(board)/freescale-mx53-vmx53/flash-header-i
FILE_barebox-freescale-imx53-vmx53.img = start_imx53_vmx53.pblx.imximg
image-$(CONFIG_MACH_FREESCALE_MX53_VMX53) += barebox-freescale-imx53-vmx53.img
+ifdef CONFIG_MACH_GUF_VINCELL_XLOAD
+VINCELL_IMAGE := imx-sram-img
+else
+VINCELL_IMAGE := pblx.imximg
+endif
+
pblx-$(CONFIG_MACH_GUF_VINCELL) += start_imx53_guf_vincell
-CFG_start_imx53_guf_vincell.pblx.imximg = $(board)/guf-vincell/flash-header.imxcfg
-FILE_barebox-guf-vincell.img = start_imx53_guf_vincell.pblx.imximg
+CFG_start_imx53_guf_vincell.$(VINCELL_IMAGE) = $(board)/guf-vincell/flash-header.imxcfg
+FILE_barebox-guf-vincell.img = start_imx53_guf_vincell.$(VINCELL_IMAGE)
image-$(CONFIG_MACH_GUF_VINCELL) += barebox-guf-vincell.img
pblx-$(CONFIG_MACH_GUF_VINCELL) += start_imx53_guf_vincell_lt
-CFG_start_imx53_guf_vincell_lt.pblx.imximg = $(board)/guf-vincell/flash-header.imxcfg
-FILE_barebox-guf-vincell-lt.img = start_imx53_guf_vincell_lt.pblx.imximg
+CFG_start_imx53_guf_vincell_lt.$(VINCELL_IMAGE) = $(board)/guf-vincell/flash-header.imxcfg
+FILE_barebox-guf-vincell-lt.img = start_imx53_guf_vincell_lt.$(VINCELL_IMAGE)
image-$(CONFIG_MACH_GUF_VINCELL) += barebox-guf-vincell-lt.img
pblx-$(CONFIG_MACH_TQMA53) += start_imx53_mba53_512mib
--
2.8.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-07-04 9:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 9:27 i.MX53 " Sascha Hauer
2016-07-04 9:27 ` [PATCH 01/12] ARM: i.MX53: do not pass base address to imx*_boot_save_loc Sascha Hauer
2016-07-04 9:27 ` [PATCH 02/12] ARM: i.MX: Provide bootsource functions for early boot code Sascha Hauer
2016-07-04 9:27 ` [PATCH 03/12] ARM: i.MX53: Detect booting from USB Sascha Hauer
2016-07-04 9:27 ` [PATCH 04/12] mtd: imx-nand: Move v3 register definitions to include file Sascha Hauer
2016-07-04 9:27 ` [PATCH 05/12] ARM: i.MX53: Implement NAND xload Sascha Hauer
2016-07-04 9:27 ` [PATCH 06/12] ARM: i.MX53: Add uart5 clock support Sascha Hauer
2016-07-04 9:27 ` [PATCH 07/12] ARM: i.MX53 Vincell: Reset phy consistently from device tree Sascha Hauer
2016-07-04 9:27 ` [PATCH 08/12] ARM: i.MX53 Vincell: Adjust bbu handler partition size to real partition size Sascha Hauer
2016-07-04 9:27 ` [PATCH 09/12] ARM: i.MX53 Vincell: Add PBL console support Sascha Hauer
2016-07-04 9:27 ` Sascha Hauer [this message]
2016-07-04 12:58 ` [PATCH 10/12] ARM: i.MX53 Vincell: Add NAND xload support Michael Grzeschik
2016-07-05 7:00 ` Sascha Hauer
2016-07-04 9:27 ` [PATCH 11/12] ARM: imx_v7_defconfig: Enable Vincell support Sascha Hauer
2016-07-04 9:27 ` [PATCH 12/12] ARM: vincell_defconfig: make smaller Sascha Hauer
2016-09-14 9:12 [PATCH 01/12] ARM: i.MX53: Add uart5 clock support Sascha Hauer
2016-09-14 9:12 ` [PATCH 10/12] ARM: i.MX53 Vincell: Add NAND xload support 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=1467624459-16448-11-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