aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2010-01-05 12:45:09 -0500
committerBen Dooks <ben-linux@fluff.org>2010-01-15 03:10:13 -0500
commitb6a604137bb978d9f65b1228cf0bb691ece45cba (patch)
tree9fe4d3df50c44249d7a4344bb137b96904d627fb /arch/arm/plat-samsung
parent9745626b65b856bf58e70feb4eee1e5471db699e (diff)
ARM: SAMSUNG: Move device definitions in plat-samsung
Move all the platform device definitions from plat-s3c into plat-samsung Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r--arch/arm/plat-samsung/Kconfig42
-rw-r--r--arch/arm/plat-samsung/Makefile12
-rw-r--r--arch/arm/plat-samsung/dev-fb.c73
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc.c68
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc1.c68
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc2.c69
-rw-r--r--arch/arm/plat-samsung/dev-i2c0.c71
-rw-r--r--arch/arm/plat-samsung/dev-i2c1.c68
-rw-r--r--arch/arm/plat-samsung/dev-nand.c129
-rw-r--r--arch/arm/plat-samsung/dev-usb-hsotg.c41
-rw-r--r--arch/arm/plat-samsung/dev-usb.c50
11 files changed, 691 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index e3ae68472ea..5a72a523557 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -19,4 +19,46 @@ config SAMSUNG_CLKSRC
19 Select the clock code for the clksrc implementation 19 Select the clock code for the clksrc implementation
20 used by newer systems such as the S3C64XX. 20 used by newer systems such as the S3C64XX.
21 21
22# device definitions to compile in
23
24config S3C_DEV_HSMMC
25 bool
26 help
27 Compile in platform device definitions for HSMMC code
28
29config S3C_DEV_HSMMC1
30 bool
31 help
32 Compile in platform device definitions for HSMMC channel 1
33
34config S3C_DEV_HSMMC2
35 bool
36 help
37 Compile in platform device definitions for HSMMC channel 2
38
39config S3C_DEV_I2C1
40 bool
41 help
42 Compile in platform device definitions for I2C channel 1
43
44config S3C_DEV_FB
45 bool
46 help
47 Compile in platform device definition for framebuffer
48
49config S3C_DEV_USB_HOST
50 bool
51 help
52 Compile in platform device definition for USB host.
53
54config S3C_DEV_USB_HSOTG
55 bool
56 help
57 Compile in platform device definition for USB high-speed OtG
58
59config S3C_DEV_NAND
60 bool
61 help
62 Compile in platform device definition for NAND controller
63
22endif 64endif
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index d4d5f942d34..32f03e549d0 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -15,3 +15,15 @@ obj-y += clock.o
15obj-y += pwm-clock.o 15obj-y += pwm-clock.o
16 16
17obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o 17obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o
18
19# devices
20
21obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
22obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
23obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o
24obj-y += dev-i2c0.o
25obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
26obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
27obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
28obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
29obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
diff --git a/arch/arm/plat-samsung/dev-fb.c b/arch/arm/plat-samsung/dev-fb.c
new file mode 100644
index 00000000000..a90198fc4b0
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-fb.c
@@ -0,0 +1,73 @@
1/* linux/arch/arm/plat-s3c/dev-fb.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for framebuffer device
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/string.h>
16#include <linux/platform_device.h>
17#include <linux/fb.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21#include <mach/regs-fb.h>
22
23#include <plat/fb.h>
24#include <plat/devs.h>
25#include <plat/cpu.h>
26
27static struct resource s3c_fb_resource[] = {
28 [0] = {
29 .start = S3C_PA_FB,
30 .end = S3C_PA_FB + SZ_16K - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_LCD_VSYNC,
35 .end = IRQ_LCD_VSYNC,
36 .flags = IORESOURCE_IRQ,
37 },
38 [2] = {
39 .start = IRQ_LCD_FIFO,
40 .end = IRQ_LCD_FIFO,
41 .flags = IORESOURCE_IRQ,
42 },
43 [3] = {
44 .start = IRQ_LCD_SYSTEM,
45 .end = IRQ_LCD_SYSTEM,
46 .flags = IORESOURCE_IRQ,
47 },
48};
49
50struct platform_device s3c_device_fb = {
51 .name = "s3c-fb",
52 .id = -1,
53 .num_resources = ARRAY_SIZE(s3c_fb_resource),
54 .resource = s3c_fb_resource,
55 .dev.dma_mask = &s3c_device_fb.dev.coherent_dma_mask,
56 .dev.coherent_dma_mask = 0xffffffffUL,
57};
58
59void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
60{
61 struct s3c_fb_platdata *npd;
62
63 if (!pd) {
64 printk(KERN_ERR "%s: no platform data\n", __func__);
65 return;
66 }
67
68 npd = kmemdup(pd, sizeof(struct s3c_fb_platdata), GFP_KERNEL);
69 if (!npd)
70 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
71
72 s3c_device_fb.dev.platform_data = npd;
73}
diff --git a/arch/arm/plat-samsung/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c
new file mode 100644
index 00000000000..4c05b39810e
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-hsmmc.c
@@ -0,0 +1,68 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for hsmmc 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/mmc/host.h>
17
18#include <mach/map.h>
19#include <plat/sdhci.h>
20#include <plat/devs.h>
21#include <plat/cpu.h>
22
23#define S3C_SZ_HSMMC (0x1000)
24
25static struct resource s3c_hsmmc_resource[] = {
26 [0] = {
27 .start = S3C_PA_HSMMC0,
28 .end = S3C_PA_HSMMC0 + S3C_SZ_HSMMC - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_HSMMC0,
33 .end = IRQ_HSMMC0,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL;
39
40struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
41 .max_width = 4,
42 .host_caps = (MMC_CAP_4_BIT_DATA |
43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
44};
45
46struct platform_device s3c_device_hsmmc0 = {
47 .name = "s3c-sdhci",
48 .id = 0,
49 .num_resources = ARRAY_SIZE(s3c_hsmmc_resource),
50 .resource = s3c_hsmmc_resource,
51 .dev = {
52 .dma_mask = &s3c_device_hsmmc_dmamask,
53 .coherent_dma_mask = 0xffffffffUL,
54 .platform_data = &s3c_hsmmc0_def_platdata,
55 },
56};
57
58void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
59{
60 struct s3c_sdhci_platdata *set = &s3c_hsmmc0_def_platdata;
61
62 set->max_width = pd->max_width;
63
64 if (pd->cfg_gpio)
65 set->cfg_gpio = pd->cfg_gpio;
66 if (pd->cfg_card)
67 set->cfg_card = pd->cfg_card;
68}
diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c
new file mode 100644
index 00000000000..e49bc4cd0ee
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-hsmmc1.c
@@ -0,0 +1,68 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc1.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for hsmmc device 1
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/mmc/host.h>
17
18#include <mach/map.h>
19#include <plat/sdhci.h>
20#include <plat/devs.h>
21#include <plat/cpu.h>
22
23#define S3C_SZ_HSMMC (0x1000)
24
25static struct resource s3c_hsmmc1_resource[] = {
26 [0] = {
27 .start = S3C_PA_HSMMC1,
28 .end = S3C_PA_HSMMC1 + S3C_SZ_HSMMC - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_HSMMC1,
33 .end = IRQ_HSMMC1,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38static u64 s3c_device_hsmmc1_dmamask = 0xffffffffUL;
39
40struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
41 .max_width = 4,
42 .host_caps = (MMC_CAP_4_BIT_DATA |
43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
44};
45
46struct platform_device s3c_device_hsmmc1 = {
47 .name = "s3c-sdhci",
48 .id = 1,
49 .num_resources = ARRAY_SIZE(s3c_hsmmc1_resource),
50 .resource = s3c_hsmmc1_resource,
51 .dev = {
52 .dma_mask = &s3c_device_hsmmc1_dmamask,
53 .coherent_dma_mask = 0xffffffffUL,
54 .platform_data = &s3c_hsmmc1_def_platdata,
55 },
56};
57
58void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
59{
60 struct s3c_sdhci_platdata *set = &s3c_hsmmc1_def_platdata;
61
62 set->max_width = pd->max_width;
63
64 if (pd->cfg_gpio)
65 set->cfg_gpio = pd->cfg_gpio;
66 if (pd->cfg_card)
67 set->cfg_card = pd->cfg_card;
68}
diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c
new file mode 100644
index 00000000000..824580bc0e0
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-hsmmc2.c
@@ -0,0 +1,69 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc2.c
2 *
3 * Copyright (c) 2009 Samsung Electronics
4 * Copyright (c) 2009 Maurus Cuelenaere
5 *
6 * Based on arch/arm/plat-s3c/dev-hsmmc1.c
7 * original file Copyright (c) 2008 Simtec Electronics
8 *
9 * S3C series device definition for hsmmc device 2
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/mmc/host.h>
19
20#include <mach/map.h>
21#include <plat/sdhci.h>
22#include <plat/devs.h>
23
24#define S3C_SZ_HSMMC (0x1000)
25
26static struct resource s3c_hsmmc2_resource[] = {
27 [0] = {
28 .start = S3C_PA_HSMMC2,
29 .end = S3C_PA_HSMMC2 + S3C_SZ_HSMMC - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_HSMMC2,
34 .end = IRQ_HSMMC2,
35 .flags = IORESOURCE_IRQ,
36 }
37};
38
39static u64 s3c_device_hsmmc2_dmamask = 0xffffffffUL;
40
41struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
42 .max_width = 4,
43 .host_caps = (MMC_CAP_4_BIT_DATA |
44 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
45};
46
47struct platform_device s3c_device_hsmmc2 = {
48 .name = "s3c-sdhci",
49 .id = 2,
50 .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource),
51 .resource = s3c_hsmmc2_resource,
52 .dev = {
53 .dma_mask = &s3c_device_hsmmc2_dmamask,
54 .coherent_dma_mask = 0xffffffffUL,
55 .platform_data = &s3c_hsmmc2_def_platdata,
56 },
57};
58
59void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
60{
61 struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata;
62
63 set->max_width = pd->max_width;
64
65 if (pd->cfg_gpio)
66 set->cfg_gpio = pd->cfg_gpio;
67 if (pd->cfg_card)
68 set->cfg_card = pd->cfg_card;
69}
diff --git a/arch/arm/plat-samsung/dev-i2c0.c b/arch/arm/plat-samsung/dev-i2c0.c
new file mode 100644
index 00000000000..4c761529b94
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-i2c0.c
@@ -0,0 +1,71 @@
1/* linux/arch/arm/plat-s3c/dev-i2c0.c
2 *
3 * Copyright 2008-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for i2c device 0
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/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC,
29 .end = S3C_PA_IIC + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC,
34 .end = IRQ_IIC,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c0 = {
40 .name = "s3c2410-i2c",
41#ifdef CONFIG_S3C_DEV_I2C1
42 .id = 0,
43#else
44 .id = -1,
45#endif
46 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
47 .resource = s3c_i2c_resource,
48};
49
50static struct s3c2410_platform_i2c default_i2c_data0 __initdata = {
51 .flags = 0,
52 .slave_addr = 0x10,
53 .frequency = 100*1000,
54 .sda_delay = 100,
55};
56
57void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
58{
59 struct s3c2410_platform_i2c *npd;
60
61 if (!pd)
62 pd = &default_i2c_data0;
63
64 npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
65 if (!npd)
66 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
67 else if (!npd->cfg_gpio)
68 npd->cfg_gpio = s3c_i2c0_cfg_gpio;
69
70 s3c_device_i2c0.dev.platform_data = npd;
71}
diff --git a/arch/arm/plat-samsung/dev-i2c1.c b/arch/arm/plat-samsung/dev-i2c1.c
new file mode 100644
index 00000000000..d44f7911050
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-i2c1.c
@@ -0,0 +1,68 @@
1/* linux/arch/arm/plat-s3c/dev-i2c1.c
2 *
3 * Copyright 2008-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for i2c device 1
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/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC1,
29 .end = S3C_PA_IIC1 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC1,
34 .end = IRQ_IIC1,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c1 = {
40 .name = "s3c2410-i2c",
41 .id = 1,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46static struct s3c2410_platform_i2c default_i2c_data1 __initdata = {
47 .flags = 0,
48 .bus_num = 1,
49 .slave_addr = 0x10,
50 .frequency = 100*1000,
51 .sda_delay = 100,
52};
53
54void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
55{
56 struct s3c2410_platform_i2c *npd;
57
58 if (!pd)
59 pd = &default_i2c_data1;
60
61 npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
62 if (!npd)
63 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
64 else if (!npd->cfg_gpio)
65 npd->cfg_gpio = s3c_i2c1_cfg_gpio;
66
67 s3c_device_i2c1.dev.platform_data = npd;
68}
diff --git a/arch/arm/plat-samsung/dev-nand.c b/arch/arm/plat-samsung/dev-nand.c
new file mode 100644
index 00000000000..a52fb6cf618
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-nand.c
@@ -0,0 +1,129 @@
1/*
2 * S3C series device definition for nand device
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7*/
8
9#include <linux/kernel.h>
10#include <linux/platform_device.h>
11
12#include <linux/mtd/mtd.h>
13#include <linux/mtd/partitions.h>
14
15#include <mach/map.h>
16#include <plat/devs.h>
17#include <plat/nand.h>
18
19static struct resource s3c_nand_resource[] = {
20 [0] = {
21 .start = S3C_PA_NAND,
22 .end = S3C_PA_NAND + SZ_1M,
23 .flags = IORESOURCE_MEM,
24 }
25};
26
27struct platform_device s3c_device_nand = {
28 .name = "s3c2410-nand",
29 .id = -1,
30 .num_resources = ARRAY_SIZE(s3c_nand_resource),
31 .resource = s3c_nand_resource,
32};
33
34EXPORT_SYMBOL(s3c_device_nand);
35
36/**
37 * s3c_nand_copy_set() - copy nand set data
38 * @set: The new structure, directly copied from the old.
39 *
40 * Copy all the fields from the NAND set field from what is probably __initdata
41 * to new kernel memory. The code returns 0 if the copy happened correctly or
42 * an error code for the calling function to display.
43 *
44 * Note, we currently do not try and look to see if we've already copied the
45 * data in a previous set.
46 */
47static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
48{
49 void *ptr;
50 int size;
51
52 size = sizeof(struct mtd_partition) * set->nr_partitions;
53 if (size) {
54 ptr = kmemdup(set->partitions, size, GFP_KERNEL);
55 set->partitions = ptr;
56
57 if (!ptr)
58 return -ENOMEM;
59 }
60
61 if (set->nr_map && set->nr_chips) {
62 size = sizeof(int) * set->nr_chips;
63 ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
64 set->nr_map = ptr;
65
66 if (!ptr)
67 return -ENOMEM;
68 }
69
70 if (set->ecc_layout) {
71 ptr = kmemdup(set->ecc_layout,
72 sizeof(struct nand_ecclayout), GFP_KERNEL);
73 set->ecc_layout = ptr;
74
75 if (!ptr)
76 return -ENOMEM;
77 }
78
79 return 0;
80}
81
82void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
83{
84 struct s3c2410_platform_nand *npd;
85 int size;
86 int ret;
87
88 /* note, if we get a failure in allocation, we simply drop out of the
89 * function. If there is so little memory available at initialisation
90 * time then there is little chance the system is going to run.
91 */
92
93 npd = kmemdup(nand, sizeof(struct s3c2410_platform_nand), GFP_KERNEL);
94 if (!npd) {
95 printk(KERN_ERR "%s: failed copying platform data\n", __func__);
96 return;
97 }
98
99 /* now see if we need to copy any of the nand set data */
100
101 size = sizeof(struct s3c2410_nand_set) * npd->nr_sets;
102 if (size) {
103 struct s3c2410_nand_set *from = npd->sets;
104 struct s3c2410_nand_set *to;
105 int i;
106
107 to = kmemdup(from, size, GFP_KERNEL);
108 npd->sets = to; /* set, even if we failed */
109
110 if (!to) {
111 printk(KERN_ERR "%s: no memory for sets\n", __func__);
112 return;
113 }
114
115 for (i = 0; i < npd->nr_sets; i++) {
116 ret = s3c_nand_copy_set(to);
117 if (ret) {
118 printk(KERN_ERR "%s: failed to copy set %d\n",
119 __func__, i);
120 return;
121 }
122 to++;
123 }
124 }
125
126 s3c_device_nand.dev.platform_data = npd;
127}
128
129EXPORT_SYMBOL_GPL(s3c_nand_set_platdata);
diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c
new file mode 100644
index 00000000000..e2f604b51c8
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-usb-hsotg.c
@@ -0,0 +1,41 @@
1/* linux/arch/arm/plat-s3c/dev-usb-hsotg.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for USB high-speed UDC/OtG block
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/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/devs.h>
22
23static struct resource s3c_usb_hsotg_resources[] = {
24 [0] = {
25 .start = S3C_PA_USB_HSOTG,
26 .end = S3C_PA_USB_HSOTG + 0x10000 - 1,
27 .flags = IORESOURCE_MEM,
28 },
29 [1] = {
30 .start = IRQ_OTG,
31 .end = IRQ_OTG,
32 .flags = IORESOURCE_IRQ,
33 },
34};
35
36struct platform_device s3c_device_usb_hsotg = {
37 .name = "s3c-hsotg",
38 .id = -1,
39 .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources),
40 .resource = s3c_usb_hsotg_resources,
41};
diff --git a/arch/arm/plat-samsung/dev-usb.c b/arch/arm/plat-samsung/dev-usb.c
new file mode 100644
index 00000000000..2ee85abed6d
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-usb.c
@@ -0,0 +1,50 @@
1/* linux/arch/arm/plat-s3c/dev-usb.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for USB host
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/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/devs.h>
22
23
24static struct resource s3c_usb_resource[] = {
25 [0] = {
26 .start = S3C_PA_USBHOST,
27 .end = S3C_PA_USBHOST + 0x100 - 1,
28 .flags = IORESOURCE_MEM,
29 },
30 [1] = {
31 .start = IRQ_USBH,
32 .end = IRQ_USBH,
33 .flags = IORESOURCE_IRQ,
34 }
35};
36
37static u64 s3c_device_usb_dmamask = 0xffffffffUL;
38
39struct platform_device s3c_device_usb = {
40 .name = "s3c2410-ohci",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(s3c_usb_resource),
43 .resource = s3c_usb_resource,
44 .dev = {
45 .dma_mask = &s3c_device_usb_dmamask,
46 .coherent_dma_mask = 0xffffffffUL
47 }
48};
49
50EXPORT_SYMBOL(s3c_device_usb);