aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2010-05-20 02:59:05 -0400
committerBen Dooks <ben-linux@fluff.org>2010-05-20 04:48:36 -0400
commit999304be1177d42d16bc59c546228c6ac5a3e76a (patch)
treeab8ba2b618484e93033bcc53fe0a4e014434d99f /arch/arm/mach-s5pv210
parent504d36e91ac12ccdb0e1193cee7bef9831a1c99e (diff)
ARM: SAMSUNG: Add platform support code for OneNAND controller
This patch adds setup code for Samsung OneNAND controller driver. The driver needs to be aware on which SoC it is running, so the actual device id is being changed in cpu init code. S3C64xx SoCs have 2 OneNAND controllers while S5PC100 and S5PC110 has only one. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> [ben-linux@fluff.org: sort map.h entries] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s5pv210')
-rw-r--r--arch/arm/mach-s5pv210/Kconfig5
-rw-r--r--arch/arm/mach-s5pv210/Makefile1
-rw-r--r--arch/arm/mach-s5pv210/dev-onenand.c50
-rw-r--r--arch/arm/mach-s5pv210/include/mach/map.h3
4 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 7601c28e240b..ef063e2890c5 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -21,6 +21,11 @@ choice
21 depends on ARCH_S5PV210 21 depends on ARCH_S5PV210
22 default MACH_SMDKV210 22 default MACH_SMDKV210
23 23
24config S5PC110_DEV_ONENAND
25 bool
26 help
27 Compile in platform device definition for OneNAND1 controller
28
24config MACH_SMDKV210 29config MACH_SMDKV210
25 bool "SMDKV210" 30 bool "SMDKV210"
26 select CPU_S5PV210 31 select CPU_S5PV210
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 99827813d293..610b9496c186 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -23,3 +23,4 @@ obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o
23# device support 23# device support
24 24
25obj-y += dev-audio.o 25obj-y += dev-audio.o
26obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-onenand.o \ No newline at end of file
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
22static 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
35struct 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
42void 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 5adcb9f26e44..d2a505fa1fff 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