[U-Boot] [PATCH 0/7] *** iMX6SL-evk SPL Support ***

This patch is for SPL support for iMX6SL-evk. The said patches has been tested to work on SD1, SD2 and SD3 ports of the said board.
After applying the following patches, it will produces SPL and u-boot.img binary images. You should run the two commands below to store it in your SD or eMMC.
sudo dd if=SPL of=/dev/xxx bs=1K seek=1; sync sudo dd if=u-boot.img of=/dev/xxx bs=1K seek=69
John Tobias (7): imx6: add macro define inclusion imx6sl: update DCD configuration file imx6sl: add spl on board configuration imx6: add additional flexibility for defining macros imx6sl: add spl in include header file imx6sl: add SPL support for iMX6SL-evk kconfig: imx6sl: add add SUPPORT_SPL
arch/arm/Kconfig | 1 + arch/arm/cpu/armv7/mx6/ddr.c | 2 + board/freescale/mx6slevk/imximage.cfg | 78 +--------------- board/freescale/mx6slevk/mx6slevk.c | 168 +++++++++++++++++++++++++++++++++- configs/mx6slevk_defconfig | 5 +- include/configs/imx6_spl.h | 6 ++ include/configs/mx6slevk.h | 8 ++ 7 files changed, 191 insertions(+), 77 deletions(-)

add a macro define inclusion to compile the function. iMX6SL doesn't have an MMDC_P1_BASE_ADDR in the header. It will break the build if the SPL features is enabled for iMX6SL. --- arch/arm/cpu/armv7/mx6/ddr.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/cpu/armv7/mx6/ddr.c b/arch/arm/cpu/armv7/mx6/ddr.c index 7a9b03a..3beeded 100644 --- a/arch/arm/cpu/armv7/mx6/ddr.c +++ b/arch/arm/cpu/armv7/mx6/ddr.c @@ -182,6 +182,7 @@ void mx6sdl_dram_iocfg(unsigned width, * For details on each register, refer to the IMX6DQRM and/or IMX6SDLRM * section titled MMDC initialization */ +#if defined(CONFIG_MX6QDL) || defined(CONFIG_MX6Q) || defined(CONFIG_MX6D) #define MR(val, ba, cmd, cs1) \ ((val << 16) | (1 << 15) | (cmd << 4) | (cs1 << 3) | ba) void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo, @@ -489,3 +490,4 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo, /* wait for auto-ZQ calibration to complete */ mdelay(1); } +#endif

Hi John,
On Sun, Nov 9, 2014 at 3:51 PM, John Tobias john.tobias.ph@gmail.com wrote:
add a macro define inclusion to compile the function. iMX6SL doesn't have an MMDC_P1_BASE_ADDR in the header. It will break the build if the SPL features is enabled for iMX6SL.
You missed to add the Signed-off-by tag in your patches. Please run ./scripts/checkpatch on your patches.
Regards,
Fabio Estevam

Hi Fabio,
I didn't notice that one... Thanks for the info.
Regards,
john
On Sun, Nov 9, 2014 at 3:26 PM, Fabio Estevam festevam@gmail.com wrote:
Hi John,
On Sun, Nov 9, 2014 at 3:51 PM, John Tobias john.tobias.ph@gmail.com wrote:
add a macro define inclusion to compile the function. iMX6SL doesn't have an MMDC_P1_BASE_ADDR in the header. It will break the build if the SPL features is enabled for iMX6SL.
You missed to add the Signed-off-by tag in your patches. Please run ./scripts/checkpatch on your patches.
Regards,
Fabio Estevam

