4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6 * Implements DSP MMU fault handling functions.
8 * Copyright (C) 2005-2006 Texas Instruments, Inc.
10 * This package is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 /* ----------------------------------- DSP/BIOS Bridge */
20 #include <dspbridge/std.h>
21 #include <dspbridge/dbdefs.h>
23 /* ----------------------------------- Trace & Debug */
24 #include <dspbridge/host_os.h>
25 #include <dspbridge/dbc.h>
27 /* ----------------------------------- OS Adaptation Layer */
28 #include <dspbridge/drv.h>
30 /* ----------------------------------- Link Driver */
31 #include <dspbridge/dspdeh.h>
33 /* ------------------------------------ Hardware Abstraction Layer */
37 /* ----------------------------------- This */
39 #include <dspbridge/cfg.h>
41 #include "mmu_fault.h"
44 * ======== mmu_fault_dpc ========
45 * Deferred procedure call to handle DSP MMU fault.
47 void mmu_fault_dpc(IN
unsigned long pRefData
)
49 struct deh_mgr
*hdeh_mgr
= (struct deh_mgr
*)pRefData
;
54 bridge_deh_notify(hdeh_mgr
, DSP_MMUFAULT
, 0L);
58 * ======== mmu_fault_isr ========
59 * ISR to be triggered by a DSP MMU fault interrupt.
61 irqreturn_t
mmu_fault_isr(int irq
, IN
void *pRefData
)
63 struct deh_mgr
*deh_mgr_obj
= pRefData
;
64 struct cfg_hostres
*resources
;
70 resources
= deh_mgr_obj
->hbridge_context
->resources
;
72 dev_dbg(bridge
, "%s: Failed to get Host Resources\n",
77 hw_mmu_event_status(resources
->dw_dmmu_base
, &dmmu_event_mask
);
78 if (dmmu_event_mask
== HW_MMU_TRANSLATION_FAULT
) {
79 hw_mmu_fault_addr_read(resources
->dw_dmmu_base
, &deh_mgr_obj
->fault_addr
);
80 dev_info(bridge
, "%s: status=0x%x, fault_addr=0x%x\n", __func__
,
81 dmmu_event_mask
, deh_mgr_obj
->fault_addr
);
83 * Schedule a DPC directly. In the future, it may be
84 * necessary to check if DSP MMU fault is intended for
87 tasklet_schedule(&deh_mgr_obj
->dpc_tasklet
);
89 /* Disable the MMU events, else once we clear it will
90 * start to raise INTs again */
91 hw_mmu_event_disable(resources
->dw_dmmu_base
,
92 HW_MMU_TRANSLATION_FAULT
);
94 hw_mmu_event_disable(resources
->dw_dmmu_base
,
95 HW_MMU_ALL_INTERRUPTS
);