11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * 31da177e4SLinus Torvalds * tp3780i.h -- declarations for tp3780i.c 41da177e4SLinus Torvalds * 51da177e4SLinus Torvalds * 61da177e4SLinus Torvalds * Written By: Mike Sullivan IBM Corporation 71da177e4SLinus Torvalds * 81da177e4SLinus Torvalds * Copyright (C) 1999 IBM Corporation 91da177e4SLinus Torvalds * 101da177e4SLinus Torvalds * This program is free software; you can redistribute it and/or modify 111da177e4SLinus Torvalds * it under the terms of the GNU General Public License as published by 121da177e4SLinus Torvalds * the Free Software Foundation; either version 2 of the License, or 131da177e4SLinus Torvalds * (at your option) any later version. 141da177e4SLinus Torvalds * 151da177e4SLinus Torvalds * This program is distributed in the hope that it will be useful, 161da177e4SLinus Torvalds * but WITHOUT ANY WARRANTY; without even the implied warranty of 171da177e4SLinus Torvalds * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 181da177e4SLinus Torvalds * GNU General Public License for more details. 191da177e4SLinus Torvalds * 201da177e4SLinus Torvalds * NO WARRANTY 211da177e4SLinus Torvalds * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR 221da177e4SLinus Torvalds * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT 231da177e4SLinus Torvalds * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, 241da177e4SLinus Torvalds * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is 251da177e4SLinus Torvalds * solely responsible for determining the appropriateness of using and 261da177e4SLinus Torvalds * distributing the Program and assumes all risks associated with its 271da177e4SLinus Torvalds * exercise of rights under this Agreement, including but not limited to 281da177e4SLinus Torvalds * the risks and costs of program errors, damage to or loss of data, 291da177e4SLinus Torvalds * programs or equipment, and unavailability or interruption of operations. 301da177e4SLinus Torvalds * 311da177e4SLinus Torvalds * DISCLAIMER OF LIABILITY 321da177e4SLinus Torvalds * NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY 331da177e4SLinus Torvalds * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 341da177e4SLinus Torvalds * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND 351da177e4SLinus Torvalds * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 361da177e4SLinus Torvalds * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 371da177e4SLinus Torvalds * USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED 381da177e4SLinus Torvalds * HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES 391da177e4SLinus Torvalds * 401da177e4SLinus Torvalds * You should have received a copy of the GNU General Public License 411da177e4SLinus Torvalds * along with this program; if not, write to the Free Software 421da177e4SLinus Torvalds * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 431da177e4SLinus Torvalds * 441da177e4SLinus Torvalds * 451da177e4SLinus Torvalds * 10/23/2000 - Alpha Release 461da177e4SLinus Torvalds * First release to the public 471da177e4SLinus Torvalds */ 481da177e4SLinus Torvalds 491da177e4SLinus Torvalds #ifndef _LINUX_TP3780I_H 501da177e4SLinus Torvalds #define _LINUX_TP3780I_H 511da177e4SLinus Torvalds 521da177e4SLinus Torvalds #include <asm/io.h> 531da177e4SLinus Torvalds #include "mwavepub.h" 541da177e4SLinus Torvalds 551da177e4SLinus Torvalds 561da177e4SLinus Torvalds /* DSP abilities constants for 3780i based Thinkpads */ 571da177e4SLinus Torvalds #define TP_ABILITIES_INTS_PER_SEC 39160800 581da177e4SLinus Torvalds #define TP_ABILITIES_DATA_SIZE 32768 591da177e4SLinus Torvalds #define TP_ABILITIES_INST_SIZE 32768 601da177e4SLinus Torvalds #define TP_ABILITIES_MWAVEOS_NAME "mwaveos0700.dsp" 611da177e4SLinus Torvalds #define TP_ABILITIES_BIOSTASK_NAME "mwbio701.dsp" 621da177e4SLinus Torvalds 631da177e4SLinus Torvalds 641da177e4SLinus Torvalds /* DSP configuration values for 3780i based Thinkpads */ 651da177e4SLinus Torvalds #define TP_CFG_NumTransfers 3 /* 16 transfers */ 661da177e4SLinus Torvalds #define TP_CFG_RerequestTimer 1 /* 2 usec */ 671da177e4SLinus Torvalds #define TP_CFG_MEMCS16 0 /* Disabled, 16-bit memory assumed */ 681da177e4SLinus Torvalds #define TP_CFG_IsaMemCmdWidth 3 /* 295 nsec (16-bit) */ 691da177e4SLinus Torvalds #define TP_CFG_GateIOCHRDY 0 /* No IOCHRDY gating */ 701da177e4SLinus Torvalds #define TP_CFG_EnablePwrMgmt 1 /* Enable low poser suspend/resume */ 711da177e4SLinus Torvalds #define TP_CFG_HBusTimerValue 255 /* HBus timer load value */ 721da177e4SLinus Torvalds #define TP_CFG_DisableLBusTimeout 0 /* Enable LBus timeout */ 731da177e4SLinus Torvalds #define TP_CFG_N_Divisor 32 /* Clock = 39.1608 Mhz */ 741da177e4SLinus Torvalds #define TP_CFG_M_Multiplier 37 /* " */ 751da177e4SLinus Torvalds #define TP_CFG_PllBypass 0 /* don't bypass */ 761da177e4SLinus Torvalds #define TP_CFG_ChipletEnable 0xFFFF /* Enable all chiplets */ 771da177e4SLinus Torvalds 781da177e4SLinus Torvalds typedef struct { 791da177e4SLinus Torvalds int bDSPEnabled; 801da177e4SLinus Torvalds int bShareDspIrq; 811da177e4SLinus Torvalds int bShareUartIrq; 821da177e4SLinus Torvalds DSP_3780I_CONFIG_SETTINGS rDspSettings; 831da177e4SLinus Torvalds } THINKPAD_BD_DATA; 841da177e4SLinus Torvalds 851da177e4SLinus Torvalds int tp3780I_InitializeBoardData(THINKPAD_BD_DATA * pBDData); 861da177e4SLinus Torvalds int tp3780I_CalcResources(THINKPAD_BD_DATA * pBDData); 871da177e4SLinus Torvalds int tp3780I_ClaimResources(THINKPAD_BD_DATA * pBDData); 881da177e4SLinus Torvalds int tp3780I_ReleaseResources(THINKPAD_BD_DATA * pBDData); 891da177e4SLinus Torvalds int tp3780I_EnableDSP(THINKPAD_BD_DATA * pBDData); 901da177e4SLinus Torvalds int tp3780I_DisableDSP(THINKPAD_BD_DATA * pBDData); 911da177e4SLinus Torvalds int tp3780I_ResetDSP(THINKPAD_BD_DATA * pBDData); 921da177e4SLinus Torvalds int tp3780I_StartDSP(THINKPAD_BD_DATA * pBDData); 931da177e4SLinus Torvalds int tp3780I_QueryAbilities(THINKPAD_BD_DATA * pBDData, MW_ABILITIES * pAbilities); 94*f6d706ddSYang Li void tp3780I_Cleanup(THINKPAD_BD_DATA *pBDData); 951da177e4SLinus Torvalds int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode, 961da177e4SLinus Torvalds void __user *pvBuffer, unsigned int uCount, 971da177e4SLinus Torvalds unsigned long ulDSPAddr); 981da177e4SLinus Torvalds int tp3780I_ReadWriteDspIStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode, 991da177e4SLinus Torvalds void __user *pvBuffer, unsigned int uCount, 1001da177e4SLinus Torvalds unsigned long ulDSPAddr); 1011da177e4SLinus Torvalds 1021da177e4SLinus Torvalds 1031da177e4SLinus Torvalds #endif 104