summaryrefslogtreecommitdiff
path: root/target/linux/ifxmips/files/arch/mips
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2007-12-25 13:26:41 +0000
committerJohn Crispin <john@openwrt.org>2007-12-25 13:26:41 +0000
commitea2872326a0675e9d051b94e3368fb6cfd91d32f (patch)
tree300d662b5103c9013acf00104a3cb6d994f61806 /target/linux/ifxmips/files/arch/mips
parent8c487df2463efbacdaf7ec355b116fe4d12346ff (diff)
downloadmtk-20170518-ea2872326a0675e9d051b94e3368fb6cfd91d32f.zip
mtk-20170518-ea2872326a0675e9d051b94e3368fb6cfd91d32f.tar.gz
mtk-20170518-ea2872326a0675e9d051b94e3368fb6cfd91d32f.tar.bz2
turned ifxmips mtd driver into a platform device
SVN-Revision: 9926
Diffstat (limited to 'target/linux/ifxmips/files/arch/mips')
-rw-r--r--target/linux/ifxmips/files/arch/mips/ifxmips/board.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/target/linux/ifxmips/files/arch/mips/ifxmips/board.c b/target/linux/ifxmips/files/arch/mips/ifxmips/board.c
index 05a0715..f048321 100644
--- a/target/linux/ifxmips/files/arch/mips/ifxmips/board.c
+++ b/target/linux/ifxmips/files/arch/mips/ifxmips/board.c
@@ -71,6 +71,29 @@ static struct platform_device ifxmips_mii[] =
.name = "ifxmips_mii0",
},
};
+
+static struct physmap_flash_data ifxmips_mtd_data = {
+ .width = 2,
+};
+
+static struct resource ifxmips_mtd_resource = {
+ .start = IFXMIPS_FLASH_START,
+ .end = IFXMIPS_FLASH_START + IFXMIPS_FLASH_MAX - 1,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device ifxmips_mtd[] =
+{
+ {
+ .id = 0,
+ .name = "ifxmips_mtd",
+ .dev = {
+ .platform_data = &ifxmips_mtd_data,
+ },
+ .num_resources = 1,
+ .resource = &ifxmips_mtd_resource,
+ },
+};
const char*
get_system_type (void)
@@ -102,6 +125,7 @@ int __init ifxmips_init_devices(void)
ifxmips_devs[dev++] = ifxmips_led;
ifxmips_devs[dev++] = ifxmips_gpio;
ifxmips_devs[dev++] = ifxmips_mii;
+ ifxmips_devs[dev++] = ifxmips_mtd;
return platform_add_devices(ifxmips_devs, dev);
}