MLK-14250-1 mx6slevk: Add plugin boot support
authorYe Li <ye.li@nxp.com>
Thu, 23 Feb 2017 06:47:57 +0000 (14:47 +0800)
committerYe Li <ye.li@nxp.com>
Wed, 5 Apr 2017 06:04:38 +0000 (14:04 +0800)
Add plugin.S for plugin boot initialization. Need to set "CONFIG_USE_IMXIMG_PLUGIN"
for this feature.
Add the build configuration "mx6slevk_plugin_defconfig" to use the plugin.

Signed-off-by: Ye Li <ye.li@nxp.com>
board/freescale/mx6slevk/imximage.cfg
board/freescale/mx6slevk/plugin.S [new file with mode: 0644]
configs/mx6slevk_plugin_defconfig [new file with mode: 0644]

index 024de9c..a8c940e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ * Copyright (C) 2013-2016 Freescale Semiconductor, Inc.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  *
@@ -9,6 +9,9 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
+#define __ASSEMBLY__
+#include <config.h>
+
 /* image version */
 
 IMAGE_VERSION 2
@@ -20,6 +23,11 @@ IMAGE_VERSION 2
 
 BOOT_FROM      sd
 
+#ifdef CONFIG_USE_IMXIMG_PLUGIN
+/*PLUGIN    plugin-binary-file    IRAM_FREE_START_ADDR*/
+PLUGIN  board/freescale/mx6slevk/plugin.bin 0x00907000
+#else
+
 /*
  * Device Configuration Data (DCD)
  *
@@ -113,3 +121,4 @@ DATA 4 0x021b08b8 0x00000800
 DATA 4 0x021b0004 0x00025564
 DATA 4 0x021b0404 0x00011006
 DATA 4 0x021b001c 0x00000000
+#endif
diff --git a/board/freescale/mx6slevk/plugin.S b/board/freescale/mx6slevk/plugin.S
new file mode 100644 (file)
index 0000000..2b39c7f
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <config.h>
+
+/* DDR script */
+.macro imx6slevk_ddr_setting
+       ldr r0, =CCM_BASE_ADDR
+       ldr r1, =0x00260324
+       str r1, [r0, #0x018]
+
+       ldr r0, =IOMUXC_BASE_ADDR
+       ldr r1, =0x00020000
+       str r1, [r0, #0x5c0]
+       ldr r1, =0x00000000
+       str r1, [r0, #0x5b4]
+
+       ldr r1, =0x00000028
+       str r1, [r0, #0x338]
+
+       ldr r1, =0x00000030
+       str r1, [r0, #0x300]
+       str r1, [r0, #0x31c]
+       str r1, [r0, #0x320]
+
+       ldr r1, =0x00000000
+       str r1, [r0, #0x32c]
+
+       ldr r1, =0x00000030
+       str r1, [r0, #0x5ac]
+       str r1, [r0, #0x5c8]
+
+       ldr r1, =0x00020000
+       str r1, [r0, #0x5b0]
+
+       ldr r1, =0x00003030
+       str r1, [r0, #0x344]
+       str r1, [r0, #0x348]
+       str r1, [r0, #0x34c]
+       str r1, [r0, #0x350]
+
+       ldr r1, =0x00080000
+       str r1, [r0, #0x5d0]
+
+       ldr r1, =0x00000030
+       str r1, [r0, #0x5c4]
+       str r1, [r0, #0x5cc]
+       str r1, [r0, #0x5d4]
+       str r1, [r0, #0x5d8]
+
+       str r1, [r0, #0x30c]
+       str r1, [r0, #0x310]
+       str r1, [r0, #0x314]
+       str r1, [r0, #0x318]
+
+       ldr r0, =MMDC_P0_BASE_ADDR
+       ldr r2, =0x00008000
+       str r2, [r0, #0x01c]
+
+       ldr r2, =0x1b4700c7
+       str r2, [r0, #0x85c]
+
+       ldr r2, =0xa1390003
+       str r2, [r0, #0x800]
+
+       ldr r2, =0x00300000
+       str r2, [r0, #0x890]
+
+       ldr r2, =0x00000800
+       str r2, [r0, #0x8b8]
+
+       ldr r2, =0x33333333
+       str r2, [r0, #0x81c]
+       str r2, [r0, #0x820]
+       str r2, [r0, #0x824]
+       str r2, [r0, #0x828]
+       str r2, [r0, #0x82c]
+       str r2, [r0, #0x830]
+       str r2, [r0, #0x834]
+       str r2, [r0, #0x838]
+
+       ldr r2, =0x4241444a
+       str r2, [r0, #0x848]
+
+       ldr r2, =0x3030312b
+       str r2, [r0, #0x850]
+
+       ldr r2, =0x20000000
+       str r2, [r0, #0x83c]
+
+       ldr r2, =0x00000000
+       str r2, [r0, #0x840]
+
+       ldr r2, =0x00000800
+       str r2, [r0, #0x8b8]
+
+       ldr r2, =0x33374133
+       str r2, [r0, #0x00c]
+
+       ldr r2, =0x00020024
+       str r2, [r0, #0x004]
+
+       ldr r2, =0x00100A82
+       str r2, [r0, #0x010]
+       ldr r2, =0x00000093
+       str r2, [r0, #0x014]
+       ldr r2, =0x00001688
+       str r2, [r0, #0x018]
+       ldr r2, =0x0F9F26D2
+       str r2, [r0, #0x02c]
+
+       ldr r2, =0x0000020E
+       str r2, [r0, #0x030]
+       ldr r2, =0x00190778
+       str r2, [r0, #0x038]
+       ldr r2, =0x00000000
+       str r2, [r0, #0x008]
+       ldr r2, =0x0000004F
+       str r2, [r0, #0x040]
+       ldr r2, =0xC3110000
+       str r2, [r0, #0x000]
+
+       ldr r2, =0x00008050
+       str r2, [r0, #0x01c]
+       ldr r2, =0x003F8030
+       str r2, [r0, #0x01c]
+       ldr r2, =0xFF0A8030
+       str r2, [r0, #0x01c]
+       ldr r2, =0x82018030
+       str r2, [r0, #0x01c]
+       ldr r2, =0x04028030
+       str r2, [r0, #0x01c]
+       ldr r2, =0x02038030
+       str r2, [r0, #0x01c]
+       ldr r2, =0xFF0A8038
+       str r2, [r0, #0x01c]
+       ldr r2, =0x82018038
+       str r2, [r0, #0x01c]
+       ldr r2, =0x04028038
+       str r2, [r0, #0x01c]
+       ldr r2, =0x02038038
+       str r2, [r0, #0x01c]
+
+       ldr r2, =0xa1310003
+       str r2, [r0, #0x800]
+
+       ldr r2, =0x00001800
+       str r2, [r0, #0x020]
+
+       ldr r2, =0x00000000
+       str r2, [r0, #0x818]
+
+       ldr r2, =0x00000800
+       str r2, [r0, #0x8b8]
+
+       ldr r2, =0x00025564
+       str r2, [r0, #0x004]
+
+       ldr r2, =0x00011006
+       str r2, [r0, #0x404]
+
+       ldr r2, =0x00000000
+       str r2, [r0, #0x01c]
+.endm
+.macro imx6_clock_gating
+       ldr r0, =CCM_BASE_ADDR
+       ldr r1, =0xffffffff
+       str r1, [r0, #0x068]
+       str r1, [r0, #0x06c]
+       str r1, [r0, #0x070]
+       str r1, [r0, #0x074]
+       str r1, [r0, #0x078]
+       str r1, [r0, #0x07c]
+       str r1, [r0, #0x080]
+       str r1, [r0, #0x084]
+.endm
+
+.macro imx6_qos_setting
+.endm
+
+.macro imx6_ddr_setting
+       imx6slevk_ddr_setting
+.endm
+
+/* include the common plugin code here */
+#include <asm/arch/mx6_plugin.S>
diff --git a/configs/mx6slevk_plugin_defconfig b/configs/mx6slevk_plugin_defconfig
new file mode 100644 (file)
index 0000000..35c6cdb
--- /dev/null
@@ -0,0 +1,33 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MX6=y
+CONFIG_TARGET_MX6SLEVK=y
+CONFIG_USE_IMXIMG_PLUGIN=y
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL"
+CONFIG_BOOTDELAY=3
+CONFIG_BOARD_EARLY_INIT_F=y
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_GPIO=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_DM=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_DM_THERMAL=y
+CONFIG_USB=y
+CONFIG_USB_STORAGE=y
+CONFIG_OF_LIBFDT=y