diff --git a/target/linux/rdc/config-2.6.28 b/target/linux/rdc/config-2.6.28 index 206990b2c9..dac461ff81 100644 --- a/target/linux/rdc/config-2.6.28 +++ b/target/linux/rdc/config-2.6.28 @@ -188,6 +188,7 @@ CONFIG_MTD_CMDLINE_PARTS=y # CONFIG_MTD_COMPLEX_MAPPINGS is not set CONFIG_MTD_CONCAT=y # CONFIG_MTD_NETSC520 is not set +# CONFIG_MTD_R8610 is not set CONFIG_MTD_RDC3210=y CONFIG_MTD_RDC3210_ALLOW_JFFS2=y CONFIG_MTD_RDC3210_BUSWIDTH=2 diff --git a/target/linux/rdc/config/profile-r8610 b/target/linux/rdc/config/profile-r8610 new file mode 100644 index 0000000000..da72f9e6f0 --- /dev/null +++ b/target/linux/rdc/config/profile-r8610 @@ -0,0 +1,6 @@ +CONFIG_MTD_R8610=y +# CONFIG_MTD_RDC3210 is not set +CONFIG_MTD_RDC3210_BUSWIDTH=2 +# CONFIG_MTD_RDC3210_FACTORY_PRESENT is not set +CONFIG_MTD_RDC3210_SIZE=0x400000 +# CONFIG_MTD_RDC3210_STATIC_MAP is not set diff --git a/target/linux/rdc/files-2.6.28/drivers/mtd/maps/r8610.c b/target/linux/rdc/files-2.6.28/drivers/mtd/maps/r8610.c new file mode 100644 index 0000000000..4401bfff14 --- /dev/null +++ b/target/linux/rdc/files-2.6.28/drivers/mtd/maps/r8610.c @@ -0,0 +1,97 @@ +/* + * Flash memory access on RDC R8610 Evaluation board + * + * (C) 2009, Florian Fainelli + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include + +static struct map_info r8610_map = { + .name = "r8610", + .size = CONFIG_MTD_RDC3210_SIZE, + .bankwidth = CONFIG_MTD_RDC3210_BUSWIDTH, +}; + +static struct mtd_partition r8610_partitions[] = { + { + .name = "Kernel", + .size = 0x001f0000, + .offset = 0 + },{ + .name = "Config", + .size = 0x10000, + .offset = MTDPART_OFS_APPEND, + },{ + .name = "Initrd", + .size = 0x1E0000, + .offset = MTDPART_OFS_APPEND, + },{ + .name = "Redboot", + .size = 0x20000, + .offset = MTDPART_OFS_APPEND, + .mask_flags = MTD_WRITEABLE + } +}; + +static struct mtd_info *mymtd; + +int __init r8610_mtd_init(void) +{ + struct mtd_partition *parts; + int nb_parts = 0; + + /* + * Static partition definition selection + */ + parts = r8610_partitions; + nb_parts = ARRAY_SIZE(r8610_partitions); + + /* + * Now let's probe for the actual flash. Do it here since + * specific machine settings might have been set above. + */ + r8610_map.phys = -r8610_map.size; + printk(KERN_NOTICE "r8610: flash device: %lx at %x\n", r8610_map.size, r8610_map.phys); + + r8610_map.map_priv_1 = (unsigned long)(r8610_map.virt = ioremap_nocache(r8610_map.phys, r8610_map.size)); + if (!r8610_map.map_priv_1) { + printk(KERN_ERR "Failed to ioremap\n"); + return -EIO; + } + + mymtd = do_map_probe("cfi_probe", &r8610_map); + if (!mymtd) { + iounmap(r8610_map.virt); + return -ENXIO; + } + mymtd->owner = THIS_MODULE; + + add_mtd_partitions(mymtd, parts, nb_parts); + + return 0; +} + +static void __exit r8610_mtd_cleanup(void) +{ + if (mymtd) { + del_mtd_partitions(mymtd); + map_destroy(mymtd); + iounmap(r8610_map.virt); + } +} + +module_init(r8610_mtd_init); +module_exit(r8610_mtd_cleanup); + +MODULE_AUTHOR("Florian Fainelli "); +MODULE_DESCRIPTION("RDC R8610 MTD driver"); +MODULE_LICENSE("GPL"); diff --git a/target/linux/rdc/patches-2.6.28/008-r8610_flash_map.patch b/target/linux/rdc/patches-2.6.28/008-r8610_flash_map.patch new file mode 100644 index 0000000000..a969ec56a8 --- /dev/null +++ b/target/linux/rdc/patches-2.6.28/008-r8610_flash_map.patch @@ -0,0 +1,25 @@ +--- a/drivers/mtd/maps/Kconfig 2009-05-07 00:51:33.000000000 +0200 ++++ b/drivers/mtd/maps/Kconfig 2009-05-07 01:08:25.000000000 +0200 +@@ -156,6 +156,12 @@ + Number of bytes addressed on the RDC-3210 flash device before + addressing the same chip again + ++config MTD_R8610 ++ tristate "CFI flash device mapped on R8610" ++ depends on X86 && MTD_CFI && MTD_PARTITIONS ++ help ++ Flash support for the RDC R8610 evaluation board. ++ + config MTD_SC520CDP + tristate "CFI Flash device mapped on AMD SC520 CDP" + depends on X86 && MTD_CFI && MTD_CONCAT +--- a/drivers/mtd/maps/Makefile 2009-05-07 00:51:33.000000000 +0200 ++++ b/drivers/mtd/maps/Makefile 2009-05-07 01:07:28.000000000 +0200 +@@ -28,6 +28,7 @@ + obj-$(CONFIG_MTD_PMC_MSP_RAMROOT)+= pmcmsp-ramroot.o + obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o + obj-$(CONFIG_MTD_RDC3210) += rdc3210.o ++obj-$(CONFIG_MTD_R8610) += r8610.o + obj-$(CONFIG_MTD_RPXLITE) += rpxlite.o + obj-$(CONFIG_MTD_TQM8XXL) += tqm8xxl.o + obj-$(CONFIG_MTD_SA1100) += sa1100-flash.o diff --git a/target/linux/rdc/profiles/R8610.mk b/target/linux/rdc/profiles/R8610.mk new file mode 100644 index 0000000000..3d001dbf9b --- /dev/null +++ b/target/linux/rdc/profiles/R8610.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/r8610 + NAME:=RDC R8160 Evaluation board + PACKAGES:=kmod-r6040 kmod-usb-core kmod-usb-ohci kmod-usb2 \ + kmod-hwmon-core kmod-hwmon-w83627hf kmod-ide-core kmod-ide-it821x \ + kmod-rtc-core kmod-rtc-m48t86 \ + kmod-fs-ext2 kmod-fs-ext3 +endef +$(eval $(call Profile,r8610)) +