aboutsummaryrefslogtreecommitdiff
path: root/linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-12-31 16:25:21 +0100
committerLars-Dominik Braun <lars@6xq.net>2011-12-31 16:25:21 +0100
commit91e51701b30a09790b1420a3a5298221e6eb4384 (patch)
treeb0f4186da035bca6c7e538a6c400e229f6ce0229 /linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch
parent148eb8573585c694c6f259d4233631091a2b00c2 (diff)
downloadbuildroot-n35-91e51701b30a09790b1420a3a5298221e6eb4384.tar.gz
buildroot-n35-91e51701b30a09790b1420a3a5298221e6eb4384.tar.bz2
buildroot-n35-91e51701b30a09790b1420a3a5298221e6eb4384.zip
Import patches from Jiri Pinkava
Diffstat (limited to 'linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch')
-rw-r--r--linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch122
1 files changed, 122 insertions, 0 deletions
diff --git a/linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch b/linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch
new file mode 100644
index 0000000..3a72c6a
--- /dev/null
+++ b/linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch
@@ -0,0 +1,122 @@
+From c8955e56555dae6e308b3fa3ea91c8d823402bd5 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Sat, 22 May 2010 05:01:39 +0200
+Subject: [PATCH 08/14] n35: Support for NAND Flash on Acer n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 73 ++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 73 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index 3158165..c492f5d 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -17,6 +17,7 @@
+ #include <linux/kernel.h>
+ #include <linux/types.h>
+
++#include <linux/delay.h>
+ #include <linux/gpio_keys.h>
+ #include <linux/init.h>
+ #include <linux/gpio.h>
+@@ -49,10 +50,69 @@
+ #include <plat/cpu.h>
+ #include <plat/devs.h>
+ #include <plat/mci.h>
++#include <plat/nand.h>
+ #include <plat/s3c2410.h>
+ #include <plat/ts.h>
+ #include <plat/udc.h>
+
++#ifdef CONFIG_MTD_PARTITIONS
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/nand.h>
++#include <linux/mtd/nand_ecc.h>
++#include <linux/mtd/partitions.h>
++
++struct mtd_partition n35_default_nand_part[] = {
++ /* Original partitioning by manufacturer
++ *
++ * 0x0 - 0x3fff NBoot
++ * 0x4000 - 0x4fff TOC
++ * 0x8000 - 0x27fff Eboot
++ * 0x28000 - 0x2bfff partition table
++ * 0x2c000 - data ...
++ * FIXME: incomplete
++ * */
++ {
++ .name = "bootloader",
++ .offset = 0,
++ .size = 0x28000,
++ .mask_flags = MTD_WRITEABLE,
++ },
++ {
++ .name = "partition",
++ .offset = MTDPART_OFS_APPEND,
++ .size = 0x4000,
++ },
++ {
++ .name = "kernel",
++ .offset = MTDPART_OFS_APPEND,
++ .size = 0x180000,
++ },
++ {
++ .name = "rootfs",
++ .offset = MTDPART_OFS_APPEND,
++ .size = MTDPART_SIZ_FULL,
++ },
++};
++
++static struct s3c2410_nand_set n35_nand_sets[] = {
++ {
++ .name = "chip0",
++ .nr_chips = 1,
++ .nr_partitions = ARRAY_SIZE(n35_default_nand_part),
++ .partitions = n35_default_nand_part,
++ },
++};
++
++static struct s3c2410_platform_nand n35_nand_info = {
++ .tacls = 20,
++ .twrph0 = 35,
++ .twrph1 = 20,
++ .nr_sets = ARRAY_SIZE(n35_nand_sets),
++ .sets = n35_nand_sets,
++ .ignore_unset_ecc = 1,
++};
++#endif
++
+ static struct map_desc n30_iodesc[] __initdata = {
+ /* nothing here yet */
+ };
+@@ -492,6 +552,9 @@ static struct platform_device *n35_devices[] __initdata = {
+ &s3c_device_rtc,
+ &s3c_device_usbgadget,
+ &s3c_device_sdi,
++#ifdef CONFIG_MTD_PARTITIONS
++ &s3c_device_nand,
++#endif
+ &s3c_device_adc,
+ &s3c_device_ts,
+ &s3c_device_timer[0],
+@@ -681,6 +744,16 @@ static void __init n30_init(void)
+ }
+
+ if (machine_is_n35()) {
++ s3c_nand_set_platdata(&n35_nand_info);
++
++ /* Clear any locks and write protects on the flash. */
++ WARN_ON(gpio_request(S3C2410_GPC(5), "NAND write protection"));
++ gpio_set_value(S3C2410_GPC(5), 1);
++ udelay(1);
++ gpio_set_value(S3C2410_GPC(5), 0);
++ udelay(1);
++ gpio_set_value(S3C2410_GPC(5), 1);
++
+ /* Turn off suspend and switch the selectable USB port
+ * to USB device mode. Turn on suspend for the host
+ * port since it is not connected on the N35.
+--
+1.7.3.1
+