diff options
author | David Cohen <dacohen@gmail.com> | 2011-02-16 14:35:51 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-02-24 17:23:17 -0500 |
commit | d594f1f31afe13edd8c02f3854a65cc58cfb3b74 (patch) | |
tree | 8986a9af7302b214316f9498d153be46c9c4df38 /arch/arm/mach-omap2/iommu2.c | |
parent | 92e753d7984db36f0a3c0bbf0f377da114768775 (diff) |
omap: IOMMU: add support to callback during fault handling
Add support to register an isr for IOMMU fault situations and adapt it
to allow such (*isr)() to be used as fault callback. Drivers using IOMMU
module might want to be informed when errors happen in order to debug it
or react.
Signed-off-by: David Cohen <dacohen@gmail.com>
Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/iommu2.c')
-rw-r--r-- | arch/arm/mach-omap2/iommu2.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c index 49a1e5e841ca..adb083e41acd 100644 --- a/arch/arm/mach-omap2/iommu2.c +++ b/arch/arm/mach-omap2/iommu2.c | |||
@@ -146,18 +146,31 @@ static void omap2_iommu_set_twl(struct iommu *obj, bool on) | |||
146 | static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) | 146 | static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) |
147 | { | 147 | { |
148 | u32 stat, da; | 148 | u32 stat, da; |
149 | u32 errs = 0; | ||
149 | 150 | ||
150 | stat = iommu_read_reg(obj, MMU_IRQSTATUS); | 151 | stat = iommu_read_reg(obj, MMU_IRQSTATUS); |
151 | stat &= MMU_IRQ_MASK; | 152 | stat &= MMU_IRQ_MASK; |
152 | if (!stat) | 153 | if (!stat) { |
154 | *ra = 0; | ||
153 | return 0; | 155 | return 0; |
156 | } | ||
154 | 157 | ||
155 | da = iommu_read_reg(obj, MMU_FAULT_AD); | 158 | da = iommu_read_reg(obj, MMU_FAULT_AD); |
156 | *ra = da; | 159 | *ra = da; |
157 | 160 | ||
161 | if (stat & MMU_IRQ_TLBMISS) | ||
162 | errs |= OMAP_IOMMU_ERR_TLB_MISS; | ||
163 | if (stat & MMU_IRQ_TRANSLATIONFAULT) | ||
164 | errs |= OMAP_IOMMU_ERR_TRANS_FAULT; | ||
165 | if (stat & MMU_IRQ_EMUMISS) | ||
166 | errs |= OMAP_IOMMU_ERR_EMU_MISS; | ||
167 | if (stat & MMU_IRQ_TABLEWALKFAULT) | ||
168 | errs |= OMAP_IOMMU_ERR_TBLWALK_FAULT; | ||
169 | if (stat & MMU_IRQ_MULTIHITFAULT) | ||
170 | errs |= OMAP_IOMMU_ERR_MULTIHIT_FAULT; | ||
158 | iommu_write_reg(obj, stat, MMU_IRQSTATUS); | 171 | iommu_write_reg(obj, stat, MMU_IRQSTATUS); |
159 | 172 | ||
160 | return stat; | 173 | return errs; |
161 | } | 174 | } |
162 | 175 | ||
163 | static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr) | 176 | static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr) |