summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx6/board-mx6sl_arm2.c
diff options
context:
space:
mode:
authorRobby Cai <R63905@freescale.com>2012-06-08 14:48:15 +0800
committerJason Liu <r64343@freescale.com>2012-07-20 13:38:35 +0800
commit1d8ad58fe1f404ef4883eedcc2ef18ea4b334e51 (patch)
treec208c114bb19395e371d40caa12a50abf2ef5615 /arch/arm/mach-mx6/board-mx6sl_arm2.c
parent9aca7cadad3cafa974dba51596f7bde2a732c23a (diff)
ENGR00212818: mx6sl: Add SPI NOR flash support
only set board-specific data and re-use the existing SPI-NOR flash driver. Signed-off-by: Robby Cai <R63905@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx6/board-mx6sl_arm2.c')
-rwxr-xr-xarch/arm/mach-mx6/board-mx6sl_arm2.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-mx6/board-mx6sl_arm2.c b/arch/arm/mach-mx6/board-mx6sl_arm2.c
index 6d5cdc1f5472..3d1bba15c626 100755
--- a/arch/arm/mach-mx6/board-mx6sl_arm2.c
+++ b/arch/arm/mach-mx6/board-mx6sl_arm2.c
@@ -365,6 +365,46 @@ static const struct spi_imx_master mx6_arm2_spi_data __initconst = {
.num_chipselect = ARRAY_SIZE(mx6_arm2_spi_cs),
};
+#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
+static struct mtd_partition m25p32_partitions[] = {
+ {
+ .name = "bootloader",
+ .offset = 0,
+ .size = 0x00040000,
+ }, {
+ .name = "kernel",
+ .offset = MTDPART_OFS_APPEND,
+ .size = MTDPART_SIZ_FULL,
+ },
+};
+
+static struct flash_platform_data m25p32_spi_flash_data = {
+ .name = "m25p32",
+ .parts = m25p32_partitions,
+ .nr_parts = ARRAY_SIZE(m25p32_partitions),
+ .type = "m25p32",
+};
+
+static struct spi_board_info m25p32_spi0_board_info[] __initdata = {
+ {
+ /* The modalias must be the same as spi device driver name */
+ .modalias = "m25p80",
+ .max_speed_hz = 20000000,
+ .bus_num = 0,
+ .chip_select = 0,
+ .platform_data = &m25p32_spi_flash_data,
+ },
+};
+#endif
+
+static void spi_device_init(void)
+{
+#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
+ spi_register_board_info(m25p32_spi0_board_info,
+ ARRAY_SIZE(m25p32_spi0_board_info));
+#endif
+}
+
static struct imx_ssi_platform_data mx6_sabresd_ssi_pdata = {
.flags = IMX_SSI_DMA | IMX_SSI_SYN,
};
@@ -1019,6 +1059,11 @@ static void __init mx6_arm2_init(void)
imx6q_add_imx_i2c(2, &mx6_arm2_i2c2_data);
i2c_register_board_info(2, mxc_i2c2_board_info,
ARRAY_SIZE(mxc_i2c2_board_info));
+
+ /* SPI */
+ imx6q_add_ecspi(0, &mx6_arm2_spi_data);
+ spi_device_init();
+
mx6sl_arm2_init_pfuze100(0);
imx6q_add_anatop_thermal_imx(1, &mx6sl_anatop_thermal_data);