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>
15 #include <linux/export.h>
18 #include <mach/irqs.h>
19 #include <mach/sysmmu.h>
20 #include <plat/s5p-clock.h>
22 /* These names must be equal to the clock names in mach-exynos4/clock.c */
23 const char *sysmmu_ips_name
[EXYNOS4_SYSMMU_TOTAL_IPNUM
] = {
42 static struct resource exynos4_sysmmu_resource
[] = {
44 .start
= EXYNOS4_PA_SYSMMU_MDMA
,
45 .end
= EXYNOS4_PA_SYSMMU_MDMA
+ SZ_64K
- 1,
46 .flags
= IORESOURCE_MEM
,
49 .start
= IRQ_SYSMMU_MDMA0_0
,
50 .end
= IRQ_SYSMMU_MDMA0_0
,
51 .flags
= IORESOURCE_IRQ
,
54 .start
= EXYNOS4_PA_SYSMMU_SSS
,
55 .end
= EXYNOS4_PA_SYSMMU_SSS
+ SZ_64K
- 1,
56 .flags
= IORESOURCE_MEM
,
59 .start
= IRQ_SYSMMU_SSS_0
,
60 .end
= IRQ_SYSMMU_SSS_0
,
61 .flags
= IORESOURCE_IRQ
,
64 .start
= EXYNOS4_PA_SYSMMU_FIMC0
,
65 .end
= EXYNOS4_PA_SYSMMU_FIMC0
+ SZ_64K
- 1,
66 .flags
= IORESOURCE_MEM
,
69 .start
= IRQ_SYSMMU_FIMC0_0
,
70 .end
= IRQ_SYSMMU_FIMC0_0
,
71 .flags
= IORESOURCE_IRQ
,
74 .start
= EXYNOS4_PA_SYSMMU_FIMC1
,
75 .end
= EXYNOS4_PA_SYSMMU_FIMC1
+ SZ_64K
- 1,
76 .flags
= IORESOURCE_MEM
,
79 .start
= IRQ_SYSMMU_FIMC1_0
,
80 .end
= IRQ_SYSMMU_FIMC1_0
,
81 .flags
= IORESOURCE_IRQ
,
84 .start
= EXYNOS4_PA_SYSMMU_FIMC2
,
85 .end
= EXYNOS4_PA_SYSMMU_FIMC2
+ SZ_64K
- 1,
86 .flags
= IORESOURCE_MEM
,
89 .start
= IRQ_SYSMMU_FIMC2_0
,
90 .end
= IRQ_SYSMMU_FIMC2_0
,
91 .flags
= IORESOURCE_IRQ
,
94 .start
= EXYNOS4_PA_SYSMMU_FIMC3
,
95 .end
= EXYNOS4_PA_SYSMMU_FIMC3
+ SZ_64K
- 1,
96 .flags
= IORESOURCE_MEM
,
99 .start
= IRQ_SYSMMU_FIMC3_0
,
100 .end
= IRQ_SYSMMU_FIMC3_0
,
101 .flags
= IORESOURCE_IRQ
,
104 .start
= EXYNOS4_PA_SYSMMU_JPEG
,
105 .end
= EXYNOS4_PA_SYSMMU_JPEG
+ SZ_64K
- 1,
106 .flags
= IORESOURCE_MEM
,
109 .start
= IRQ_SYSMMU_JPEG_0
,
110 .end
= IRQ_SYSMMU_JPEG_0
,
111 .flags
= IORESOURCE_IRQ
,
114 .start
= EXYNOS4_PA_SYSMMU_FIMD0
,
115 .end
= EXYNOS4_PA_SYSMMU_FIMD0
+ SZ_64K
- 1,
116 .flags
= IORESOURCE_MEM
,
119 .start
= IRQ_SYSMMU_LCD0_M0_0
,
120 .end
= IRQ_SYSMMU_LCD0_M0_0
,
121 .flags
= IORESOURCE_IRQ
,
124 .start
= EXYNOS4_PA_SYSMMU_FIMD1
,
125 .end
= EXYNOS4_PA_SYSMMU_FIMD1
+ SZ_64K
- 1,
126 .flags
= IORESOURCE_MEM
,
129 .start
= IRQ_SYSMMU_LCD1_M1_0
,
130 .end
= IRQ_SYSMMU_LCD1_M1_0
,
131 .flags
= IORESOURCE_IRQ
,
134 .start
= EXYNOS4_PA_SYSMMU_PCIe
,
135 .end
= EXYNOS4_PA_SYSMMU_PCIe
+ SZ_64K
- 1,
136 .flags
= IORESOURCE_MEM
,
139 .start
= IRQ_SYSMMU_PCIE_0
,
140 .end
= IRQ_SYSMMU_PCIE_0
,
141 .flags
= IORESOURCE_IRQ
,
144 .start
= EXYNOS4_PA_SYSMMU_G2D
,
145 .end
= EXYNOS4_PA_SYSMMU_G2D
+ SZ_64K
- 1,
146 .flags
= IORESOURCE_MEM
,
149 .start
= IRQ_SYSMMU_2D_0
,
150 .end
= IRQ_SYSMMU_2D_0
,
151 .flags
= IORESOURCE_IRQ
,
154 .start
= EXYNOS4_PA_SYSMMU_ROTATOR
,
155 .end
= EXYNOS4_PA_SYSMMU_ROTATOR
+ SZ_64K
- 1,
156 .flags
= IORESOURCE_MEM
,
159 .start
= IRQ_SYSMMU_ROTATOR_0
,
160 .end
= IRQ_SYSMMU_ROTATOR_0
,
161 .flags
= IORESOURCE_IRQ
,
164 .start
= EXYNOS4_PA_SYSMMU_MDMA2
,
165 .end
= EXYNOS4_PA_SYSMMU_MDMA2
+ SZ_64K
- 1,
166 .flags
= IORESOURCE_MEM
,
169 .start
= IRQ_SYSMMU_MDMA1_0
,
170 .end
= IRQ_SYSMMU_MDMA1_0
,
171 .flags
= IORESOURCE_IRQ
,
174 .start
= EXYNOS4_PA_SYSMMU_TV
,
175 .end
= EXYNOS4_PA_SYSMMU_TV
+ SZ_64K
- 1,
176 .flags
= IORESOURCE_MEM
,
179 .start
= IRQ_SYSMMU_TV_M0_0
,
180 .end
= IRQ_SYSMMU_TV_M0_0
,
181 .flags
= IORESOURCE_IRQ
,
184 .start
= EXYNOS4_PA_SYSMMU_MFC_L
,
185 .end
= EXYNOS4_PA_SYSMMU_MFC_L
+ SZ_64K
- 1,
186 .flags
= IORESOURCE_MEM
,
189 .start
= IRQ_SYSMMU_MFC_M0_0
,
190 .end
= IRQ_SYSMMU_MFC_M0_0
,
191 .flags
= IORESOURCE_IRQ
,
194 .start
= EXYNOS4_PA_SYSMMU_MFC_R
,
195 .end
= EXYNOS4_PA_SYSMMU_MFC_R
+ SZ_64K
- 1,
196 .flags
= IORESOURCE_MEM
,
199 .start
= IRQ_SYSMMU_MFC_M1_0
,
200 .end
= IRQ_SYSMMU_MFC_M1_0
,
201 .flags
= IORESOURCE_IRQ
,
205 struct platform_device exynos4_device_sysmmu
= {
206 .name
= "s5p-sysmmu",
208 .num_resources
= ARRAY_SIZE(exynos4_sysmmu_resource
),
209 .resource
= exynos4_sysmmu_resource
,
211 EXPORT_SYMBOL(exynos4_device_sysmmu
);
213 static struct clk
*sysmmu_clk
[S5P_SYSMMU_TOTAL_IPNUM
];
214 void sysmmu_clk_init(struct device
*dev
, sysmmu_ips ips
)
216 sysmmu_clk
[ips
] = clk_get(dev
, sysmmu_ips_name
[ips
]);
217 if (IS_ERR(sysmmu_clk
[ips
]))
218 sysmmu_clk
[ips
] = NULL
;
220 clk_put(sysmmu_clk
[ips
]);
223 void sysmmu_clk_enable(sysmmu_ips ips
)
226 clk_enable(sysmmu_clk
[ips
]);
229 void sysmmu_clk_disable(sysmmu_ips ips
)
232 clk_disable(sysmmu_clk
[ips
]);