aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2011-10-02 20:46:56 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-10-05 22:15:09 -0400
commit5716714927b789a27853eaacdbba1f2675505af0 (patch)
treedfd522832c9312e0438c190a52484ca7fa1bd1d3 /arch/arm/plat-samsung
parent0523ec3a685573730dbd619544c46465f5df6147 (diff)
ARM: S5P: To merge devs.c files to one devs.c
This patch moves regarding s5p dev files to one devs.c file in plat-samsung directory and this help to keep it more easily. Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r--arch/arm/plat-samsung/devs.c468
1 files changed, 468 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 7a00dee89ebb..d8bd7ad6367c 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -22,10 +22,14 @@
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
25#include <linux/fb.h>
26#include <linux/gfp.h>
25#include <linux/mtd/mtd.h> 27#include <linux/mtd/mtd.h>
26#include <linux/mtd/onenand.h> 28#include <linux/mtd/onenand.h>
29#include <linux/ioport.h>
27 30
28#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/pmu.h>
29#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 34#include <asm/mach/map.h>
31#include <asm/mach/irq.h> 35#include <asm/mach/irq.h>
@@ -37,11 +41,15 @@
37 41
38#include <plat/cpu.h> 42#include <plat/cpu.h>
39#include <plat/devs.h> 43#include <plat/devs.h>
44#include <plat/ehci.h>
40#include <plat/fb.h> 45#include <plat/fb.h>
41#include <plat/fb-s3c2410.h> 46#include <plat/fb-s3c2410.h>
47#include <plat/iic.h>
42#include <plat/mci.h> 48#include <plat/mci.h>
43#include <plat/ts.h> 49#include <plat/ts.h>
44#include <plat/udc.h> 50#include <plat/udc.h>
51#include <plat/usb-phy.h>
52#include <plat/regs-iic.h>
45#include <plat/regs-serial.h> 53#include <plat/regs-serial.h>
46#include <plat/regs-spi.h> 54#include <plat/regs-spi.h>
47 55
@@ -149,6 +157,199 @@ struct platform_device s3c_device_camif = {
149}; 157};
150#endif /* CONFIG_CPU_S3C2440 */ 158#endif /* CONFIG_CPU_S3C2440 */
151 159
160/* FIMC */
161
162#ifdef CONFIG_S5P_DEV_FIMC0
163static struct resource s5p_fimc0_resource[] = {
164 [0] = {
165 .start = S5P_PA_FIMC0,
166 .end = S5P_PA_FIMC0 + SZ_4K - 1,
167 .flags = IORESOURCE_MEM,
168 },
169 [1] = {
170 .start = IRQ_FIMC0,
171 .end = IRQ_FIMC0,
172 .flags = IORESOURCE_IRQ,
173 },
174};
175
176struct platform_device s5p_device_fimc0 = {
177 .name = "s5p-fimc",
178 .id = 0,
179 .num_resources = ARRAY_SIZE(s5p_fimc0_resource),
180 .resource = s5p_fimc0_resource,
181 .dev = {
182 .dma_mask = &samsung_device_dma_mask,
183 .coherent_dma_mask = DMA_BIT_MASK(32),
184 },
185};
186#endif /* CONFIG_S5P_DEV_FIMC0 */
187
188#ifdef CONFIG_S5P_DEV_FIMC1
189static struct resource s5p_fimc1_resource[] = {
190 [0] = {
191 .start = S5P_PA_FIMC1,
192 .end = S5P_PA_FIMC1 + SZ_4K - 1,
193 .flags = IORESOURCE_MEM,
194 },
195 [1] = {
196 .start = IRQ_FIMC1,
197 .end = IRQ_FIMC1,
198 .flags = IORESOURCE_IRQ,
199 },
200};
201
202struct platform_device s5p_device_fimc1 = {
203 .name = "s5p-fimc",
204 .id = 1,
205 .num_resources = ARRAY_SIZE(s5p_fimc1_resource),
206 .resource = s5p_fimc1_resource,
207 .dev = {
208 .dma_mask = &samsung_device_dma_mask,
209 .coherent_dma_mask = DMA_BIT_MASK(32),
210 },
211};
212#endif /* CONFIG_S5P_DEV_FIMC1 */
213
214#ifdef CONFIG_S5P_DEV_FIMC2
215static struct resource s5p_fimc2_resource[] = {
216 [0] = {
217 .start = S5P_PA_FIMC2,
218 .end = S5P_PA_FIMC2 + SZ_4K - 1,
219 .flags = IORESOURCE_MEM,
220 },
221 [1] = {
222 .start = IRQ_FIMC2,
223 .end = IRQ_FIMC2,
224 .flags = IORESOURCE_IRQ,
225 },
226};
227
228struct platform_device s5p_device_fimc2 = {
229 .name = "s5p-fimc",
230 .id = 2,
231 .num_resources = ARRAY_SIZE(s5p_fimc2_resource),
232 .resource = s5p_fimc2_resource,
233 .dev = {
234 .dma_mask = &samsung_device_dma_mask,
235 .coherent_dma_mask = DMA_BIT_MASK(32),
236 },
237};
238#endif /* CONFIG_S5P_DEV_FIMC2 */
239
240#ifdef CONFIG_S5P_DEV_FIMC3
241static struct resource s5p_fimc3_resource[] = {
242 [0] = {
243 .start = S5P_PA_FIMC3,
244 .end = S5P_PA_FIMC3 + SZ_4K - 1,
245 .flags = IORESOURCE_MEM,
246 },
247 [1] = {
248 .start = IRQ_FIMC3,
249 .end = IRQ_FIMC3,
250 .flags = IORESOURCE_IRQ,
251 },
252};
253
254struct platform_device s5p_device_fimc3 = {
255 .name = "s5p-fimc",
256 .id = 3,
257 .num_resources = ARRAY_SIZE(s5p_fimc3_resource),
258 .resource = s5p_fimc3_resource,
259 .dev = {
260 .dma_mask = &samsung_device_dma_mask,
261 .coherent_dma_mask = DMA_BIT_MASK(32),
262 },
263};
264#endif /* CONFIG_S5P_DEV_FIMC3 */
265
266/* FIMD0 */
267
268#ifdef CONFIG_S5P_DEV_FIMD0
269static struct resource s5p_fimd0_resource[] = {
270 [0] = {
271 .start = S5P_PA_FIMD0,
272 .end = S5P_PA_FIMD0 + SZ_32K - 1,
273 .flags = IORESOURCE_MEM,
274 },
275 [1] = {
276 .start = IRQ_FIMD0_VSYNC,
277 .end = IRQ_FIMD0_VSYNC,
278 .flags = IORESOURCE_IRQ,
279 },
280 [2] = {
281 .start = IRQ_FIMD0_FIFO,
282 .end = IRQ_FIMD0_FIFO,
283 .flags = IORESOURCE_IRQ,
284 },
285 [3] = {
286 .start = IRQ_FIMD0_SYSTEM,
287 .end = IRQ_FIMD0_SYSTEM,
288 .flags = IORESOURCE_IRQ,
289 },
290};
291
292struct platform_device s5p_device_fimd0 = {
293 .name = "s5p-fb",
294 .id = 0,
295 .num_resources = ARRAY_SIZE(s5p_fimd0_resource),
296 .resource = s5p_fimd0_resource,
297 .dev = {
298 .dma_mask = &samsung_device_dma_mask,
299 .coherent_dma_mask = DMA_BIT_MASK(32),
300 },
301};
302
303void __init s5p_fimd0_set_platdata(struct s3c_fb_platdata *pd)
304{
305 s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
306 &s5p_device_fimd0);
307}
308#endif /* CONFIG_S5P_DEV_FIMD0 */
309
310/* I2C HDMIPHY */
311
312#ifdef CONFIG_S5P_DEV_I2C_HDMIPHY
313static struct resource s5p_i2c_resource[] = {
314 [0] = {
315 .start = S5P_PA_IIC_HDMIPHY,
316 .end = S5P_PA_IIC_HDMIPHY + SZ_4K - 1,
317 .flags = IORESOURCE_MEM,
318 },
319 [1] = {
320 .start = IRQ_IIC_HDMIPHY,
321 .end = IRQ_IIC_HDMIPHY,
322 .flags = IORESOURCE_IRQ,
323 },
324};
325
326struct platform_device s5p_device_i2c_hdmiphy = {
327 .name = "s3c2440-hdmiphy-i2c",
328 .id = -1,
329 .num_resources = ARRAY_SIZE(s5p_i2c_resource),
330 .resource = s5p_i2c_resource,
331};
332
333void __init s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *pd)
334{
335 struct s3c2410_platform_i2c *npd;
336
337 if (!pd) {
338 pd = &default_i2c_data;
339
340 if (soc_is_exynos4210())
341 pd->bus_num = 8;
342 else if (soc_is_s5pv210())
343 pd->bus_num = 3;
344 else
345 pd->bus_num = 0;
346 }
347
348 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
349 &s5p_device_i2c_hdmiphy);
350}
351#endif /* CONFIG_S5P_DEV_I2C_HDMIPHY */
352
152/* I2S */ 353/* I2S */
153 354
154#ifdef CONFIG_PLAT_S3C24XX 355#ifdef CONFIG_PLAT_S3C24XX
@@ -227,6 +428,104 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
227} 428}
228#endif /* CONFIG_PLAT_S3C24XX */ 429#endif /* CONFIG_PLAT_S3C24XX */
229 430
431/* MFC */
432
433#ifdef CONFIG_S5P_DEV_MFC
434static struct resource s5p_mfc_resource[] = {
435 [0] = {
436 .start = S5P_PA_MFC,
437 .end = S5P_PA_MFC + SZ_64K - 1,
438 .flags = IORESOURCE_MEM,
439 },
440 [1] = {
441 .start = IRQ_MFC,
442 .end = IRQ_MFC,
443 .flags = IORESOURCE_IRQ,
444 }
445};
446
447struct platform_device s5p_device_mfc = {
448 .name = "s5p-mfc",
449 .id = -1,
450 .num_resources = ARRAY_SIZE(s5p_mfc_resource),
451 .resource = s5p_mfc_resource,
452};
453
454/*
455 * MFC hardware has 2 memory interfaces which are modelled as two separate
456 * platform devices to let dma-mapping distinguish between them.
457 *
458 * MFC parent device (s5p_device_mfc) must be registered before memory
459 * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r).
460 */
461
462struct platform_device s5p_device_mfc_l = {
463 .name = "s5p-mfc-l",
464 .id = -1,
465 .dev = {
466 .parent = &s5p_device_mfc.dev,
467 .dma_mask = &samsung_device_dma_mask,
468 .coherent_dma_mask = DMA_BIT_MASK(32),
469 },
470};
471
472struct platform_device s5p_device_mfc_r = {
473 .name = "s5p-mfc-r",
474 .id = -1,
475 .dev = {
476 .parent = &s5p_device_mfc.dev,
477 .dma_mask = &samsung_device_dma_mask,
478 .coherent_dma_mask = DMA_BIT_MASK(32),
479 },
480};
481#endif /* CONFIG_S5P_DEV_MFC */
482
483/* MIPI CSIS */
484
485#ifdef CONFIG_S5P_DEV_CSIS0
486static struct resource s5p_mipi_csis0_resource[] = {
487 [0] = {
488 .start = S5P_PA_MIPI_CSIS0,
489 .end = S5P_PA_MIPI_CSIS0 + SZ_4K - 1,
490 .flags = IORESOURCE_MEM,
491 },
492 [1] = {
493 .start = IRQ_MIPI_CSIS0,
494 .end = IRQ_MIPI_CSIS0,
495 .flags = IORESOURCE_IRQ,
496 }
497};
498
499struct platform_device s5p_device_mipi_csis0 = {
500 .name = "s5p-mipi-csis",
501 .id = 0,
502 .num_resources = ARRAY_SIZE(s5p_mipi_csis0_resource),
503 .resource = s5p_mipi_csis0_resource,
504};
505#endif /* CONFIG_S5P_DEV_CSIS0 */
506
507#ifdef CONFIG_S5P_DEV_CSIS1
508static struct resource s5p_mipi_csis1_resource[] = {
509 [0] = {
510 .start = S5P_PA_MIPI_CSIS1,
511 .end = S5P_PA_MIPI_CSIS1 + SZ_4K - 1,
512 .flags = IORESOURCE_MEM,
513 },
514 [1] = {
515 .start = IRQ_MIPI_CSIS1,
516 .end = IRQ_MIPI_CSIS1,
517 .flags = IORESOURCE_IRQ,
518 },
519};
520
521struct platform_device s5p_device_mipi_csis1 = {
522 .name = "s5p-mipi-csis",
523 .id = 1,
524 .num_resources = ARRAY_SIZE(s5p_mipi_csis1_resource),
525 .resource = s5p_mipi_csis1_resource,
526};
527#endif
528
230#ifdef CONFIG_S3C64XX_DEV_ONENAND1 529#ifdef CONFIG_S3C64XX_DEV_ONENAND1
231static struct resource s3c64xx_onenand1_resources[] = { 530static struct resource s3c64xx_onenand1_resources[] = {
232 [0] = { 531 [0] = {
@@ -260,6 +559,57 @@ void s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata)
260} 559}
261#endif /* CONFIG_S3C64XX_DEV_ONENAND1 */ 560#endif /* CONFIG_S3C64XX_DEV_ONENAND1 */
262 561
562#ifdef CONFIG_S5P_DEV_ONENAND
563static struct resource s5p_onenand_resources[] = {
564 [0] = {
565 .start = S5P_PA_ONENAND,
566 .end = S5P_PA_ONENAND + SZ_128K - 1,
567 .flags = IORESOURCE_MEM,
568 },
569 [1] = {
570 .start = S5P_PA_ONENAND_DMA,
571 .end = S5P_PA_ONENAND_DMA + SZ_8K - 1,
572 .flags = IORESOURCE_MEM,
573 },
574 [2] = {
575 .start = IRQ_ONENAND_AUDI,
576 .end = IRQ_ONENAND_AUDI,
577 .flags = IORESOURCE_IRQ,
578 },
579};
580
581struct platform_device s5p_device_onenand = {
582 .name = "s5pc110-onenand",
583 .id = -1,
584 .num_resources = ARRAY_SIZE(s5p_onenand_resources),
585 .resource = s5p_onenand_resources,
586};
587#endif /* CONFIG_S5P_DEV_ONENAND */
588
589/* PMU */
590
591#ifdef CONFIG_PLAT_S5P
592static struct resource s5p_pmu_resource = {
593 .start = IRQ_PMU,
594 .end = IRQ_PMU,
595 .flags = IORESOURCE_IRQ,
596};
597
598struct platform_device s5p_device_pmu = {
599 .name = "arm-pmu",
600 .id = ARM_PMU_DEVICE_CPU,
601 .num_resources = 1,
602 .resource = &s5p_pmu_resource,
603};
604
605static int __init s5p_pmu_init(void)
606{
607 platform_device_register(&s5p_device_pmu);
608 return 0;
609}
610arch_initcall(s5p_pmu_init);
611#endif /* CONFIG_PLAT_S5P */
612
263/* RTC */ 613/* RTC */
264 614
265#ifdef CONFIG_PLAT_S3C24XX 615#ifdef CONFIG_PLAT_S3C24XX
@@ -403,6 +753,83 @@ void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_
403} 753}
404#endif /* CONFIG_PLAT_S3C24XX */ 754#endif /* CONFIG_PLAT_S3C24XX */
405 755
756/* TV */
757
758#ifdef CONFIG_S5P_DEV_TV
759
760static struct resource s5p_hdmi_resources[] = {
761 [0] = {
762 .start = S5P_PA_HDMI,
763 .end = S5P_PA_HDMI + SZ_1M - 1,
764 .flags = IORESOURCE_MEM,
765 },
766 [1] = {
767 .start = IRQ_HDMI,
768 .end = IRQ_HDMI,
769 .flags = IORESOURCE_IRQ,
770 },
771};
772
773struct platform_device s5p_device_hdmi = {
774 .name = "s5p-hdmi",
775 .id = -1,
776 .num_resources = ARRAY_SIZE(s5p_hdmi_resources),
777 .resource = s5p_hdmi_resources,
778};
779
780static struct resource s5p_sdo_resources[] = {
781 [0] = {
782 .start = S5P_PA_SDO,
783 .end = S5P_PA_SDO + SZ_64K - 1,
784 .flags = IORESOURCE_MEM,
785 },
786 [1] = {
787 .start = IRQ_SDO,
788 .end = IRQ_SDO,
789 .flags = IORESOURCE_IRQ,
790 }
791};
792
793struct platform_device s5p_device_sdo = {
794 .name = "s5p-sdo",
795 .id = -1,
796 .num_resources = ARRAY_SIZE(s5p_sdo_resources),
797 .resource = s5p_sdo_resources,
798};
799
800static struct resource s5p_mixer_resources[] = {
801 [0] = {
802 .start = S5P_PA_MIXER,
803 .end = S5P_PA_MIXER + SZ_64K - 1,
804 .flags = IORESOURCE_MEM,
805 .name = "mxr"
806 },
807 [1] = {
808 .start = S5P_PA_VP,
809 .end = S5P_PA_VP + SZ_64K - 1,
810 .flags = IORESOURCE_MEM,
811 .name = "vp"
812 },
813 [2] = {
814 .start = IRQ_MIXER,
815 .end = IRQ_MIXER,
816 .flags = IORESOURCE_IRQ,
817 .name = "irq"
818 }
819};
820
821struct platform_device s5p_device_mixer = {
822 .name = "s5p-mixer",
823 .id = -1,
824 .num_resources = ARRAY_SIZE(s5p_mixer_resources),
825 .resource = s5p_mixer_resources,
826 .dev = {
827 .dma_mask = &samsung_device_dma_mask,
828 .coherent_dma_mask = DMA_BIT_MASK(32),
829 }
830};
831#endif /* CONFIG_S5P_DEV_TV */
832
406/* USB Device (Gadget) */ 833/* USB Device (Gadget) */
407 834
408#ifdef CONFIG_PLAT_S3C24XX 835#ifdef CONFIG_PLAT_S3C24XX
@@ -432,6 +859,47 @@ void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
432} 859}
433#endif /* CONFIG_PLAT_S3C24XX */ 860#endif /* CONFIG_PLAT_S3C24XX */
434 861
862/* USB EHCI Host Controller */
863
864#ifdef CONFIG_S5P_DEV_USB_EHCI
865static struct resource s5p_ehci_resource[] = {
866 [0] = {
867 .start = S5P_PA_EHCI,
868 .end = S5P_PA_EHCI + SZ_256 - 1,
869 .flags = IORESOURCE_MEM,
870 },
871 [1] = {
872 .start = IRQ_USB_HOST,
873 .end = IRQ_USB_HOST,
874 .flags = IORESOURCE_IRQ,
875 }
876};
877
878struct platform_device s5p_device_ehci = {
879 .name = "s5p-ehci",
880 .id = -1,
881 .num_resources = ARRAY_SIZE(s5p_ehci_resource),
882 .resource = s5p_ehci_resource,
883 .dev = {
884 .dma_mask = &samsung_device_dma_mask,
885 .coherent_dma_mask = DMA_BIT_MASK(32),
886 }
887};
888
889void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd)
890{
891 struct s5p_ehci_platdata *npd;
892
893 npd = s3c_set_platdata(pd, sizeof(struct s5p_ehci_platdata),
894 &s5p_device_ehci);
895
896 if (!npd->phy_init)
897 npd->phy_init = s5p_usb_phy_init;
898 if (!npd->phy_exit)
899 npd->phy_exit = s5p_usb_phy_exit;
900}
901#endif /* CONFIG_S5P_DEV_USB_EHCI */
902
435/* USB High Spped 2.0 Device (Gadget) */ 903/* USB High Spped 2.0 Device (Gadget) */
436 904
437#ifdef CONFIG_PLAT_S3C24XX 905#ifdef CONFIG_PLAT_S3C24XX