From 45325c21d7f2695c7b114b0df47f4a1a75ed68f2 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 1 Jul 2016 07:42:25 +0200 Subject: ARM: i.MX53 Vincell: Reset phy consistently from device tree The phy reset for the Vincell board is done from device tree whereas the Vincell-LT resets the phy from board init code. Since both boards share the same code base the regular Vincell board ends up with a duplicated phy reset, with the second reset being done after the FEC has been initialized. Fix this by removing the phy reset from the board code and adding the phy reset to the Vincell-LT dts file. Signed-off-by: Sascha Hauer --- arch/arm/boards/guf-vincell/board.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'arch/arm/boards') diff --git a/arch/arm/boards/guf-vincell/board.c b/arch/arm/boards/guf-vincell/board.c index 43c195254e..ee5be10991 100644 --- a/arch/arm/boards/guf-vincell/board.c +++ b/arch/arm/boards/guf-vincell/board.c @@ -29,15 +29,6 @@ #include #include -#define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6) - -static void vincell_fec_reset(void) -{ - gpio_direction_output(LOCO_FEC_PHY_RST, 0); - mdelay(1); - gpio_set_value(LOCO_FEC_PHY_RST, 1); -} - static int vincell_devices_init(void) { if (!of_machine_is_compatible("guf,imx53-vincell") && @@ -49,8 +40,6 @@ static int vincell_devices_init(void) clk_set_rate(clk_lookup("emi_slow_podf"), 133333334); clk_set_rate(clk_lookup("nfc_podf"), 33333334); - vincell_fec_reset(); - imx53_bbu_internal_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT, SZ_512K); -- cgit v1.2.3 From 8b4bbbbd13d67251dbcef80b88786da5b6a61c99 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 1 Jul 2016 13:24:09 +0200 Subject: ARM: i.MX53 Vincell: Adjust bbu handler partition size to real partition size The bootloader partition size was increased to 0xe0000, so adjust the barebox update handler partition size accordingly. Signed-off-by: Sascha Hauer --- arch/arm/boards/guf-vincell/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/boards') diff --git a/arch/arm/boards/guf-vincell/board.c b/arch/arm/boards/guf-vincell/board.c index ee5be10991..007b6dd347 100644 --- a/arch/arm/boards/guf-vincell/board.c +++ b/arch/arm/boards/guf-vincell/board.c @@ -41,7 +41,7 @@ static int vincell_devices_init(void) clk_set_rate(clk_lookup("nfc_podf"), 33333334); imx53_bbu_internal_nand_register_handler("nand", - BBU_HANDLER_FLAG_DEFAULT, SZ_512K); + BBU_HANDLER_FLAG_DEFAULT, 0xe0000); return 0; } -- cgit v1.2.3 From 712a7de9b420228717be40fe9a2d4ec5e38b797f Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 1 Jul 2016 13:26:01 +0200 Subject: ARM: i.MX53 Vincell: Add PBL console support PBL console support is more useful than debug_ll. Add support for it to the Vincell Board. Signed-off-by: Sascha Hauer --- arch/arm/boards/guf-vincell/lowlevel.c | 50 ++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'arch/arm/boards') diff --git a/arch/arm/boards/guf-vincell/lowlevel.c b/arch/arm/boards/guf-vincell/lowlevel.c index af7c65d9be..a09842f1f1 100644 --- a/arch/arm/boards/guf-vincell/lowlevel.c +++ b/arch/arm/boards/guf-vincell/lowlevel.c @@ -11,6 +11,7 @@ #include #include #include +#include #define IOMUX_PADCTL_DDRI_DDR (1 << 9) @@ -123,12 +124,16 @@ void disable_watchdog(void) writew(0x0, MX53_WDOG2_BASE_ADDR + 8); } -static noinline void imx53_guf_vincell_init(void *fdt) +extern char __dtb_imx53_guf_vincell_lt_start[]; +extern char __dtb_imx53_guf_vincell_start[]; + +static noinline void imx53_guf_vincell_init(int is_lt) { void __iomem *ccm = (void *)MX53_CCM_BASE_ADDR; + void __iomem *uart = IOMEM(MX53_UART2_BASE_ADDR); + void *fdt; u32 r; - imx5_cpu_lowlevel_init(); arm_setup_stack(MX53_IRAM_BASE_ADDR + MX53_IRAM_SIZE - 8); writel(0x0088494c, ccm + MX5_CCM_CBCDR); @@ -137,12 +142,11 @@ static noinline void imx53_guf_vincell_init(void *fdt) imx53_init_lowlevel_early(800); - if (IS_ENABLED(CONFIG_DEBUG_LL)) { - writel(0x3, MX53_IOMUXC_BASE_ADDR + 0x27c); - writel(0x3, MX53_IOMUXC_BASE_ADDR + 0x278); - imx53_uart_setup_ll(); - putc_ll('>'); - } + writel(0x3, MX53_IOMUXC_BASE_ADDR + 0x27c); + writel(0x3, MX53_IOMUXC_BASE_ADDR + 0x278); + imx53_uart_setup(uart); + pbl_set_putc(imx_uart_putc, uart); + pr_debug("GuF Vincell\n"); /* Skip SDRAM initialization if we run from RAM */ r = get_pc(); @@ -152,27 +156,31 @@ static noinline void imx53_guf_vincell_init(void *fdt) imx_esdctlv4_init(); } + if (is_lt) + fdt = __dtb_imx53_guf_vincell_lt_start; + else + fdt = __dtb_imx53_guf_vincell_start; + imx53_barebox_entry(fdt); } -extern char __dtb_imx53_guf_vincell_lt_start[]; - -ENTRY_FUNCTION(start_imx53_guf_vincell_lt, r0, r1, r2) +static void __imx53_guf_vincell_init(int is_lt) { - void *fdt; - - fdt = __dtb_imx53_guf_vincell_lt_start - get_runtime_offset(); + arm_early_mmu_cache_invalidate(); + imx5_cpu_lowlevel_init(); + relocate_to_current_adr(); + setup_c(); + barrier(); - imx53_guf_vincell_init(fdt); + imx53_guf_vincell_init(is_lt); } -extern char __dtb_imx53_guf_vincell_start[]; +ENTRY_FUNCTION(start_imx53_guf_vincell_lt, r0, r1, r2) +{ + __imx53_guf_vincell_init(1); +} ENTRY_FUNCTION(start_imx53_guf_vincell, r0, r1, r2) { - void *fdt; - - fdt = __dtb_imx53_guf_vincell_start - get_runtime_offset(); - - imx53_guf_vincell_init(fdt); + __imx53_guf_vincell_init(0); } -- cgit v1.2.3 From 8840b3ecbbd838fc88679cdd9d7062c70852efce Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 1 Jul 2016 14:11:39 +0200 Subject: ARM: i.MX53 Vincell: Add NAND xload support 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 --- arch/arm/boards/guf-vincell/lowlevel.c | 9 +++++++++ arch/arm/mach-imx/Kconfig | 9 +++++++++ images/Makefile.imx | 14 ++++++++++---- 3 files changed, 28 insertions(+), 4 deletions(-) (limited to 'arch/arm/boards') diff --git a/arch/arm/boards/guf-vincell/lowlevel.c b/arch/arm/boards/guf-vincell/lowlevel.c index a09842f1f1..de706b68b2 100644 --- a/arch/arm/boards/guf-vincell/lowlevel.c +++ b/arch/arm/boards/guf-vincell/lowlevel.c @@ -12,6 +12,7 @@ #include #include #include +#include #define IOMUX_PADCTL_DDRI_DDR (1 << 9) @@ -133,6 +134,8 @@ static noinline void imx53_guf_vincell_init(int is_lt) void __iomem *uart = IOMEM(MX53_UART2_BASE_ADDR); void *fdt; u32 r; + enum bootsource src; + int instance; arm_setup_stack(MX53_IRAM_BASE_ADDR + MX53_IRAM_SIZE - 8); @@ -154,6 +157,12 @@ static noinline void imx53_guf_vincell_init(int is_lt) 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(); } if (is_lt) diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index a80bc6b986..81f78e0636 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -224,6 +224,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 b02fdff4b1..1904e8bcf3 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 -- cgit v1.2.3