diff options
Diffstat (limited to 'arch/arm/mach-s5pv310/include/mach/sysmmu.h')
-rw-r--r-- | arch/arm/mach-s5pv310/include/mach/sysmmu.h | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv310/include/mach/sysmmu.h b/arch/arm/mach-s5pv310/include/mach/sysmmu.h new file mode 100644 index 000000000000..662fe85ff4d5 --- /dev/null +++ b/arch/arm/mach-s5pv310/include/mach/sysmmu.h | |||
@@ -0,0 +1,119 @@ | |||
1 | /* linux/arch/arm/mach-s5pv310/include/mach/sysmmu.h | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * Samsung sysmmu driver for S5PV310 | ||
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 | #ifndef __ASM_ARM_ARCH_SYSMMU_H | ||
14 | #define __ASM_ARM_ARCH_SYSMMU_H __FILE__ | ||
15 | |||
16 | enum s5pv310_sysmmu_ips { | ||
17 | SYSMMU_MDMA, | ||
18 | SYSMMU_SSS, | ||
19 | SYSMMU_FIMC0, | ||
20 | SYSMMU_FIMC1, | ||
21 | SYSMMU_FIMC2, | ||
22 | SYSMMU_FIMC3, | ||
23 | SYSMMU_JPEG, | ||
24 | SYSMMU_FIMD0, | ||
25 | SYSMMU_FIMD1, | ||
26 | SYSMMU_PCIe, | ||
27 | SYSMMU_G2D, | ||
28 | SYSMMU_ROTATOR, | ||
29 | SYSMMU_MDMA2, | ||
30 | SYSMMU_TV, | ||
31 | SYSMMU_MFC_L, | ||
32 | SYSMMU_MFC_R, | ||
33 | }; | ||
34 | |||
35 | static char *sysmmu_ips_name[S5P_SYSMMU_TOTAL_IPNUM] = { | ||
36 | "SYSMMU_MDMA" , | ||
37 | "SYSMMU_SSS" , | ||
38 | "SYSMMU_FIMC0" , | ||
39 | "SYSMMU_FIMC1" , | ||
40 | "SYSMMU_FIMC2" , | ||
41 | "SYSMMU_FIMC3" , | ||
42 | "SYSMMU_JPEG" , | ||
43 | "SYSMMU_FIMD0" , | ||
44 | "SYSMMU_FIMD1" , | ||
45 | "SYSMMU_PCIe" , | ||
46 | "SYSMMU_G2D" , | ||
47 | "SYSMMU_ROTATOR", | ||
48 | "SYSMMU_MDMA2" , | ||
49 | "SYSMMU_TV" , | ||
50 | "SYSMMU_MFC_L" , | ||
51 | "SYSMMU_MFC_R" , | ||
52 | }; | ||
53 | |||
54 | typedef enum s5pv310_sysmmu_ips sysmmu_ips; | ||
55 | |||
56 | struct sysmmu_tt_info { | ||
57 | unsigned long *pgd; | ||
58 | unsigned long pgd_paddr; | ||
59 | unsigned long *pte; | ||
60 | }; | ||
61 | |||
62 | struct sysmmu_controller { | ||
63 | const char *name; | ||
64 | |||
65 | /* channels registers */ | ||
66 | void __iomem *regs; | ||
67 | |||
68 | /* channel irq */ | ||
69 | unsigned int irq; | ||
70 | |||
71 | sysmmu_ips ips; | ||
72 | |||
73 | /* Translation Table Info. */ | ||
74 | struct sysmmu_tt_info *tt_info; | ||
75 | |||
76 | struct resource *mem; | ||
77 | struct device *dev; | ||
78 | |||
79 | /* SysMMU controller enable - true : enable */ | ||
80 | bool enable; | ||
81 | }; | ||
82 | |||
83 | /** | ||
84 | * s5p_sysmmu_enable() - enable system mmu of ip | ||
85 | * @ips: The ip connected system mmu. | ||
86 | * | ||
87 | * This function enable system mmu to transfer address | ||
88 | * from virtual address to physical address | ||
89 | */ | ||
90 | int s5p_sysmmu_enable(sysmmu_ips ips); | ||
91 | |||
92 | /** | ||
93 | * s5p_sysmmu_disable() - disable sysmmu mmu of ip | ||
94 | * @ips: The ip connected system mmu. | ||
95 | * | ||
96 | * This function disable system mmu to transfer address | ||
97 | * from virtual address to physical address | ||
98 | */ | ||
99 | int s5p_sysmmu_disable(sysmmu_ips ips); | ||
100 | |||
101 | /** | ||
102 | * s5p_sysmmu_set_tablebase_pgd() - set page table base address to refer page table | ||
103 | * @ips: The ip connected system mmu. | ||
104 | * @pgd: The page table base address. | ||
105 | * | ||
106 | * This function set page table base address | ||
107 | * When system mmu transfer address from virtaul address to physical address, | ||
108 | * system mmu refer address information from page table | ||
109 | */ | ||
110 | int s5p_sysmmu_set_tablebase_pgd(sysmmu_ips ips, unsigned long pgd); | ||
111 | |||
112 | /** | ||
113 | * s5p_sysmmu_tlb_invalidate() - flush all TLB entry in system mmu | ||
114 | * @ips: The ip connected system mmu. | ||
115 | * | ||
116 | * This function flush all TLB entry in system mmu | ||
117 | */ | ||
118 | int s5p_sysmmu_tlb_invalidate(sysmmu_ips ips); | ||
119 | #endif /* __ASM_ARM_ARCH_SYSMMU_H */ | ||