From patchwork Sun May 16 15:46:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 99976 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4GFkZgf025331 for ; Sun, 16 May 2010 15:46:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753758Ab0EPPqe (ORCPT ); Sun, 16 May 2010 11:46:34 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:5081 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753628Ab0EPPqd (ORCPT ); Sun, 16 May 2010 11:46:33 -0400 Received: by fg-out-1718.google.com with SMTP id d23so2359940fga.1 for ; Sun, 16 May 2010 08:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=bpX/HkXjzCIj7jBr5MNjcR1GRlg4aYQqqQmUajfU8us=; b=Pt1+ZCxKG/a2Soxx98jqgasmAWkFhB0vk5gdLYFACql+bCrslT37V23CeFGxDzmJAH YIAhmtT9+vhlIf6LOQcQ7lEXLJNVT6lpO+SOFPwP62KNWwdCApXl51w9APwqI4350/mw c8pjlBAoLoJovA1la1/YAGXiFeWuToPdxBOe8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=ILm3ctouQEaXn8ffW3AwUyVz1gBP72LyIlQ2zPhc7f3l59KzoHBTNPYuSP6J9CrPDG N8WxbQPnp/8sTUBhmF504XKVJInFKPbeikSGy0SFz4ZXOv8/Mj2lhScx1jLovws8Ic0E vo3MNEoOvHIVMGg9i/Yaoq2KiRzRQq2reVHZk= Received: by 10.87.62.17 with SMTP id p17mr6793312fgk.30.1274024792876; Sun, 16 May 2010 08:46:32 -0700 (PDT) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id d4sm11599893fga.15.2010.05.16.08.46.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 May 2010 08:46:32 -0700 (PDT) From: Felipe Contreras To: linux-omap Cc: Omar Ramirez Luna , Fernando Guzman Lugo , Felipe Contreras Subject: [PATCH 12/14] dspbridge: move mmufault to deh Date: Sun, 16 May 2010 18:46:03 +0300 Message-Id: <1274024765-21076-13-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1274024765-21076-1-git-send-email-felipe.contreras@gmail.com> References: <1274024765-21076-1-git-send-email-felipe.contreras@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 16 May 2010 15:46:35 +0000 (UTC) diff --git a/drivers/dsp/bridge/Makefile b/drivers/dsp/bridge/Makefile index 4c2f923..39624d4 100644 --- a/drivers/dsp/bridge/Makefile +++ b/drivers/dsp/bridge/Makefile @@ -5,7 +5,7 @@ libservices = services/sync.o services/cfg.o \ services/ntfy.o services/services.o libcore = core/chnl_sm.o core/msg_sm.o core/io_sm.o core/tiomap3430.o \ core/tiomap3430_pwr.o core/tiomap_io.o \ - core/mmu_fault.o core/ue_deh.o core/wdt.o core/dsp-clock.o + core/ue_deh.o core/wdt.o core/dsp-clock.o libpmgr = pmgr/chnl.o pmgr/io.o pmgr/msg.o pmgr/cod.o pmgr/dev.o pmgr/dspapi.o \ pmgr/dmm.o pmgr/cmm.o pmgr/dbll.o librmgr = rmgr/dbdcd.o rmgr/disp.o rmgr/drv.o rmgr/mgr.o rmgr/node.o \ diff --git a/drivers/dsp/bridge/core/mmu_fault.c b/drivers/dsp/bridge/core/mmu_fault.c deleted file mode 100644 index 49034cf..0000000 --- a/drivers/dsp/bridge/core/mmu_fault.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * mmu_fault.c - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Implements DSP MMU fault handling functions. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* ----------------------------------- DSP/BIOS Bridge */ -#include -#include -#include - -/* ----------------------------------- Trace & Debug */ -#include -#include - -/* ----------------------------------- OS Adaptation Layer */ -#include - -/* ----------------------------------- Link Driver */ -#include - -/* ------------------------------------ Hardware Abstraction Layer */ -#include -#include - -/* ----------------------------------- This */ -#include "_deh.h" -#include -#include "_tiomap_mmu.h" -#include "_tiomap.h" -#include "mmu_fault.h" - -/* - * ======== mmu_fault_dpc ======== - * Deferred procedure call to handle DSP MMU fault. - */ -void mmu_fault_dpc(IN unsigned long pRefData) -{ - struct deh_mgr *hdeh_mgr = (struct deh_mgr *)pRefData; - - if (!hdeh_mgr) - return; - - bridge_deh_notify(hdeh_mgr, DSP_MMUFAULT, 0L); -} - -/* - * ======== mmu_fault_isr ======== - * ISR to be triggered by a DSP MMU fault interrupt. - */ -irqreturn_t mmu_fault_isr(int irq, IN void *pRefData) -{ - struct deh_mgr *deh_mgr_obj = pRefData; - struct cfg_hostres *resources; - u32 dmmu_event_mask; - - if (!deh_mgr_obj) - return IRQ_HANDLED; - - resources = deh_mgr_obj->hbridge_context->resources; - if (!resources) { - dev_dbg(bridge, "%s: Failed to get Host Resources\n", - __func__); - return IRQ_HANDLED; - } - - hw_mmu_event_status(resources->dw_dmmu_base, &dmmu_event_mask); - if (dmmu_event_mask == HW_MMU_TRANSLATION_FAULT) { - hw_mmu_fault_addr_read(resources->dw_dmmu_base, &deh_mgr_obj->fault_addr); - dev_info(bridge, "%s: status=0x%x, fault_addr=0x%x\n", __func__, - dmmu_event_mask, deh_mgr_obj->fault_addr); - /* - * Schedule a DPC directly. In the future, it may be - * necessary to check if DSP MMU fault is intended for - * Bridge. - */ - tasklet_schedule(&deh_mgr_obj->dpc_tasklet); - - /* Disable the MMU events, else once we clear it will - * start to raise INTs again */ - hw_mmu_event_disable(resources->dw_dmmu_base, - HW_MMU_TRANSLATION_FAULT); - } else { - hw_mmu_event_disable(resources->dw_dmmu_base, - HW_MMU_ALL_INTERRUPTS); - } - return IRQ_HANDLED; -} diff --git a/drivers/dsp/bridge/core/mmu_fault.h b/drivers/dsp/bridge/core/mmu_fault.h deleted file mode 100644 index 537e6e7..0000000 --- a/drivers/dsp/bridge/core/mmu_fault.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * mmu_fault.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Defines DSP MMU fault handling functions. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef MMU_FAULT_ -#define MMU_FAULT_ - -/* - * ======== mmu_fault_dpc ======== - * Deferred procedure call to handle DSP MMU fault. - */ -void mmu_fault_dpc(IN unsigned long pRefData); - -/* - * ======== mmu_fault_isr ======== - * ISR to be triggered by a DSP MMU fault interrupt. - */ -irqreturn_t mmu_fault_isr(int irq, IN void *pRefData); - -#endif /* MMU_FAULT_ */ diff --git a/drivers/dsp/bridge/core/ue_deh.c b/drivers/dsp/bridge/core/ue_deh.c index 6035757..d44c895 100644 --- a/drivers/dsp/bridge/core/ue_deh.c +++ b/drivers/dsp/bridge/core/ue_deh.c @@ -46,7 +46,6 @@ #include /* ----------------------------------- This */ -#include "mmu_fault.h" #include "_tiomap.h" #include "_deh.h" #include "_tiomap_mmu.h" @@ -62,6 +61,55 @@ static struct omap_dm_timer *timer; +static void mmu_fault_dpc(unsigned long data) +{ + struct deh_mgr *hdeh_mgr = (void *)data; + + if (!hdeh_mgr) + return; + + bridge_deh_notify(hdeh_mgr, DSP_MMUFAULT, 0); +} + +static irqreturn_t mmu_fault_isr(int irq, void *data) +{ + struct deh_mgr *deh_mgr_obj = data; + struct cfg_hostres *resources; + u32 dmmu_event_mask; + + if (!deh_mgr_obj) + return IRQ_HANDLED; + + resources = deh_mgr_obj->hbridge_context->resources; + if (!resources) { + dev_dbg(bridge, "%s: Failed to get Host Resources\n", + __func__); + return IRQ_HANDLED; + } + + hw_mmu_event_status(resources->dw_dmmu_base, &dmmu_event_mask); + if (dmmu_event_mask == HW_MMU_TRANSLATION_FAULT) { + hw_mmu_fault_addr_read(resources->dw_dmmu_base, &deh_mgr_obj->fault_addr); + dev_info(bridge, "%s: status=0x%x, fault_addr=0x%x\n", __func__, + dmmu_event_mask, deh_mgr_obj->fault_addr); + /* + * Schedule a DPC directly. In the future, it may be + * necessary to check if DSP MMU fault is intended for + * Bridge. + */ + tasklet_schedule(&deh_mgr_obj->dpc_tasklet); + + /* Disable the MMU events, else once we clear it will + * start to raise INTs again */ + hw_mmu_event_disable(resources->dw_dmmu_base, + HW_MMU_TRANSLATION_FAULT); + } else { + hw_mmu_event_disable(resources->dw_dmmu_base, + HW_MMU_ALL_INTERRUPTS); + } + return IRQ_HANDLED; +} + dsp_status bridge_deh_create(struct deh_mgr **ret_deh_mgr, struct dev_object *hdev_obj) {