diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2010-08-05 05:16:31 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-08-06 08:28:35 -0400 |
commit | 33c14ff838c3617616112b6dd833f2d7b70d6224 (patch) | |
tree | 0e26cd9729b98a90356859789c5006f48cf5a124 /arch/arm | |
parent | 290d0983b86f6243beffaa3ddb02c14adc30f02a (diff) |
ARM: SAMSUNG: Add platform definitions and helpers for FIMC driver
FIMC (CAMIF) device is a camera interface embedded in S3C/S5P Samsung
SOC series. It supports ITU-R BT.601/656 and MIPI-CSI2 standards,
memory to memory operations, color conversion, resizing and rotation.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-s5pc100/include/mach/map.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/cpu.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/include/mach/map.h | 7 | ||||
-rw-r--r-- | arch/arm/plat-s5p/Makefile | 5 | ||||
-rw-r--r-- | arch/arm/plat-s5p/dev-fimc0.c | 36 | ||||
-rw-r--r-- | arch/arm/plat-s5p/dev-fimc1.c | 36 | ||||
-rw-r--r-- | arch/arm/plat-s5p/dev-fimc2.c | 36 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/devs.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/fimc-core.h | 44 |
9 files changed, 181 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h index cadae4305688..abf17e8eb321 100644 --- a/arch/arm/mach-s5pc100/include/mach/map.h +++ b/arch/arm/mach-s5pc100/include/mach/map.h | |||
@@ -94,6 +94,10 @@ | |||
94 | 94 | ||
95 | #define S5PC100_PA_FB (0xEE000000) | 95 | #define S5PC100_PA_FB (0xEE000000) |
96 | 96 | ||
97 | #define S5PC100_PA_FIMC0 (0xEE200000) | ||
98 | #define S5PC100_PA_FIMC1 (0xEE300000) | ||
99 | #define S5PC100_PA_FIMC2 (0xEE400000) | ||
100 | |||
97 | #define S5PC100_PA_I2S0 (0xF2000000) | 101 | #define S5PC100_PA_I2S0 (0xF2000000) |
98 | #define S5PC100_PA_I2S1 (0xF2100000) | 102 | #define S5PC100_PA_I2S1 (0xF2100000) |
99 | #define S5PC100_PA_I2S2 (0xF2200000) | 103 | #define S5PC100_PA_I2S2 (0xF2200000) |
@@ -135,4 +139,8 @@ | |||
135 | #define S3C_PA_ONENAND_BUF S5PC100_PA_ONENAND_BUF | 139 | #define S3C_PA_ONENAND_BUF S5PC100_PA_ONENAND_BUF |
136 | #define S3C_SZ_ONENAND_BUF S5PC100_SZ_ONENAND_BUF | 140 | #define S3C_SZ_ONENAND_BUF S5PC100_SZ_ONENAND_BUF |
137 | 141 | ||
142 | #define S5P_PA_FIMC0 S5PC100_PA_FIMC0 | ||
143 | #define S5P_PA_FIMC1 S5PC100_PA_FIMC1 | ||
144 | #define S5P_PA_FIMC2 S5PC100_PA_FIMC2 | ||
145 | |||
138 | #endif /* __ASM_ARCH_C100_MAP_H */ | 146 | #endif /* __ASM_ARCH_C100_MAP_H */ |
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c index 68317a4170cf..1acf9ac7ad35 100644 --- a/arch/arm/mach-s5pv210/cpu.c +++ b/arch/arm/mach-s5pv210/cpu.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <plat/clock.h> | 33 | #include <plat/clock.h> |
34 | #include <plat/s5pv210.h> | 34 | #include <plat/s5pv210.h> |
35 | #include <plat/adc-core.h> | 35 | #include <plat/adc-core.h> |
36 | #include <plat/fimc-core.h> | ||
36 | #include <plat/iic-core.h> | 37 | #include <plat/iic-core.h> |
37 | #include <plat/sdhci.h> | 38 | #include <plat/sdhci.h> |
38 | 39 | ||
@@ -90,6 +91,10 @@ void __init s5pv210_map_io(void) | |||
90 | s3c_i2c0_setname("s3c2440-i2c"); | 91 | s3c_i2c0_setname("s3c2440-i2c"); |
91 | s3c_i2c1_setname("s3c2440-i2c"); | 92 | s3c_i2c1_setname("s3c2440-i2c"); |
92 | s3c_i2c2_setname("s3c2440-i2c"); | 93 | s3c_i2c2_setname("s3c2440-i2c"); |
94 | |||
95 | s3c_fimc_setname(0, "s5pv210-fimc"); | ||
96 | s3c_fimc_setname(1, "s5pv210-fimc"); | ||
97 | s3c_fimc_setname(2, "s5pv210-fimc"); | ||
93 | } | 98 | } |
94 | 99 | ||
95 | void __init s5pv210_init_clocks(int xtal) | 100 | void __init s5pv210_init_clocks(int xtal) |
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h index 34eb168ec950..69210bf76c47 100644 --- a/arch/arm/mach-s5pv210/include/mach/map.h +++ b/arch/arm/mach-s5pv210/include/mach/map.h | |||
@@ -60,6 +60,10 @@ | |||
60 | 60 | ||
61 | #define S5PV210_PA_FB (0xF8000000) | 61 | #define S5PV210_PA_FB (0xF8000000) |
62 | 62 | ||
63 | #define S5PV210_PA_FIMC0 (0xFB200000) | ||
64 | #define S5PV210_PA_FIMC1 (0xFB300000) | ||
65 | #define S5PV210_PA_FIMC2 (0xFB400000) | ||
66 | |||
63 | #define S5PV210_PA_HSMMC(x) (0xEB000000 + ((x) * 0x100000)) | 67 | #define S5PV210_PA_HSMMC(x) (0xEB000000 + ((x) * 0x100000)) |
64 | 68 | ||
65 | #define S5PV210_PA_VIC0 (0xF2000000) | 69 | #define S5PV210_PA_VIC0 (0xF2000000) |
@@ -102,6 +106,9 @@ | |||
102 | #define S3C_PA_IIC2 S5PV210_PA_IIC2 | 106 | #define S3C_PA_IIC2 S5PV210_PA_IIC2 |
103 | #define S3C_PA_FB S5PV210_PA_FB | 107 | #define S3C_PA_FB S5PV210_PA_FB |
104 | #define S3C_PA_WDT S5PV210_PA_WATCHDOG | 108 | #define S3C_PA_WDT S5PV210_PA_WATCHDOG |
109 | #define S5P_PA_FIMC0 S5PV210_PA_FIMC0 | ||
110 | #define S5P_PA_FIMC1 S5PV210_PA_FIMC1 | ||
111 | #define S5P_PA_FIMC2 S5PV210_PA_FIMC2 | ||
105 | 112 | ||
106 | #define SAMSUNG_PA_ADC S5PV210_PA_ADC | 113 | #define SAMSUNG_PA_ADC S5PV210_PA_ADC |
107 | 114 | ||
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile index 39c242bb9d58..8e18b5123dd7 100644 --- a/arch/arm/plat-s5p/Makefile +++ b/arch/arm/plat-s5p/Makefile | |||
@@ -18,3 +18,8 @@ obj-y += clock.o | |||
18 | obj-y += irq.o | 18 | obj-y += irq.o |
19 | obj-$(CONFIG_S5P_EXT_INT) += irq-eint.o | 19 | obj-$(CONFIG_S5P_EXT_INT) += irq-eint.o |
20 | 20 | ||
21 | # devices | ||
22 | |||
23 | obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o | ||
24 | obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o | ||
25 | obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o | ||
diff --git a/arch/arm/plat-s5p/dev-fimc0.c b/arch/arm/plat-s5p/dev-fimc0.c new file mode 100644 index 000000000000..d3f1a9b5d2b5 --- /dev/null +++ b/arch/arm/plat-s5p/dev-fimc0.c | |||
@@ -0,0 +1,36 @@ | |||
1 | /* linux/arch/arm/plat-s5p/dev-fimc0.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics | ||
4 | * | ||
5 | * Base S5P FIMC0 resource and device definitions | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/ioport.h> | ||
16 | #include <mach/map.h> | ||
17 | |||
18 | static struct resource s5p_fimc0_resource[] = { | ||
19 | [0] = { | ||
20 | .start = S5P_PA_FIMC0, | ||
21 | .end = S5P_PA_FIMC0 + SZ_1M - 1, | ||
22 | .flags = IORESOURCE_MEM, | ||
23 | }, | ||
24 | [1] = { | ||
25 | .start = IRQ_FIMC0, | ||
26 | .end = IRQ_FIMC0, | ||
27 | .flags = IORESOURCE_IRQ, | ||
28 | }, | ||
29 | }; | ||
30 | |||
31 | struct platform_device s5p_device_fimc0 = { | ||
32 | .name = "s5p-fimc", | ||
33 | .id = 0, | ||
34 | .num_resources = ARRAY_SIZE(s5p_fimc0_resource), | ||
35 | .resource = s5p_fimc0_resource, | ||
36 | }; | ||
diff --git a/arch/arm/plat-s5p/dev-fimc1.c b/arch/arm/plat-s5p/dev-fimc1.c new file mode 100644 index 000000000000..41bd6986d0ad --- /dev/null +++ b/arch/arm/plat-s5p/dev-fimc1.c | |||
@@ -0,0 +1,36 @@ | |||
1 | /* linux/arch/arm/plat-s5p/dev-fimc1.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics | ||
4 | * | ||
5 | * Base S5P FIMC1 resource and device definitions | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/ioport.h> | ||
16 | #include <mach/map.h> | ||
17 | |||
18 | static struct resource s5p_fimc1_resource[] = { | ||
19 | [0] = { | ||
20 | .start = S5P_PA_FIMC1, | ||
21 | .end = S5P_PA_FIMC1 + SZ_1M - 1, | ||
22 | .flags = IORESOURCE_MEM, | ||
23 | }, | ||
24 | [1] = { | ||
25 | .start = IRQ_FIMC1, | ||
26 | .end = IRQ_FIMC1, | ||
27 | .flags = IORESOURCE_IRQ, | ||
28 | }, | ||
29 | }; | ||
30 | |||
31 | struct platform_device s5p_device_fimc1 = { | ||
32 | .name = "s5p-fimc", | ||
33 | .id = 1, | ||
34 | .num_resources = ARRAY_SIZE(s5p_fimc1_resource), | ||
35 | .resource = s5p_fimc1_resource, | ||
36 | }; | ||
diff --git a/arch/arm/plat-s5p/dev-fimc2.c b/arch/arm/plat-s5p/dev-fimc2.c new file mode 100644 index 000000000000..dfddeda6d4a3 --- /dev/null +++ b/arch/arm/plat-s5p/dev-fimc2.c | |||
@@ -0,0 +1,36 @@ | |||
1 | /* linux/arch/arm/plat-s5p/dev-fimc2.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics | ||
4 | * | ||
5 | * Base S5P FIMC2 resource and device definitions | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/ioport.h> | ||
16 | #include <mach/map.h> | ||
17 | |||
18 | static struct resource s5p_fimc2_resource[] = { | ||
19 | [0] = { | ||
20 | .start = S5P_PA_FIMC2, | ||
21 | .end = S5P_PA_FIMC2 + SZ_1M - 1, | ||
22 | .flags = IORESOURCE_MEM, | ||
23 | }, | ||
24 | [1] = { | ||
25 | .start = IRQ_FIMC2, | ||
26 | .end = IRQ_FIMC2, | ||
27 | .flags = IORESOURCE_IRQ, | ||
28 | }, | ||
29 | }; | ||
30 | |||
31 | struct platform_device s5p_device_fimc2 = { | ||
32 | .name = "s5p-fimc", | ||
33 | .id = 2, | ||
34 | .num_resources = ARRAY_SIZE(s5p_fimc2_resource), | ||
35 | .resource = s5p_fimc2_resource, | ||
36 | }; | ||
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index 4c31d328669b..85f6f23a510f 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -104,6 +104,10 @@ extern struct platform_device s5pc100_device_iis2; | |||
104 | 104 | ||
105 | extern struct platform_device samsung_device_keypad; | 105 | extern struct platform_device samsung_device_keypad; |
106 | 106 | ||
107 | extern struct platform_device s5p_device_fimc0; | ||
108 | extern struct platform_device s5p_device_fimc1; | ||
109 | extern struct platform_device s5p_device_fimc2; | ||
110 | |||
107 | /* s3c2440 specific devices */ | 111 | /* s3c2440 specific devices */ |
108 | 112 | ||
109 | #ifdef CONFIG_CPU_S3C2440 | 113 | #ifdef CONFIG_CPU_S3C2440 |
diff --git a/arch/arm/plat-samsung/include/plat/fimc-core.h b/arch/arm/plat-samsung/include/plat/fimc-core.h new file mode 100644 index 000000000000..81a3bfeeccad --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/fimc-core.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-samsung/include/plat/fimc-core.h | ||
3 | * | ||
4 | * Copyright 2010 Samsung Electronics Co., Ltd. | ||
5 | * Sylwester Nawrocki <s.nawrocki@samsung.com> | ||
6 | * | ||
7 | * Samsung camera interface driver core functions | ||
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 | #ifndef __ASM_PLAT_FIMC_CORE_H | ||
15 | #define __ASM_PLAT_FIMC_CORE_H __FILE__ | ||
16 | |||
17 | /* | ||
18 | * These functions are only for use with the core support code, such as | ||
19 | * the CPU-specific initialization code. | ||
20 | */ | ||
21 | |||
22 | /* Re-define device name to differentiate the subsystem in various SoCs. */ | ||
23 | static inline void s3c_fimc_setname(int id, char *name) | ||
24 | { | ||
25 | switch (id) { | ||
26 | #ifdef CONFIG_S5P_DEV_FIMC0 | ||
27 | case 0: | ||
28 | s5p_device_fimc0.name = name; | ||
29 | break; | ||
30 | #endif | ||
31 | #ifdef CONFIG_S5P_DEV_FIMC1 | ||
32 | case 1: | ||
33 | s5p_device_fimc1.name = name; | ||
34 | break; | ||
35 | #endif | ||
36 | #ifdef CONFIG_S5P_DEV_FIMC2 | ||
37 | case 2: | ||
38 | s5p_device_fimc2.name = name; | ||
39 | break; | ||
40 | #endif | ||
41 | } | ||
42 | } | ||
43 | |||
44 | #endif /* __ASM_PLAT_FIMC_CORE_H */ | ||