aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJonghun Han <jonghun.han@samsung.com>2011-07-21 02:46:26 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-07-21 04:28:51 -0400
commite61b170139225ccb808eb98a047dd2a8d3af830d (patch)
treeaa225f29c5eb4d3c2a5195808f9e8287586535a5 /arch
parent1aee2add2179a46c93bd62137feca22b1822eda2 (diff)
ARM: EXYNOS4: Add platform device and helper functions for FIMD
This patch adds platform device s5p_device_fimd0 for EXYNOS4 FIMD0. EXYNOS4 has two FIMDs(FIMD0, FIMD1). FIMD1 will be added later. Some definitions used to enable EXYNOS4 FIMD0 are added. Signed-off-by: Jonghun Han <jonghun.han@samsung.com> Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-exynos4/Kconfig9
-rw-r--r--arch/arm/mach-exynos4/Makefile1
-rw-r--r--arch/arm/mach-exynos4/cpu.c3
-rw-r--r--arch/arm/mach-exynos4/setup-fimd0.c43
-rw-r--r--arch/arm/plat-s5p/Kconfig5
-rw-r--r--arch/arm/plat-s5p/Makefile1
-rw-r--r--arch/arm/plat-s5p/dev-fimd0.c67
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/fb-core.h15
-rw-r--r--arch/arm/plat-samsung/include/plat/fb.h15
10 files changed, 160 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index b735705c8b47..75982b53e527 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -26,6 +26,11 @@ config EXYNOS4_DEV_AHCI
26 help 26 help
27 Compile in platform device definitions for AHCI 27 Compile in platform device definitions for AHCI
28 28
29config EXYNOS4_SETUP_FIMD0
30 bool
31 help
32 Common setup code for FIMD0.
33
29config EXYNOS4_DEV_PD 34config EXYNOS4_DEV_PD
30 bool 35 bool
31 help 36 help
@@ -109,6 +114,7 @@ menu "EXYNOS4 Machines"
109config MACH_SMDKC210 114config MACH_SMDKC210
110 bool "SMDKC210" 115 bool "SMDKC210"
111 select CPU_EXYNOS4210 116 select CPU_EXYNOS4210
117 select S5P_DEV_FIMD0
112 select S3C_DEV_RTC 118 select S3C_DEV_RTC
113 select S3C_DEV_WDT 119 select S3C_DEV_WDT
114 select S3C_DEV_I2C1 120 select S3C_DEV_I2C1
@@ -118,6 +124,7 @@ config MACH_SMDKC210
118 select S3C_DEV_HSMMC3 124 select S3C_DEV_HSMMC3
119 select EXYNOS4_DEV_PD 125 select EXYNOS4_DEV_PD
120 select EXYNOS4_DEV_SYSMMU 126 select EXYNOS4_DEV_SYSMMU
127 select EXYNOS4_SETUP_FIMD0
121 select EXYNOS4_SETUP_I2C1 128 select EXYNOS4_SETUP_I2C1
122 select EXYNOS4_SETUP_SDHCI 129 select EXYNOS4_SETUP_SDHCI
123 help 130 help
@@ -126,6 +133,7 @@ config MACH_SMDKC210
126config MACH_SMDKV310 133config MACH_SMDKV310
127 bool "SMDKV310" 134 bool "SMDKV310"
128 select CPU_EXYNOS4210 135 select CPU_EXYNOS4210
136 select S5P_DEV_FIMD0
129 select S3C_DEV_RTC 137 select S3C_DEV_RTC
130 select S3C_DEV_WDT 138 select S3C_DEV_WDT
131 select S3C_DEV_I2C1 139 select S3C_DEV_I2C1
@@ -137,6 +145,7 @@ config MACH_SMDKV310
137 select SAMSUNG_DEV_KEYPAD 145 select SAMSUNG_DEV_KEYPAD
138 select EXYNOS4_DEV_PD 146 select EXYNOS4_DEV_PD
139 select EXYNOS4_DEV_SYSMMU 147 select EXYNOS4_DEV_SYSMMU
148 select EXYNOS4_SETUP_FIMD0
140 select EXYNOS4_SETUP_I2C1 149 select EXYNOS4_SETUP_I2C1
141 select EXYNOS4_SETUP_KEYPAD 150 select EXYNOS4_SETUP_KEYPAD
142 select EXYNOS4_SETUP_SDHCI 151 select EXYNOS4_SETUP_SDHCI
diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile
index 2a0b68220b2f..e8b33aba14d8 100644
--- a/arch/arm/mach-exynos4/Makefile
+++ b/arch/arm/mach-exynos4/Makefile
@@ -41,6 +41,7 @@ obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o
41obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o 41obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o
42 42
43obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o 43obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o
44obj-$(CONFIG_EXYNOS4_SETUP_FIMD0) += setup-fimd0.o
44obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.o 45obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.o
45obj-$(CONFIG_EXYNOS4_SETUP_I2C2) += setup-i2c2.o 46obj-$(CONFIG_EXYNOS4_SETUP_I2C2) += setup-i2c2.o
46obj-$(CONFIG_EXYNOS4_SETUP_I2C3) += setup-i2c3.o 47obj-$(CONFIG_EXYNOS4_SETUP_I2C3) += setup-i2c3.o
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
index b0370f79ce7e..2d8a40c9e6e5 100644
--- a/arch/arm/mach-exynos4/cpu.c
+++ b/arch/arm/mach-exynos4/cpu.c
@@ -25,6 +25,7 @@
25#include <plat/adc-core.h> 25#include <plat/adc-core.h>
26#include <plat/sdhci.h> 26#include <plat/sdhci.h>
27#include <plat/devs.h> 27#include <plat/devs.h>
28#include <plat/fb-core.h>
28#include <plat/fimc-core.h> 29#include <plat/fimc-core.h>
29#include <plat/iic-core.h> 30#include <plat/iic-core.h>
30 31
@@ -153,6 +154,8 @@ void __init exynos4_map_io(void)
153 s3c_i2c0_setname("s3c2440-i2c"); 154 s3c_i2c0_setname("s3c2440-i2c");
154 s3c_i2c1_setname("s3c2440-i2c"); 155 s3c_i2c1_setname("s3c2440-i2c");
155 s3c_i2c2_setname("s3c2440-i2c"); 156 s3c_i2c2_setname("s3c2440-i2c");
157
158 s5p_fb_setname(0, "exynos4-fb");
156} 159}
157 160
158void __init exynos4_init_clocks(int xtal) 161void __init exynos4_init_clocks(int xtal)
diff --git a/arch/arm/mach-exynos4/setup-fimd0.c b/arch/arm/mach-exynos4/setup-fimd0.c
new file mode 100644
index 000000000000..07a6dbeecdd0
--- /dev/null
+++ b/arch/arm/mach-exynos4/setup-fimd0.c
@@ -0,0 +1,43 @@
1/* linux/arch/arm/mach-exynos4/setup-fimd0.c
2 *
3 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Base Exynos4 FIMD 0 configuration
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/fb.h>
14#include <linux/gpio.h>
15
16#include <plat/gpio-cfg.h>
17#include <plat/regs-fb-v4.h>
18
19#include <mach/map.h>
20
21void exynos4_fimd0_gpio_setup_24bpp(void)
22{
23 unsigned int reg;
24
25 s3c_gpio_cfgrange_nopull(EXYNOS4_GPF0(0), 8, S3C_GPIO_SFN(2));
26 s3c_gpio_cfgrange_nopull(EXYNOS4_GPF1(0), 8, S3C_GPIO_SFN(2));
27 s3c_gpio_cfgrange_nopull(EXYNOS4_GPF2(0), 8, S3C_GPIO_SFN(2));
28 s3c_gpio_cfgrange_nopull(EXYNOS4_GPF3(0), 4, S3C_GPIO_SFN(2));
29
30 /*
31 * Set DISPLAY_CONTROL register for Display path selection.
32 *
33 * DISPLAY_CONTROL[1:0]
34 * ---------------------
35 * 00 | MIE
36 * 01 | MDINE
37 * 10 | FIMD : selected
38 * 11 | FIMD
39 */
40 reg = __raw_readl(S3C_VA_SYS + 0x0210);
41 reg |= (1 << 1);
42 __raw_writel(reg, S3C_VA_SYS + 0x0210);
43}
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index 7f9ff2afffd9..7537ad57c7db 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -71,6 +71,11 @@ config S5P_DEV_FIMC3
71 help 71 help
72 Compile in platform device definitions for FIMC controller 3 72 Compile in platform device definitions for FIMC controller 3
73 73
74config S5P_DEV_FIMD0
75 bool
76 help
77 Compile in platform device definitions for FIMD controller 0
78
74config S5P_DEV_ONENAND 79config S5P_DEV_ONENAND
75 bool 80 bool
76 help 81 help
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index e234cc4d49a0..eec7e24c1a03 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o
30obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o 30obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o
31obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o 31obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o
32obj-$(CONFIG_S5P_DEV_FIMC3) += dev-fimc3.o 32obj-$(CONFIG_S5P_DEV_FIMC3) += dev-fimc3.o
33obj-$(CONFIG_S5P_DEV_FIMD0) += dev-fimd0.o
33obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o 34obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o
34obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o 35obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o
35obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o 36obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o
diff --git a/arch/arm/plat-s5p/dev-fimd0.c b/arch/arm/plat-s5p/dev-fimd0.c
new file mode 100644
index 000000000000..f728bb5abcef
--- /dev/null
+++ b/arch/arm/plat-s5p/dev-fimd0.c
@@ -0,0 +1,67 @@
1/* linux/arch/arm/plat-s5p/dev-fimd0.c
2 *
3 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Core file for Samsung Display Controller (FIMD) driver
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/string.h>
15#include <linux/platform_device.h>
16#include <linux/fb.h>
17#include <linux/gfp.h>
18#include <linux/dma-mapping.h>
19
20#include <mach/irqs.h>
21#include <mach/map.h>
22
23#include <plat/fb.h>
24#include <plat/devs.h>
25#include <plat/cpu.h>
26
27static struct resource s5p_fimd0_resource[] = {
28 [0] = {
29 .start = S5P_PA_FIMD0,
30 .end = S5P_PA_FIMD0 + SZ_32K - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_FIMD0_VSYNC,
35 .end = IRQ_FIMD0_VSYNC,
36 .flags = IORESOURCE_IRQ,
37 },
38 [2] = {
39 .start = IRQ_FIMD0_FIFO,
40 .end = IRQ_FIMD0_FIFO,
41 .flags = IORESOURCE_IRQ,
42 },
43 [3] = {
44 .start = IRQ_FIMD0_SYSTEM,
45 .end = IRQ_FIMD0_SYSTEM,
46 .flags = IORESOURCE_IRQ,
47 },
48};
49
50static u64 fimd0_dmamask = DMA_BIT_MASK(32);
51
52struct platform_device s5p_device_fimd0 = {
53 .name = "s5p-fb",
54 .id = 0,
55 .num_resources = ARRAY_SIZE(s5p_fimd0_resource),
56 .resource = s5p_fimd0_resource,
57 .dev = {
58 .dma_mask = &fimd0_dmamask,
59 .coherent_dma_mask = DMA_BIT_MASK(32),
60 },
61};
62
63void __init s5p_fimd0_set_platdata(struct s3c_fb_platdata *pd)
64{
65 s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
66 &s5p_device_fimd0);
67}
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 540969047a7b..3ceaf86ba458 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -50,6 +50,7 @@ extern struct platform_device s3c64xx_device_ac97;
50extern struct platform_device s3c_device_ts; 50extern struct platform_device s3c_device_ts;
51 51
52extern struct platform_device s3c_device_fb; 52extern struct platform_device s3c_device_fb;
53extern struct platform_device s5p_device_fimd0;
53extern struct platform_device s3c_device_ohci; 54extern struct platform_device s3c_device_ohci;
54extern struct platform_device s3c_device_lcd; 55extern struct platform_device s3c_device_lcd;
55extern struct platform_device s3c_device_wdt; 56extern struct platform_device s3c_device_wdt;
diff --git a/arch/arm/plat-samsung/include/plat/fb-core.h b/arch/arm/plat-samsung/include/plat/fb-core.h
index bca383efcf6d..6abcbf139cee 100644
--- a/arch/arm/plat-samsung/include/plat/fb-core.h
+++ b/arch/arm/plat-samsung/include/plat/fb-core.h
@@ -26,4 +26,19 @@ static inline void s3c_fb_setname(char *name)
26#endif 26#endif
27} 27}
28 28
29/* Re-define device name depending on support. */
30static inline void s5p_fb_setname(int id, char *name)
31{
32 switch (id) {
33#ifdef CONFIG_S5P_DEV_FIMD0
34 case 0:
35 s5p_device_fimd0.name = name;
36 break;
37#endif
38 default:
39 printk(KERN_ERR "%s: invalid device id(%d)\n", __func__, id);
40 break;
41 }
42}
43
29#endif /* __ASM_PLAT_FB_CORE_H */ 44#endif /* __ASM_PLAT_FB_CORE_H */
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index cb3ca3adc685..01f10e4d00c7 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -74,6 +74,14 @@ struct s3c_fb_platdata {
74extern void s3c_fb_set_platdata(struct s3c_fb_platdata *pd); 74extern void s3c_fb_set_platdata(struct s3c_fb_platdata *pd);
75 75
76/** 76/**
77 * s5p_fimd0_set_platdata() - Setup the FB device with platform data.
78 * @pd: The platform data to set. The data is copied from the passed structure
79 * so the machine data can mark the data __initdata so that any unused
80 * machines will end up dumping their data at runtime.
81 */
82extern void s5p_fimd0_set_platdata(struct s3c_fb_platdata *pd);
83
84/**
77 * s3c64xx_fb_gpio_setup_24bpp() - S3C64XX setup function for 24bpp LCD 85 * s3c64xx_fb_gpio_setup_24bpp() - S3C64XX setup function for 24bpp LCD
78 * 86 *
79 * Initialise the GPIO for an 24bpp LCD display on the RGB interface. 87 * Initialise the GPIO for an 24bpp LCD display on the RGB interface.
@@ -94,4 +102,11 @@ extern void s5pc100_fb_gpio_setup_24bpp(void);
94 */ 102 */
95extern void s5pv210_fb_gpio_setup_24bpp(void); 103extern void s5pv210_fb_gpio_setup_24bpp(void);
96 104
105/**
106 * exynos4_fimd0_gpio_setup_24bpp() - Exynos4 setup function for 24bpp LCD0
107 *
108 * Initialise the GPIO for an 24bpp LCD display on the RGB interface 0.
109 */
110extern void exynos4_fimd0_gpio_setup_24bpp(void);
111
97#endif /* __PLAT_S3C_FB_H */ 112#endif /* __PLAT_S3C_FB_H */