summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-05-07 00:49:05 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-05-07 00:49:05 +0000
commita20a9b776f129641a225891fbb9b8320faa0ca68 (patch)
treed8a1b4694a06762a579a2f1159bef0a2a2d8abad /target
parente2274f0509ee24e4e937a55e45b3d988c27b0689 (diff)
downloadmtk-20170518-a20a9b776f129641a225891fbb9b8320faa0ca68.zip
mtk-20170518-a20a9b776f129641a225891fbb9b8320faa0ca68.tar.gz
mtk-20170518-a20a9b776f129641a225891fbb9b8320faa0ca68.tar.bz2
add better support for the RDC R8610 evaluation board: ide, rtc, super I/O
SVN-Revision: 15651
Diffstat (limited to 'target')
-rw-r--r--target/linux/rdc/config-2.6.281
-rw-r--r--target/linux/rdc/config/profile-r86106
-rw-r--r--target/linux/rdc/files-2.6.28/drivers/mtd/maps/r8610.c97
-rw-r--r--target/linux/rdc/patches-2.6.28/008-r8610_flash_map.patch25
-rw-r--r--target/linux/rdc/profiles/R8610.mk16
5 files changed, 145 insertions, 0 deletions
diff --git a/target/linux/rdc/config-2.6.28 b/target/linux/rdc/config-2.6.28
index 206990b..dac461f 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 0000000..da72f9e
--- /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 0000000..4401bff
--- /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 <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/io.h>
+
+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 <florian@openwrt.org>");
+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 0000000..a969ec5
--- /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 0000000..3d001db
--- /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))
+