1 /* linux/arch/arm/mach-exynos4/dev-sysmmu.c
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
6 * EXYNOS4 - System MMU support
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.
13 #include <linux/platform_device.h>
14 #include <linux/dma-mapping.h>
17 #include <mach/irqs.h>
18 #include <mach/sysmmu.h>
19 #include <plat/s5p-clock.h>
21 /* These names must be equal to the clock names in mach-exynos4/clock.c */
22 const char *sysmmu_ips_name
[EXYNOS4_SYSMMU_TOTAL_IPNUM
] = {
41 static struct resource exynos4_sysmmu_resource
[] = {
43 .start
= EXYNOS4_PA_SYSMMU_MDMA
,
44 .end
= EXYNOS4_PA_SYSMMU_MDMA
+ SZ_64K
- 1,
45 .flags
= IORESOURCE_MEM
,
48 .start
= IRQ_SYSMMU_MDMA0_0
,
49 .end
= IRQ_SYSMMU_MDMA0_0
,
50 .flags
= IORESOURCE_IRQ
,
53 .start
= EXYNOS4_PA_SYSMMU_SSS
,
54 .end
= EXYNOS4_PA_SYSMMU_SSS
+ SZ_64K
- 1,
55 .flags
= IORESOURCE_MEM
,
58 .start
= IRQ_SYSMMU_SSS_0
,
59 .end
= IRQ_SYSMMU_SSS_0
,
60 .flags
= IORESOURCE_IRQ
,
63 .start
= EXYNOS4_PA_SYSMMU_FIMC0
,
64 .end
= EXYNOS4_PA_SYSMMU_FIMC0
+ SZ_64K
- 1,
65 .flags
= IORESOURCE_MEM
,
68 .start
= IRQ_SYSMMU_FIMC0_0
,
69 .end
= IRQ_SYSMMU_FIMC0_0
,
70 .flags
= IORESOURCE_IRQ
,
73 .start
= EXYNOS4_PA_SYSMMU_FIMC1
,
74 .end
= EXYNOS4_PA_SYSMMU_FIMC1
+ SZ_64K
- 1,
75 .flags
= IORESOURCE_MEM
,
78 .start
= IRQ_SYSMMU_FIMC1_0
,
79 .end
= IRQ_SYSMMU_FIMC1_0
,
80 .flags
= IORESOURCE_IRQ
,
83 .start
= EXYNOS4_PA_SYSMMU_FIMC2
,
84 .end
= EXYNOS4_PA_SYSMMU_FIMC2
+ SZ_64K
- 1,
85 .flags
= IORESOURCE_MEM
,
88 .start
= IRQ_SYSMMU_FIMC2_0
,
89 .end
= IRQ_SYSMMU_FIMC2_0
,
90 .flags
= IORESOURCE_IRQ
,
93 .start
= EXYNOS4_PA_SYSMMU_FIMC3
,
94 .end
= EXYNOS4_PA_SYSMMU_FIMC3
+ SZ_64K
- 1,
95 .flags
= IORESOURCE_MEM
,
98 .start
= IRQ_SYSMMU_FIMC3_0
,
99 .end
= IRQ_SYSMMU_FIMC3_0
,
100 .flags
= IORESOURCE_IRQ
,
103 .start
= EXYNOS4_PA_SYSMMU_JPEG
,
104 .end
= EXYNOS4_PA_SYSMMU_JPEG
+ SZ_64K
- 1,
105 .flags
= IORESOURCE_MEM
,
108 .start
= IRQ_SYSMMU_JPEG_0
,
109 .end
= IRQ_SYSMMU_JPEG_0
,
110 .flags
= IORESOURCE_IRQ
,
113 .start
= EXYNOS4_PA_SYSMMU_FIMD0
,
114 .end
= EXYNOS4_PA_SYSMMU_FIMD0
+ SZ_64K
- 1,
115 .flags
= IORESOURCE_MEM
,
118 .start
= IRQ_SYSMMU_LCD0_M0_0
,
119 .end
= IRQ_SYSMMU_LCD0_M0_0
,
120 .flags
= IORESOURCE_IRQ
,
123 .start
= EXYNOS4_PA_SYSMMU_FIMD1
,
124 .end
= EXYNOS4_PA_SYSMMU_FIMD1
+ SZ_64K
- 1,
125 .flags
= IORESOURCE_MEM
,
128 .start
= IRQ_SYSMMU_LCD1_M1_0
,
129 .end
= IRQ_SYSMMU_LCD1_M1_0
,
130 .flags
= IORESOURCE_IRQ
,
133 .start
= EXYNOS4_PA_SYSMMU_PCIe
,
134 .end
= EXYNOS4_PA_SYSMMU_PCIe
+ SZ_64K
- 1,
135 .flags
= IORESOURCE_MEM
,
138 .start
= IRQ_SYSMMU_PCIE_0
,
139 .end
= IRQ_SYSMMU_PCIE_0
,
140 .flags
= IORESOURCE_IRQ
,
143 .start
= EXYNOS4_PA_SYSMMU_G2D
,
144 .end
= EXYNOS4_PA_SYSMMU_G2D
+ SZ_64K
- 1,
145 .flags
= IORESOURCE_MEM
,
148 .start
= IRQ_SYSMMU_2D_0
,
149 .end
= IRQ_SYSMMU_2D_0
,
150 .flags
= IORESOURCE_IRQ
,
153 .start
= EXYNOS4_PA_SYSMMU_ROTATOR
,
154 .end
= EXYNOS4_PA_SYSMMU_ROTATOR
+ SZ_64K
- 1,
155 .flags
= IORESOURCE_MEM
,
158 .start
= IRQ_SYSMMU_ROTATOR_0
,
159 .end
= IRQ_SYSMMU_ROTATOR_0
,
160 .flags
= IORESOURCE_IRQ
,
163 .start
= EXYNOS4_PA_SYSMMU_MDMA2
,
164 .end
= EXYNOS4_PA_SYSMMU_MDMA2
+ SZ_64K
- 1,
165 .flags
= IORESOURCE_MEM
,
168 .start
= IRQ_SYSMMU_MDMA1_0
,
169 .end
= IRQ_SYSMMU_MDMA1_0
,
170 .flags
= IORESOURCE_IRQ
,
173 .start
= EXYNOS4_PA_SYSMMU_TV
,
174 .end
= EXYNOS4_PA_SYSMMU_TV
+ SZ_64K
- 1,
175 .flags
= IORESOURCE_MEM
,
178 .start
= IRQ_SYSMMU_TV_M0_0
,
179 .end
= IRQ_SYSMMU_TV_M0_0
,
180 .flags
= IORESOURCE_IRQ
,
183 .start
= EXYNOS4_PA_SYSMMU_MFC_L
,
184 .end
= EXYNOS4_PA_SYSMMU_MFC_L
+ SZ_64K
- 1,
185 .flags
= IORESOURCE_MEM
,
188 .start
= IRQ_SYSMMU_MFC_M0_0
,
189 .end
= IRQ_SYSMMU_MFC_M0_0
,
190 .flags
= IORESOURCE_IRQ
,
193 .start
= EXYNOS4_PA_SYSMMU_MFC_R
,
194 .end
= EXYNOS4_PA_SYSMMU_MFC_R
+ SZ_64K
- 1,
195 .flags
= IORESOURCE_MEM
,
198 .start
= IRQ_SYSMMU_MFC_M1_0
,
199 .end
= IRQ_SYSMMU_MFC_M1_0
,
200 .flags
= IORESOURCE_IRQ
,
204 struct platform_device exynos4_device_sysmmu
= {
205 .name
= "s5p-sysmmu",
207 .num_resources
= ARRAY_SIZE(exynos4_sysmmu_resource
),
208 .resource
= exynos4_sysmmu_resource
,
210 EXPORT_SYMBOL(exynos4_device_sysmmu
);
212 static struct clk
*sysmmu_clk
[S5P_SYSMMU_TOTAL_IPNUM
];
213 void sysmmu_clk_init(struct device
*dev
, sysmmu_ips ips
)
215 sysmmu_clk
[ips
] = clk_get(dev
, sysmmu_ips_name
[ips
]);
216 if (IS_ERR(sysmmu_clk
[ips
]))
217 sysmmu_clk
[ips
] = NULL
;
219 clk_put(sysmmu_clk
[ips
]);
222 void sysmmu_clk_enable(sysmmu_ips ips
)
225 clk_enable(sysmmu_clk
[ips
]);
228 void sysmmu_clk_disable(sysmmu_ips ips
)
231 clk_disable(sysmmu_clk
[ips
]);