From patchwork Sun May 16 15:45:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 99963 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 o4GFjFpj024839 for ; Sun, 16 May 2010 15:45:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752797Ab0EPPpV (ORCPT ); Sun, 16 May 2010 11:45:21 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:23898 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693Ab0EPPpU (ORCPT ); Sun, 16 May 2010 11:45:20 -0400 Received: by fg-out-1718.google.com with SMTP id 22so178279fge.1 for ; Sun, 16 May 2010 08:45:18 -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=VXlE9SgMYcKsh6S/JIcecAAMQw3upvHdc25F1WX+jM8=; b=RQ6b1LK/mWlYf6aKpcZXu140mzlBLu+z1eTpZzXnw7rf7fnoLoJMu8R1eY93+ampLE cox85Z4lPPbtCHnNOhzoyCuR5ymyEIBV9db0hb7npVrpL3vk7Qsy8P9rMFHP8oiND38Z mxyS0rrpDoncZTLfM7TFf5PDwy3eh8x0vT7Eo= 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=JyQ6aVaRNPpaVDOgo7EG4lbj9VPMNjEaXbGCautmKSw3q3iYFPkDoKQ3BX0OTnQFLd cAIAFW6RMbFdExxYtW/fY2dHSJLDWOpxc9uN/qZ467xpJYBWmbwST7wMM36ZJ1kFs0eS AxledseYGyrI1pEFrV0bp69ySBuhzUi1ouzJk= Received: by 10.87.67.8 with SMTP id u8mr6827481fgk.9.1274024718612; Sun, 16 May 2010 08:45:18 -0700 (PDT) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id d6sm8306533fga.8.2010.05.16.08.45.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 May 2010 08:45:18 -0700 (PDT) From: Felipe Contreras To: linux-omap Cc: Omar Ramirez Luna , Felipe Contreras Subject: [PATCH 3/4] dspbridge: remove _tiomap_mmu.h Date: Sun, 16 May 2010 18:45:01 +0300 Message-Id: <1274024702-20961-4-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1274024702-20961-1-git-send-email-felipe.contreras@gmail.com> References: <1274024702-20961-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:45:22 +0000 (UTC) diff --git a/drivers/dsp/bridge/core/_tiomap_mmu.h b/drivers/dsp/bridge/core/_tiomap_mmu.h deleted file mode 100644 index 66c1249..0000000 --- a/drivers/dsp/bridge/core/_tiomap_mmu.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * _tiomap_mmu.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Definitions and types for the DSP MMU modules. - * - * 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 _TIOMAP_MMU_ -#define _TIOMAP_MMU_ - -#include "_tiomap.h" - -/* - * ======== configure_dsp_mmu ======== - * - * Make DSP MMu page table entries. - * Note: Not utilizing Coarse / Fine page tables. - * SECTION = 1MB, LARGE_PAGE = 64KB, SMALL_PAGE = 4KB, TINY_PAGE = 1KB. - * DSP Byte address 0x40_0000 is word addr 0x20_0000. - */ -extern void configure_dsp_mmu(struct bridge_dev_context *dev_context, - u32 dataBasePhys, - u32 dspBaseVirt, - u32 sizeInBytes, - s32 nEntryStart, - enum hw_endianism_t endianism, - enum hw_element_size_t elem_size, - enum hw_mmu_mixed_size_t mixed_size); - -#endif /* _TIOMAP_MMU_ */ diff --git a/drivers/dsp/bridge/core/mmu_fault.c b/drivers/dsp/bridge/core/mmu_fault.c index 883f45d..7cd78c6 100644 --- a/drivers/dsp/bridge/core/mmu_fault.c +++ b/drivers/dsp/bridge/core/mmu_fault.c @@ -38,7 +38,6 @@ /* ----------------------------------- This */ #include "_deh.h" #include -#include "_tiomap_mmu.h" #include "_tiomap.h" #include "mmu_fault.h" diff --git a/drivers/dsp/bridge/core/tiomap3430.c b/drivers/dsp/bridge/core/tiomap3430.c index c7b0d83..3b571aa 100644 --- a/drivers/dsp/bridge/core/tiomap3430.c +++ b/drivers/dsp/bridge/core/tiomap3430.c @@ -57,7 +57,6 @@ /* ----------------------------------- Local */ #include "_tiomap.h" #include "_tiomap_pwr.h" -#include "_tiomap_mmu.h" #include "_tiomap_util.h" #include "tiomap_io.h" @@ -457,41 +456,32 @@ static dsp_status bridge_brd_start(struct bridge_dev_context *hDevContext, /* Only make TLB entry if both addresses are non-zero */ for (entry_ndx = 0; entry_ndx < BRDIOCTL_NUMOFMMUTLB; entry_ndx++) { - if ((dev_context->atlb_entry[entry_ndx].ul_gpp_pa != 0) - && (dev_context->atlb_entry[entry_ndx].ul_dsp_va != - 0)) { - dev_dbg(bridge, - "(proc) MMU %d GppPa:" - " 0x%x DspVa 0x%x Size 0x%x\n", + struct bridge_ioctl_extproc *e = &dev_context->atlb_entry[entry_ndx]; + struct hw_mmu_map_attrs_t map_attrs = { + .endianism = e->endianism, + .element_size = e->elem_size, + .mixed_size = e->mixed_mode, + }; + + if (!e->ul_gpp_pa || !e->ul_dsp_va) + continue; + + dev_dbg(bridge, + "MMU %d, pa: 0x%x, va: 0x%x, size: 0x%x", itmp_entry_ndx, - dev_context->atlb_entry[entry_ndx]. - ul_gpp_pa, - dev_context->atlb_entry[entry_ndx]. - ul_dsp_va, - dev_context->atlb_entry[entry_ndx]. - ul_size); - configure_dsp_mmu(dev_context, - dev_context-> - atlb_entry[entry_ndx]. - ul_gpp_pa, - dev_context-> - atlb_entry[entry_ndx]. - ul_dsp_va * DSPWORDSIZE, - dev_context-> - atlb_entry[entry_ndx].ul_size, - itmp_entry_ndx, - dev_context-> - atlb_entry[entry_ndx]. - endianism, - dev_context-> - atlb_entry[entry_ndx]. - elem_size, - dev_context-> - atlb_entry[entry_ndx]. - mixed_mode); - itmp_entry_ndx++; - } - } /* end for */ + e->ul_gpp_pa, + e->ul_dsp_va, + e->ul_size); + + hw_mmu_tlb_add(dev_context->dw_dsp_mmu_base, + e->ul_gpp_pa, + e->ul_dsp_va, + e->ul_size, + itmp_entry_ndx, + &map_attrs, 1, 1); + + itmp_entry_ndx++; + } } /* Lock the above TLB entries and get the BIOS and load monitor timer @@ -1870,30 +1860,6 @@ static dsp_status mem_map_vmalloc(struct bridge_dev_context *dev_context, } /* - * ======== configure_dsp_mmu ======== - * Make DSP MMU page table entries. - */ -void configure_dsp_mmu(struct bridge_dev_context *dev_context, u32 dataBasePhys, - u32 dspBaseVirt, u32 sizeInBytes, s32 nEntryStart, - enum hw_endianism_t endianism, - enum hw_element_size_t elem_size, - enum hw_mmu_mixed_size_t mixed_size) -{ - struct hw_mmu_map_attrs_t map_attrs = { endianism, elem_size, - mixed_size }; - - DBC_REQUIRE(sizeInBytes > 0); - dev_dbg(bridge, "%s: entry %x pa %x, va %x, bytes %x endianism %x, " - "elem_size %x, mixed_size %x", __func__, nEntryStart, - dataBasePhys, dspBaseVirt, sizeInBytes, endianism, - elem_size, mixed_size); - - hw_mmu_tlb_add(dev_context->dw_dsp_mmu_base, dataBasePhys, - dspBaseVirt, sizeInBytes, nEntryStart, - &map_attrs, HW_SET, HW_SET); -} - -/* * ======== wait_for_start ======== * Wait for the singal from DSP that it has started, or time out. */ diff --git a/drivers/dsp/bridge/core/ue_deh.c b/drivers/dsp/bridge/core/ue_deh.c index 605f312..10486b4 100644 --- a/drivers/dsp/bridge/core/ue_deh.c +++ b/drivers/dsp/bridge/core/ue_deh.c @@ -49,7 +49,6 @@ #include "mmu_fault.h" #include "_tiomap.h" #include "_deh.h" -#include "_tiomap_mmu.h" #include "_tiomap_pwr.h" #include