1 /* linux/arch/arm/plat-s5p/dev-onenand.c
2 *
3 * Copyright 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2008-2010 Samsung Electronics
7 * Kyungmin Park <kyungmin.park@samsung.com>
8 *
9 * S5P series device definition for OneNAND devices
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16 #include <linux/kernel.h>
17 #include <linux/platform_device.h>
18 #include <linux/mtd/mtd.h>
19 #include <linux/mtd/onenand.h>
20
21 #include <mach/irqs.h>
22 #include <mach/map.h>
23
24 static struct resource s5p_onenand_resources[] = {
25 [0] = {
26 .start = S5P_PA_ONENAND,
27 .end = S5P_PA_ONENAND + SZ_128K - 1,
28 .flags = IORESOURCE_MEM,
29 },
30 [1] = {
31 .start = S5P_PA_ONENAND_DMA,
32 .end = S5P_PA_ONENAND_DMA + SZ_8K - 1,
33 .flags = IORESOURCE_MEM,
34 },
35 [2] = {
36 .start = IRQ_ONENAND_AUDI,
37 .end = IRQ_ONENAND_AUDI,
38 .flags = IORESOURCE_IRQ,
39 },
40 };
41
42 struct platform_device s5p_device_onenand = {
43 .name = "s5pc110-onenand",
44 .id = -1,
45 .num_resources = ARRAY_SIZE(s5p_onenand_resources),
46 .resource = s5p_onenand_resources,
47 };
48
s5p_onenand_set_platdata(struct onenand_platform_data * pdata)49 void s5p_onenand_set_platdata(struct onenand_platform_data *pdata)
50 {
51 struct onenand_platform_data *pd;
52
53 pd = kmemdup(pdata, sizeof(struct onenand_platform_data), GFP_KERNEL);
54 if (!pd)
55 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
56 s5p_device_onenand.dev.platform_data = pd;
57 }
58