diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-05-20 07:25:59 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-20 07:25:59 -0400 |
commit | 206a1a825dc67060ee319c99569755ba11250907 (patch) | |
tree | e4cdbd7b8b745e0ad4adfd59fa57c3bcabe3daf4 /arch | |
parent | 6aeaad51aaecc9ebc8c1e8f132655e2ae8141f8c (diff) | |
parent | 999304be1177d42d16bc59c546228c6ac5a3e76a (diff) |
ARM: Merge for-2635-4/onenand
Merge branch 'for-2635-4/onenand' into for-2635-4/partial2
Conflicts:
arch/arm/mach-s5pc100/cpu.c
arch/arm/mach-s5pc100/include/mach/map.h
arch/arm/mach-s5pv210/Makefile
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s3c64xx/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/dev-onenand1.c | 55 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/include/mach/irqs.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/include/mach/map.h | 13 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/s3c6400.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/s3c6410.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/cpu.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/include/mach/map.h | 68 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/dev-onenand.c | 50 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/include/mach/map.h | 3 | ||||
-rw-r--r-- | arch/arm/plat-samsung/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/plat-samsung/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-onenand.c | 55 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/devs.h | 3 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/onenand-core.h | 37 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/regs-onenand.h | 63 |
19 files changed, 368 insertions, 12 deletions
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 44a9def318fb..ccdde04f6feb 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig | |||
@@ -35,6 +35,11 @@ config S3C64XX_SETUP_SDHCI | |||
35 | Internal configuration for default SDHCI setup for S3C6400 and | 35 | Internal configuration for default SDHCI setup for S3C6400 and |
36 | S3C6410 SoCs. | 36 | S3C6410 SoCs. |
37 | 37 | ||
38 | config S3C64XX_DEV_ONENAND1 | ||
39 | bool | ||
40 | help | ||
41 | Compile in platform device definition for OneNAND1 controller | ||
42 | |||
38 | # platform specific device setup | 43 | # platform specific device setup |
39 | 44 | ||
40 | config S3C64XX_SETUP_I2C0 | 45 | config S3C64XX_SETUP_I2C0 |
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile index 39ef55e2655f..9d1006938f5c 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile | |||
@@ -62,3 +62,4 @@ obj-y += dev-uart.o | |||
62 | obj-y += dev-audio.o | 62 | obj-y += dev-audio.o |
63 | obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o | 63 | obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o |
64 | obj-$(CONFIG_S3C64XX_DEV_TS) += dev-ts.o | 64 | obj-$(CONFIG_S3C64XX_DEV_TS) += dev-ts.o |
65 | obj-$(CONFIG_S3C64XX_DEV_ONENAND1) += dev-onenand1.o | ||
diff --git a/arch/arm/mach-s3c64xx/dev-onenand1.c b/arch/arm/mach-s3c64xx/dev-onenand1.c new file mode 100644 index 000000000000..92ffd5bac104 --- /dev/null +++ b/arch/arm/mach-s3c64xx/dev-onenand1.c | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-s3c64xx/dev-onenand1.c | ||
3 | * | ||
4 | * Copyright (c) 2008-2010 Samsung Electronics | ||
5 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
6 | * | ||
7 | * S3C64XX series device definition for OneNAND devices | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/mtd/mtd.h> | ||
17 | #include <linux/mtd/onenand.h> | ||
18 | |||
19 | #include <mach/irqs.h> | ||
20 | #include <mach/map.h> | ||
21 | |||
22 | static struct resource s3c64xx_onenand1_resources[] = { | ||
23 | [0] = { | ||
24 | .start = S3C64XX_PA_ONENAND1, | ||
25 | .end = S3C64XX_PA_ONENAND1 + 0x400 - 1, | ||
26 | .flags = IORESOURCE_MEM, | ||
27 | }, | ||
28 | [1] = { | ||
29 | .start = S3C64XX_PA_ONENAND1_BUF, | ||
30 | .end = S3C64XX_PA_ONENAND1_BUF + S3C64XX_SZ_ONENAND1_BUF - 1, | ||
31 | .flags = IORESOURCE_MEM, | ||
32 | }, | ||
33 | [2] = { | ||
34 | .start = IRQ_ONENAND1, | ||
35 | .end = IRQ_ONENAND1, | ||
36 | .flags = IORESOURCE_IRQ, | ||
37 | }, | ||
38 | }; | ||
39 | |||
40 | struct platform_device s3c64xx_device_onenand1 = { | ||
41 | .name = "samsung-onenand", | ||
42 | .id = 1, | ||
43 | .num_resources = ARRAY_SIZE(s3c64xx_onenand1_resources), | ||
44 | .resource = s3c64xx_onenand1_resources, | ||
45 | }; | ||
46 | |||
47 | void s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata) | ||
48 | { | ||
49 | struct onenand_platform_data *pd; | ||
50 | |||
51 | pd = kmemdup(pdata, sizeof(struct onenand_platform_data), GFP_KERNEL); | ||
52 | if (!pd) | ||
53 | printk(KERN_ERR "%s: no memory for platform data\n", __func__); | ||
54 | s3c64xx_device_onenand1.dev.platform_data = pd; | ||
55 | } | ||
diff --git a/arch/arm/mach-s3c64xx/include/mach/irqs.h b/arch/arm/mach-s3c64xx/include/mach/irqs.h index e9ab4ac0b9a8..8e2df26cf14a 100644 --- a/arch/arm/mach-s3c64xx/include/mach/irqs.h +++ b/arch/arm/mach-s3c64xx/include/mach/irqs.h | |||
@@ -212,5 +212,9 @@ | |||
212 | 212 | ||
213 | #define NR_IRQS (IRQ_BOARD_END + 1) | 213 | #define NR_IRQS (IRQ_BOARD_END + 1) |
214 | 214 | ||
215 | /* Compatibility */ | ||
216 | |||
217 | #define IRQ_ONENAND IRQ_ONENAND0 | ||
218 | |||
215 | #endif /* __ASM_MACH_S3C64XX_IRQS_H */ | 219 | #endif /* __ASM_MACH_S3C64XX_IRQS_H */ |
216 | 220 | ||
diff --git a/arch/arm/mach-s3c64xx/include/mach/map.h b/arch/arm/mach-s3c64xx/include/mach/map.h index c3e48cdfb990..e1eab3c94aea 100644 --- a/arch/arm/mach-s3c64xx/include/mach/map.h +++ b/arch/arm/mach-s3c64xx/include/mach/map.h | |||
@@ -52,6 +52,16 @@ | |||
52 | 52 | ||
53 | #define S3C64XX_PA_SROM (0x70000000) | 53 | #define S3C64XX_PA_SROM (0x70000000) |
54 | 54 | ||
55 | #define S3C64XX_PA_ONENAND0 (0x70100000) | ||
56 | #define S3C64XX_PA_ONENAND0_BUF (0x20000000) | ||
57 | #define S3C64XX_SZ_ONENAND0_BUF (SZ_64M) | ||
58 | |||
59 | /* NAND and OneNAND1 controllers occupy the same register region | ||
60 | (depending on SoC POP version) */ | ||
61 | #define S3C64XX_PA_ONENAND1 (0x70200000) | ||
62 | #define S3C64XX_PA_ONENAND1_BUF (0x28000000) | ||
63 | #define S3C64XX_SZ_ONENAND1_BUF (SZ_64M) | ||
64 | |||
55 | #define S3C64XX_PA_NAND (0x70200000) | 65 | #define S3C64XX_PA_NAND (0x70200000) |
56 | #define S3C64XX_PA_FB (0x77100000) | 66 | #define S3C64XX_PA_FB (0x77100000) |
57 | #define S3C64XX_PA_USB_HSOTG (0x7C000000) | 67 | #define S3C64XX_PA_USB_HSOTG (0x7C000000) |
@@ -99,6 +109,9 @@ | |||
99 | #define S3C_PA_IIC S3C64XX_PA_IIC0 | 109 | #define S3C_PA_IIC S3C64XX_PA_IIC0 |
100 | #define S3C_PA_IIC1 S3C64XX_PA_IIC1 | 110 | #define S3C_PA_IIC1 S3C64XX_PA_IIC1 |
101 | #define S3C_PA_NAND S3C64XX_PA_NAND | 111 | #define S3C_PA_NAND S3C64XX_PA_NAND |
112 | #define S3C_PA_ONENAND S3C64XX_PA_ONENAND0 | ||
113 | #define S3C_PA_ONENAND_BUF S3C64XX_PA_ONENAND0_BUF | ||
114 | #define S3C_SZ_ONENAND_BUF S3C64XX_SZ_ONENAND0_BUF | ||
102 | #define S3C_PA_FB S3C64XX_PA_FB | 115 | #define S3C_PA_FB S3C64XX_PA_FB |
103 | #define S3C_PA_USBHOST S3C64XX_PA_USBHOST | 116 | #define S3C_PA_USBHOST S3C64XX_PA_USBHOST |
104 | #define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG | 117 | #define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG |
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c index 707e34e3afd1..5e93fe3f3f40 100644 --- a/arch/arm/mach-s3c64xx/s3c6400.c +++ b/arch/arm/mach-s3c64xx/s3c6400.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <plat/clock.h> | 37 | #include <plat/clock.h> |
38 | #include <plat/sdhci.h> | 38 | #include <plat/sdhci.h> |
39 | #include <plat/iic-core.h> | 39 | #include <plat/iic-core.h> |
40 | #include <plat/onenand-core.h> | ||
40 | #include <mach/s3c6400.h> | 41 | #include <mach/s3c6400.h> |
41 | 42 | ||
42 | void __init s3c6400_map_io(void) | 43 | void __init s3c6400_map_io(void) |
@@ -51,6 +52,9 @@ void __init s3c6400_map_io(void) | |||
51 | s3c_i2c0_setname("s3c2440-i2c"); | 52 | s3c_i2c0_setname("s3c2440-i2c"); |
52 | 53 | ||
53 | s3c_device_nand.name = "s3c6400-nand"; | 54 | s3c_device_nand.name = "s3c6400-nand"; |
55 | |||
56 | s3c_onenand_setname("s3c6400-onenand"); | ||
57 | s3c64xx_onenand1_setname("s3c6400-onenand"); | ||
54 | } | 58 | } |
55 | 59 | ||
56 | void __init s3c6400_init_clocks(int xtal) | 60 | void __init s3c6400_init_clocks(int xtal) |
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c index 3ab695c691ee..014401c39f36 100644 --- a/arch/arm/mach-s3c64xx/s3c6410.c +++ b/arch/arm/mach-s3c64xx/s3c6410.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <plat/sdhci.h> | 39 | #include <plat/sdhci.h> |
40 | #include <plat/iic-core.h> | 40 | #include <plat/iic-core.h> |
41 | #include <plat/adc.h> | 41 | #include <plat/adc.h> |
42 | #include <plat/onenand-core.h> | ||
42 | #include <mach/s3c6400.h> | 43 | #include <mach/s3c6400.h> |
43 | #include <mach/s3c6410.h> | 44 | #include <mach/s3c6410.h> |
44 | 45 | ||
@@ -55,6 +56,8 @@ void __init s3c6410_map_io(void) | |||
55 | 56 | ||
56 | s3c_device_adc.name = "s3c64xx-adc"; | 57 | s3c_device_adc.name = "s3c64xx-adc"; |
57 | s3c_device_nand.name = "s3c6400-nand"; | 58 | s3c_device_nand.name = "s3c6400-nand"; |
59 | s3c_onenand_setname("s3c6410-onenand"); | ||
60 | s3c64xx_onenand1_setname("s3c6410-onenand"); | ||
58 | } | 61 | } |
59 | 62 | ||
60 | void __init s3c6410_init_clocks(int xtal) | 63 | void __init s3c6410_init_clocks(int xtal) |
diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/cpu.c index d424a9fda034..816c4d4afef0 100644 --- a/arch/arm/mach-s5pc100/cpu.c +++ b/arch/arm/mach-s5pc100/cpu.c | |||
@@ -40,6 +40,8 @@ | |||
40 | #include <plat/clock.h> | 40 | #include <plat/clock.h> |
41 | #include <plat/iic-core.h> | 41 | #include <plat/iic-core.h> |
42 | #include <plat/sdhci.h> | 42 | #include <plat/sdhci.h> |
43 | #include <plat/onenand-core.h> | ||
44 | |||
43 | #include <plat/s5pc100.h> | 45 | #include <plat/s5pc100.h> |
44 | 46 | ||
45 | /* Initial IO mappings */ | 47 | /* Initial IO mappings */ |
@@ -88,6 +90,8 @@ void __init s5pc100_map_io(void) | |||
88 | /* the i2c devices are directly compatible with s3c2440 */ | 90 | /* the i2c devices are directly compatible with s3c2440 */ |
89 | s3c_i2c0_setname("s3c2440-i2c"); | 91 | s3c_i2c0_setname("s3c2440-i2c"); |
90 | s3c_i2c1_setname("s3c2440-i2c"); | 92 | s3c_i2c1_setname("s3c2440-i2c"); |
93 | |||
94 | s3c_onenand_setname("s5pc100-onenand"); | ||
91 | } | 95 | } |
92 | 96 | ||
93 | void __init s5pc100_init_clocks(int xtal) | 97 | void __init s5pc100_init_clocks(int xtal) |
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h index 88009549ab28..a0b2fee332a1 100644 --- a/arch/arm/mach-s5pc100/include/mach/map.h +++ b/arch/arm/mach-s5pc100/include/mach/map.h | |||
@@ -16,6 +16,25 @@ | |||
16 | #include <plat/map-base.h> | 16 | #include <plat/map-base.h> |
17 | #include <plat/map-s5p.h> | 17 | #include <plat/map-s5p.h> |
18 | 18 | ||
19 | /* | ||
20 | * map-base.h has already defined virtual memory address | ||
21 | * S3C_VA_IRQ S3C_ADDR(0x00000000) irq controller(s) | ||
22 | * S3C_VA_SYS S3C_ADDR(0x00100000) system control | ||
23 | * S3C_VA_MEM S3C_ADDR(0x00200000) system control (not used) | ||
24 | * S3C_VA_TIMER S3C_ADDR(0x00300000) timer block | ||
25 | * S3C_VA_WATCHDOG S3C_ADDR(0x00400000) watchdog | ||
26 | * S3C_VA_UART S3C_ADDR(0x01000000) UART | ||
27 | * | ||
28 | * S5PC100 specific virtual memory address can be defined here | ||
29 | * S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) GPIO | ||
30 | * | ||
31 | */ | ||
32 | |||
33 | #define S5PC100_PA_ONENAND_BUF (0xB0000000) | ||
34 | #define S5PC100_SZ_ONENAND_BUF (SZ_256M - SZ_32M) | ||
35 | |||
36 | /* Chip ID */ | ||
37 | |||
19 | #define S5PC100_PA_CHIPID (0xE0000000) | 38 | #define S5PC100_PA_CHIPID (0xE0000000) |
20 | #define S5P_PA_CHIPID S5PC100_PA_CHIPID | 39 | #define S5P_PA_CHIPID S5PC100_PA_CHIPID |
21 | 40 | ||
@@ -26,17 +45,26 @@ | |||
26 | #define S5PC100_VA_OTHERS (S3C_VA_SYS + 0x10000) | 45 | #define S5PC100_VA_OTHERS (S3C_VA_SYS + 0x10000) |
27 | 46 | ||
28 | #define S5PC100_PA_GPIO (0xE0300000) | 47 | #define S5PC100_PA_GPIO (0xE0300000) |
29 | #define S5P_PA_GPIO S5PC100_PA_GPIO | ||
30 | 48 | ||
31 | #define S5PC100_PA_VIC0 (0xE4000000) | 49 | #define S5PC1XX_PA_GPIO S5PC100_PA_GPIO |
32 | #define S5P_PA_VIC0 S5PC100_PA_VIC0 | 50 | #define S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) |
51 | |||
52 | /* Interrupt */ | ||
53 | #define S5PC100_PA_VIC (0xE4000000) | ||
54 | #define S5PC100_VA_VIC S3C_VA_IRQ | ||
55 | #define S5PC100_PA_VIC_OFFSET 0x100000 | ||
56 | #define S5PC100_VA_VIC_OFFSET 0x10000 | ||
57 | #define S5PC1XX_PA_VIC(x) (S5PC100_PA_VIC + ((x) * S5PC100_PA_VIC_OFFSET)) | ||
58 | #define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET)) | ||
33 | 59 | ||
34 | #define S5PC100_PA_VIC1 (0xE4100000) | 60 | #define S5PC100_PA_ONENAND (0xE7100000) |
35 | #define S5P_PA_VIC1 S5PC100_PA_VIC1 | ||
36 | 61 | ||
37 | #define S5PC100_PA_VIC2 (0xE4200000) | 62 | /* DMA */ |
38 | #define S5P_PA_VIC2 S5PC100_PA_VIC2 | 63 | #define S5PC100_PA_MDMA (0xE8100000) |
64 | #define S5PC100_PA_PDMA0 (0xE9000000) | ||
65 | #define S5PC100_PA_PDMA1 (0xE9200000) | ||
39 | 66 | ||
67 | /* Timer */ | ||
40 | #define S5PC100_PA_TIMER (0xEA000000) | 68 | #define S5PC100_PA_TIMER (0xEA000000) |
41 | #define S5P_PA_TIMER S5PC100_PA_TIMER | 69 | #define S5P_PA_TIMER S5PC100_PA_TIMER |
42 | 70 | ||
@@ -83,8 +111,24 @@ | |||
83 | #define S3C_PA_IIC S5PC100_PA_IIC0 | 111 | #define S3C_PA_IIC S5PC100_PA_IIC0 |
84 | #define S3C_PA_IIC1 S5PC100_PA_IIC1 | 112 | #define S3C_PA_IIC1 S5PC100_PA_IIC1 |
85 | #define S3C_PA_FB S5PC100_PA_FB | 113 | #define S3C_PA_FB S5PC100_PA_FB |
86 | #define S3C_PA_HSMMC0 S5PC100_PA_HSMMC(0) | 114 | #define S3C_PA_G2D S5PC100_PA_G2D |
87 | #define S3C_PA_HSMMC1 S5PC100_PA_HSMMC(1) | 115 | #define S3C_PA_G3D S5PC100_PA_G3D |
88 | #define S3C_PA_HSMMC2 S5PC100_PA_HSMMC(2) | 116 | #define S3C_PA_JPEG S5PC100_PA_JPEG |
89 | 117 | #define S3C_PA_ROTATOR S5PC100_PA_ROTATOR | |
90 | #endif /* __ASM_ARCH_MAP_H */ | 118 | #define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0) |
119 | #define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) | ||
120 | #define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000) | ||
121 | #define S3C_PA_IIC S5PC100_PA_I2C | ||
122 | #define S3C_PA_IIC1 S5PC100_PA_I2C1 | ||
123 | #define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG | ||
124 | #define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY | ||
125 | #define S3C_PA_HSMMC0 S5PC100_PA_HSMMC0 | ||
126 | #define S3C_PA_HSMMC1 S5PC100_PA_HSMMC1 | ||
127 | #define S3C_PA_HSMMC2 S5PC100_PA_HSMMC2 | ||
128 | #define S3C_PA_KEYPAD S5PC100_PA_KEYPAD | ||
129 | #define S3C_PA_TSADC S5PC100_PA_TSADC | ||
130 | #define S3C_PA_ONENAND S5PC100_PA_ONENAND | ||
131 | #define S3C_PA_ONENAND_BUF S5PC100_PA_ONENAND_BUF | ||
132 | #define S3C_SZ_ONENAND_BUF S5PC100_SZ_ONENAND_BUF | ||
133 | |||
134 | #endif /* __ASM_ARCH_C100_MAP_H */ | ||
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 96f4d9b7eab4..0761eac9aaea 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig | |||
@@ -62,6 +62,11 @@ config MACH_GONI | |||
62 | Machine support for Samsung GONI board | 62 | Machine support for Samsung GONI board |
63 | S5PC110(MCP) is one of package option of S5PV210 | 63 | S5PC110(MCP) is one of package option of S5PV210 |
64 | 64 | ||
65 | config S5PC110_DEV_ONENAND | ||
66 | bool | ||
67 | help | ||
68 | Compile in platform device definition for OneNAND1 controller | ||
69 | |||
65 | config MACH_SMDKV210 | 70 | config MACH_SMDKV210 |
66 | bool "SMDKV210" | 71 | bool "SMDKV210" |
67 | select CPU_S5PV210 | 72 | select CPU_S5PV210 |
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index 6a6dea19dec5..30be9a6a4620 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile | |||
@@ -26,6 +26,7 @@ obj-$(CONFIG_MACH_GONI) += mach-goni.o | |||
26 | 26 | ||
27 | obj-y += dev-audio.o | 27 | obj-y += dev-audio.o |
28 | obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o | 28 | obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o |
29 | obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-onenand.o | ||
29 | 30 | ||
30 | obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o | 31 | obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o |
31 | obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o | 32 | obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o |
diff --git a/arch/arm/mach-s5pv210/dev-onenand.c b/arch/arm/mach-s5pv210/dev-onenand.c new file mode 100644 index 000000000000..34997b752f93 --- /dev/null +++ b/arch/arm/mach-s5pv210/dev-onenand.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-s5pv210/dev-onenand.c | ||
3 | * | ||
4 | * Copyright (c) 2008-2010 Samsung Electronics | ||
5 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
6 | * | ||
7 | * S5PC110 series device definition for OneNAND devices | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/mtd/mtd.h> | ||
17 | #include <linux/mtd/onenand.h> | ||
18 | |||
19 | #include <mach/irqs.h> | ||
20 | #include <mach/map.h> | ||
21 | |||
22 | static struct resource s5pc110_onenand_resources[] = { | ||
23 | [0] = { | ||
24 | .start = S5PC110_PA_ONENAND, | ||
25 | .end = S5PC110_PA_ONENAND + SZ_128K - 1, | ||
26 | .flags = IORESOURCE_MEM, | ||
27 | }, | ||
28 | [1] = { | ||
29 | .start = S5PC110_PA_ONENAND_DMA, | ||
30 | .end = S5PC110_PA_ONENAND_DMA + SZ_2K - 1, | ||
31 | .flags = IORESOURCE_MEM, | ||
32 | }, | ||
33 | }; | ||
34 | |||
35 | struct platform_device s5pc110_device_onenand = { | ||
36 | .name = "s5pc110-onenand", | ||
37 | .id = -1, | ||
38 | .num_resources = ARRAY_SIZE(s5pc110_onenand_resources), | ||
39 | .resource = s5pc110_onenand_resources, | ||
40 | }; | ||
41 | |||
42 | void s5pc110_onenand_set_platdata(struct onenand_platform_data *pdata) | ||
43 | { | ||
44 | struct onenand_platform_data *pd; | ||
45 | |||
46 | pd = kmemdup(pdata, sizeof(struct onenand_platform_data), GFP_KERNEL); | ||
47 | if (!pd) | ||
48 | printk(KERN_ERR "%s: no memory for platform data\n", __func__); | ||
49 | s5pc110_device_onenand.dev.platform_data = pd; | ||
50 | } | ||
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h index 3a44e1e5f126..34eb168ec950 100644 --- a/arch/arm/mach-s5pv210/include/mach/map.h +++ b/arch/arm/mach-s5pv210/include/mach/map.h | |||
@@ -16,6 +16,9 @@ | |||
16 | #include <plat/map-base.h> | 16 | #include <plat/map-base.h> |
17 | #include <plat/map-s5p.h> | 17 | #include <plat/map-s5p.h> |
18 | 18 | ||
19 | #define S5PC110_PA_ONENAND (0xB0000000) | ||
20 | #define S5PC110_PA_ONENAND_DMA (0xB0600000) | ||
21 | |||
19 | #define S5PV210_PA_CHIPID (0xE0000000) | 22 | #define S5PV210_PA_CHIPID (0xE0000000) |
20 | #define S5P_PA_CHIPID S5PV210_PA_CHIPID | 23 | #define S5P_PA_CHIPID S5PV210_PA_CHIPID |
21 | 24 | ||
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 47c8aa75e747..d663078253de 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig | |||
@@ -201,6 +201,11 @@ config S3C_DEV_NAND | |||
201 | help | 201 | help |
202 | Compile in platform device definition for NAND controller | 202 | Compile in platform device definition for NAND controller |
203 | 203 | ||
204 | config S3C_DEV_ONENAND | ||
205 | bool | ||
206 | help | ||
207 | Compile in platform device definition for OneNAND controller | ||
208 | |||
204 | config S3C_DEV_RTC | 209 | config S3C_DEV_RTC |
205 | bool | 210 | bool |
206 | help | 211 | help |
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index d73ee553b46e..d98316b30c26 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile | |||
@@ -43,6 +43,7 @@ obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o | |||
43 | obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o | 43 | obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o |
44 | obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o | 44 | obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o |
45 | obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o | 45 | obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o |
46 | obj-$(CONFIG_S3C_DEV_ONENAND) += dev-onenand.o | ||
46 | obj-$(CONFIG_S3C_DEV_RTC) += dev-rtc.o | 47 | obj-$(CONFIG_S3C_DEV_RTC) += dev-rtc.o |
47 | 48 | ||
48 | obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o | 49 | obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o |
diff --git a/arch/arm/plat-samsung/dev-onenand.c b/arch/arm/plat-samsung/dev-onenand.c new file mode 100644 index 000000000000..45ec73287d8c --- /dev/null +++ b/arch/arm/plat-samsung/dev-onenand.c | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-samsung/dev-onenand.c | ||
3 | * | ||
4 | * Copyright (c) 2008-2010 Samsung Electronics | ||
5 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
6 | * | ||
7 | * S3C64XX/S5PC100 series device definition for OneNAND devices | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/mtd/mtd.h> | ||
17 | #include <linux/mtd/onenand.h> | ||
18 | |||
19 | #include <mach/irqs.h> | ||
20 | #include <mach/map.h> | ||
21 | |||
22 | static struct resource s3c_onenand_resources[] = { | ||
23 | [0] = { | ||
24 | .start = S3C_PA_ONENAND, | ||
25 | .end = S3C_PA_ONENAND + 0x400 - 1, | ||
26 | .flags = IORESOURCE_MEM, | ||
27 | }, | ||
28 | [1] = { | ||
29 | .start = S3C_PA_ONENAND_BUF, | ||
30 | .end = S3C_PA_ONENAND_BUF + S3C_SZ_ONENAND_BUF - 1, | ||
31 | .flags = IORESOURCE_MEM, | ||
32 | }, | ||
33 | [2] = { | ||
34 | .start = IRQ_ONENAND, | ||
35 | .end = IRQ_ONENAND, | ||
36 | .flags = IORESOURCE_IRQ, | ||
37 | }, | ||
38 | }; | ||
39 | |||
40 | struct platform_device s3c_device_onenand = { | ||
41 | .name = "samsung-onenand", | ||
42 | .id = 0, | ||
43 | .num_resources = ARRAY_SIZE(s3c_onenand_resources), | ||
44 | .resource = s3c_onenand_resources, | ||
45 | }; | ||
46 | |||
47 | void s3c_onenand_set_platdata(struct onenand_platform_data *pdata) | ||
48 | { | ||
49 | struct onenand_platform_data *pd; | ||
50 | |||
51 | pd = kmemdup(pdata, sizeof(struct onenand_platform_data), GFP_KERNEL); | ||
52 | if (!pd) | ||
53 | printk(KERN_ERR "%s: no memory for platform data\n", __func__); | ||
54 | s3c_device_onenand.dev.platform_data = pd; | ||
55 | } | ||
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index 8d516d498051..e6144e4b9118 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -69,6 +69,9 @@ extern struct platform_device s5p6440_device_spi1; | |||
69 | extern struct platform_device s3c_device_hwmon; | 69 | extern struct platform_device s3c_device_hwmon; |
70 | 70 | ||
71 | extern struct platform_device s3c_device_nand; | 71 | extern struct platform_device s3c_device_nand; |
72 | extern struct platform_device s3c_device_onenand; | ||
73 | extern struct platform_device s3c64xx_device_onenand1; | ||
74 | extern struct platform_device s5pc110_device_onenand; | ||
72 | 75 | ||
73 | extern struct platform_device s3c_device_usbgadget; | 76 | extern struct platform_device s3c_device_usbgadget; |
74 | extern struct platform_device s3c_device_usb_hsotg; | 77 | extern struct platform_device s3c_device_usb_hsotg; |
diff --git a/arch/arm/plat-samsung/include/plat/onenand-core.h b/arch/arm/plat-samsung/include/plat/onenand-core.h new file mode 100644 index 000000000000..7701cb7020c8 --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/onenand-core.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-samsung/onenand-core.h | ||
3 | * | ||
4 | * Copyright (c) 2010 Samsung Electronics | ||
5 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
6 | * Marek Szyprowski <m.szyprowski@samsung.com> | ||
7 | * | ||
8 | * Samsung OneNAD Controller core functions | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #ifndef __ASM_ARCH_ONENAND_CORE_H | ||
16 | #define __ASM_ARCH_ONENAND_CORE_H __FILE__ | ||
17 | |||
18 | /* These functions are only for use with the core support code, such as | ||
19 | * the cpu specific initialisation code | ||
20 | */ | ||
21 | |||
22 | /* re-define device name depending on support. */ | ||
23 | static inline void s3c_onenand_setname(char *name) | ||
24 | { | ||
25 | #ifdef CONFIG_S3C_DEV_ONENAND | ||
26 | s3c_device_onenand.name = name; | ||
27 | #endif | ||
28 | } | ||
29 | |||
30 | static inline void s3c64xx_onenand1_setname(char *name) | ||
31 | { | ||
32 | #ifdef CONFIG_S3C64XX_DEV_ONENAND1 | ||
33 | s3c64xx_device_onenand1.name = name; | ||
34 | #endif | ||
35 | } | ||
36 | |||
37 | #endif /* __ASM_ARCH_ONENAND_CORE_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/regs-onenand.h b/arch/arm/plat-samsung/include/plat/regs-onenand.h new file mode 100644 index 000000000000..930ea8b88ed3 --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/regs-onenand.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-s3c/include/plat/regs-onenand.h | ||
3 | * | ||
4 | * Copyright (C) 2008-2010 Samsung Electronics | ||
5 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __SAMSUNG_ONENAND_H__ | ||
12 | #define __SAMSUNG_ONENAND_H__ | ||
13 | |||
14 | #include <mach/hardware.h> | ||
15 | |||
16 | /* | ||
17 | * OneNAND Controller | ||
18 | */ | ||
19 | #define MEM_CFG_OFFSET 0x0000 | ||
20 | #define BURST_LEN_OFFSET 0x0010 | ||
21 | #define MEM_RESET_OFFSET 0x0020 | ||
22 | #define INT_ERR_STAT_OFFSET 0x0030 | ||
23 | #define INT_ERR_MASK_OFFSET 0x0040 | ||
24 | #define INT_ERR_ACK_OFFSET 0x0050 | ||
25 | #define ECC_ERR_STAT_OFFSET 0x0060 | ||
26 | #define MANUFACT_ID_OFFSET 0x0070 | ||
27 | #define DEVICE_ID_OFFSET 0x0080 | ||
28 | #define DATA_BUF_SIZE_OFFSET 0x0090 | ||
29 | #define BOOT_BUF_SIZE_OFFSET 0x00A0 | ||
30 | #define BUF_AMOUNT_OFFSET 0x00B0 | ||
31 | #define TECH_OFFSET 0x00C0 | ||
32 | #define FBA_WIDTH_OFFSET 0x00D0 | ||
33 | #define FPA_WIDTH_OFFSET 0x00E0 | ||
34 | #define FSA_WIDTH_OFFSET 0x00F0 | ||
35 | #define TRANS_SPARE_OFFSET 0x0140 | ||
36 | #define DBS_DFS_WIDTH_OFFSET 0x0160 | ||
37 | #define INT_PIN_ENABLE_OFFSET 0x01A0 | ||
38 | #define ACC_CLOCK_OFFSET 0x01C0 | ||
39 | #define FLASH_VER_ID_OFFSET 0x01F0 | ||
40 | #define FLASH_AUX_CNTRL_OFFSET 0x0300 /* s3c64xx only */ | ||
41 | |||
42 | #define ONENAND_MEM_RESET_HOT 0x3 | ||
43 | #define ONENAND_MEM_RESET_COLD 0x2 | ||
44 | #define ONENAND_MEM_RESET_WARM 0x1 | ||
45 | |||
46 | #define CACHE_OP_ERR (1 << 13) | ||
47 | #define RST_CMP (1 << 12) | ||
48 | #define RDY_ACT (1 << 11) | ||
49 | #define INT_ACT (1 << 10) | ||
50 | #define UNSUP_CMD (1 << 9) | ||
51 | #define LOCKED_BLK (1 << 8) | ||
52 | #define BLK_RW_CMP (1 << 7) | ||
53 | #define ERS_CMP (1 << 6) | ||
54 | #define PGM_CMP (1 << 5) | ||
55 | #define LOAD_CMP (1 << 4) | ||
56 | #define ERS_FAIL (1 << 3) | ||
57 | #define PGM_FAIL (1 << 2) | ||
58 | #define INT_TO (1 << 1) | ||
59 | #define LD_FAIL_ECC_ERR (1 << 0) | ||
60 | |||
61 | #define TSRF (1 << 0) | ||
62 | |||
63 | #endif | ||