18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * tcic.h 1.13 1999/10/25 20:03:34 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * The contents of this file are subject to the Mozilla Public License 58c2ecf20Sopenharmony_ci * Version 1.1 (the "License"); you may not use this file except in 68c2ecf20Sopenharmony_ci * compliance with the License. You may obtain a copy of the License 78c2ecf20Sopenharmony_ci * at http://www.mozilla.org/MPL/ 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * Software distributed under the License is distributed on an "AS IS" 108c2ecf20Sopenharmony_ci * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 118c2ecf20Sopenharmony_ci * the License for the specific language governing rights and 128c2ecf20Sopenharmony_ci * limitations under the License. 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * The initial developer of the original code is David A. Hinds 158c2ecf20Sopenharmony_ci * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds 168c2ecf20Sopenharmony_ci * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. 178c2ecf20Sopenharmony_ci * 188c2ecf20Sopenharmony_ci * Alternatively, the contents of this file may be used under the 198c2ecf20Sopenharmony_ci * terms of the GNU General Public License version 2 (the "GPL"), in which 208c2ecf20Sopenharmony_ci * case the provisions of the GPL are applicable instead of the 218c2ecf20Sopenharmony_ci * above. If you wish to allow the use of your version of this file 228c2ecf20Sopenharmony_ci * only under the terms of the GPL and not to allow others to use 238c2ecf20Sopenharmony_ci * your version of this file under the MPL, indicate your decision by 248c2ecf20Sopenharmony_ci * deleting the provisions above and replace them with the notice and 258c2ecf20Sopenharmony_ci * other provisions required by the GPL. If you do not delete the 268c2ecf20Sopenharmony_ci * provisions above, a recipient may use your version of this file 278c2ecf20Sopenharmony_ci * under either the MPL or the GPL. 288c2ecf20Sopenharmony_ci */ 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#ifndef _LINUX_TCIC_H 318c2ecf20Sopenharmony_ci#define _LINUX_TCIC_H 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define TCIC_BASE 0x240 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci/* offsets of registers from TCIC_BASE */ 368c2ecf20Sopenharmony_ci#define TCIC_DATA 0x00 378c2ecf20Sopenharmony_ci#define TCIC_ADDR 0x02 388c2ecf20Sopenharmony_ci#define TCIC_SCTRL 0x06 398c2ecf20Sopenharmony_ci#define TCIC_SSTAT 0x07 408c2ecf20Sopenharmony_ci#define TCIC_MODE 0x08 418c2ecf20Sopenharmony_ci#define TCIC_PWR 0x09 428c2ecf20Sopenharmony_ci#define TCIC_EDC 0x0A 438c2ecf20Sopenharmony_ci#define TCIC_ICSR 0x0C 448c2ecf20Sopenharmony_ci#define TCIC_IENA 0x0D 458c2ecf20Sopenharmony_ci#define TCIC_AUX 0x0E 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci#define TCIC_SS_SHFT 12 488c2ecf20Sopenharmony_ci#define TCIC_SS_MASK 0x7000 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci/* Flags for TCIC_ADDR */ 518c2ecf20Sopenharmony_ci#define TCIC_ADR2_REG 0x8000 528c2ecf20Sopenharmony_ci#define TCIC_ADR2_INDREG 0x0800 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci#define TCIC_ADDR_REG 0x80000000 558c2ecf20Sopenharmony_ci#define TCIC_ADDR_SS_SHFT (TCIC_SS_SHFT+16) 568c2ecf20Sopenharmony_ci#define TCIC_ADDR_SS_MASK (TCIC_SS_MASK<<16) 578c2ecf20Sopenharmony_ci#define TCIC_ADDR_INDREG 0x08000000 588c2ecf20Sopenharmony_ci#define TCIC_ADDR_IO 0x04000000 598c2ecf20Sopenharmony_ci#define TCIC_ADDR_MASK 0x03ffffff 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ci/* Flags for TCIC_SCTRL */ 628c2ecf20Sopenharmony_ci#define TCIC_SCTRL_ENA 0x01 638c2ecf20Sopenharmony_ci#define TCIC_SCTRL_INCMODE 0x18 648c2ecf20Sopenharmony_ci#define TCIC_SCTRL_INCMODE_HOLD 0x00 658c2ecf20Sopenharmony_ci#define TCIC_SCTRL_INCMODE_WORD 0x08 668c2ecf20Sopenharmony_ci#define TCIC_SCTRL_INCMODE_REG 0x10 678c2ecf20Sopenharmony_ci#define TCIC_SCTRL_INCMODE_AUTO 0x18 688c2ecf20Sopenharmony_ci#define TCIC_SCTRL_EDCSUM 0x20 698c2ecf20Sopenharmony_ci#define TCIC_SCTRL_RESET 0x80 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci/* Flags for TCIC_SSTAT */ 728c2ecf20Sopenharmony_ci#define TCIC_SSTAT_6US 0x01 738c2ecf20Sopenharmony_ci#define TCIC_SSTAT_10US 0x02 748c2ecf20Sopenharmony_ci#define TCIC_SSTAT_PROGTIME 0x04 758c2ecf20Sopenharmony_ci#define TCIC_SSTAT_LBAT1 0x08 768c2ecf20Sopenharmony_ci#define TCIC_SSTAT_LBAT2 0x10 778c2ecf20Sopenharmony_ci#define TCIC_SSTAT_RDY 0x20 /* Inverted */ 788c2ecf20Sopenharmony_ci#define TCIC_SSTAT_WP 0x40 798c2ecf20Sopenharmony_ci#define TCIC_SSTAT_CD 0x80 /* Card detect */ 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci/* Flags for TCIC_MODE */ 828c2ecf20Sopenharmony_ci#define TCIC_MODE_PGMMASK 0x1f 838c2ecf20Sopenharmony_ci#define TCIC_MODE_NORMAL 0x00 848c2ecf20Sopenharmony_ci#define TCIC_MODE_PGMWR 0x01 858c2ecf20Sopenharmony_ci#define TCIC_MODE_PGMRD 0x02 868c2ecf20Sopenharmony_ci#define TCIC_MODE_PGMCE 0x04 878c2ecf20Sopenharmony_ci#define TCIC_MODE_PGMDBW 0x08 888c2ecf20Sopenharmony_ci#define TCIC_MODE_PGMWORD 0x10 898c2ecf20Sopenharmony_ci#define TCIC_MODE_AUXSEL_MASK 0xe0 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci/* Registers accessed through TCIC_AUX, by setting TCIC_MODE */ 928c2ecf20Sopenharmony_ci#define TCIC_AUX_TCTL (0<<5) 938c2ecf20Sopenharmony_ci#define TCIC_AUX_PCTL (1<<5) 948c2ecf20Sopenharmony_ci#define TCIC_AUX_WCTL (2<<5) 958c2ecf20Sopenharmony_ci#define TCIC_AUX_EXTERN (3<<5) 968c2ecf20Sopenharmony_ci#define TCIC_AUX_PDATA (4<<5) 978c2ecf20Sopenharmony_ci#define TCIC_AUX_SYSCFG (5<<5) 988c2ecf20Sopenharmony_ci#define TCIC_AUX_ILOCK (6<<5) 998c2ecf20Sopenharmony_ci#define TCIC_AUX_TEST (7<<5) 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci/* Flags for TCIC_PWR */ 1028c2ecf20Sopenharmony_ci#define TCIC_PWR_VCC(sock) (0x01<<(sock)) 1038c2ecf20Sopenharmony_ci#define TCIC_PWR_VCC_MASK 0x03 1048c2ecf20Sopenharmony_ci#define TCIC_PWR_VPP(sock) (0x08<<(sock)) 1058c2ecf20Sopenharmony_ci#define TCIC_PWR_VPP_MASK 0x18 1068c2ecf20Sopenharmony_ci#define TCIC_PWR_CLIMENA 0x40 1078c2ecf20Sopenharmony_ci#define TCIC_PWR_CLIMSTAT 0x80 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ci/* Flags for TCIC_ICSR */ 1108c2ecf20Sopenharmony_ci#define TCIC_ICSR_CLEAR 0x01 1118c2ecf20Sopenharmony_ci#define TCIC_ICSR_SET 0x02 1128c2ecf20Sopenharmony_ci#define TCIC_ICSR_JAM (TCIC_ICSR_CLEAR|TCIC_ICSR_SET) 1138c2ecf20Sopenharmony_ci#define TCIC_ICSR_STOPCPU 0x04 1148c2ecf20Sopenharmony_ci#define TCIC_ICSR_ILOCK 0x08 1158c2ecf20Sopenharmony_ci#define TCIC_ICSR_PROGTIME 0x10 1168c2ecf20Sopenharmony_ci#define TCIC_ICSR_ERR 0x20 1178c2ecf20Sopenharmony_ci#define TCIC_ICSR_CDCHG 0x40 1188c2ecf20Sopenharmony_ci#define TCIC_ICSR_IOCHK 0x80 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci/* Flags for TCIC_IENA */ 1218c2ecf20Sopenharmony_ci#define TCIC_IENA_CFG_MASK 0x03 1228c2ecf20Sopenharmony_ci#define TCIC_IENA_CFG_OFF 0x00 /* disabled */ 1238c2ecf20Sopenharmony_ci#define TCIC_IENA_CFG_OD 0x01 /* active low, open drain */ 1248c2ecf20Sopenharmony_ci#define TCIC_IENA_CFG_LOW 0x02 /* active low, totem pole */ 1258c2ecf20Sopenharmony_ci#define TCIC_IENA_CFG_HIGH 0x03 /* active high, totem pole */ 1268c2ecf20Sopenharmony_ci#define TCIC_IENA_ILOCK 0x08 1278c2ecf20Sopenharmony_ci#define TCIC_IENA_PROGTIME 0x10 1288c2ecf20Sopenharmony_ci#define TCIC_IENA_ERR 0x20 /* overcurrent or iochk */ 1298c2ecf20Sopenharmony_ci#define TCIC_IENA_CDCHG 0x40 1308c2ecf20Sopenharmony_ci 1318c2ecf20Sopenharmony_ci/* Flags for TCIC_AUX_WCTL */ 1328c2ecf20Sopenharmony_ci#define TCIC_WAIT_COUNT_MASK 0x001f 1338c2ecf20Sopenharmony_ci#define TCIC_WAIT_ASYNC 0x0020 1348c2ecf20Sopenharmony_ci#define TCIC_WAIT_SENSE 0x0040 1358c2ecf20Sopenharmony_ci#define TCIC_WAIT_SRC 0x0080 1368c2ecf20Sopenharmony_ci#define TCIC_WCTL_WR 0x0100 1378c2ecf20Sopenharmony_ci#define TCIC_WCTL_RD 0x0200 1388c2ecf20Sopenharmony_ci#define TCIC_WCTL_CE 0x0400 1398c2ecf20Sopenharmony_ci#define TCIC_WCTL_LLBAT1 0x0800 1408c2ecf20Sopenharmony_ci#define TCIC_WCTL_LLBAT2 0x1000 1418c2ecf20Sopenharmony_ci#define TCIC_WCTL_LRDY 0x2000 1428c2ecf20Sopenharmony_ci#define TCIC_WCTL_LWP 0x4000 1438c2ecf20Sopenharmony_ci#define TCIC_WCTL_LCD 0x8000 1448c2ecf20Sopenharmony_ci 1458c2ecf20Sopenharmony_ci/* Flags for TCIC_AUX_SYSCFG */ 1468c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_IRQ_MASK 0x000f 1478c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_MCSFULL 0x0010 1488c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_IO1723 0x0020 1498c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_MCSXB 0x0040 1508c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_ICSXB 0x0080 1518c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_NOPDN 0x0100 1528c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_MPSEL_SHFT 9 1538c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_MPSEL_MASK 0x0e00 1548c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_MPSENSE 0x2000 1558c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_AUTOBUSY 0x4000 1568c2ecf20Sopenharmony_ci#define TCIC_SYSCFG_ACC 0x8000 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_ci#define TCIC_ILOCK_OUT 0x01 1598c2ecf20Sopenharmony_ci#define TCIC_ILOCK_SENSE 0x02 1608c2ecf20Sopenharmony_ci#define TCIC_ILOCK_CRESET 0x04 1618c2ecf20Sopenharmony_ci#define TCIC_ILOCK_CRESENA 0x08 1628c2ecf20Sopenharmony_ci#define TCIC_ILOCK_CWAIT 0x10 1638c2ecf20Sopenharmony_ci#define TCIC_ILOCK_CWAITSNS 0x20 1648c2ecf20Sopenharmony_ci#define TCIC_ILOCK_HOLD_MASK 0xc0 1658c2ecf20Sopenharmony_ci#define TCIC_ILOCK_HOLD_CCLK 0xc0 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_ci#define TCIC_ILOCKTEST_ID_SH 8 1688c2ecf20Sopenharmony_ci#define TCIC_ILOCKTEST_ID_MASK 0x7f00 1698c2ecf20Sopenharmony_ci#define TCIC_ILOCKTEST_MCIC_1 0x8000 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci#define TCIC_ID_DB86082 0x02 1728c2ecf20Sopenharmony_ci#define TCIC_ID_DB86082A 0x03 1738c2ecf20Sopenharmony_ci#define TCIC_ID_DB86084 0x04 1748c2ecf20Sopenharmony_ci#define TCIC_ID_DB86084A 0x08 1758c2ecf20Sopenharmony_ci#define TCIC_ID_DB86072 0x15 1768c2ecf20Sopenharmony_ci#define TCIC_ID_DB86184 0x14 1778c2ecf20Sopenharmony_ci#define TCIC_ID_DB86082B 0x17 1788c2ecf20Sopenharmony_ci 1798c2ecf20Sopenharmony_ci#define TCIC_TEST_DIAG 0x8000 1808c2ecf20Sopenharmony_ci 1818c2ecf20Sopenharmony_ci/* 1828c2ecf20Sopenharmony_ci * Indirectly addressed registers 1838c2ecf20Sopenharmony_ci */ 1848c2ecf20Sopenharmony_ci 1858c2ecf20Sopenharmony_ci#define TCIC_SCF1(sock) ((sock)<<3) 1868c2ecf20Sopenharmony_ci#define TCIC_SCF2(sock) (((sock)<<3)+2) 1878c2ecf20Sopenharmony_ci 1888c2ecf20Sopenharmony_ci/* Flags for SCF1 */ 1898c2ecf20Sopenharmony_ci#define TCIC_SCF1_IRQ_MASK 0x000f 1908c2ecf20Sopenharmony_ci#define TCIC_SCF1_IRQ_OFF 0x0000 1918c2ecf20Sopenharmony_ci#define TCIC_SCF1_IRQOC 0x0010 1928c2ecf20Sopenharmony_ci#define TCIC_SCF1_PCVT 0x0020 1938c2ecf20Sopenharmony_ci#define TCIC_SCF1_IRDY 0x0040 1948c2ecf20Sopenharmony_ci#define TCIC_SCF1_ATA 0x0080 1958c2ecf20Sopenharmony_ci#define TCIC_SCF1_DMA_SHIFT 8 1968c2ecf20Sopenharmony_ci#define TCIC_SCF1_DMA_MASK 0x0700 1978c2ecf20Sopenharmony_ci#define TCIC_SCF1_DMA_OFF 0 1988c2ecf20Sopenharmony_ci#define TCIC_SCF1_DREQ2 2 1998c2ecf20Sopenharmony_ci#define TCIC_SCF1_IOSTS 0x0800 2008c2ecf20Sopenharmony_ci#define TCIC_SCF1_SPKR 0x1000 2018c2ecf20Sopenharmony_ci#define TCIC_SCF1_FINPACK 0x2000 2028c2ecf20Sopenharmony_ci#define TCIC_SCF1_DELWR 0x4000 2038c2ecf20Sopenharmony_ci#define TCIC_SCF1_HD7IDE 0x8000 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci/* Flags for SCF2 */ 2068c2ecf20Sopenharmony_ci#define TCIC_SCF2_RI 0x0001 2078c2ecf20Sopenharmony_ci#define TCIC_SCF2_IDBR 0x0002 2088c2ecf20Sopenharmony_ci#define TCIC_SCF2_MDBR 0x0004 2098c2ecf20Sopenharmony_ci#define TCIC_SCF2_MLBAT1 0x0008 2108c2ecf20Sopenharmony_ci#define TCIC_SCF2_MLBAT2 0x0010 2118c2ecf20Sopenharmony_ci#define TCIC_SCF2_MRDY 0x0020 2128c2ecf20Sopenharmony_ci#define TCIC_SCF2_MWP 0x0040 2138c2ecf20Sopenharmony_ci#define TCIC_SCF2_MCD 0x0080 2148c2ecf20Sopenharmony_ci#define TCIC_SCF2_MALL 0x00f8 2158c2ecf20Sopenharmony_ci 2168c2ecf20Sopenharmony_ci/* Indirect addresses for memory window registers */ 2178c2ecf20Sopenharmony_ci#define TCIC_MWIN(sock,map) (0x100+(((map)+((sock)<<2))<<3)) 2188c2ecf20Sopenharmony_ci#define TCIC_MBASE_X 2 2198c2ecf20Sopenharmony_ci#define TCIC_MMAP_X 4 2208c2ecf20Sopenharmony_ci#define TCIC_MCTL_X 6 2218c2ecf20Sopenharmony_ci 2228c2ecf20Sopenharmony_ci#define TCIC_MBASE_4K_BIT 0x4000 2238c2ecf20Sopenharmony_ci#define TCIC_MBASE_HA_SHFT 12 2248c2ecf20Sopenharmony_ci#define TCIC_MBASE_HA_MASK 0x0fff 2258c2ecf20Sopenharmony_ci 2268c2ecf20Sopenharmony_ci#define TCIC_MMAP_REG 0x8000 2278c2ecf20Sopenharmony_ci#define TCIC_MMAP_CA_SHFT 12 2288c2ecf20Sopenharmony_ci#define TCIC_MMAP_CA_MASK 0x3fff 2298c2ecf20Sopenharmony_ci 2308c2ecf20Sopenharmony_ci#define TCIC_MCTL_WSCNT_MASK 0x001f 2318c2ecf20Sopenharmony_ci#define TCIC_MCTL_WCLK 0x0020 2328c2ecf20Sopenharmony_ci#define TCIC_MCTL_WCLK_CCLK 0x0000 2338c2ecf20Sopenharmony_ci#define TCIC_MCTL_WCLK_BCLK 0x0020 2348c2ecf20Sopenharmony_ci#define TCIC_MCTL_QUIET 0x0040 2358c2ecf20Sopenharmony_ci#define TCIC_MCTL_WP 0x0080 2368c2ecf20Sopenharmony_ci#define TCIC_MCTL_ACC 0x0100 2378c2ecf20Sopenharmony_ci#define TCIC_MCTL_KE 0x0200 2388c2ecf20Sopenharmony_ci#define TCIC_MCTL_EDC 0x0400 2398c2ecf20Sopenharmony_ci#define TCIC_MCTL_B8 0x0800 2408c2ecf20Sopenharmony_ci#define TCIC_MCTL_SS_SHFT TCIC_SS_SHFT 2418c2ecf20Sopenharmony_ci#define TCIC_MCTL_SS_MASK TCIC_SS_MASK 2428c2ecf20Sopenharmony_ci#define TCIC_MCTL_ENA 0x8000 2438c2ecf20Sopenharmony_ci 2448c2ecf20Sopenharmony_ci/* Indirect addresses for I/O window registers */ 2458c2ecf20Sopenharmony_ci#define TCIC_IWIN(sock,map) (0x200+(((map)+((sock)<<1))<<2)) 2468c2ecf20Sopenharmony_ci#define TCIC_IBASE_X 0 2478c2ecf20Sopenharmony_ci#define TCIC_ICTL_X 2 2488c2ecf20Sopenharmony_ci 2498c2ecf20Sopenharmony_ci#define TCIC_ICTL_WSCNT_MASK TCIC_MCTL_WSCNT_MASK 2508c2ecf20Sopenharmony_ci#define TCIC_ICTL_QUIET TCIC_MCTL_QUIET 2518c2ecf20Sopenharmony_ci#define TCIC_ICTL_1K 0x0080 2528c2ecf20Sopenharmony_ci#define TCIC_ICTL_PASS16 0x0100 2538c2ecf20Sopenharmony_ci#define TCIC_ICTL_ACC TCIC_MCTL_ACC 2548c2ecf20Sopenharmony_ci#define TCIC_ICTL_TINY 0x0200 2558c2ecf20Sopenharmony_ci#define TCIC_ICTL_B16 0x0400 2568c2ecf20Sopenharmony_ci#define TCIC_ICTL_B8 TCIC_MCTL_B8 2578c2ecf20Sopenharmony_ci#define TCIC_ICTL_BW_MASK (TCIC_ICTL_B16|TCIC_ICTL_B8) 2588c2ecf20Sopenharmony_ci#define TCIC_ICTL_BW_DYN 0 2598c2ecf20Sopenharmony_ci#define TCIC_ICTL_BW_8 TCIC_ICTL_B8 2608c2ecf20Sopenharmony_ci#define TCIC_ICTL_BW_16 TCIC_ICTL_B16 2618c2ecf20Sopenharmony_ci#define TCIC_ICTL_BW_ATA (TCIC_ICTL_B16|TCIC_ICTL_B8) 2628c2ecf20Sopenharmony_ci#define TCIC_ICTL_SS_SHFT TCIC_SS_SHFT 2638c2ecf20Sopenharmony_ci#define TCIC_ICTL_SS_MASK TCIC_SS_MASK 2648c2ecf20Sopenharmony_ci#define TCIC_ICTL_ENA TCIC_MCTL_ENA 2658c2ecf20Sopenharmony_ci 2668c2ecf20Sopenharmony_ci#endif /* _LINUX_TCIC_H */ 267