@@ -38,6 +38,7 @@ extern struct platform_device spear13xx_kbd_device;
extern struct platform_device spear13xx_ohci0_device;
extern struct platform_device spear13xx_ohci1_device;
extern struct platform_device spear13xx_rtc_device;
+extern struct platform_device spear13xx_smi_device;
extern struct sys_timer spear13xx_timer;
/* Add spear1300 machine device structure declarations here */
@@ -17,6 +17,7 @@
#include <mach/generic.h>
#include <mach/spear.h>
#include <plat/keyboard.h>
+#include <plat/smi.h>
static struct amba_device *amba_devs[] __initdata = {
&spear13xx_gpio_device[0],
@@ -32,6 +33,7 @@ static struct platform_device *plat_devs[] __initdata = {
&spear13xx_ohci0_device,
&spear13xx_ohci1_device,
&spear13xx_rtc_device,
+ &spear13xx_smi_device,
};
/* keyboard specific platform data */
@@ -56,6 +58,9 @@ static void __init spear1300_evb_init(void)
/* Register slave devices on the I2C buses */
i2c_register_board_devices();
+ /* initialize serial nor related data in smi plat data */
+ smi_init_board_info(&spear13xx_smi_device);
+
/* Add Platform Devices */
platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
@@ -241,6 +241,25 @@ struct platform_device spear13xx_rtc_device = {
.resource = rtc_resources,
};
+/* smi device registration */
+static struct resource smi_resources[] = {
+ {
+ .start = SPEAR13XX_SMI_CTRL_BASE,
+ .end = SPEAR13XX_SMI_CTRL_BASE + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = IRQ_SMI,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device spear13xx_smi_device = {
+ .name = "smi",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(smi_resources),
+ .resource = smi_resources,
+};
+
/* Do spear13xx familiy common initialization part here */
void __init spear13xx_init(void)
{
@@ -38,6 +38,7 @@ extern struct platform_device i2c_device;
extern struct platform_device ohci0_device;
extern struct platform_device ohci1_device;
extern struct platform_device rtc_device;
+extern struct platform_device smi_device;
extern struct sys_timer spear3xx_timer;
/* Add spear3xx family function declarations here */
@@ -16,6 +16,7 @@
#include <mach/generic.h>
#include <mach/spear.h>
#include <plat/keyboard.h>
+#include <plat/smi.h>
/* padmux devices to enable */
static struct pmx_dev *pmx_devs[] = {
@@ -50,6 +51,7 @@ static struct platform_device *plat_devs[] __initdata = {
&ohci0_device,
&ohci1_device,
&rtc_device,
+ &smi_device,
/* spear300 specific devices */
&kbd_device,
@@ -82,6 +84,9 @@ static void __init spear300_evb_init(void)
/* Register slave devices on the I2C buses */
i2c_register_board_devices();
+ /* initialize serial nor related data in smi plat data */
+ smi_init_board_info(&smi_device);
+
/* Add Platform Devices */
platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
@@ -15,6 +15,7 @@
#include <asm/mach-types.h>
#include <mach/generic.h>
#include <mach/spear.h>
+#include <plat/smi.h>
/* padmux devices to enable */
static struct pmx_dev *pmx_devs[] = {
@@ -55,6 +56,7 @@ static struct platform_device *plat_devs[] __initdata = {
&ohci0_device,
&ohci1_device,
&rtc_device,
+ &smi_device,
/* spear310 specific devices */
&plgpio_device,
@@ -75,6 +77,9 @@ static void __init spear310_evb_init(void)
/* Register slave devices on the I2C buses */
i2c_register_board_devices();
+ /* initialize serial nor related data in smi plat data */
+ smi_init_board_info(&smi_device);
+
/* Add Platform Devices */
platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
@@ -15,6 +15,7 @@
#include <asm/mach-types.h>
#include <mach/generic.h>
#include <mach/spear.h>
+#include <plat/smi.h>
/* padmux devices to enable */
static struct pmx_dev *pmx_devs[] = {
@@ -53,6 +54,7 @@ static struct platform_device *plat_devs[] __initdata = {
&ohci0_device,
&ohci1_device,
&rtc_device,
+ &smi_device,
/* spear320 specific devices */
&i2c1_device,
@@ -72,6 +74,9 @@ static void __init spear320_evb_init(void)
/* call spear320 machine init function */
spear320_init();
+ /* initialize serial nor related data in smi plat data */
+ smi_init_board_info(&smi_device);
+
/* Register slave devices on the I2C buses */
i2c_register_board_devices();
@@ -175,6 +175,25 @@ struct platform_device rtc_device = {
.resource = rtc_resources,
};
+/* smi device registration */
+static struct resource smi_resources[] = {
+ {
+ .start = SPEAR3XX_ICM3_SMI_CTRL_BASE,
+ .end = SPEAR3XX_ICM3_SMI_CTRL_BASE + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = IRQ_BASIC_SMI,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device smi_device = {
+ .name = "smi",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(smi_resources),
+ .resource = smi_resources,
+};
+
/* Do spear3xx familiy common initialization part here */
void __init spear3xx_init(void)
{
@@ -38,6 +38,7 @@ extern struct platform_device i2c_device;
extern struct platform_device ohci0_device;
extern struct platform_device ohci1_device;
extern struct platform_device rtc_device;
+extern struct platform_device smi_device;
extern struct sys_timer spear6xx_timer;
/* Add spear6xx family function declarations here */
@@ -15,6 +15,7 @@
#include <asm/mach-types.h>
#include <mach/generic.h>
#include <mach/spear.h>
+#include <plat/smi.h>
static struct amba_device *amba_devs[] __initdata = {
&clcd_device,
@@ -32,6 +33,7 @@ static struct platform_device *plat_devs[] __initdata = {
&ohci0_device,
&ohci1_device,
&rtc_device,
+ &smi_device,
};
static void __init spear600_evb_init(void)
@@ -44,6 +46,9 @@ static void __init spear600_evb_init(void)
/* Register slave devices on the I2C buses */
i2c_register_board_devices();
+ /* initialize serial nor related data in smi plat data */
+ smi_init_board_info(&smi_device);
+
/* Add Platform Devices */
platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
@@ -267,6 +267,25 @@ struct platform_device rtc_device = {
.resource = rtc_resources,
};
+/* smi device registration */
+static struct resource smi_resources[] = {
+ {
+ .start = SPEAR6XX_ICM3_SMI_CTRL_BASE,
+ .end = SPEAR6XX_ICM3_SMI_CTRL_BASE + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = IRQ_BASIC_SMI,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device smi_device = {
+ .name = "smi",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(smi_resources),
+ .resource = smi_resources,
+};
+
/* This will add devices, and do machine specific tasks */
void __init spear6xx_init(void)
{
@@ -3,7 +3,7 @@
#
# Common support
-obj-y := clcd.o clock.o time.o
+obj-y := clcd.o clock.o time.o smi.o
obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o padmux.o
obj-$(CONFIG_MACH_SPEAR310) += plgpio.o
@@ -65,4 +65,7 @@ static inline void smi_set_plat_data(struct platform_device *pdev,
pdev->dev.platform_data = pdata;
}
+/* function used to initialize default smi platform data */
+void smi_init_board_info(struct platform_device *pdev);
+
#endif /* __PLAT_SMI_H */
new file mode 100644
@@ -0,0 +1,63 @@
+/*
+ * arch/arm/plat-spear/smi.c
+ *
+ * spear smi platform intialization
+ *
+ * Copyright (C) 2010 ST Microelectronics
+ * Shiraz Hashim <shiraz.hashim@st.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <asm/mach-types.h>
+#include <plat/smi.h>
+#include <mach/spear.h>
+
+/*
+ * physical base address of flash/bank mem map base associated with smi
+ * depends on SoC
+ */
+
+#if defined(CONFIG_ARCH_SPEAR13XX)
+#define FLASH_MEM_BASE SPEAR13XX_SMI_MEM_BASE
+
+#elif defined(CONFIG_ARCH_SPEAR3XX)
+#define FLASH_MEM_BASE SPEAR3XX_ICM3_SMEM_BASE
+
+#elif defined(CONFIG_ARCH_SPEAR6XX)
+#define FLASH_MEM_BASE SPEAR6XX_ICM3_SMEM_BASE
+
+#endif
+
+/* serial nor flash specific board data */
+static struct mtd_partition nor_partition_info[] = {
+ DEFINE_PARTS("Xloader", 0x00, 0x10000),
+ DEFINE_PARTS("UBoot", 0x10000, 0x40000),
+ DEFINE_PARTS("Kernel", 0x50000, 0x2C0000),
+ DEFINE_PARTS("Root File System", 0x310000, 0x4F0000),
+};
+
+static struct spear_smi_flash_info nor_flash_info[] = {
+ {
+ .name = "m25p64",
+ .fast_mode = 1,
+ .mem_base = FLASH_MEM_BASE,
+ .size = 8 * 1024 * 1024,
+ .num_parts = ARRAY_SIZE(nor_partition_info),
+ .parts = nor_partition_info,
+ },
+};
+
+/* smi specific board data */
+static struct spear_smi_plat_data smi_plat_data = {
+ .clk_rate = 50000000, /* 50MHz */
+ .num_flashes = ARRAY_SIZE(nor_flash_info),
+ .board_flash_info = nor_flash_info,
+};
+
+void smi_init_board_info(struct platform_device *pdev)
+{
+ smi_set_plat_data(pdev, &smi_plat_data);
+}