162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * tcic.h 1.13 1999/10/25 20:03:34 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * The contents of this file are subject to the Mozilla Public License 562306a36Sopenharmony_ci * Version 1.1 (the "License"); you may not use this file except in 662306a36Sopenharmony_ci * compliance with the License. You may obtain a copy of the License 762306a36Sopenharmony_ci * at http://www.mozilla.org/MPL/ 862306a36Sopenharmony_ci * 962306a36Sopenharmony_ci * Software distributed under the License is distributed on an "AS IS" 1062306a36Sopenharmony_ci * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 1162306a36Sopenharmony_ci * the License for the specific language governing rights and 1262306a36Sopenharmony_ci * limitations under the License. 1362306a36Sopenharmony_ci * 1462306a36Sopenharmony_ci * The initial developer of the original code is David A. Hinds 1562306a36Sopenharmony_ci * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds 1662306a36Sopenharmony_ci * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. 1762306a36Sopenharmony_ci * 1862306a36Sopenharmony_ci * Alternatively, the contents of this file may be used under the 1962306a36Sopenharmony_ci * terms of the GNU General Public License version 2 (the "GPL"), in which 2062306a36Sopenharmony_ci * case the provisions of the GPL are applicable instead of the 2162306a36Sopenharmony_ci * above. If you wish to allow the use of your version of this file 2262306a36Sopenharmony_ci * only under the terms of the GPL and not to allow others to use 2362306a36Sopenharmony_ci * your version of this file under the MPL, indicate your decision by 2462306a36Sopenharmony_ci * deleting the provisions above and replace them with the notice and 2562306a36Sopenharmony_ci * other provisions required by the GPL. If you do not delete the 2662306a36Sopenharmony_ci * provisions above, a recipient may use your version of this file 2762306a36Sopenharmony_ci * under either the MPL or the GPL. 2862306a36Sopenharmony_ci */ 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci#ifndef _LINUX_TCIC_H 3162306a36Sopenharmony_ci#define _LINUX_TCIC_H 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci#define TCIC_BASE 0x240 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci/* offsets of registers from TCIC_BASE */ 3662306a36Sopenharmony_ci#define TCIC_DATA 0x00 3762306a36Sopenharmony_ci#define TCIC_ADDR 0x02 3862306a36Sopenharmony_ci#define TCIC_SCTRL 0x06 3962306a36Sopenharmony_ci#define TCIC_SSTAT 0x07 4062306a36Sopenharmony_ci#define TCIC_MODE 0x08 4162306a36Sopenharmony_ci#define TCIC_PWR 0x09 4262306a36Sopenharmony_ci#define TCIC_EDC 0x0A 4362306a36Sopenharmony_ci#define TCIC_ICSR 0x0C 4462306a36Sopenharmony_ci#define TCIC_IENA 0x0D 4562306a36Sopenharmony_ci#define TCIC_AUX 0x0E 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci#define TCIC_SS_SHFT 12 4862306a36Sopenharmony_ci#define TCIC_SS_MASK 0x7000 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci/* Flags for TCIC_ADDR */ 5162306a36Sopenharmony_ci#define TCIC_ADR2_REG 0x8000 5262306a36Sopenharmony_ci#define TCIC_ADR2_INDREG 0x0800 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci#define TCIC_ADDR_REG 0x80000000 5562306a36Sopenharmony_ci#define TCIC_ADDR_SS_SHFT (TCIC_SS_SHFT+16) 5662306a36Sopenharmony_ci#define TCIC_ADDR_SS_MASK (TCIC_SS_MASK<<16) 5762306a36Sopenharmony_ci#define TCIC_ADDR_INDREG 0x08000000 5862306a36Sopenharmony_ci#define TCIC_ADDR_IO 0x04000000 5962306a36Sopenharmony_ci#define TCIC_ADDR_MASK 0x03ffffff 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ci/* Flags for TCIC_SCTRL */ 6262306a36Sopenharmony_ci#define TCIC_SCTRL_ENA 0x01 6362306a36Sopenharmony_ci#define TCIC_SCTRL_INCMODE 0x18 6462306a36Sopenharmony_ci#define TCIC_SCTRL_INCMODE_HOLD 0x00 6562306a36Sopenharmony_ci#define TCIC_SCTRL_INCMODE_WORD 0x08 6662306a36Sopenharmony_ci#define TCIC_SCTRL_INCMODE_REG 0x10 6762306a36Sopenharmony_ci#define TCIC_SCTRL_INCMODE_AUTO 0x18 6862306a36Sopenharmony_ci#define TCIC_SCTRL_EDCSUM 0x20 6962306a36Sopenharmony_ci#define TCIC_SCTRL_RESET 0x80 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci/* Flags for TCIC_SSTAT */ 7262306a36Sopenharmony_ci#define TCIC_SSTAT_6US 0x01 7362306a36Sopenharmony_ci#define TCIC_SSTAT_10US 0x02 7462306a36Sopenharmony_ci#define TCIC_SSTAT_PROGTIME 0x04 7562306a36Sopenharmony_ci#define TCIC_SSTAT_LBAT1 0x08 7662306a36Sopenharmony_ci#define TCIC_SSTAT_LBAT2 0x10 7762306a36Sopenharmony_ci#define TCIC_SSTAT_RDY 0x20 /* Inverted */ 7862306a36Sopenharmony_ci#define TCIC_SSTAT_WP 0x40 7962306a36Sopenharmony_ci#define TCIC_SSTAT_CD 0x80 /* Card detect */ 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ci/* Flags for TCIC_MODE */ 8262306a36Sopenharmony_ci#define TCIC_MODE_PGMMASK 0x1f 8362306a36Sopenharmony_ci#define TCIC_MODE_NORMAL 0x00 8462306a36Sopenharmony_ci#define TCIC_MODE_PGMWR 0x01 8562306a36Sopenharmony_ci#define TCIC_MODE_PGMRD 0x02 8662306a36Sopenharmony_ci#define TCIC_MODE_PGMCE 0x04 8762306a36Sopenharmony_ci#define TCIC_MODE_PGMDBW 0x08 8862306a36Sopenharmony_ci#define TCIC_MODE_PGMWORD 0x10 8962306a36Sopenharmony_ci#define TCIC_MODE_AUXSEL_MASK 0xe0 9062306a36Sopenharmony_ci 9162306a36Sopenharmony_ci/* Registers accessed through TCIC_AUX, by setting TCIC_MODE */ 9262306a36Sopenharmony_ci#define TCIC_AUX_TCTL (0<<5) 9362306a36Sopenharmony_ci#define TCIC_AUX_PCTL (1<<5) 9462306a36Sopenharmony_ci#define TCIC_AUX_WCTL (2<<5) 9562306a36Sopenharmony_ci#define TCIC_AUX_EXTERN (3<<5) 9662306a36Sopenharmony_ci#define TCIC_AUX_PDATA (4<<5) 9762306a36Sopenharmony_ci#define TCIC_AUX_SYSCFG (5<<5) 9862306a36Sopenharmony_ci#define TCIC_AUX_ILOCK (6<<5) 9962306a36Sopenharmony_ci#define TCIC_AUX_TEST (7<<5) 10062306a36Sopenharmony_ci 10162306a36Sopenharmony_ci/* Flags for TCIC_PWR */ 10262306a36Sopenharmony_ci#define TCIC_PWR_VCC(sock) (0x01<<(sock)) 10362306a36Sopenharmony_ci#define TCIC_PWR_VCC_MASK 0x03 10462306a36Sopenharmony_ci#define TCIC_PWR_VPP(sock) (0x08<<(sock)) 10562306a36Sopenharmony_ci#define TCIC_PWR_VPP_MASK 0x18 10662306a36Sopenharmony_ci#define TCIC_PWR_CLIMENA 0x40 10762306a36Sopenharmony_ci#define TCIC_PWR_CLIMSTAT 0x80 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ci/* Flags for TCIC_ICSR */ 11062306a36Sopenharmony_ci#define TCIC_ICSR_CLEAR 0x01 11162306a36Sopenharmony_ci#define TCIC_ICSR_SET 0x02 11262306a36Sopenharmony_ci#define TCIC_ICSR_JAM (TCIC_ICSR_CLEAR|TCIC_ICSR_SET) 11362306a36Sopenharmony_ci#define TCIC_ICSR_STOPCPU 0x04 11462306a36Sopenharmony_ci#define TCIC_ICSR_ILOCK 0x08 11562306a36Sopenharmony_ci#define TCIC_ICSR_PROGTIME 0x10 11662306a36Sopenharmony_ci#define TCIC_ICSR_ERR 0x20 11762306a36Sopenharmony_ci#define TCIC_ICSR_CDCHG 0x40 11862306a36Sopenharmony_ci#define TCIC_ICSR_IOCHK 0x80 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_ci/* Flags for TCIC_IENA */ 12162306a36Sopenharmony_ci#define TCIC_IENA_CFG_MASK 0x03 12262306a36Sopenharmony_ci#define TCIC_IENA_CFG_OFF 0x00 /* disabled */ 12362306a36Sopenharmony_ci#define TCIC_IENA_CFG_OD 0x01 /* active low, open drain */ 12462306a36Sopenharmony_ci#define TCIC_IENA_CFG_LOW 0x02 /* active low, totem pole */ 12562306a36Sopenharmony_ci#define TCIC_IENA_CFG_HIGH 0x03 /* active high, totem pole */ 12662306a36Sopenharmony_ci#define TCIC_IENA_ILOCK 0x08 12762306a36Sopenharmony_ci#define TCIC_IENA_PROGTIME 0x10 12862306a36Sopenharmony_ci#define TCIC_IENA_ERR 0x20 /* overcurrent or iochk */ 12962306a36Sopenharmony_ci#define TCIC_IENA_CDCHG 0x40 13062306a36Sopenharmony_ci 13162306a36Sopenharmony_ci/* Flags for TCIC_AUX_WCTL */ 13262306a36Sopenharmony_ci#define TCIC_WAIT_COUNT_MASK 0x001f 13362306a36Sopenharmony_ci#define TCIC_WAIT_ASYNC 0x0020 13462306a36Sopenharmony_ci#define TCIC_WAIT_SENSE 0x0040 13562306a36Sopenharmony_ci#define TCIC_WAIT_SRC 0x0080 13662306a36Sopenharmony_ci#define TCIC_WCTL_WR 0x0100 13762306a36Sopenharmony_ci#define TCIC_WCTL_RD 0x0200 13862306a36Sopenharmony_ci#define TCIC_WCTL_CE 0x0400 13962306a36Sopenharmony_ci#define TCIC_WCTL_LLBAT1 0x0800 14062306a36Sopenharmony_ci#define TCIC_WCTL_LLBAT2 0x1000 14162306a36Sopenharmony_ci#define TCIC_WCTL_LRDY 0x2000 14262306a36Sopenharmony_ci#define TCIC_WCTL_LWP 0x4000 14362306a36Sopenharmony_ci#define TCIC_WCTL_LCD 0x8000 14462306a36Sopenharmony_ci 14562306a36Sopenharmony_ci/* Flags for TCIC_AUX_SYSCFG */ 14662306a36Sopenharmony_ci#define TCIC_SYSCFG_IRQ_MASK 0x000f 14762306a36Sopenharmony_ci#define TCIC_SYSCFG_MCSFULL 0x0010 14862306a36Sopenharmony_ci#define TCIC_SYSCFG_IO1723 0x0020 14962306a36Sopenharmony_ci#define TCIC_SYSCFG_MCSXB 0x0040 15062306a36Sopenharmony_ci#define TCIC_SYSCFG_ICSXB 0x0080 15162306a36Sopenharmony_ci#define TCIC_SYSCFG_NOPDN 0x0100 15262306a36Sopenharmony_ci#define TCIC_SYSCFG_MPSEL_SHFT 9 15362306a36Sopenharmony_ci#define TCIC_SYSCFG_MPSEL_MASK 0x0e00 15462306a36Sopenharmony_ci#define TCIC_SYSCFG_MPSENSE 0x2000 15562306a36Sopenharmony_ci#define TCIC_SYSCFG_AUTOBUSY 0x4000 15662306a36Sopenharmony_ci#define TCIC_SYSCFG_ACC 0x8000 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_ci#define TCIC_ILOCK_OUT 0x01 15962306a36Sopenharmony_ci#define TCIC_ILOCK_SENSE 0x02 16062306a36Sopenharmony_ci#define TCIC_ILOCK_CRESET 0x04 16162306a36Sopenharmony_ci#define TCIC_ILOCK_CRESENA 0x08 16262306a36Sopenharmony_ci#define TCIC_ILOCK_CWAIT 0x10 16362306a36Sopenharmony_ci#define TCIC_ILOCK_CWAITSNS 0x20 16462306a36Sopenharmony_ci#define TCIC_ILOCK_HOLD_MASK 0xc0 16562306a36Sopenharmony_ci#define TCIC_ILOCK_HOLD_CCLK 0xc0 16662306a36Sopenharmony_ci 16762306a36Sopenharmony_ci#define TCIC_ILOCKTEST_ID_SH 8 16862306a36Sopenharmony_ci#define TCIC_ILOCKTEST_ID_MASK 0x7f00 16962306a36Sopenharmony_ci#define TCIC_ILOCKTEST_MCIC_1 0x8000 17062306a36Sopenharmony_ci 17162306a36Sopenharmony_ci#define TCIC_ID_DB86082 0x02 17262306a36Sopenharmony_ci#define TCIC_ID_DB86082A 0x03 17362306a36Sopenharmony_ci#define TCIC_ID_DB86084 0x04 17462306a36Sopenharmony_ci#define TCIC_ID_DB86084A 0x08 17562306a36Sopenharmony_ci#define TCIC_ID_DB86072 0x15 17662306a36Sopenharmony_ci#define TCIC_ID_DB86184 0x14 17762306a36Sopenharmony_ci#define TCIC_ID_DB86082B 0x17 17862306a36Sopenharmony_ci 17962306a36Sopenharmony_ci#define TCIC_TEST_DIAG 0x8000 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ci/* 18262306a36Sopenharmony_ci * Indirectly addressed registers 18362306a36Sopenharmony_ci */ 18462306a36Sopenharmony_ci 18562306a36Sopenharmony_ci#define TCIC_SCF1(sock) ((sock)<<3) 18662306a36Sopenharmony_ci#define TCIC_SCF2(sock) (((sock)<<3)+2) 18762306a36Sopenharmony_ci 18862306a36Sopenharmony_ci/* Flags for SCF1 */ 18962306a36Sopenharmony_ci#define TCIC_SCF1_IRQ_MASK 0x000f 19062306a36Sopenharmony_ci#define TCIC_SCF1_IRQ_OFF 0x0000 19162306a36Sopenharmony_ci#define TCIC_SCF1_IRQOC 0x0010 19262306a36Sopenharmony_ci#define TCIC_SCF1_PCVT 0x0020 19362306a36Sopenharmony_ci#define TCIC_SCF1_IRDY 0x0040 19462306a36Sopenharmony_ci#define TCIC_SCF1_ATA 0x0080 19562306a36Sopenharmony_ci#define TCIC_SCF1_DMA_SHIFT 8 19662306a36Sopenharmony_ci#define TCIC_SCF1_DMA_MASK 0x0700 19762306a36Sopenharmony_ci#define TCIC_SCF1_DMA_OFF 0 19862306a36Sopenharmony_ci#define TCIC_SCF1_DREQ2 2 19962306a36Sopenharmony_ci#define TCIC_SCF1_IOSTS 0x0800 20062306a36Sopenharmony_ci#define TCIC_SCF1_SPKR 0x1000 20162306a36Sopenharmony_ci#define TCIC_SCF1_FINPACK 0x2000 20262306a36Sopenharmony_ci#define TCIC_SCF1_DELWR 0x4000 20362306a36Sopenharmony_ci#define TCIC_SCF1_HD7IDE 0x8000 20462306a36Sopenharmony_ci 20562306a36Sopenharmony_ci/* Flags for SCF2 */ 20662306a36Sopenharmony_ci#define TCIC_SCF2_RI 0x0001 20762306a36Sopenharmony_ci#define TCIC_SCF2_IDBR 0x0002 20862306a36Sopenharmony_ci#define TCIC_SCF2_MDBR 0x0004 20962306a36Sopenharmony_ci#define TCIC_SCF2_MLBAT1 0x0008 21062306a36Sopenharmony_ci#define TCIC_SCF2_MLBAT2 0x0010 21162306a36Sopenharmony_ci#define TCIC_SCF2_MRDY 0x0020 21262306a36Sopenharmony_ci#define TCIC_SCF2_MWP 0x0040 21362306a36Sopenharmony_ci#define TCIC_SCF2_MCD 0x0080 21462306a36Sopenharmony_ci#define TCIC_SCF2_MALL 0x00f8 21562306a36Sopenharmony_ci 21662306a36Sopenharmony_ci/* Indirect addresses for memory window registers */ 21762306a36Sopenharmony_ci#define TCIC_MWIN(sock,map) (0x100+(((map)+((sock)<<2))<<3)) 21862306a36Sopenharmony_ci#define TCIC_MBASE_X 2 21962306a36Sopenharmony_ci#define TCIC_MMAP_X 4 22062306a36Sopenharmony_ci#define TCIC_MCTL_X 6 22162306a36Sopenharmony_ci 22262306a36Sopenharmony_ci#define TCIC_MBASE_4K_BIT 0x4000 22362306a36Sopenharmony_ci#define TCIC_MBASE_HA_SHFT 12 22462306a36Sopenharmony_ci#define TCIC_MBASE_HA_MASK 0x0fff 22562306a36Sopenharmony_ci 22662306a36Sopenharmony_ci#define TCIC_MMAP_REG 0x8000 22762306a36Sopenharmony_ci#define TCIC_MMAP_CA_SHFT 12 22862306a36Sopenharmony_ci#define TCIC_MMAP_CA_MASK 0x3fff 22962306a36Sopenharmony_ci 23062306a36Sopenharmony_ci#define TCIC_MCTL_WSCNT_MASK 0x001f 23162306a36Sopenharmony_ci#define TCIC_MCTL_WCLK 0x0020 23262306a36Sopenharmony_ci#define TCIC_MCTL_WCLK_CCLK 0x0000 23362306a36Sopenharmony_ci#define TCIC_MCTL_WCLK_BCLK 0x0020 23462306a36Sopenharmony_ci#define TCIC_MCTL_QUIET 0x0040 23562306a36Sopenharmony_ci#define TCIC_MCTL_WP 0x0080 23662306a36Sopenharmony_ci#define TCIC_MCTL_ACC 0x0100 23762306a36Sopenharmony_ci#define TCIC_MCTL_KE 0x0200 23862306a36Sopenharmony_ci#define TCIC_MCTL_EDC 0x0400 23962306a36Sopenharmony_ci#define TCIC_MCTL_B8 0x0800 24062306a36Sopenharmony_ci#define TCIC_MCTL_SS_SHFT TCIC_SS_SHFT 24162306a36Sopenharmony_ci#define TCIC_MCTL_SS_MASK TCIC_SS_MASK 24262306a36Sopenharmony_ci#define TCIC_MCTL_ENA 0x8000 24362306a36Sopenharmony_ci 24462306a36Sopenharmony_ci/* Indirect addresses for I/O window registers */ 24562306a36Sopenharmony_ci#define TCIC_IWIN(sock,map) (0x200+(((map)+((sock)<<1))<<2)) 24662306a36Sopenharmony_ci#define TCIC_IBASE_X 0 24762306a36Sopenharmony_ci#define TCIC_ICTL_X 2 24862306a36Sopenharmony_ci 24962306a36Sopenharmony_ci#define TCIC_ICTL_WSCNT_MASK TCIC_MCTL_WSCNT_MASK 25062306a36Sopenharmony_ci#define TCIC_ICTL_QUIET TCIC_MCTL_QUIET 25162306a36Sopenharmony_ci#define TCIC_ICTL_1K 0x0080 25262306a36Sopenharmony_ci#define TCIC_ICTL_PASS16 0x0100 25362306a36Sopenharmony_ci#define TCIC_ICTL_ACC TCIC_MCTL_ACC 25462306a36Sopenharmony_ci#define TCIC_ICTL_TINY 0x0200 25562306a36Sopenharmony_ci#define TCIC_ICTL_B16 0x0400 25662306a36Sopenharmony_ci#define TCIC_ICTL_B8 TCIC_MCTL_B8 25762306a36Sopenharmony_ci#define TCIC_ICTL_BW_MASK (TCIC_ICTL_B16|TCIC_ICTL_B8) 25862306a36Sopenharmony_ci#define TCIC_ICTL_BW_DYN 0 25962306a36Sopenharmony_ci#define TCIC_ICTL_BW_8 TCIC_ICTL_B8 26062306a36Sopenharmony_ci#define TCIC_ICTL_BW_16 TCIC_ICTL_B16 26162306a36Sopenharmony_ci#define TCIC_ICTL_BW_ATA (TCIC_ICTL_B16|TCIC_ICTL_B8) 26262306a36Sopenharmony_ci#define TCIC_ICTL_SS_SHFT TCIC_SS_SHFT 26362306a36Sopenharmony_ci#define TCIC_ICTL_SS_MASK TCIC_SS_MASK 26462306a36Sopenharmony_ci#define TCIC_ICTL_ENA TCIC_MCTL_ENA 26562306a36Sopenharmony_ci 26662306a36Sopenharmony_ci#endif /* _LINUX_TCIC_H */ 267