aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-yocto-dev/h1940/0005-ARM-s3c2410-Add-nand-device-for-h1940.patch
blob: f5272be20229d50e5d8deaaf13d5755015c0614f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
From d284529e4b6f6001031d8f7d513fd12f84c9d5de Mon Sep 17 00:00:00 2001
From: Vasily Khoruzhick <anarsoul@gmail.com>
Date: Thu, 17 Oct 2013 12:13:29 +0300
Subject: [PATCH 05/12] ARM: s3c2410: Add nand device for h1940

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 arch/arm/mach-s3c24xx/mach-h1940.c | 62 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index 74dd479..6f2e979 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -31,6 +31,9 @@
 #include <linux/s3c_adc_battery.h>
 #include <linux/delay.h>
 
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+
 #include <video/platform_lcd.h>
 
 #include <linux/mmc/host.h>
@@ -46,6 +49,7 @@
 #include <linux/platform_data/mmc-s3cmci.h>
 #include <linux/platform_data/touchscreen-s3c2410.h>
 #include <linux/platform_data/usb-s3c2410_udc.h>
+#include <linux/platform_data/mtd-nand-s3c2410.h>
 
 #include <sound/uda1380.h>
 
@@ -465,6 +469,62 @@ static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = {
 	.ocr_avail     = MMC_VDD_32_33,
 };
 
+static struct mtd_partition h1940_nand_part[] = {
+	[0] = {
+			.name = "Boot0",
+			.offset = 0,
+			.size = SZ_16K,
+			.mask_flags = MTD_WRITEABLE,
+	},
+	[1] = {
+			.name = "Boot1",
+			.offset = MTDPART_OFS_APPEND,
+			.size = SZ_1K * 240,
+			.mask_flags = 0,
+	},
+	[2] = {
+			.name = "Env",
+			.offset = MTDPART_OFS_APPEND,
+			.size = SZ_16K,
+			.mask_flags = 0,
+	},
+	[3] = {
+			.name = "Opts",
+			.offset = MTDPART_OFS_APPEND,
+			.size = SZ_32K,
+			.mask_flags = 0,
+	},
+	[4] = {
+			.name = "Kernel",
+			.offset = MTDPART_OFS_APPEND,
+			.size = SZ_1M * 3,
+			.mask_flags = 0,
+	},
+	[5] = {
+			.name = "Filesystem",
+			.offset = MTDPART_OFS_APPEND,
+			.size = MTDPART_SIZ_FULL,
+			.mask_flags = 0,
+	},
+};
+
+static struct s3c2410_nand_set h1940_nand_sets[] = {
+	[0] = {
+			.name = "Internal",
+			.nr_chips = 1,
+			.nr_partitions = ARRAY_SIZE(h1940_nand_part),
+			.partitions = h1940_nand_part,
+	},
+};
+
+static struct s3c2410_platform_nand h1940_nand_info = {
+	.tacls = 14,
+	.twrph0 = 44,
+	.twrph1 = 20,
+	.nr_sets = ARRAY_SIZE(h1940_nand_sets),
+	.sets = h1940_nand_sets,
+};
+
 static int h1940_backlight_init(struct device *dev)
 {
 	gpio_request(S3C2410_GPB(0), "Backlight");
@@ -632,6 +692,7 @@ static struct platform_device *h1940_devices[] __initdata = {
 	&h1940_device_bluetooth,
 	&s3c_device_sdi,
 	&s3c_device_rtc,
+	&s3c_device_nand,
 	&samsung_device_pwm,
 	&h1940_backlight,
 	&h1940_lcd_powerdev,
@@ -676,6 +737,7 @@ static void __init h1940_init(void)
  	s3c24xx_udc_set_platdata(&h1940_udc_cfg);
 	s3c24xx_ts_set_platdata(&h1940_ts_cfg);
 	s3c_i2c0_set_platdata(NULL);
+	s3c_nand_set_platdata(&h1940_nand_info);
 
 	/* Turn off suspend on both USB ports, and switch the
 	 * selectable USB port to USB device mode. */
-- 
1.8.4