Update the Device Configuration Data file for iMX6SL for SPL support. --- board/freescale/mx6slevk/imximage.cfg | 78 ++--------------------------------- 1 file changed, 4 insertions(+), 74 deletions(-)
diff --git a/board/freescale/mx6slevk/imximage.cfg b/board/freescale/mx6slevk/imximage.cfg index 16ea597..3ebd985 100644 --- a/board/freescale/mx6slevk/imximage.cfg +++ b/board/freescale/mx6slevk/imximage.cfg @@ -1,7 +1,10 @@ /* * Copyright (C) 2013 Freescale Semiconductor, Inc. * - * SPDX-License-Identifier: GPL-2.0+ + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) any later version. * * Refer docs/README.imxmage for more details about how-to configure * and create imximage boot image @@ -40,76 +43,3 @@ DATA 4 0x020c4074 0xffffffff DATA 4 0x020c4078 0xffffffff DATA 4 0x020c407c 0xffffffff DATA 4 0x020c4080 0xffffffff - -DATA 4 0x020e0344 0x00003030 -DATA 4 0x020e0348 0x00003030 -DATA 4 0x020e034c 0x00003030 -DATA 4 0x020e0350 0x00003030 -DATA 4 0x020e030c 0x00000030 -DATA 4 0x020e0310 0x00000030 -DATA 4 0x020e0314 0x00000030 -DATA 4 0x020e0318 0x00000030 -DATA 4 0x020e0300 0x00000030 -DATA 4 0x020e031c 0x00000030 -DATA 4 0x020e0338 0x00000028 -DATA 4 0x020e0320 0x00000030 -DATA 4 0x020e032c 0x00000000 -DATA 4 0x020e033c 0x00000008 -DATA 4 0x020e0340 0x00000008 -DATA 4 0x020e05c4 0x00000030 -DATA 4 0x020e05cc 0x00000030 -DATA 4 0x020e05d4 0x00000030 -DATA 4 0x020e05d8 0x00000030 -DATA 4 0x020e05ac 0x00000030 -DATA 4 0x020e05c8 0x00000030 -DATA 4 0x020e05b0 0x00020000 -DATA 4 0x020e05b4 0x00000000 -DATA 4 0x020e05c0 0x00020000 -DATA 4 0x020e05d0 0x00080000 - -DATA 4 0x021b001c 0x00008000 -DATA 4 0x021b085c 0x1b4700c7 -DATA 4 0x021b0800 0xa1390003 -DATA 4 0x021b0890 0x00300000 -DATA 4 0x021b08b8 0x00000800 -DATA 4 0x021b081c 0x33333333 -DATA 4 0x021b0820 0x33333333 -DATA 4 0x021b0824 0x33333333 -DATA 4 0x021b0828 0x33333333 -DATA 4 0x021b082c 0xf3333333 -DATA 4 0x021b0830 0xf3333333 -DATA 4 0x021b0834 0xf3333333 -DATA 4 0x021b0838 0xf3333333 -DATA 4 0x021b0848 0x4241444a -DATA 4 0x021b0850 0x3030312b -DATA 4 0x021b083c 0x20000000 -DATA 4 0x021b0840 0x00000000 -DATA 4 0x021b08c0 0x24911492 -DATA 4 0x021b08b8 0x00000800 -DATA 4 0x021b000c 0x33374133 -DATA 4 0x021b0004 0x00020024 -DATA 4 0x021b0010 0x00100A82 -DATA 4 0x021b0014 0x00000093 -DATA 4 0x021b0018 0x00001688 -DATA 4 0x021b002c 0x0f9f26d2 -DATA 4 0x021b0030 0x0000020e -DATA 4 0x021b0038 0x00190778 -DATA 4 0x021b0008 0x00000000 -DATA 4 0x021b0040 0x0000004f -DATA 4 0x021b0000 0xc3110000 -DATA 4 0x021b001c 0x003f8030 -DATA 4 0x021b001c 0xff0a8030 -DATA 4 0x021b001c 0x82018030 -DATA 4 0x021b001c 0x04028030 -DATA 4 0x021b001c 0x02038030 -DATA 4 0x021b001c 0xff0a8038 -DATA 4 0x021b001c 0x82018038 -DATA 4 0x021b001c 0x04028038 -DATA 4 0x021b001c 0x02038038 -DATA 4 0x021b0800 0xa1310003 -DATA 4 0x021b0020 0x00001800 -DATA 4 0x021b0818 0x00000000 -DATA 4 0x021b08b8 0x00000800 -DATA 4 0x021b0004 0x00025564 -DATA 4 0x021b0404 0x00011006 -DATA 4 0x021b001c 0x00000000

Hi John,
On 09/11/2014 18:51, John Tobias wrote:
Update the Device Configuration Data file for iMX6SL for SPL support.
board/freescale/mx6slevk/imximage.cfg | 78 ++--------------------------------- 1 file changed, 4 insertions(+), 74 deletions(-)
diff --git a/board/freescale/mx6slevk/imximage.cfg b/board/freescale/mx6slevk/imximage.cfg index 16ea597..3ebd985 100644 --- a/board/freescale/mx6slevk/imximage.cfg +++ b/board/freescale/mx6slevk/imximage.cfg @@ -1,7 +1,10 @@ /*
- Copyright (C) 2013 Freescale Semiconductor, Inc.
- SPDX-License-Identifier: GPL-2.0+
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License or (at your option) any later version.
NAK. Please take a look at the SPDX. The SPDX identifier substitutes all stuff related to license, avoiding to duplicate the same lines in multiple files.
- Refer docs/README.imxmage for more details about how-to configure
- and create imximage boot image
@@ -40,76 +43,3 @@ DATA 4 0x020c4074 0xffffffff DATA 4 0x020c4078 0xffffffff DATA 4 0x020c407c 0xffffffff DATA 4 0x020c4080 0xffffffff
-DATA 4 0x020e0344 0x00003030 -DATA 4 0x020e0348 0x00003030 -DATA 4 0x020e034c 0x00003030 -DATA 4 0x020e0350 0x00003030 -DATA 4 0x020e030c 0x00000030 -DATA 4 0x020e0310 0x00000030 -DATA 4 0x020e0314 0x00000030 -DATA 4 0x020e0318 0x00000030 -DATA 4 0x020e0300 0x00000030 -DATA 4 0x020e031c 0x00000030 -DATA 4 0x020e0338 0x00000028 -DATA 4 0x020e0320 0x00000030 -DATA 4 0x020e032c 0x00000000 -DATA 4 0x020e033c 0x00000008 -DATA 4 0x020e0340 0x00000008 -DATA 4 0x020e05c4 0x00000030 -DATA 4 0x020e05cc 0x00000030 -DATA 4 0x020e05d4 0x00000030 -DATA 4 0x020e05d8 0x00000030 -DATA 4 0x020e05ac 0x00000030 -DATA 4 0x020e05c8 0x00000030 -DATA 4 0x020e05b0 0x00020000 -DATA 4 0x020e05b4 0x00000000 -DATA 4 0x020e05c0 0x00020000 -DATA 4 0x020e05d0 0x00080000
-DATA 4 0x021b001c 0x00008000 -DATA 4 0x021b085c 0x1b4700c7 -DATA 4 0x021b0800 0xa1390003 -DATA 4 0x021b0890 0x00300000 -DATA 4 0x021b08b8 0x00000800 -DATA 4 0x021b081c 0x33333333 -DATA 4 0x021b0820 0x33333333 -DATA 4 0x021b0824 0x33333333 -DATA 4 0x021b0828 0x33333333 -DATA 4 0x021b082c 0xf3333333 -DATA 4 0x021b0830 0xf3333333 -DATA 4 0x021b0834 0xf3333333 -DATA 4 0x021b0838 0xf3333333 -DATA 4 0x021b0848 0x4241444a -DATA 4 0x021b0850 0x3030312b -DATA 4 0x021b083c 0x20000000 -DATA 4 0x021b0840 0x00000000 -DATA 4 0x021b08c0 0x24911492 -DATA 4 0x021b08b8 0x00000800 -DATA 4 0x021b000c 0x33374133 -DATA 4 0x021b0004 0x00020024 -DATA 4 0x021b0010 0x00100A82 -DATA 4 0x021b0014 0x00000093 -DATA 4 0x021b0018 0x00001688 -DATA 4 0x021b002c 0x0f9f26d2 -DATA 4 0x021b0030 0x0000020e -DATA 4 0x021b0038 0x00190778 -DATA 4 0x021b0008 0x00000000 -DATA 4 0x021b0040 0x0000004f -DATA 4 0x021b0000 0xc3110000 -DATA 4 0x021b001c 0x003f8030 -DATA 4 0x021b001c 0xff0a8030 -DATA 4 0x021b001c 0x82018030 -DATA 4 0x021b001c 0x04028030 -DATA 4 0x021b001c 0x02038030 -DATA 4 0x021b001c 0xff0a8038 -DATA 4 0x021b001c 0x82018038 -DATA 4 0x021b001c 0x04028038 -DATA 4 0x021b001c 0x02038038 -DATA 4 0x021b0800 0xa1310003 -DATA 4 0x021b0020 0x00001800 -DATA 4 0x021b0818 0x00000000 -DATA 4 0x021b08b8 0x00000800 -DATA 4 0x021b0004 0x00025564 -DATA 4 0x021b0404 0x00011006 -DATA 4 0x021b001c 0x00000000
Some comment in the commit message explaining what is happening here can be useful.
Best regards, Stefano Babic

My mistake, I should use what's in the mx6q_4x_mt41j128.cfg.
Regards,
john
On Sun, Nov 9, 2014 at 1:31 PM, Stefano Babic sbabic@denx.de wrote:
Hi John,
On 09/11/2014 18:51, John Tobias wrote:
Update the Device Configuration Data file for iMX6SL for SPL support.
board/freescale/mx6slevk/imximage.cfg | 78 ++--------------------------------- 1 file changed, 4 insertions(+), 74 deletions(-)
diff --git a/board/freescale/mx6slevk/imximage.cfg b/board/freescale/mx6slevk/imximage.cfg index 16ea597..3ebd985 100644 --- a/board/freescale/mx6slevk/imximage.cfg +++ b/board/freescale/mx6slevk/imximage.cfg @@ -1,7 +1,10 @@ /*
- Copyright (C) 2013 Freescale Semiconductor, Inc.
- SPDX-License-Identifier: GPL-2.0+
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License or (at your option) any later version.
NAK. Please take a look at the SPDX. The SPDX identifier substitutes all stuff related to license, avoiding to duplicate the same lines in multiple files.
- Refer docs/README.imxmage for more details about how-to configure
- and create imximage boot image
@@ -40,76 +43,3 @@ DATA 4 0x020c4074 0xffffffff DATA 4 0x020c4078 0xffffffff DATA 4 0x020c407c 0xffffffff DATA 4 0x020c4080 0xffffffff
-DATA 4 0x020e0344 0x00003030 -DATA 4 0x020e0348 0x00003030 -DATA 4 0x020e034c 0x00003030 -DATA 4 0x020e0350 0x00003030 -DATA 4 0x020e030c 0x00000030 -DATA 4 0x020e0310 0x00000030 -DATA 4 0x020e0314 0x00000030 -DATA 4 0x020e0318 0x00000030 -DATA 4 0x020e0300 0x00000030 -DATA 4 0x020e031c 0x00000030 -DATA 4 0x020e0338 0x00000028 -DATA 4 0x020e0320 0x00000030 -DATA 4 0x020e032c 0x00000000 -DATA 4 0x020e033c 0x00000008 -DATA 4 0x020e0340 0x00000008 -DATA 4 0x020e05c4 0x00000030 -DATA 4 0x020e05cc 0x00000030 -DATA 4 0x020e05d4 0x00000030 -DATA 4 0x020e05d8 0x00000030 -DATA 4 0x020e05ac 0x00000030 -DATA 4 0x020e05c8 0x00000030 -DATA 4 0x020e05b0 0x00020000 -DATA 4 0x020e05b4 0x00000000 -DATA 4 0x020e05c0 0x00020000 -DATA 4 0x020e05d0 0x00080000
-DATA 4 0x021b001c 0x00008000 -DATA 4 0x021b085c 0x1b4700c7 -DATA 4 0x021b0800 0xa1390003 -DATA 4 0x021b0890 0x00300000 -DATA 4 0x021b08b8 0x00000800 -DATA 4 0x021b081c 0x33333333 -DATA 4 0x021b0820 0x33333333 -DATA 4 0x021b0824 0x33333333 -DATA 4 0x021b0828 0x33333333 -DATA 4 0x021b082c 0xf3333333 -DATA 4 0x021b0830 0xf3333333 -DATA 4 0x021b0834 0xf3333333 -DATA 4 0x021b0838 0xf3333333 -DATA 4 0x021b0848 0x4241444a -DATA 4 0x021b0850 0x3030312b -DATA 4 0x021b083c 0x20000000 -DATA 4 0x021b0840 0x00000000 -DATA 4 0x021b08c0 0x24911492 -DATA 4 0x021b08b8 0x00000800 -DATA 4 0x021b000c 0x33374133 -DATA 4 0x021b0004 0x00020024 -DATA 4 0x021b0010 0x00100A82 -DATA 4 0x021b0014 0x00000093 -DATA 4 0x021b0018 0x00001688 -DATA 4 0x021b002c 0x0f9f26d2 -DATA 4 0x021b0030 0x0000020e -DATA 4 0x021b0038 0x00190778 -DATA 4 0x021b0008 0x00000000 -DATA 4 0x021b0040 0x0000004f -DATA 4 0x021b0000 0xc3110000 -DATA 4 0x021b001c 0x003f8030 -DATA 4 0x021b001c 0xff0a8030 -DATA 4 0x021b001c 0x82018030 -DATA 4 0x021b001c 0x04028030 -DATA 4 0x021b001c 0x02038030 -DATA 4 0x021b001c 0xff0a8038 -DATA 4 0x021b001c 0x82018038 -DATA 4 0x021b001c 0x04028038 -DATA 4 0x021b001c 0x02038038 -DATA 4 0x021b0800 0xa1310003 -DATA 4 0x021b0020 0x00001800 -DATA 4 0x021b0818 0x00000000 -DATA 4 0x021b08b8 0x00000800 -DATA 4 0x021b0004 0x00025564 -DATA 4 0x021b0404 0x00011006 -DATA 4 0x021b001c 0x00000000
Some comment in the commit message explaining what is happening here can be useful.
Best regards, Stefano Babic
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de =====================================================================

add spl on build configuration for iMX6SL --- configs/mx6slevk_defconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/configs/mx6slevk_defconfig b/configs/mx6slevk_defconfig index fb8c4de..dfdf54f 100644 --- a/configs/mx6slevk_defconfig +++ b/configs/mx6slevk_defconfig @@ -1,3 +1,4 @@ +CONFIG_SPL=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL" -CONFIG_ARM=y -CONFIG_TARGET_MX6SLEVK=y ++S:CONFIG_ARM=y ++S:CONFIG_TARGET_MX6SLEVK=y

iMX6SL has a different address value for the following:
CONFIG_SPL_BSS_START_ADDR CONFIG_SYS_SPL_MALLOC_START --- include/configs/imx6_spl.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/configs/imx6_spl.h b/include/configs/imx6_spl.h index 4ff37b3..61233c4 100644 --- a/include/configs/imx6_spl.h +++ b/include/configs/imx6_spl.h @@ -64,10 +64,16 @@ #define CONFIG_SPL_LIBDISK_SUPPORT #endif
+#ifndef CONFIG_SPL_BSS_START_ADDR #define CONFIG_SPL_BSS_START_ADDR 0x18200000 +#endif #define CONFIG_SPL_BSS_MAX_SIZE 0x100000 /* 1 MB */ +#ifndef CONFIG_SYS_SPL_MALLOC_START #define CONFIG_SYS_SPL_MALLOC_START 0x18300000 +#endif +#ifndef CONFIG_SYS_SPL_MALLOC_SIZE #define CONFIG_SYS_SPL_MALLOC_SIZE 0x3200000 /* 50 MB */ +#endif #ifndef CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_TEXT_BASE 0x17800000 #endif

