19 #include <mach/irqs.h>
24 #define SYSMMU_PLATFORM_DEVICE(ipname, devid) \
25 static struct sysmmu_platform_data platdata_##ipname = { \
28 struct platform_device SYSMMU_PLATDEV(ipname) = \
30 .name = SYSMMU_DEVNAME_BASE, \
33 .dma_mask = &exynos_sysmmu_dma_mask, \
34 .coherent_dma_mask = DMA_BIT_MASK(32), \
35 .platform_data = &platdata_##ipname, \
59 #define SYSMMU_RESOURCE_NAME(core, ipname) sysmmures_##core##_##ipname
61 #define SYSMMU_RESOURCE(core, ipname) \
62 static struct resource SYSMMU_RESOURCE_NAME(core, ipname)[] __initdata =
64 #define DEFINE_SYSMMU_RESOURCE(core, mem, irq) \
65 DEFINE_RES_MEM_NAMED(core##_PA_SYSMMU_##mem, SZ_4K, #mem), \
66 DEFINE_RES_IRQ_NAMED(core##_IRQ_SYSMMU_##irq##_0, #mem)
68 #define SYSMMU_RESOURCE_DEFINE(core, ipname, mem, irq) \
69 SYSMMU_RESOURCE(core, ipname) { \
70 DEFINE_SYSMMU_RESOURCE(core, mem, irq) \
81 #define SYSMMU_RESOURCE_MAPPING(core, ipname, resname) { \
82 .pdev = &SYSMMU_PLATDEV(ipname), \
83 .res = SYSMMU_RESOURCE_NAME(EXYNOS##core, resname), \
84 .rnum = ARRAY_SIZE(SYSMMU_RESOURCE_NAME(EXYNOS##core, resname)),\
85 .clocknames = SYSMMU_CLOCK_NAME, \
88 #define SYSMMU_RESOURCE_MAPPING_MC(core, ipname, resname, pdata) { \
89 .pdev = &SYSMMU_PLATDEV(ipname), \
90 .res = SYSMMU_RESOURCE_NAME(EXYNOS##core, resname), \
91 .rnum = ARRAY_SIZE(SYSMMU_RESOURCE_NAME(EXYNOS##core, resname)),\
92 .clocknames = SYSMMU_CLOCK_NAME "," SYSMMU_CLOCK_NAME2, \
95 #ifdef CONFIG_EXYNOS_DEV_PD
96 #define SYSMMU_RESOURCE_MAPPING_PD(core, ipname, resname, pd) { \
97 .pdev = &SYSMMU_PLATDEV(ipname), \
98 .res = &SYSMMU_RESOURCE_NAME(EXYNOS##core, resname), \
99 .rnum = ARRAY_SIZE(SYSMMU_RESOURCE_NAME(EXYNOS##core, resname)),\
100 .clocknames = SYSMMU_CLOCK_NAME, \
101 .pdd = &exynos##core##_device_pd[pd].dev, \
104 #define SYSMMU_RESOURCE_MAPPING_MCPD(core, ipname, resname, pd, pdata) {\
105 .pdev = &SYSMMU_PLATDEV(ipname), \
106 .res = &SYSMMU_RESOURCE_NAME(EXYNOS##core, resname), \
107 .rnum = ARRAY_SIZE(SYSMMU_RESOURCE_NAME(EXYNOS##core, resname)),\
108 .clocknames = SYSMMU_CLOCK_NAME "," SYSMMU_CLOCK_NAME2, \
109 .pdd = &exynos##core##_device_pd[pd].dev, \
112 #define SYSMMU_RESOURCE_MAPPING_PD(core, ipname, resname, pd) \
113 SYSMMU_RESOURCE_MAPPING(core, ipname, resname)
114 #define SYSMMU_RESOURCE_MAPPING_MCPD(core, ipname, resname, pd, pdata) \
115 SYSMMU_RESOURCE_MAPPING_MC(core, ipname, resname, pdata)
119 #ifdef CONFIG_ARCH_EXYNOS4
168 #ifdef CONFIG_ARCH_EXYNOS5
213 static int __init init_sysmmu_platform_device(
void)
217 int nmap[2] = {0, 0};
219 #ifdef CONFIG_ARCH_EXYNOS5
221 resmap[0] = sysmmu_resmap5;
227 #ifdef CONFIG_ARCH_EXYNOS4
228 if (resmap[0] ==
NULL) {
229 resmap[0] = sysmmu_resmap4;
234 resmap[1] = sysmmu_resmap4210;
239 resmap[1] = sysmmu_resmap4212;
244 for (j = 0; j < 2; j++) {
245 for (i = 0; i < nmap[
j]; i++) {
251 map->
pdev->dev.parent = map->
pdd;
253 platdata = map->
pdev->dev.platform_data;
258 pr_err(
"%s: Failed to add device resources for "
265 pr_err(
"%s: Failed to register %s.%d\n",
266 __func__, map->
pdev->name,