summaryrefslogtreecommitdiff
path: root/target/linux/adm8668/files/arch/mips
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-12-06 22:40:17 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-12-06 22:40:17 +0000
commite9824bd88f25c41db1a09e1752d44c4edb5fff48 (patch)
treefe4ddae6999c56902ffe57fe4ed9431192dc17fc /target/linux/adm8668/files/arch/mips
parentb96a534bb25f12b478340ee36c7d4e3b376ceb8f (diff)
[adm8668] replace the custom mtd driver with a partition parser
Signed-off-by: Florian Fainelli <florian@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34554 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/adm8668/files/arch/mips')
-rw-r--r--target/linux/adm8668/files/arch/mips/adm8668/platform.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/adm8668/files/arch/mips/adm8668/platform.c b/target/linux/adm8668/files/arch/mips/adm8668/platform.c
index 5030565a2c..264eaf4858 100644
--- a/target/linux/adm8668/files/arch/mips/adm8668/platform.c
+++ b/target/linux/adm8668/files/arch/mips/adm8668/platform.c
@@ -1,4 +1,6 @@
/*
+ * Infineon/ADMTek 8668 (WildPass) platform devices support
+ *
* Copyright (C) 2010 Scott Nicholas <neutronscott@scottn.us>
* Copyright (C) 2012 Florian Fainelli <florian@openwrt.org>
*
@@ -11,6 +13,7 @@
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/mtd/physmap.h>
+#include <linux/mtd/partitions.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/ioport.h>
@@ -89,9 +92,33 @@ static struct platform_device adm8668_eth1_device = {
.num_resources = ARRAY_SIZE(eth1_resources),
};
+static const char *nor_probe_types[] = { "adm8668part", NULL };
+
+static struct physmap_flash_data nor_flash_data = {
+ .width = 2,
+ .part_probe_types = nor_probe_types,
+};
+
+static struct resource nor_resources[] = {
+ {
+ .start = ADM8668_SMEM1_BASE,
+ .end = ADM8668_SMEM1_BASE + 0x800000 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct platform_device adm8668_nor_device = {
+ .name = "physmap-flash",
+ .id = -1,
+ .resource = nor_resources,
+ .num_resources = ARRAY_SIZE(nor_resources),
+ .dev.platform_data = &nor_flash_data,
+};
+
static struct platform_device *adm8668_devs[] = {
&adm8668_eth0_device,
&adm8668_eth1_device,
+ &adm8668_nor_device,
};
int __devinit adm8668_devs_register(void)