add the SPL macros in include header file for iMX6SL --- include/configs/mx6slevk.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h index 4fcaf51..afbb81d 100644 --- a/include/configs/mx6slevk.h +++ b/include/configs/mx6slevk.h @@ -14,6 +14,14 @@ #include <linux/sizes.h> #include "mx6_common.h"
+#ifdef CONFIG_SPL +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_MMC_SUPPORT +#define CONFIG_SPL_BSS_START_ADDR 0x82000000 +#define CONFIG_SYS_SPL_MALLOC_START 0x83000000 +#include "imx6_spl.h" +#endif + #define CONFIG_MX6 #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO

This patch support the SPL features for iMX6SL. It tested to boot on SD1, SD2 and SD3 mmc ports. --- board/freescale/mx6slevk/mx6slevk.c | 168 +++++++++++++++++++++++++++++++++++- 1 file changed, 167 insertions(+), 1 deletion(-)
diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index e76c343..2c11c4a 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -42,7 +42,7 @@ DECLARE_GLOBAL_DATA_PTR;
int dram_init(void) { - gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); + gd->ram_size = imx_ddr_size();
return 0; } @@ -275,3 +275,169 @@ int checkboard(void)
return 0; } + +#ifdef CONFIG_SPL_BUILD +#include <spl.h> +#include <libfdt.h> + +#define BOOT_CFG 0x20D8004 +#define __REG(x) (*((volatile u32 *)(x))) + +struct fsl_esdhc_cfg spl_usdhc_cfg; +/* + * Got it from imximage.cfg file + */ +static void spl_dram_mx6slevk(void) +{ + __REG(0x020e0344) = 0x00003030; + __REG(0x020e0348) = 0x00003030; + __REG(0x020e034c) = 0x00003030; + __REG(0x020e0350) = 0x00003030; + __REG(0x020e030c) = 0x00000030; + __REG(0x020e0310) = 0x00000030; + __REG(0x020e0314) = 0x00000030; + __REG(0x020e0318) = 0x00000030; + __REG(0x020e0300) = 0x00000030; + __REG(0x020e031c) = 0x00000030; + __REG(0x020e0338) = 0x00000028; + __REG(0x020e0320) = 0x00000030; + __REG(0x020e032c) = 0x00000000; + __REG(0x020e033c) = 0x00000008; + __REG(0x020e0340) = 0x00000008; + __REG(0x020e05c4) = 0x00000030; + __REG(0x020e05cc) = 0x00000030; + __REG(0x020e05d4) = 0x00000030; + __REG(0x020e05d8) = 0x00000030; + __REG(0x020e05ac) = 0x00000030; + __REG(0x020e05c8) = 0x00000030; + __REG(0x020e05b0) = 0x00020000; + __REG(0x020e05b4) = 0x00000000; + __REG(0x020e05c0) = 0x00020000; + __REG(0x020e05d0) = 0x00080000; + + __REG(0x021b001c) = 0x00008000; + __REG(0x021b085c) = 0x1b4700c7; + __REG(0x021b0800) = 0xa1390003; + __REG(0x021b0890) = 0x00300000; + __REG(0x021b08b8) = 0x00000800; + __REG(0x021b081c) = 0x33333333; + __REG(0x021b0820) = 0x33333333; + __REG(0x021b0824) = 0x33333333; + __REG(0x021b0828) = 0x33333333; + __REG(0x021b082c) = 0xf3333333; + __REG(0x021b0830) = 0xf3333333; + __REG(0x021b0834) = 0xf3333333; + __REG(0x021b0838) = 0xf3333333; + __REG(0x021b0848) = 0x4241444a; + __REG(0x021b0850) = 0x3030312b; + __REG(0x021b083c) = 0x20000000; + __REG(0x021b0840) = 0x00000000; + __REG(0x021b08c0) = 0x24911492; + __REG(0x021b08b8) = 0x00000800; + __REG(0x021b000c) = 0x33374133; + __REG(0x021b0004) = 0x00020024; + __REG(0x021b0010) = 0x00100A82; + __REG(0x021b0014) = 0x00000093; + __REG(0x021b0018) = 0x00001688; + __REG(0x021b002c) = 0x0f9f26d2; + __REG(0x021b0030) = 0x0000020e; + __REG(0x021b0038) = 0x00190778; + __REG(0x021b0008) = 0x00000000; + __REG(0x021b0040) = 0x0000004f; + __REG(0x021b0000) = 0xc3110000; + __REG(0x021b001c) = 0x003f8030; + __REG(0x021b001c) = 0xff0a8030; + __REG(0x021b001c) = 0x82018030; + __REG(0x021b001c) = 0x04028030; + __REG(0x021b001c) = 0x02038030; + __REG(0x021b001c) = 0xff0a8038; + __REG(0x021b001c) = 0x82018038; + __REG(0x021b001c) = 0x04028038; + __REG(0x021b001c) = 0x02038038; + __REG(0x021b0800) = 0xa1310003; + __REG(0x021b0020) = 0x00001800; + __REG(0x021b0818) = 0x00000000; + __REG(0x021b08b8) = 0x00000800; + __REG(0x021b0004) = 0x00025564; + __REG(0x021b0404) = 0x00011006; + __REG(0x021b001c) = 0x00000000; +} + +/* + * This section require the differentiation + * between iMX6 SL. + * But for now, it will configure only for + * iMX6SL-evk. + */ +static void spl_dram_init(void) +{ + spl_dram_mx6slevk(); +} + +int spl_board_mmc_init(bd_t *bis) +{ + unsigned reg = readl(BOOT_CFG) >> 11; + /* + * Upon reading BOOT_CFG register the following map is done: + * Bit 11 and 12 of BOOT_CFG register can determine the current + * mmc port + * 0x0 SD1 + * 0x1 SD2 + * 0x2 SD3 + */ + + switch (reg & 0x3) { + case 0x0: + imx_iomux_v3_setup_multiple_pads( + usdhc1_pads, ARRAY_SIZE(usdhc1_pads)); + spl_usdhc_cfg.esdhc_base = USDHC1_BASE_ADDR; + spl_usdhc_cfg.sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK); + gd->arch.sdhc_clk = spl_usdhc_cfg.sdhc_clk; + break; + case 0x1: + imx_iomux_v3_setup_multiple_pads( + usdhc2_pads, ARRAY_SIZE(usdhc2_pads)); + spl_usdhc_cfg.esdhc_base = USDHC2_BASE_ADDR; + spl_usdhc_cfg.sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); + gd->arch.sdhc_clk = spl_usdhc_cfg.sdhc_clk; + break; + case 0x2: + imx_iomux_v3_setup_multiple_pads( + usdhc3_pads, ARRAY_SIZE(usdhc3_pads)); + spl_usdhc_cfg.esdhc_base = USDHC3_BASE_ADDR; + spl_usdhc_cfg.sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); + gd->arch.sdhc_clk = spl_usdhc_cfg.sdhc_clk; + break; + } + + return fsl_esdhc_initialize(bis, &spl_usdhc_cfg); +} + +void board_init_f(ulong dummy) +{ + /* setup AIPS and disable watchdog */ + arch_cpu_init(); + + /* iomux and setup of i2c */ + board_early_init_f(); + + /* setup GP timer */ + timer_init(); + + /* UART clocks enabled and gd valid - init serial console */ + preloader_console_init(); + + /* DDR initialization */ + spl_dram_init(); + + /* Clear the BSS. */ + memset(__bss_start, 0, __bss_end - __bss_start); + + /* load/boot image from boot device */ + board_init_r(NULL, 0); +} + +void reset_cpu(ulong addr) +{ +} +#endif

enable SUPPORT_SPL by default for iMX6SL-evk --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ab0d284..40a3604 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -614,6 +614,7 @@ config TARGET_MX6SABRESD config TARGET_MX6SLEVK bool "Support mx6slevk" select CPU_V7 + select SUPPORT_SPL
config TARGET_MX6SXSABRESD bool "Support mx6sxsabresd"

Hi,
Please drop "***" from the cover letter template git-format-patch generates. :)
Cheers, Andreas

Thanks for the info.
Regards,
John
On Sunday, November 9, 2014, Andreas Färber afaerber@suse.de wrote:
Hi,
Please drop "***" from the cover letter template git-format-patch generates. :)
Cheers, Andreas
-- SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 21284 AG Nürnberg
participants (4)
-
Andreas Färber
-
Fabio Estevam
-
John Tobias
-
Stefano Babic