1*65c85c83SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 22908d778SJames Bottomley /* 36070d81eSAdam Buchbinder * Aic94xx SAS/SATA driver hardware registers definitions. 42908d778SJames Bottomley * 52908d778SJames Bottomley * Copyright (C) 2004 Adaptec, Inc. All rights reserved. 62908d778SJames Bottomley * Copyright (C) 2004 David Chaw <david_chaw@adaptec.com> 72908d778SJames Bottomley * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com> 82908d778SJames Bottomley * 92908d778SJames Bottomley * Luben Tuikov: Some register value updates to make it work with the window 102908d778SJames Bottomley * agnostic register r/w functions. Some register corrections, sizes, 112908d778SJames Bottomley * etc. 122908d778SJames Bottomley * 132908d778SJames Bottomley * $Id: //depot/aic94xx/aic94xx_reg_def.h#27 $ 142908d778SJames Bottomley */ 152908d778SJames Bottomley 162908d778SJames Bottomley #ifndef _ADP94XX_REG_DEF_H_ 172908d778SJames Bottomley #define _ADP94XX_REG_DEF_H_ 182908d778SJames Bottomley 192908d778SJames Bottomley /* 202908d778SJames Bottomley * Common definitions. 212908d778SJames Bottomley */ 222908d778SJames Bottomley #define CSEQ_MODE_PAGE_SIZE 0x200 /* CSEQ mode page size */ 232908d778SJames Bottomley #define LmSEQ_MODE_PAGE_SIZE 0x200 /* LmSEQ mode page size */ 242908d778SJames Bottomley #define LmSEQ_HOST_REG_SIZE 0x4000 /* LmSEQ Host Register size */ 252908d778SJames Bottomley 262908d778SJames Bottomley /********************* COM_SAS registers definition *************************/ 272908d778SJames Bottomley 282908d778SJames Bottomley /* The base is REG_BASE_ADDR, defined in aic94xx_reg.h. 292908d778SJames Bottomley */ 302908d778SJames Bottomley 312908d778SJames Bottomley /* 322908d778SJames Bottomley * CHIM Registers, Address Range : (0x00-0xFF) 332908d778SJames Bottomley */ 342908d778SJames Bottomley #define COMBIST (REG_BASE_ADDR + 0x00) 352908d778SJames Bottomley 362908d778SJames Bottomley /* bits 31:24 */ 372908d778SJames Bottomley #define L7BLKRST 0x80000000 382908d778SJames Bottomley #define L6BLKRST 0x40000000 392908d778SJames Bottomley #define L5BLKRST 0x20000000 402908d778SJames Bottomley #define L4BLKRST 0x10000000 412908d778SJames Bottomley #define L3BLKRST 0x08000000 422908d778SJames Bottomley #define L2BLKRST 0x04000000 432908d778SJames Bottomley #define L1BLKRST 0x02000000 442908d778SJames Bottomley #define L0BLKRST 0x01000000 452908d778SJames Bottomley #define LmBLKRST 0xFF000000 462908d778SJames Bottomley #define LmBLKRST_COMBIST(phyid) (1 << (24 + phyid)) 472908d778SJames Bottomley 482908d778SJames Bottomley #define OCMBLKRST 0x00400000 492908d778SJames Bottomley #define CTXMEMBLKRST 0x00200000 502908d778SJames Bottomley #define CSEQBLKRST 0x00100000 512908d778SJames Bottomley #define EXSIBLKRST 0x00040000 522908d778SJames Bottomley #define DPIBLKRST 0x00020000 532908d778SJames Bottomley #define DFIFBLKRST 0x00010000 542908d778SJames Bottomley #define HARDRST 0x00000200 552908d778SJames Bottomley #define COMBLKRST 0x00000100 562908d778SJames Bottomley #define FRCDFPERR 0x00000080 572908d778SJames Bottomley #define FRCCIOPERR 0x00000020 582908d778SJames Bottomley #define FRCBISTERR 0x00000010 592908d778SJames Bottomley #define COMBISTEN 0x00000004 602908d778SJames Bottomley #define COMBISTDONE 0x00000002 /* ro */ 612908d778SJames Bottomley #define COMBISTFAIL 0x00000001 /* ro */ 622908d778SJames Bottomley 632908d778SJames Bottomley #define COMSTAT (REG_BASE_ADDR + 0x04) 642908d778SJames Bottomley 652908d778SJames Bottomley #define REQMBXREAD 0x00000040 662908d778SJames Bottomley #define RSPMBXAVAIL 0x00000020 672908d778SJames Bottomley #define CSBUFPERR 0x00000008 682908d778SJames Bottomley #define OVLYERR 0x00000004 692908d778SJames Bottomley #define CSERR 0x00000002 702908d778SJames Bottomley #define OVLYDMADONE 0x00000001 712908d778SJames Bottomley 722908d778SJames Bottomley #define COMSTAT_MASK (REQMBXREAD | RSPMBXAVAIL | \ 732908d778SJames Bottomley CSBUFPERR | OVLYERR | CSERR |\ 742908d778SJames Bottomley OVLYDMADONE) 752908d778SJames Bottomley 762908d778SJames Bottomley #define COMSTATEN (REG_BASE_ADDR + 0x08) 772908d778SJames Bottomley 782908d778SJames Bottomley #define EN_REQMBXREAD 0x00000040 792908d778SJames Bottomley #define EN_RSPMBXAVAIL 0x00000020 802908d778SJames Bottomley #define EN_CSBUFPERR 0x00000008 812908d778SJames Bottomley #define EN_OVLYERR 0x00000004 822908d778SJames Bottomley #define EN_CSERR 0x00000002 832908d778SJames Bottomley #define EN_OVLYDONE 0x00000001 842908d778SJames Bottomley 852908d778SJames Bottomley #define SCBPRO (REG_BASE_ADDR + 0x0C) 862908d778SJames Bottomley 872908d778SJames Bottomley #define SCBCONS_MASK 0xFFFF0000 882908d778SJames Bottomley #define SCBPRO_MASK 0x0000FFFF 892908d778SJames Bottomley 902908d778SJames Bottomley #define CHIMREQMBX (REG_BASE_ADDR + 0x10) 912908d778SJames Bottomley 922908d778SJames Bottomley #define CHIMRSPMBX (REG_BASE_ADDR + 0x14) 932908d778SJames Bottomley 942908d778SJames Bottomley #define CHIMINT (REG_BASE_ADDR + 0x18) 952908d778SJames Bottomley 962908d778SJames Bottomley #define EXT_INT0 0x00000800 972908d778SJames Bottomley #define EXT_INT1 0x00000400 982908d778SJames Bottomley #define PORRSTDET 0x00000200 992908d778SJames Bottomley #define HARDRSTDET 0x00000100 1002908d778SJames Bottomley #define DLAVAILQ 0x00000080 /* ro */ 1012908d778SJames Bottomley #define HOSTERR 0x00000040 1022908d778SJames Bottomley #define INITERR 0x00000020 1032908d778SJames Bottomley #define DEVINT 0x00000010 1042908d778SJames Bottomley #define COMINT 0x00000008 1052908d778SJames Bottomley #define DEVTIMER2 0x00000004 1062908d778SJames Bottomley #define DEVTIMER1 0x00000002 1072908d778SJames Bottomley #define DLAVAIL 0x00000001 1082908d778SJames Bottomley 1092908d778SJames Bottomley #define CHIMINT_MASK (HOSTERR | INITERR | DEVINT | COMINT |\ 1102908d778SJames Bottomley DEVTIMER2 | DEVTIMER1 | DLAVAIL) 1112908d778SJames Bottomley 1122908d778SJames Bottomley #define DEVEXCEPT_MASK (HOSTERR | INITERR | DEVINT | COMINT) 1132908d778SJames Bottomley 1142908d778SJames Bottomley #define CHIMINTEN (REG_BASE_ADDR + 0x1C) 1152908d778SJames Bottomley 1162908d778SJames Bottomley #define RST_EN_EXT_INT1 0x01000000 1172908d778SJames Bottomley #define RST_EN_EXT_INT0 0x00800000 1182908d778SJames Bottomley #define RST_EN_HOSTERR 0x00400000 1192908d778SJames Bottomley #define RST_EN_INITERR 0x00200000 1202908d778SJames Bottomley #define RST_EN_DEVINT 0x00100000 1212908d778SJames Bottomley #define RST_EN_COMINT 0x00080000 1222908d778SJames Bottomley #define RST_EN_DEVTIMER2 0x00040000 1232908d778SJames Bottomley #define RST_EN_DEVTIMER1 0x00020000 1242908d778SJames Bottomley #define RST_EN_DLAVAIL 0x00010000 1252908d778SJames Bottomley #define SET_EN_EXT_INT1 0x00000100 1262908d778SJames Bottomley #define SET_EN_EXT_INT0 0x00000080 1272908d778SJames Bottomley #define SET_EN_HOSTERR 0x00000040 1282908d778SJames Bottomley #define SET_EN_INITERR 0x00000020 1292908d778SJames Bottomley #define SET_EN_DEVINT 0x00000010 1302908d778SJames Bottomley #define SET_EN_COMINT 0x00000008 1312908d778SJames Bottomley #define SET_EN_DEVTIMER2 0x00000004 1322908d778SJames Bottomley #define SET_EN_DEVTIMER1 0x00000002 1332908d778SJames Bottomley #define SET_EN_DLAVAIL 0x00000001 1342908d778SJames Bottomley 1352908d778SJames Bottomley #define RST_CHIMINTEN (RST_EN_HOSTERR | RST_EN_INITERR | \ 1362908d778SJames Bottomley RST_EN_DEVINT | RST_EN_COMINT | \ 1372908d778SJames Bottomley RST_EN_DEVTIMER2 | RST_EN_DEVTIMER1 |\ 1382908d778SJames Bottomley RST_EN_DLAVAIL) 1392908d778SJames Bottomley 1402908d778SJames Bottomley #define SET_CHIMINTEN (SET_EN_HOSTERR | SET_EN_INITERR |\ 1412908d778SJames Bottomley SET_EN_DEVINT | SET_EN_COMINT |\ 1422908d778SJames Bottomley SET_EN_DLAVAIL) 1432908d778SJames Bottomley 1442908d778SJames Bottomley #define OVLYDMACTL (REG_BASE_ADDR + 0x20) 1452908d778SJames Bottomley 1462908d778SJames Bottomley #define OVLYADR_MASK 0x07FF0000 1472908d778SJames Bottomley #define OVLYLSEQ_MASK 0x0000FF00 1482908d778SJames Bottomley #define OVLYCSEQ 0x00000080 1492908d778SJames Bottomley #define OVLYHALTERR 0x00000040 1502908d778SJames Bottomley #define PIOCMODE 0x00000020 1512908d778SJames Bottomley #define RESETOVLYDMA 0x00000008 /* wo */ 1522908d778SJames Bottomley #define STARTOVLYDMA 0x00000004 1532908d778SJames Bottomley #define STOPOVLYDMA 0x00000002 /* wo */ 1542908d778SJames Bottomley #define OVLYDMAACT 0x00000001 /* ro */ 1552908d778SJames Bottomley 1562908d778SJames Bottomley #define OVLYDMACNT (REG_BASE_ADDR + 0x24) 1572908d778SJames Bottomley 1582908d778SJames Bottomley #define OVLYDOMAIN1 0x20000000 /* ro */ 1592908d778SJames Bottomley #define OVLYDOMAIN0 0x10000000 1602908d778SJames Bottomley #define OVLYBUFADR_MASK 0x007F0000 1612908d778SJames Bottomley #define OVLYDMACNT_MASK 0x00003FFF 1622908d778SJames Bottomley 1632908d778SJames Bottomley #define OVLYDMAADR (REG_BASE_ADDR + 0x28) 1642908d778SJames Bottomley 1652908d778SJames Bottomley #define DMAERR (REG_BASE_ADDR + 0x30) 1662908d778SJames Bottomley 1672908d778SJames Bottomley #define OVLYERRSTAT_MASK 0x0000FF00 /* ro */ 1682908d778SJames Bottomley #define CSERRSTAT_MASK 0x000000FF /* ro */ 1692908d778SJames Bottomley 1702908d778SJames Bottomley #define SPIODATA (REG_BASE_ADDR + 0x34) 1712908d778SJames Bottomley 1722908d778SJames Bottomley /* 0x38 - 0x3C are reserved */ 1732908d778SJames Bottomley 1742908d778SJames Bottomley #define T1CNTRLR (REG_BASE_ADDR + 0x40) 1752908d778SJames Bottomley 1762908d778SJames Bottomley #define T1DONE 0x00010000 /* ro */ 1772908d778SJames Bottomley #define TIMER64 0x00000400 1782908d778SJames Bottomley #define T1ENABLE 0x00000200 1792908d778SJames Bottomley #define T1RELOAD 0x00000100 1802908d778SJames Bottomley #define T1PRESCALER_MASK 0x00000003 1812908d778SJames Bottomley 1822908d778SJames Bottomley #define T1CMPR (REG_BASE_ADDR + 0x44) 1832908d778SJames Bottomley 1842908d778SJames Bottomley #define T1CNTR (REG_BASE_ADDR + 0x48) 1852908d778SJames Bottomley 1862908d778SJames Bottomley #define T2CNTRLR (REG_BASE_ADDR + 0x4C) 1872908d778SJames Bottomley 1882908d778SJames Bottomley #define T2DONE 0x00010000 /* ro */ 1892908d778SJames Bottomley #define T2ENABLE 0x00000200 1902908d778SJames Bottomley #define T2RELOAD 0x00000100 1912908d778SJames Bottomley #define T2PRESCALER_MASK 0x00000003 1922908d778SJames Bottomley 1932908d778SJames Bottomley #define T2CMPR (REG_BASE_ADDR + 0x50) 1942908d778SJames Bottomley 1952908d778SJames Bottomley #define T2CNTR (REG_BASE_ADDR + 0x54) 1962908d778SJames Bottomley 1972908d778SJames Bottomley /* 0x58h - 0xFCh are reserved */ 1982908d778SJames Bottomley 1992908d778SJames Bottomley /* 2002908d778SJames Bottomley * DCH_SAS Registers, Address Range : (0x800-0xFFF) 2012908d778SJames Bottomley */ 2022908d778SJames Bottomley #define CMDCTXBASE (REG_BASE_ADDR + 0x800) 2032908d778SJames Bottomley 2042908d778SJames Bottomley #define DEVCTXBASE (REG_BASE_ADDR + 0x808) 2052908d778SJames Bottomley 2062908d778SJames Bottomley #define CTXDOMAIN (REG_BASE_ADDR + 0x810) 2072908d778SJames Bottomley 2082908d778SJames Bottomley #define DEVCTXDOMAIN1 0x00000008 /* ro */ 2092908d778SJames Bottomley #define DEVCTXDOMAIN0 0x00000004 2102908d778SJames Bottomley #define CMDCTXDOMAIN1 0x00000002 /* ro */ 2112908d778SJames Bottomley #define CMDCTXDOMAIN0 0x00000001 2122908d778SJames Bottomley 2132908d778SJames Bottomley #define DCHCTL (REG_BASE_ADDR + 0x814) 2142908d778SJames Bottomley 2152908d778SJames Bottomley #define OCMBISTREPAIR 0x00080000 2162908d778SJames Bottomley #define OCMBISTEN 0x00040000 2172908d778SJames Bottomley #define OCMBISTDN 0x00020000 /* ro */ 2182908d778SJames Bottomley #define OCMBISTFAIL 0x00010000 /* ro */ 2192908d778SJames Bottomley #define DDBBISTEN 0x00004000 2202908d778SJames Bottomley #define DDBBISTDN 0x00002000 /* ro */ 2212908d778SJames Bottomley #define DDBBISTFAIL 0x00001000 /* ro */ 2222908d778SJames Bottomley #define SCBBISTEN 0x00000400 2232908d778SJames Bottomley #define SCBBISTDN 0x00000200 /* ro */ 2242908d778SJames Bottomley #define SCBBISTFAIL 0x00000100 /* ro */ 2252908d778SJames Bottomley 2262908d778SJames Bottomley #define MEMSEL_MASK 0x000000E0 2272908d778SJames Bottomley #define MEMSEL_CCM_LSEQ 0x00000000 2282908d778SJames Bottomley #define MEMSEL_CCM_IOP 0x00000020 2292908d778SJames Bottomley #define MEMSEL_CCM_SASCTL 0x00000040 2302908d778SJames Bottomley #define MEMSEL_DCM_LSEQ 0x00000060 2312908d778SJames Bottomley #define MEMSEL_DCM_IOP 0x00000080 2322908d778SJames Bottomley #define MEMSEL_OCM 0x000000A0 2332908d778SJames Bottomley 2342908d778SJames Bottomley #define FRCERR 0x00000010 2352908d778SJames Bottomley #define AUTORLS 0x00000001 2362908d778SJames Bottomley 2372908d778SJames Bottomley #define DCHREVISION (REG_BASE_ADDR + 0x818) 2382908d778SJames Bottomley 2392908d778SJames Bottomley #define DCHREVISION_MASK 0x000000FF 2402908d778SJames Bottomley 2412908d778SJames Bottomley #define DCHSTATUS (REG_BASE_ADDR + 0x81C) 2422908d778SJames Bottomley 2432908d778SJames Bottomley #define EN_CFIFTOERR 0x00020000 2442908d778SJames Bottomley #define CFIFTOERR 0x00000200 2452908d778SJames Bottomley #define CSEQINT 0x00000100 /* ro */ 2462908d778SJames Bottomley #define LSEQ7INT 0x00000080 /* ro */ 2472908d778SJames Bottomley #define LSEQ6INT 0x00000040 /* ro */ 2482908d778SJames Bottomley #define LSEQ5INT 0x00000020 /* ro */ 2492908d778SJames Bottomley #define LSEQ4INT 0x00000010 /* ro */ 2502908d778SJames Bottomley #define LSEQ3INT 0x00000008 /* ro */ 2512908d778SJames Bottomley #define LSEQ2INT 0x00000004 /* ro */ 2522908d778SJames Bottomley #define LSEQ1INT 0x00000002 /* ro */ 2532908d778SJames Bottomley #define LSEQ0INT 0x00000001 /* ro */ 2542908d778SJames Bottomley 2552908d778SJames Bottomley #define LSEQINT_MASK (LSEQ7INT | LSEQ6INT | LSEQ5INT |\ 2562908d778SJames Bottomley LSEQ4INT | LSEQ3INT | LSEQ2INT |\ 2572908d778SJames Bottomley LSEQ1INT | LSEQ0INT) 2582908d778SJames Bottomley 2592908d778SJames Bottomley #define DCHDFIFDEBUG (REG_BASE_ADDR + 0x820) 2602908d778SJames Bottomley #define ENFAIRMST 0x00FF0000 2612908d778SJames Bottomley #define DISWRMST9 0x00000200 2622908d778SJames Bottomley #define DISWRMST8 0x00000100 2632908d778SJames Bottomley #define DISRDMST 0x000000FF 2642908d778SJames Bottomley 2652908d778SJames Bottomley #define ATOMICSTATCTL (REG_BASE_ADDR + 0x824) 2662908d778SJames Bottomley /* 8 bit wide */ 2672908d778SJames Bottomley #define AUTOINC 0x80 2682908d778SJames Bottomley #define ATOMICERR 0x04 2692908d778SJames Bottomley #define ATOMICWIN 0x02 2702908d778SJames Bottomley #define ATOMICDONE 0x01 2712908d778SJames Bottomley 2722908d778SJames Bottomley 2732908d778SJames Bottomley #define ALTCIOADR (REG_BASE_ADDR + 0x828) 2742908d778SJames Bottomley /* 16 bit; bits 8:0 define CIO addr space of CSEQ */ 2752908d778SJames Bottomley 2762908d778SJames Bottomley #define ASCBPTR (REG_BASE_ADDR + 0x82C) 2772908d778SJames Bottomley /* 16 bit wide */ 2782908d778SJames Bottomley 2792908d778SJames Bottomley #define ADDBPTR (REG_BASE_ADDR + 0x82E) 2802908d778SJames Bottomley /* 16 bit wide */ 2812908d778SJames Bottomley 2822908d778SJames Bottomley #define ANEWDATA (REG_BASE_ADDR + 0x830) 2832908d778SJames Bottomley /* 16 bit */ 2842908d778SJames Bottomley 2852908d778SJames Bottomley #define AOLDDATA (REG_BASE_ADDR + 0x834) 2862908d778SJames Bottomley /* 16 bit */ 2872908d778SJames Bottomley 2882908d778SJames Bottomley #define CTXACCESS (REG_BASE_ADDR + 0x838) 2892908d778SJames Bottomley /* 32 bit */ 2902908d778SJames Bottomley 2912908d778SJames Bottomley /* 0x83Ch - 0xFFCh are reserved */ 2922908d778SJames Bottomley 2932908d778SJames Bottomley /* 2942908d778SJames Bottomley * ARP2 External Processor Registers, Address Range : (0x00-0x1F) 2952908d778SJames Bottomley */ 2962908d778SJames Bottomley #define ARP2CTL 0x00 2972908d778SJames Bottomley 2982908d778SJames Bottomley #define FRCSCRPERR 0x00040000 2992908d778SJames Bottomley #define FRCARP2PERR 0x00020000 3002908d778SJames Bottomley #define FRCARP2ILLOPC 0x00010000 3012908d778SJames Bottomley #define ENWAITTO 0x00008000 3022908d778SJames Bottomley #define PERRORDIS 0x00004000 3032908d778SJames Bottomley #define FAILDIS 0x00002000 3042908d778SJames Bottomley #define CIOPERRDIS 0x00001000 3052908d778SJames Bottomley #define BREAKEN3 0x00000800 3062908d778SJames Bottomley #define BREAKEN2 0x00000400 3072908d778SJames Bottomley #define BREAKEN1 0x00000200 3082908d778SJames Bottomley #define BREAKEN0 0x00000100 3092908d778SJames Bottomley #define EPAUSE 0x00000008 3102908d778SJames Bottomley #define PAUSED 0x00000004 /* ro */ 3112908d778SJames Bottomley #define STEP 0x00000002 3122908d778SJames Bottomley #define ARP2RESET 0x00000001 /* wo */ 3132908d778SJames Bottomley 3142908d778SJames Bottomley #define ARP2INT 0x04 3152908d778SJames Bottomley 3162908d778SJames Bottomley #define HALTCODE_MASK 0x00FF0000 /* ro */ 3172908d778SJames Bottomley #define ARP2WAITTO 0x00000100 3182908d778SJames Bottomley #define ARP2HALTC 0x00000080 3192908d778SJames Bottomley #define ARP2ILLOPC 0x00000040 3202908d778SJames Bottomley #define ARP2PERR 0x00000020 3212908d778SJames Bottomley #define ARP2CIOPERR 0x00000010 3222908d778SJames Bottomley #define ARP2BREAK3 0x00000008 3232908d778SJames Bottomley #define ARP2BREAK2 0x00000004 3242908d778SJames Bottomley #define ARP2BREAK1 0x00000002 3252908d778SJames Bottomley #define ARP2BREAK0 0x00000001 3262908d778SJames Bottomley 3272908d778SJames Bottomley #define ARP2INTEN 0x08 3282908d778SJames Bottomley 3292908d778SJames Bottomley #define EN_ARP2WAITTO 0x00000100 3302908d778SJames Bottomley #define EN_ARP2HALTC 0x00000080 3312908d778SJames Bottomley #define EN_ARP2ILLOPC 0x00000040 3322908d778SJames Bottomley #define EN_ARP2PERR 0x00000020 3332908d778SJames Bottomley #define EN_ARP2CIOPERR 0x00000010 3342908d778SJames Bottomley #define EN_ARP2BREAK3 0x00000008 3352908d778SJames Bottomley #define EN_ARP2BREAK2 0x00000004 3362908d778SJames Bottomley #define EN_ARP2BREAK1 0x00000002 3372908d778SJames Bottomley #define EN_ARP2BREAK0 0x00000001 3382908d778SJames Bottomley 3392908d778SJames Bottomley #define ARP2BREAKADR01 0x0C 3402908d778SJames Bottomley 3412908d778SJames Bottomley #define BREAKADR1_MASK 0x0FFF0000 3422908d778SJames Bottomley #define BREAKADR0_MASK 0x00000FFF 3432908d778SJames Bottomley 3442908d778SJames Bottomley #define ARP2BREAKADR23 0x10 3452908d778SJames Bottomley 3462908d778SJames Bottomley #define BREAKADR3_MASK 0x0FFF0000 3472908d778SJames Bottomley #define BREAKADR2_MASK 0x00000FFF 3482908d778SJames Bottomley 3492908d778SJames Bottomley /* 0x14h - 0x1Ch are reserved */ 3502908d778SJames Bottomley 3512908d778SJames Bottomley /* 3522908d778SJames Bottomley * ARP2 Registers, Address Range : (0x00-0x1F) 3532908d778SJames Bottomley * The definitions have the same address offset for CSEQ and LmSEQ 3542908d778SJames Bottomley * CIO Bus Registers. 3552908d778SJames Bottomley */ 3562908d778SJames Bottomley #define MODEPTR 0x00 3572908d778SJames Bottomley 3582908d778SJames Bottomley #define DSTMODE 0xF0 3592908d778SJames Bottomley #define SRCMODE 0x0F 3602908d778SJames Bottomley 3612908d778SJames Bottomley #define ALTMODE 0x01 3622908d778SJames Bottomley 3632908d778SJames Bottomley #define ALTDMODE 0xF0 3642908d778SJames Bottomley #define ALTSMODE 0x0F 3652908d778SJames Bottomley 3662908d778SJames Bottomley #define ATOMICXCHG 0x02 3672908d778SJames Bottomley 3682908d778SJames Bottomley #define FLAG 0x04 3692908d778SJames Bottomley 3702908d778SJames Bottomley #define INTCODE_MASK 0xF0 3712908d778SJames Bottomley #define ALTMODEV2 0x04 3722908d778SJames Bottomley #define CARRY_INT 0x02 3732908d778SJames Bottomley #define CARRY 0x01 3742908d778SJames Bottomley 3752908d778SJames Bottomley #define ARP2INTCTL 0x05 3762908d778SJames Bottomley 3772908d778SJames Bottomley #define PAUSEDIS 0x80 3782908d778SJames Bottomley #define RSTINTCTL 0x40 3792908d778SJames Bottomley #define POPALTMODE 0x08 3802908d778SJames Bottomley #define ALTMODEV 0x04 3812908d778SJames Bottomley #define INTMASK 0x02 3822908d778SJames Bottomley #define IRET 0x01 3832908d778SJames Bottomley 3842908d778SJames Bottomley #define STACK 0x06 3852908d778SJames Bottomley 3862908d778SJames Bottomley #define FUNCTION1 0x07 3872908d778SJames Bottomley 3882908d778SJames Bottomley #define PRGMCNT 0x08 3892908d778SJames Bottomley 3902908d778SJames Bottomley #define ACCUM 0x0A 3912908d778SJames Bottomley 3922908d778SJames Bottomley #define SINDEX 0x0C 3932908d778SJames Bottomley 3942908d778SJames Bottomley #define DINDEX 0x0E 3952908d778SJames Bottomley 3962908d778SJames Bottomley #define ALLONES 0x10 3972908d778SJames Bottomley 3982908d778SJames Bottomley #define ALLZEROS 0x11 3992908d778SJames Bottomley 4002908d778SJames Bottomley #define SINDIR 0x12 4012908d778SJames Bottomley 4022908d778SJames Bottomley #define DINDIR 0x13 4032908d778SJames Bottomley 4042908d778SJames Bottomley #define JUMLDIR 0x14 4052908d778SJames Bottomley 4062908d778SJames Bottomley #define ARP2HALTCODE 0x15 4072908d778SJames Bottomley 4082908d778SJames Bottomley #define CURRADDR 0x16 4092908d778SJames Bottomley 4102908d778SJames Bottomley #define LASTADDR 0x18 4112908d778SJames Bottomley 4122908d778SJames Bottomley #define NXTLADDR 0x1A 4132908d778SJames Bottomley 4142908d778SJames Bottomley #define DBGPORTPTR 0x1C 4152908d778SJames Bottomley 4162908d778SJames Bottomley #define DBGPORT 0x1D 4172908d778SJames Bottomley 4182908d778SJames Bottomley /* 4192908d778SJames Bottomley * CIO Registers. 4202908d778SJames Bottomley * The definitions have the same address offset for CSEQ and LmSEQ 4212908d778SJames Bottomley * CIO Bus Registers. 4222908d778SJames Bottomley */ 4232908d778SJames Bottomley #define MnSCBPTR 0x20 4242908d778SJames Bottomley 4252908d778SJames Bottomley #define MnDDBPTR 0x22 4262908d778SJames Bottomley 4272908d778SJames Bottomley #define SCRATCHPAGE 0x24 4282908d778SJames Bottomley 4292908d778SJames Bottomley #define MnSCRATCHPAGE 0x25 4302908d778SJames Bottomley 4312908d778SJames Bottomley #define SCRATCHPAGESV 0x26 4322908d778SJames Bottomley 4332908d778SJames Bottomley #define MnSCRATCHPAGESV 0x27 4342908d778SJames Bottomley 4352908d778SJames Bottomley #define MnDMAERRS 0x46 4362908d778SJames Bottomley 4372908d778SJames Bottomley #define MnSGDMAERRS 0x47 4382908d778SJames Bottomley 4392908d778SJames Bottomley #define MnSGBUF 0x53 4402908d778SJames Bottomley 4412908d778SJames Bottomley #define MnSGDMASTAT 0x5b 4422908d778SJames Bottomley 4432908d778SJames Bottomley #define MnDDMACTL 0x5c /* RAZOR.rspec.fm rev 1.5 is wrong */ 4442908d778SJames Bottomley 4452908d778SJames Bottomley #define MnDDMASTAT 0x5d /* RAZOR.rspec.fm rev 1.5 is wrong */ 4462908d778SJames Bottomley 4472908d778SJames Bottomley #define MnDDMAMODE 0x5e /* RAZOR.rspec.fm rev 1.5 is wrong */ 4482908d778SJames Bottomley 4492908d778SJames Bottomley #define MnDMAENG 0x60 4502908d778SJames Bottomley 4512908d778SJames Bottomley #define MnPIPECTL 0x61 4522908d778SJames Bottomley 4532908d778SJames Bottomley #define MnSGBADR 0x65 4542908d778SJames Bottomley 4552908d778SJames Bottomley #define MnSCB_SITE 0x100 4562908d778SJames Bottomley 4572908d778SJames Bottomley #define MnDDB_SITE 0x180 4582908d778SJames Bottomley 4592908d778SJames Bottomley /* 4602908d778SJames Bottomley * The common definitions below have the same address offset for both 4612908d778SJames Bottomley * CSEQ and LmSEQ. 4622908d778SJames Bottomley */ 4632908d778SJames Bottomley #define BISTCTL0 0x4C 4642908d778SJames Bottomley 4652908d778SJames Bottomley #define BISTCTL1 0x50 4662908d778SJames Bottomley 4672908d778SJames Bottomley #define MAPPEDSCR 0x800 4682908d778SJames Bottomley 4692908d778SJames Bottomley /* 4702908d778SJames Bottomley * CSEQ Host Register, Address Range : (0x000-0xFFC) 4712908d778SJames Bottomley */ 4722908d778SJames Bottomley #define CSEQ_HOST_REG_BASE_ADR 0xB8001000 4732908d778SJames Bottomley 4742908d778SJames Bottomley #define CARP2CTL (CSEQ_HOST_REG_BASE_ADR + ARP2CTL) 4752908d778SJames Bottomley 4762908d778SJames Bottomley #define CARP2INT (CSEQ_HOST_REG_BASE_ADR + ARP2INT) 4772908d778SJames Bottomley 4782908d778SJames Bottomley #define CARP2INTEN (CSEQ_HOST_REG_BASE_ADR + ARP2INTEN) 4792908d778SJames Bottomley 4802908d778SJames Bottomley #define CARP2BREAKADR01 (CSEQ_HOST_REG_BASE_ADR+ARP2BREAKADR01) 4812908d778SJames Bottomley 4822908d778SJames Bottomley #define CARP2BREAKADR23 (CSEQ_HOST_REG_BASE_ADR+ARP2BREAKADR23) 4832908d778SJames Bottomley 4842908d778SJames Bottomley #define CBISTCTL (CSEQ_HOST_REG_BASE_ADR + BISTCTL1) 4852908d778SJames Bottomley 4862908d778SJames Bottomley #define CSEQRAMBISTEN 0x00000040 4872908d778SJames Bottomley #define CSEQRAMBISTDN 0x00000020 /* ro */ 4882908d778SJames Bottomley #define CSEQRAMBISTFAIL 0x00000010 /* ro */ 4892908d778SJames Bottomley #define CSEQSCRBISTEN 0x00000004 4902908d778SJames Bottomley #define CSEQSCRBISTDN 0x00000002 /* ro */ 4912908d778SJames Bottomley #define CSEQSCRBISTFAIL 0x00000001 /* ro */ 4922908d778SJames Bottomley 4932908d778SJames Bottomley #define CMAPPEDSCR (CSEQ_HOST_REG_BASE_ADR + MAPPEDSCR) 4942908d778SJames Bottomley 4952908d778SJames Bottomley /* 4962908d778SJames Bottomley * CSEQ CIO Bus Registers, Address Range : (0x0000-0x1FFC) 4972908d778SJames Bottomley * 16 modes, each mode is 512 bytes. 4982908d778SJames Bottomley * Unless specified, the register should valid for all modes. 4992908d778SJames Bottomley */ 5002908d778SJames Bottomley #define CSEQ_CIO_REG_BASE_ADR REG_BASE_ADDR_CSEQCIO 5012908d778SJames Bottomley 5022908d778SJames Bottomley #define CSEQm_CIO_REG(Mode, Reg) \ 5032908d778SJames Bottomley (CSEQ_CIO_REG_BASE_ADR + \ 5042908d778SJames Bottomley ((u32) (Mode) * CSEQ_MODE_PAGE_SIZE) + (u32) (Reg)) 5052908d778SJames Bottomley 5062908d778SJames Bottomley #define CMODEPTR (CSEQ_CIO_REG_BASE_ADR + MODEPTR) 5072908d778SJames Bottomley 5082908d778SJames Bottomley #define CALTMODE (CSEQ_CIO_REG_BASE_ADR + ALTMODE) 5092908d778SJames Bottomley 5102908d778SJames Bottomley #define CATOMICXCHG (CSEQ_CIO_REG_BASE_ADR + ATOMICXCHG) 5112908d778SJames Bottomley 5122908d778SJames Bottomley #define CFLAG (CSEQ_CIO_REG_BASE_ADR + FLAG) 5132908d778SJames Bottomley 5142908d778SJames Bottomley #define CARP2INTCTL (CSEQ_CIO_REG_BASE_ADR + ARP2INTCTL) 5152908d778SJames Bottomley 5162908d778SJames Bottomley #define CSTACK (CSEQ_CIO_REG_BASE_ADR + STACK) 5172908d778SJames Bottomley 5182908d778SJames Bottomley #define CFUNCTION1 (CSEQ_CIO_REG_BASE_ADR + FUNCTION1) 5192908d778SJames Bottomley 5202908d778SJames Bottomley #define CPRGMCNT (CSEQ_CIO_REG_BASE_ADR + PRGMCNT) 5212908d778SJames Bottomley 5222908d778SJames Bottomley #define CACCUM (CSEQ_CIO_REG_BASE_ADR + ACCUM) 5232908d778SJames Bottomley 5242908d778SJames Bottomley #define CSINDEX (CSEQ_CIO_REG_BASE_ADR + SINDEX) 5252908d778SJames Bottomley 5262908d778SJames Bottomley #define CDINDEX (CSEQ_CIO_REG_BASE_ADR + DINDEX) 5272908d778SJames Bottomley 5282908d778SJames Bottomley #define CALLONES (CSEQ_CIO_REG_BASE_ADR + ALLONES) 5292908d778SJames Bottomley 5302908d778SJames Bottomley #define CALLZEROS (CSEQ_CIO_REG_BASE_ADR + ALLZEROS) 5312908d778SJames Bottomley 5322908d778SJames Bottomley #define CSINDIR (CSEQ_CIO_REG_BASE_ADR + SINDIR) 5332908d778SJames Bottomley 5342908d778SJames Bottomley #define CDINDIR (CSEQ_CIO_REG_BASE_ADR + DINDIR) 5352908d778SJames Bottomley 5362908d778SJames Bottomley #define CJUMLDIR (CSEQ_CIO_REG_BASE_ADR + JUMLDIR) 5372908d778SJames Bottomley 5382908d778SJames Bottomley #define CARP2HALTCODE (CSEQ_CIO_REG_BASE_ADR + ARP2HALTCODE) 5392908d778SJames Bottomley 5402908d778SJames Bottomley #define CCURRADDR (CSEQ_CIO_REG_BASE_ADR + CURRADDR) 5412908d778SJames Bottomley 5422908d778SJames Bottomley #define CLASTADDR (CSEQ_CIO_REG_BASE_ADR + LASTADDR) 5432908d778SJames Bottomley 5442908d778SJames Bottomley #define CNXTLADDR (CSEQ_CIO_REG_BASE_ADR + NXTLADDR) 5452908d778SJames Bottomley 5462908d778SJames Bottomley #define CDBGPORTPTR (CSEQ_CIO_REG_BASE_ADR + DBGPORTPTR) 5472908d778SJames Bottomley 5482908d778SJames Bottomley #define CDBGPORT (CSEQ_CIO_REG_BASE_ADR + DBGPORT) 5492908d778SJames Bottomley 5502908d778SJames Bottomley #define CSCRATCHPAGE (CSEQ_CIO_REG_BASE_ADR + SCRATCHPAGE) 5512908d778SJames Bottomley 5522908d778SJames Bottomley #define CMnSCBPTR(Mode) CSEQm_CIO_REG(Mode, MnSCBPTR) 5532908d778SJames Bottomley 5542908d778SJames Bottomley #define CMnDDBPTR(Mode) CSEQm_CIO_REG(Mode, MnDDBPTR) 5552908d778SJames Bottomley 5562908d778SJames Bottomley #define CMnSCRATCHPAGE(Mode) CSEQm_CIO_REG(Mode, MnSCRATCHPAGE) 5572908d778SJames Bottomley 5582908d778SJames Bottomley #define CLINKCON (CSEQ_CIO_REG_BASE_ADR + 0x28) 5592908d778SJames Bottomley 5602908d778SJames Bottomley #define CCIOAACESS (CSEQ_CIO_REG_BASE_ADR + 0x2C) 5612908d778SJames Bottomley 5622908d778SJames Bottomley /* mode 0-7 */ 5632908d778SJames Bottomley #define MnREQMBX 0x30 5642908d778SJames Bottomley #define CMnREQMBX(Mode) CSEQm_CIO_REG(Mode, 0x30) 5652908d778SJames Bottomley 5662908d778SJames Bottomley /* mode 8 */ 5672908d778SJames Bottomley #define CSEQCON CSEQm_CIO_REG(8, 0x30) 5682908d778SJames Bottomley 5692908d778SJames Bottomley /* mode 0-7 */ 5702908d778SJames Bottomley #define MnRSPMBX 0x34 5712908d778SJames Bottomley #define CMnRSPMBX(Mode) CSEQm_CIO_REG(Mode, 0x34) 5722908d778SJames Bottomley 5732908d778SJames Bottomley /* mode 8 */ 5742908d778SJames Bottomley #define CSEQCOMCTL CSEQm_CIO_REG(8, 0x34) 5752908d778SJames Bottomley 5762908d778SJames Bottomley /* mode 8 */ 5772908d778SJames Bottomley #define CSEQCOMSTAT CSEQm_CIO_REG(8, 0x35) 5782908d778SJames Bottomley 5792908d778SJames Bottomley /* mode 8 */ 5802908d778SJames Bottomley #define CSEQCOMINTEN CSEQm_CIO_REG(8, 0x36) 5812908d778SJames Bottomley 5822908d778SJames Bottomley /* mode 8 */ 5832908d778SJames Bottomley #define CSEQCOMDMACTL CSEQm_CIO_REG(8, 0x37) 5842908d778SJames Bottomley 5852908d778SJames Bottomley #define CSHALTERR 0x10 5862908d778SJames Bottomley #define RESETCSDMA 0x08 /* wo */ 5872908d778SJames Bottomley #define STARTCSDMA 0x04 5882908d778SJames Bottomley #define STOPCSDMA 0x02 /* wo */ 5892908d778SJames Bottomley #define CSDMAACT 0x01 /* ro */ 5902908d778SJames Bottomley 5912908d778SJames Bottomley /* mode 0-7 */ 5922908d778SJames Bottomley #define MnINT 0x38 5932908d778SJames Bottomley #define CMnINT(Mode) CSEQm_CIO_REG(Mode, 0x38) 5942908d778SJames Bottomley 5952908d778SJames Bottomley #define CMnREQMBXE 0x02 5962908d778SJames Bottomley #define CMnRSPMBXF 0x01 5972908d778SJames Bottomley #define CMnINT_MASK 0x00000003 5982908d778SJames Bottomley 5992908d778SJames Bottomley /* mode 8 */ 6002908d778SJames Bottomley #define CSEQREQMBX CSEQm_CIO_REG(8, 0x38) 6012908d778SJames Bottomley 6022908d778SJames Bottomley /* mode 0-7 */ 6032908d778SJames Bottomley #define MnINTEN 0x3C 6042908d778SJames Bottomley #define CMnINTEN(Mode) CSEQm_CIO_REG(Mode, 0x3C) 6052908d778SJames Bottomley 6062908d778SJames Bottomley #define EN_CMnRSPMBXF 0x01 6072908d778SJames Bottomley 6082908d778SJames Bottomley /* mode 8 */ 6092908d778SJames Bottomley #define CSEQRSPMBX CSEQm_CIO_REG(8, 0x3C) 6102908d778SJames Bottomley 6112908d778SJames Bottomley /* mode 8 */ 6122908d778SJames Bottomley #define CSDMAADR CSEQm_CIO_REG(8, 0x40) 6132908d778SJames Bottomley 6142908d778SJames Bottomley /* mode 8 */ 6152908d778SJames Bottomley #define CSDMACNT CSEQm_CIO_REG(8, 0x48) 6162908d778SJames Bottomley 6172908d778SJames Bottomley /* mode 8 */ 6182908d778SJames Bottomley #define CSEQDLCTL CSEQm_CIO_REG(8, 0x4D) 6192908d778SJames Bottomley 6202908d778SJames Bottomley #define DONELISTEND 0x10 6212908d778SJames Bottomley #define DONELISTSIZE_MASK 0x0F 6222908d778SJames Bottomley #define DONELISTSIZE_8ELEM 0x01 6232908d778SJames Bottomley #define DONELISTSIZE_16ELEM 0x02 6242908d778SJames Bottomley #define DONELISTSIZE_32ELEM 0x03 6252908d778SJames Bottomley #define DONELISTSIZE_64ELEM 0x04 6262908d778SJames Bottomley #define DONELISTSIZE_128ELEM 0x05 6272908d778SJames Bottomley #define DONELISTSIZE_256ELEM 0x06 6282908d778SJames Bottomley #define DONELISTSIZE_512ELEM 0x07 6292908d778SJames Bottomley #define DONELISTSIZE_1024ELEM 0x08 6302908d778SJames Bottomley #define DONELISTSIZE_2048ELEM 0x09 6312908d778SJames Bottomley #define DONELISTSIZE_4096ELEM 0x0A 6322908d778SJames Bottomley #define DONELISTSIZE_8192ELEM 0x0B 6332908d778SJames Bottomley #define DONELISTSIZE_16384ELEM 0x0C 6342908d778SJames Bottomley 6352908d778SJames Bottomley /* mode 8 */ 6362908d778SJames Bottomley #define CSEQDLOFFS CSEQm_CIO_REG(8, 0x4E) 6372908d778SJames Bottomley 6382908d778SJames Bottomley /* mode 11 */ 6392908d778SJames Bottomley #define CM11INTVEC0 CSEQm_CIO_REG(11, 0x50) 6402908d778SJames Bottomley 6412908d778SJames Bottomley /* mode 11 */ 6422908d778SJames Bottomley #define CM11INTVEC1 CSEQm_CIO_REG(11, 0x52) 6432908d778SJames Bottomley 6442908d778SJames Bottomley /* mode 11 */ 6452908d778SJames Bottomley #define CM11INTVEC2 CSEQm_CIO_REG(11, 0x54) 6462908d778SJames Bottomley 6472908d778SJames Bottomley #define CCONMSK (CSEQ_CIO_REG_BASE_ADR + 0x60) 6482908d778SJames Bottomley 6492908d778SJames Bottomley #define CCONEXIST (CSEQ_CIO_REG_BASE_ADR + 0x61) 6502908d778SJames Bottomley 6512908d778SJames Bottomley #define CCONMODE (CSEQ_CIO_REG_BASE_ADR + 0x62) 6522908d778SJames Bottomley 6532908d778SJames Bottomley #define CTIMERCALC (CSEQ_CIO_REG_BASE_ADR + 0x64) 6542908d778SJames Bottomley 6552908d778SJames Bottomley #define CINTDIS (CSEQ_CIO_REG_BASE_ADR + 0x68) 6562908d778SJames Bottomley 6572908d778SJames Bottomley /* mode 8, 32x32 bits, 128 bytes of mapped buffer */ 6582908d778SJames Bottomley #define CSBUFFER CSEQm_CIO_REG(8, 0x80) 6592908d778SJames Bottomley 6602908d778SJames Bottomley #define CSCRATCH (CSEQ_CIO_REG_BASE_ADR + 0x1C0) 6612908d778SJames Bottomley 6622908d778SJames Bottomley /* mode 0-8 */ 6632908d778SJames Bottomley #define CMnSCRATCH(Mode) CSEQm_CIO_REG(Mode, 0x1E0) 6642908d778SJames Bottomley 6652908d778SJames Bottomley /* 6662908d778SJames Bottomley * CSEQ Mapped Instruction RAM Page, Address Range : (0x0000-0x1FFC) 6672908d778SJames Bottomley */ 6682908d778SJames Bottomley #define CSEQ_RAM_REG_BASE_ADR 0xB8004000 6692908d778SJames Bottomley 6702908d778SJames Bottomley /* 6712908d778SJames Bottomley * The common definitions below have the same address offset for all the Link 6722908d778SJames Bottomley * sequencers. 6732908d778SJames Bottomley */ 6742908d778SJames Bottomley #define MODECTL 0x40 6752908d778SJames Bottomley 6762908d778SJames Bottomley #define DBGMODE 0x44 6772908d778SJames Bottomley 6782908d778SJames Bottomley #define CONTROL 0x48 6792908d778SJames Bottomley #define LEDTIMER 0x00010000 6802908d778SJames Bottomley #define LEDTIMERS_10us 0x00000000 6812908d778SJames Bottomley #define LEDTIMERS_1ms 0x00000800 6822908d778SJames Bottomley #define LEDTIMERS_100ms 0x00001000 6832908d778SJames Bottomley #define LEDMODE_TXRX 0x00000000 6842908d778SJames Bottomley #define LEDMODE_CONNECTED 0x00000200 6852908d778SJames Bottomley #define LEDPOL 0x00000100 6862908d778SJames Bottomley 6872908d778SJames Bottomley #define LSEQRAM 0x1000 6882908d778SJames Bottomley 6892908d778SJames Bottomley /* 6902908d778SJames Bottomley * LmSEQ Host Registers, Address Range : (0x0000-0x3FFC) 6912908d778SJames Bottomley */ 6922908d778SJames Bottomley #define LSEQ0_HOST_REG_BASE_ADR 0xB8020000 6932908d778SJames Bottomley #define LSEQ1_HOST_REG_BASE_ADR 0xB8024000 6942908d778SJames Bottomley #define LSEQ2_HOST_REG_BASE_ADR 0xB8028000 6952908d778SJames Bottomley #define LSEQ3_HOST_REG_BASE_ADR 0xB802C000 6962908d778SJames Bottomley #define LSEQ4_HOST_REG_BASE_ADR 0xB8030000 6972908d778SJames Bottomley #define LSEQ5_HOST_REG_BASE_ADR 0xB8034000 6982908d778SJames Bottomley #define LSEQ6_HOST_REG_BASE_ADR 0xB8038000 6992908d778SJames Bottomley #define LSEQ7_HOST_REG_BASE_ADR 0xB803C000 7002908d778SJames Bottomley 7012908d778SJames Bottomley #define LmARP2CTL(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7022908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7032908d778SJames Bottomley ARP2CTL) 7042908d778SJames Bottomley 7052908d778SJames Bottomley #define LmARP2INT(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7062908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7072908d778SJames Bottomley ARP2INT) 7082908d778SJames Bottomley 7092908d778SJames Bottomley #define LmARP2INTEN(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7102908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7112908d778SJames Bottomley ARP2INTEN) 7122908d778SJames Bottomley 7132908d778SJames Bottomley #define LmDBGMODE(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7142908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7152908d778SJames Bottomley DBGMODE) 7162908d778SJames Bottomley 7172908d778SJames Bottomley #define LmCONTROL(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7182908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7192908d778SJames Bottomley CONTROL) 7202908d778SJames Bottomley 7212908d778SJames Bottomley #define LmARP2BREAKADR01(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7222908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7232908d778SJames Bottomley ARP2BREAKADR01) 7242908d778SJames Bottomley 7252908d778SJames Bottomley #define LmARP2BREAKADR23(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7262908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7272908d778SJames Bottomley ARP2BREAKADR23) 7282908d778SJames Bottomley 7292908d778SJames Bottomley #define LmMODECTL(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7302908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7312908d778SJames Bottomley MODECTL) 7322908d778SJames Bottomley 7332908d778SJames Bottomley #define LmAUTODISCI 0x08000000 7342908d778SJames Bottomley #define LmDSBLBITLT 0x04000000 7352908d778SJames Bottomley #define LmDSBLANTT 0x02000000 7362908d778SJames Bottomley #define LmDSBLCRTT 0x01000000 7372908d778SJames Bottomley #define LmDSBLCONT 0x00000100 7382908d778SJames Bottomley #define LmPRIMODE 0x00000080 7392908d778SJames Bottomley #define LmDSBLHOLD 0x00000040 7402908d778SJames Bottomley #define LmDISACK 0x00000020 7412908d778SJames Bottomley #define LmBLIND48 0x00000010 7422908d778SJames Bottomley #define LmRCVMODE_MASK 0x0000000C 7432908d778SJames Bottomley #define LmRCVMODE_PLD 0x00000000 7442908d778SJames Bottomley #define LmRCVMODE_HPC 0x00000004 7452908d778SJames Bottomley 7462908d778SJames Bottomley #define LmDBGMODE(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7472908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7482908d778SJames Bottomley DBGMODE) 7492908d778SJames Bottomley 7502908d778SJames Bottomley #define LmFRCPERR 0x80000000 7512908d778SJames Bottomley #define LmMEMSEL_MASK 0x30000000 7522908d778SJames Bottomley #define LmFRCRBPERR 0x00000000 7532908d778SJames Bottomley #define LmFRCTBPERR 0x10000000 7542908d778SJames Bottomley #define LmFRCSGBPERR 0x20000000 7552908d778SJames Bottomley #define LmFRCARBPERR 0x30000000 7562908d778SJames Bottomley #define LmRCVIDW 0x00080000 7572908d778SJames Bottomley #define LmINVDWERR 0x00040000 7582908d778SJames Bottomley #define LmRCVDISP 0x00004000 7592908d778SJames Bottomley #define LmDISPERR 0x00002000 7602908d778SJames Bottomley #define LmDSBLDSCR 0x00000800 7612908d778SJames Bottomley #define LmDSBLSCR 0x00000400 7622908d778SJames Bottomley #define LmFRCNAK 0x00000200 7632908d778SJames Bottomley #define LmFRCROFS 0x00000100 7642908d778SJames Bottomley #define LmFRCCRC 0x00000080 7652908d778SJames Bottomley #define LmFRMTYPE_MASK 0x00000070 7662908d778SJames Bottomley #define LmSG_DATA 0x00000000 7672908d778SJames Bottomley #define LmSG_COMMAND 0x00000010 7682908d778SJames Bottomley #define LmSG_TASK 0x00000020 7692908d778SJames Bottomley #define LmSG_TGTXFER 0x00000030 7702908d778SJames Bottomley #define LmSG_RESPONSE 0x00000040 7712908d778SJames Bottomley #define LmSG_IDENADDR 0x00000050 7722908d778SJames Bottomley #define LmSG_OPENADDR 0x00000060 7732908d778SJames Bottomley #define LmDISCRCGEN 0x00000008 7742908d778SJames Bottomley #define LmDISCRCCHK 0x00000004 7752908d778SJames Bottomley #define LmSSXMTFRM 0x00000002 7762908d778SJames Bottomley #define LmSSRCVFRM 0x00000001 7772908d778SJames Bottomley 7782908d778SJames Bottomley #define LmCONTROL(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7792908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7802908d778SJames Bottomley CONTROL) 7812908d778SJames Bottomley 7822908d778SJames Bottomley #define LmSTEPXMTFRM 0x00000002 7832908d778SJames Bottomley #define LmSTEPRCVFRM 0x00000001 7842908d778SJames Bottomley 7852908d778SJames Bottomley #define LmBISTCTL0(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 7862908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) + \ 7872908d778SJames Bottomley BISTCTL0) 7882908d778SJames Bottomley 7892908d778SJames Bottomley #define ARBBISTEN 0x40000000 7902908d778SJames Bottomley #define ARBBISTDN 0x20000000 /* ro */ 7912908d778SJames Bottomley #define ARBBISTFAIL 0x10000000 /* ro */ 7922908d778SJames Bottomley #define TBBISTEN 0x00000400 7932908d778SJames Bottomley #define TBBISTDN 0x00000200 /* ro */ 7942908d778SJames Bottomley #define TBBISTFAIL 0x00000100 /* ro */ 7952908d778SJames Bottomley #define RBBISTEN 0x00000040 7962908d778SJames Bottomley #define RBBISTDN 0x00000020 /* ro */ 7972908d778SJames Bottomley #define RBBISTFAIL 0x00000010 /* ro */ 7982908d778SJames Bottomley #define SGBISTEN 0x00000004 7992908d778SJames Bottomley #define SGBISTDN 0x00000002 /* ro */ 8002908d778SJames Bottomley #define SGBISTFAIL 0x00000001 /* ro */ 8012908d778SJames Bottomley 8022908d778SJames Bottomley #define LmBISTCTL1(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 8032908d778SJames Bottomley ((LinkNum)*LmSEQ_HOST_REG_SIZE) +\ 8042908d778SJames Bottomley BISTCTL1) 8052908d778SJames Bottomley 8062908d778SJames Bottomley #define LmRAMPAGE1 0x00000200 8072908d778SJames Bottomley #define LmRAMPAGE0 0x00000100 8082908d778SJames Bottomley #define LmIMEMBISTEN 0x00000040 8092908d778SJames Bottomley #define LmIMEMBISTDN 0x00000020 /* ro */ 8102908d778SJames Bottomley #define LmIMEMBISTFAIL 0x00000010 /* ro */ 8112908d778SJames Bottomley #define LmSCRBISTEN 0x00000004 8122908d778SJames Bottomley #define LmSCRBISTDN 0x00000002 /* ro */ 8132908d778SJames Bottomley #define LmSCRBISTFAIL 0x00000001 /* ro */ 8142908d778SJames Bottomley #define LmRAMPAGE (LmRAMPAGE1 + LmRAMPAGE0) 8152908d778SJames Bottomley #define LmRAMPAGE_LSHIFT 0x8 8162908d778SJames Bottomley 8172908d778SJames Bottomley #define LmSCRATCH(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 8182908d778SJames Bottomley ((LinkNum) * LmSEQ_HOST_REG_SIZE) +\ 8192908d778SJames Bottomley MAPPEDSCR) 8202908d778SJames Bottomley 8212908d778SJames Bottomley #define LmSEQRAM(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \ 8222908d778SJames Bottomley ((LinkNum) * LmSEQ_HOST_REG_SIZE) +\ 8232908d778SJames Bottomley LSEQRAM) 8242908d778SJames Bottomley 8252908d778SJames Bottomley /* 8262908d778SJames Bottomley * LmSEQ CIO Bus Register, Address Range : (0x0000-0xFFC) 8272908d778SJames Bottomley * 8 modes, each mode is 512 bytes. 8282908d778SJames Bottomley * Unless specified, the register should valid for all modes. 8292908d778SJames Bottomley */ 8302908d778SJames Bottomley #define LmSEQ_CIOBUS_REG_BASE 0x2000 8312908d778SJames Bottomley 8322908d778SJames Bottomley #define LmSEQ_PHY_BASE(Mode, LinkNum) \ 8332908d778SJames Bottomley (LSEQ0_HOST_REG_BASE_ADR + \ 8342908d778SJames Bottomley (LmSEQ_HOST_REG_SIZE * (u32) (LinkNum)) + \ 8352908d778SJames Bottomley LmSEQ_CIOBUS_REG_BASE + \ 8362908d778SJames Bottomley ((u32) (Mode) * LmSEQ_MODE_PAGE_SIZE)) 8372908d778SJames Bottomley 8382908d778SJames Bottomley #define LmSEQ_PHY_REG(Mode, LinkNum, Reg) \ 8392908d778SJames Bottomley (LmSEQ_PHY_BASE(Mode, LinkNum) + (u32) (Reg)) 8402908d778SJames Bottomley 8412908d778SJames Bottomley #define LmMODEPTR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, MODEPTR) 8422908d778SJames Bottomley 8432908d778SJames Bottomley #define LmALTMODE(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ALTMODE) 8442908d778SJames Bottomley 8452908d778SJames Bottomley #define LmATOMICXCHG(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ATOMICXCHG) 8462908d778SJames Bottomley 8472908d778SJames Bottomley #define LmFLAG(LinkNum) LmSEQ_PHY_REG(0, LinkNum, FLAG) 8482908d778SJames Bottomley 8492908d778SJames Bottomley #define LmARP2INTCTL(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ARP2INTCTL) 8502908d778SJames Bottomley 8512908d778SJames Bottomley #define LmSTACK(LinkNum) LmSEQ_PHY_REG(0, LinkNum, STACK) 8522908d778SJames Bottomley 8532908d778SJames Bottomley #define LmFUNCTION1(LinkNum) LmSEQ_PHY_REG(0, LinkNum, FUNCTION1) 8542908d778SJames Bottomley 8552908d778SJames Bottomley #define LmPRGMCNT(LinkNum) LmSEQ_PHY_REG(0, LinkNum, PRGMCNT) 8562908d778SJames Bottomley 8572908d778SJames Bottomley #define LmACCUM(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ACCUM) 8582908d778SJames Bottomley 8592908d778SJames Bottomley #define LmSINDEX(LinkNum) LmSEQ_PHY_REG(0, LinkNum, SINDEX) 8602908d778SJames Bottomley 8612908d778SJames Bottomley #define LmDINDEX(LinkNum) LmSEQ_PHY_REG(0, LinkNum, DINDEX) 8622908d778SJames Bottomley 8632908d778SJames Bottomley #define LmALLONES(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ALLONES) 8642908d778SJames Bottomley 8652908d778SJames Bottomley #define LmALLZEROS(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ALLZEROS) 8662908d778SJames Bottomley 8672908d778SJames Bottomley #define LmSINDIR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, SINDIR) 8682908d778SJames Bottomley 8692908d778SJames Bottomley #define LmDINDIR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, DINDIR) 8702908d778SJames Bottomley 8712908d778SJames Bottomley #define LmJUMLDIR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, JUMLDIR) 8722908d778SJames Bottomley 8732908d778SJames Bottomley #define LmARP2HALTCODE(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ARP2HALTCODE) 8742908d778SJames Bottomley 8752908d778SJames Bottomley #define LmCURRADDR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, CURRADDR) 8762908d778SJames Bottomley 8772908d778SJames Bottomley #define LmLASTADDR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, LASTADDR) 8782908d778SJames Bottomley 8792908d778SJames Bottomley #define LmNXTLADDR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, NXTLADDR) 8802908d778SJames Bottomley 8812908d778SJames Bottomley #define LmDBGPORTPTR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, DBGPORTPTR) 8822908d778SJames Bottomley 8832908d778SJames Bottomley #define LmDBGPORT(LinkNum) LmSEQ_PHY_REG(0, LinkNum, DBGPORT) 8842908d778SJames Bottomley 8852908d778SJames Bottomley #define LmSCRATCHPAGE(LinkNum) LmSEQ_PHY_REG(0, LinkNum, SCRATCHPAGE) 8862908d778SJames Bottomley 8872908d778SJames Bottomley #define LmMnSCRATCHPAGE(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, \ 8882908d778SJames Bottomley MnSCRATCHPAGE) 8892908d778SJames Bottomley 8902908d778SJames Bottomley #define LmTIMERCALC(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x28) 8912908d778SJames Bottomley 8922908d778SJames Bottomley #define LmREQMBX(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x30) 8932908d778SJames Bottomley 8942908d778SJames Bottomley #define LmRSPMBX(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x34) 8952908d778SJames Bottomley 8962908d778SJames Bottomley #define LmMnINT(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x38) 8972908d778SJames Bottomley 8982908d778SJames Bottomley #define CTXMEMSIZE 0x80000000 /* ro */ 8992908d778SJames Bottomley #define LmACKREQ 0x08000000 9002908d778SJames Bottomley #define LmNAKREQ 0x04000000 9012908d778SJames Bottomley #define LmMnXMTERR 0x02000000 9022908d778SJames Bottomley #define LmM5OOBSVC 0x01000000 9032908d778SJames Bottomley #define LmHWTINT 0x00800000 9042908d778SJames Bottomley #define LmMnCTXDONE 0x00100000 9052908d778SJames Bottomley #define LmM2REQMBXF 0x00080000 9062908d778SJames Bottomley #define LmM2RSPMBXE 0x00040000 9072908d778SJames Bottomley #define LmMnDMAERR 0x00020000 9082908d778SJames Bottomley #define LmRCVPRIM 0x00010000 9092908d778SJames Bottomley #define LmRCVERR 0x00008000 9102908d778SJames Bottomley #define LmADDRRCV 0x00004000 9112908d778SJames Bottomley #define LmMnHDRMISS 0x00002000 9122908d778SJames Bottomley #define LmMnWAITSCB 0x00001000 9132908d778SJames Bottomley #define LmMnRLSSCB 0x00000800 9142908d778SJames Bottomley #define LmMnSAVECTX 0x00000400 9152908d778SJames Bottomley #define LmMnFETCHSG 0x00000200 9162908d778SJames Bottomley #define LmMnLOADCTX 0x00000100 9172908d778SJames Bottomley #define LmMnCFGICL 0x00000080 9182908d778SJames Bottomley #define LmMnCFGSATA 0x00000040 9192908d778SJames Bottomley #define LmMnCFGEXPSATA 0x00000020 9202908d778SJames Bottomley #define LmMnCFGCMPLT 0x00000010 9212908d778SJames Bottomley #define LmMnCFGRBUF 0x00000008 9222908d778SJames Bottomley #define LmMnSAVETTR 0x00000004 9232908d778SJames Bottomley #define LmMnCFGRDAT 0x00000002 9242908d778SJames Bottomley #define LmMnCFGHDR 0x00000001 9252908d778SJames Bottomley 9262908d778SJames Bottomley #define LmMnINTEN(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x3C) 9272908d778SJames Bottomley 9282908d778SJames Bottomley #define EN_LmACKREQ 0x08000000 9292908d778SJames Bottomley #define EN_LmNAKREQ 0x04000000 9302908d778SJames Bottomley #define EN_LmMnXMTERR 0x02000000 9312908d778SJames Bottomley #define EN_LmM5OOBSVC 0x01000000 9322908d778SJames Bottomley #define EN_LmHWTINT 0x00800000 9332908d778SJames Bottomley #define EN_LmMnCTXDONE 0x00100000 9342908d778SJames Bottomley #define EN_LmM2REQMBXF 0x00080000 9352908d778SJames Bottomley #define EN_LmM2RSPMBXE 0x00040000 9362908d778SJames Bottomley #define EN_LmMnDMAERR 0x00020000 9372908d778SJames Bottomley #define EN_LmRCVPRIM 0x00010000 9382908d778SJames Bottomley #define EN_LmRCVERR 0x00008000 9392908d778SJames Bottomley #define EN_LmADDRRCV 0x00004000 9402908d778SJames Bottomley #define EN_LmMnHDRMISS 0x00002000 9412908d778SJames Bottomley #define EN_LmMnWAITSCB 0x00001000 9422908d778SJames Bottomley #define EN_LmMnRLSSCB 0x00000800 9432908d778SJames Bottomley #define EN_LmMnSAVECTX 0x00000400 9442908d778SJames Bottomley #define EN_LmMnFETCHSG 0x00000200 9452908d778SJames Bottomley #define EN_LmMnLOADCTX 0x00000100 9462908d778SJames Bottomley #define EN_LmMnCFGICL 0x00000080 9472908d778SJames Bottomley #define EN_LmMnCFGSATA 0x00000040 9482908d778SJames Bottomley #define EN_LmMnCFGEXPSATA 0x00000020 9492908d778SJames Bottomley #define EN_LmMnCFGCMPLT 0x00000010 9502908d778SJames Bottomley #define EN_LmMnCFGRBUF 0x00000008 9512908d778SJames Bottomley #define EN_LmMnSAVETTR 0x00000004 9522908d778SJames Bottomley #define EN_LmMnCFGRDAT 0x00000002 9532908d778SJames Bottomley #define EN_LmMnCFGHDR 0x00000001 9542908d778SJames Bottomley 9552908d778SJames Bottomley #define LmM0INTEN_MASK (EN_LmMnCFGCMPLT | EN_LmMnCFGRBUF | \ 9562908d778SJames Bottomley EN_LmMnSAVETTR | EN_LmMnCFGRDAT | \ 9572908d778SJames Bottomley EN_LmMnCFGHDR | EN_LmRCVERR | \ 9582908d778SJames Bottomley EN_LmADDRRCV | EN_LmMnHDRMISS | \ 9592908d778SJames Bottomley EN_LmMnRLSSCB | EN_LmMnSAVECTX | \ 9602908d778SJames Bottomley EN_LmMnFETCHSG | EN_LmMnLOADCTX | \ 9612908d778SJames Bottomley EN_LmHWTINT | EN_LmMnCTXDONE | \ 9622908d778SJames Bottomley EN_LmRCVPRIM | EN_LmMnCFGSATA | \ 9632908d778SJames Bottomley EN_LmMnCFGEXPSATA | EN_LmMnDMAERR) 9642908d778SJames Bottomley 9652908d778SJames Bottomley #define LmM1INTEN_MASK (EN_LmMnCFGCMPLT | EN_LmADDRRCV | \ 9662908d778SJames Bottomley EN_LmMnRLSSCB | EN_LmMnSAVECTX | \ 9672908d778SJames Bottomley EN_LmMnFETCHSG | EN_LmMnLOADCTX | \ 9682908d778SJames Bottomley EN_LmMnXMTERR | EN_LmHWTINT | \ 9692908d778SJames Bottomley EN_LmMnCTXDONE | EN_LmRCVPRIM | \ 9702908d778SJames Bottomley EN_LmRCVERR | EN_LmMnDMAERR) 9712908d778SJames Bottomley 9722908d778SJames Bottomley #define LmM2INTEN_MASK (EN_LmADDRRCV | EN_LmHWTINT | \ 9732908d778SJames Bottomley EN_LmM2REQMBXF | EN_LmRCVPRIM | \ 9742908d778SJames Bottomley EN_LmRCVERR) 9752908d778SJames Bottomley 9762908d778SJames Bottomley #define LmM5INTEN_MASK (EN_LmADDRRCV | EN_LmM5OOBSVC | \ 9772908d778SJames Bottomley EN_LmHWTINT | EN_LmRCVPRIM | \ 9782908d778SJames Bottomley EN_LmRCVERR) 9792908d778SJames Bottomley 9802908d778SJames Bottomley #define LmXMTPRIMD(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x40) 9812908d778SJames Bottomley 9822908d778SJames Bottomley #define LmXMTPRIMCS(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x44) 9832908d778SJames Bottomley 9842908d778SJames Bottomley #define LmCONSTAT(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x45) 9852908d778SJames Bottomley 9862908d778SJames Bottomley #define LmMnDMAERRS(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x46) 9872908d778SJames Bottomley 9882908d778SJames Bottomley #define LmMnSGDMAERRS(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x47) 9892908d778SJames Bottomley 9902908d778SJames Bottomley #define LmM0EXPHDRP(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x48) 9912908d778SJames Bottomley 9922908d778SJames Bottomley #define LmM1SASALIGN(LinkNum) LmSEQ_PHY_REG(1, LinkNum, 0x48) 9932908d778SJames Bottomley #define SAS_ALIGN_DEFAULT 0xFF 9942908d778SJames Bottomley 9952908d778SJames Bottomley #define LmM0MSKHDRP(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x49) 9962908d778SJames Bottomley 9972908d778SJames Bottomley #define LmM1STPALIGN(LinkNum) LmSEQ_PHY_REG(1, LinkNum, 0x49) 9982908d778SJames Bottomley #define STP_ALIGN_DEFAULT 0x1F 9992908d778SJames Bottomley 10002908d778SJames Bottomley #define LmM0RCVHDRP(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x4A) 10012908d778SJames Bottomley 10022908d778SJames Bottomley #define LmM1XMTHDRP(LinkNum) LmSEQ_PHY_REG(1, LinkNum, 0x4A) 10032908d778SJames Bottomley 10042908d778SJames Bottomley #define LmM0ICLADR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x4B) 10052908d778SJames Bottomley 10062908d778SJames Bottomley #define LmM1ALIGNMODE(LinkNum) LmSEQ_PHY_REG(1, LinkNum, 0x4B) 10072908d778SJames Bottomley 10082908d778SJames Bottomley #define LmDISALIGN 0x20 10092908d778SJames Bottomley #define LmROTSTPALIGN 0x10 10102908d778SJames Bottomley #define LmSTPALIGN 0x08 10112908d778SJames Bottomley #define LmROTNOTIFY 0x04 10122908d778SJames Bottomley #define LmDUALALIGN 0x02 10132908d778SJames Bottomley #define LmROTALIGN 0x01 10142908d778SJames Bottomley 10152908d778SJames Bottomley #define LmM0EXPRCVNT(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x4C) 10162908d778SJames Bottomley 10172908d778SJames Bottomley #define LmM1XMTCNT(LinkNum) LmSEQ_PHY_REG(1, LinkNum, 0x4C) 10182908d778SJames Bottomley 10192908d778SJames Bottomley #define LmMnBUFSTAT(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x4E) 10202908d778SJames Bottomley 10212908d778SJames Bottomley #define LmMnBUFPERR 0x01 10222908d778SJames Bottomley 10232908d778SJames Bottomley /* mode 0-1 */ 10242908d778SJames Bottomley #define LmMnXFRLVL(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x59) 10252908d778SJames Bottomley 10262908d778SJames Bottomley #define LmMnXFRLVL_128 0x05 10272908d778SJames Bottomley #define LmMnXFRLVL_256 0x04 10282908d778SJames Bottomley #define LmMnXFRLVL_512 0x03 10292908d778SJames Bottomley #define LmMnXFRLVL_1024 0x02 10302908d778SJames Bottomley #define LmMnXFRLVL_1536 0x01 10312908d778SJames Bottomley #define LmMnXFRLVL_2048 0x00 10322908d778SJames Bottomley 10332908d778SJames Bottomley /* mode 0-1 */ 10342908d778SJames Bottomley #define LmMnSGDMACTL(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x5A) 10352908d778SJames Bottomley 10362908d778SJames Bottomley #define LmMnRESETSG 0x04 10372908d778SJames Bottomley #define LmMnSTOPSG 0x02 10382908d778SJames Bottomley #define LmMnSTARTSG 0x01 10392908d778SJames Bottomley 10402908d778SJames Bottomley /* mode 0-1 */ 10412908d778SJames Bottomley #define LmMnSGDMASTAT(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x5B) 10422908d778SJames Bottomley 10432908d778SJames Bottomley /* mode 0-1 */ 10442908d778SJames Bottomley #define LmMnDDMACTL(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x5C) 10452908d778SJames Bottomley 10462908d778SJames Bottomley #define LmMnFLUSH 0x40 /* wo */ 10472908d778SJames Bottomley #define LmMnRLSRTRY 0x20 /* wo */ 10482908d778SJames Bottomley #define LmMnDISCARD 0x10 /* wo */ 10492908d778SJames Bottomley #define LmMnRESETDAT 0x08 /* wo */ 10502908d778SJames Bottomley #define LmMnSUSDAT 0x04 /* wo */ 10512908d778SJames Bottomley #define LmMnSTOPDAT 0x02 /* wo */ 10522908d778SJames Bottomley #define LmMnSTARTDAT 0x01 /* wo */ 10532908d778SJames Bottomley 10542908d778SJames Bottomley /* mode 0-1 */ 10552908d778SJames Bottomley #define LmMnDDMASTAT(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x5D) 10562908d778SJames Bottomley 10572908d778SJames Bottomley #define LmMnDPEMPTY 0x80 10582908d778SJames Bottomley #define LmMnFLUSHING 0x40 10592908d778SJames Bottomley #define LmMnDDMAREQ 0x20 10602908d778SJames Bottomley #define LmMnHDMAREQ 0x10 10612908d778SJames Bottomley #define LmMnDATFREE 0x08 10622908d778SJames Bottomley #define LmMnDATSUS 0x04 10632908d778SJames Bottomley #define LmMnDATACT 0x02 10642908d778SJames Bottomley #define LmMnDATEN 0x01 10652908d778SJames Bottomley 10662908d778SJames Bottomley /* mode 0-1 */ 10672908d778SJames Bottomley #define LmMnDDMAMODE(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x5E) 10682908d778SJames Bottomley 10692908d778SJames Bottomley #define LmMnDMATYPE_NORMAL 0x0000 10702908d778SJames Bottomley #define LmMnDMATYPE_HOST_ONLY_TX 0x0001 10712908d778SJames Bottomley #define LmMnDMATYPE_DEVICE_ONLY_TX 0x0002 10722908d778SJames Bottomley #define LmMnDMATYPE_INVALID 0x0003 10732908d778SJames Bottomley #define LmMnDMATYPE_MASK 0x0003 10742908d778SJames Bottomley 10752908d778SJames Bottomley #define LmMnDMAWRAP 0x0004 10762908d778SJames Bottomley #define LmMnBITBUCKET 0x0008 10772908d778SJames Bottomley #define LmMnDISHDR 0x0010 10782908d778SJames Bottomley #define LmMnSTPCRC 0x0020 10792908d778SJames Bottomley #define LmXTEST 0x0040 10802908d778SJames Bottomley #define LmMnDISCRC 0x0080 10812908d778SJames Bottomley #define LmMnENINTLK 0x0100 10822908d778SJames Bottomley #define LmMnADDRFRM 0x0400 10832908d778SJames Bottomley #define LmMnENXMTCRC 0x0800 10842908d778SJames Bottomley 10852908d778SJames Bottomley /* mode 0-1 */ 10862908d778SJames Bottomley #define LmMnXFRCNT(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x70) 10872908d778SJames Bottomley 10882908d778SJames Bottomley /* mode 0-1 */ 10892908d778SJames Bottomley #define LmMnDPSEL(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x7B) 10902908d778SJames Bottomley #define LmMnDPSEL_MASK 0x07 10912908d778SJames Bottomley #define LmMnEOLPRE 0x40 10922908d778SJames Bottomley #define LmMnEOSPRE 0x80 10932908d778SJames Bottomley 10942908d778SJames Bottomley /* Registers used in conjunction with LmMnDPSEL and LmMnDPACC registers */ 10952908d778SJames Bottomley /* Receive Mode n = 0 */ 10962908d778SJames Bottomley #define LmMnHRADDR 0x00 10972908d778SJames Bottomley #define LmMnHBYTECNT 0x01 10982908d778SJames Bottomley #define LmMnHREWIND 0x02 10992908d778SJames Bottomley #define LmMnDWADDR 0x03 11002908d778SJames Bottomley #define LmMnDSPACECNT 0x04 11012908d778SJames Bottomley #define LmMnDFRMSIZE 0x05 11022908d778SJames Bottomley 11032908d778SJames Bottomley /* Registers used in conjunction with LmMnDPSEL and LmMnDPACC registers */ 11042908d778SJames Bottomley /* Transmit Mode n = 1 */ 11052908d778SJames Bottomley #define LmMnHWADDR 0x00 11062908d778SJames Bottomley #define LmMnHSPACECNT 0x01 11072908d778SJames Bottomley /* #define LmMnHREWIND 0x02 */ 11082908d778SJames Bottomley #define LmMnDRADDR 0x03 11092908d778SJames Bottomley #define LmMnDBYTECNT 0x04 11102908d778SJames Bottomley /* #define LmMnDFRMSIZE 0x05 */ 11112908d778SJames Bottomley 11122908d778SJames Bottomley /* mode 0-1 */ 11132908d778SJames Bottomley #define LmMnDPACC(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x78) 11142908d778SJames Bottomley #define LmMnDPACC_MASK 0x00FFFFFF 11152908d778SJames Bottomley 11162908d778SJames Bottomley /* mode 0-1 */ 11172908d778SJames Bottomley #define LmMnHOLDLVL(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x7D) 11182908d778SJames Bottomley 11192908d778SJames Bottomley #define LmPRMSTAT0(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x80) 11202908d778SJames Bottomley #define LmPRMSTAT0BYTE0 0x80 11212908d778SJames Bottomley #define LmPRMSTAT0BYTE1 0x81 11222908d778SJames Bottomley #define LmPRMSTAT0BYTE2 0x82 11232908d778SJames Bottomley #define LmPRMSTAT0BYTE3 0x83 11242908d778SJames Bottomley 11252908d778SJames Bottomley #define LmFRAMERCVD 0x80000000 11262908d778SJames Bottomley #define LmXFRRDYRCVD 0x40000000 11272908d778SJames Bottomley #define LmUNKNOWNP 0x20000000 11282908d778SJames Bottomley #define LmBREAK 0x10000000 11292908d778SJames Bottomley #define LmDONE 0x08000000 11302908d778SJames Bottomley #define LmOPENACPT 0x04000000 11312908d778SJames Bottomley #define LmOPENRJCT 0x02000000 11322908d778SJames Bottomley #define LmOPENRTRY 0x01000000 11332908d778SJames Bottomley #define LmCLOSERV1 0x00800000 11342908d778SJames Bottomley #define LmCLOSERV0 0x00400000 11352908d778SJames Bottomley #define LmCLOSENORM 0x00200000 11362908d778SJames Bottomley #define LmCLOSECLAF 0x00100000 11372908d778SJames Bottomley #define LmNOTIFYRV2 0x00080000 11382908d778SJames Bottomley #define LmNOTIFYRV1 0x00040000 11392908d778SJames Bottomley #define LmNOTIFYRV0 0x00020000 11402908d778SJames Bottomley #define LmNOTIFYSPIN 0x00010000 11412908d778SJames Bottomley #define LmBROADRV4 0x00008000 11422908d778SJames Bottomley #define LmBROADRV3 0x00004000 11432908d778SJames Bottomley #define LmBROADRV2 0x00002000 11442908d778SJames Bottomley #define LmBROADRV1 0x00001000 11452908d778SJames Bottomley #define LmBROADSES 0x00000800 11462908d778SJames Bottomley #define LmBROADRVCH1 0x00000400 11472908d778SJames Bottomley #define LmBROADRVCH0 0x00000200 11482908d778SJames Bottomley #define LmBROADCH 0x00000100 11492908d778SJames Bottomley #define LmAIPRVWP 0x00000080 11502908d778SJames Bottomley #define LmAIPWP 0x00000040 11512908d778SJames Bottomley #define LmAIPWD 0x00000020 11522908d778SJames Bottomley #define LmAIPWC 0x00000010 11532908d778SJames Bottomley #define LmAIPRV2 0x00000008 11542908d778SJames Bottomley #define LmAIPRV1 0x00000004 11552908d778SJames Bottomley #define LmAIPRV0 0x00000002 11562908d778SJames Bottomley #define LmAIPNRML 0x00000001 11572908d778SJames Bottomley 11582908d778SJames Bottomley #define LmBROADCAST_MASK (LmBROADCH | LmBROADRVCH0 | \ 11592908d778SJames Bottomley LmBROADRVCH1) 11602908d778SJames Bottomley 11612908d778SJames Bottomley #define LmPRMSTAT1(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x84) 11622908d778SJames Bottomley #define LmPRMSTAT1BYTE0 0x84 11632908d778SJames Bottomley #define LmPRMSTAT1BYTE1 0x85 11642908d778SJames Bottomley #define LmPRMSTAT1BYTE2 0x86 11652908d778SJames Bottomley #define LmPRMSTAT1BYTE3 0x87 11662908d778SJames Bottomley 11672908d778SJames Bottomley #define LmFRMRCVDSTAT 0x80000000 11682908d778SJames Bottomley #define LmBREAK_DET 0x04000000 11692908d778SJames Bottomley #define LmCLOSE_DET 0x02000000 11702908d778SJames Bottomley #define LmDONE_DET 0x01000000 11712908d778SJames Bottomley #define LmXRDY 0x00040000 11722908d778SJames Bottomley #define LmSYNCSRST 0x00020000 11732908d778SJames Bottomley #define LmSYNC 0x00010000 11742908d778SJames Bottomley #define LmXHOLD 0x00008000 11752908d778SJames Bottomley #define LmRRDY 0x00004000 11762908d778SJames Bottomley #define LmHOLD 0x00002000 11772908d778SJames Bottomley #define LmROK 0x00001000 11782908d778SJames Bottomley #define LmRIP 0x00000800 11792908d778SJames Bottomley #define LmCRBLK 0x00000400 11802908d778SJames Bottomley #define LmACK 0x00000200 11812908d778SJames Bottomley #define LmNAK 0x00000100 11822908d778SJames Bottomley #define LmHARDRST 0x00000080 11832908d778SJames Bottomley #define LmERROR 0x00000040 11842908d778SJames Bottomley #define LmRERR 0x00000020 11852908d778SJames Bottomley #define LmPMREQP 0x00000010 11862908d778SJames Bottomley #define LmPMREQS 0x00000008 11872908d778SJames Bottomley #define LmPMACK 0x00000004 11882908d778SJames Bottomley #define LmPMNAK 0x00000002 11892908d778SJames Bottomley #define LmDMAT 0x00000001 11902908d778SJames Bottomley 11912908d778SJames Bottomley /* mode 1 */ 11922908d778SJames Bottomley #define LmMnSATAFS(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x7E) 11932908d778SJames Bottomley #define LmMnXMTSIZE(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x93) 11942908d778SJames Bottomley 11952908d778SJames Bottomley /* mode 0 */ 11962908d778SJames Bottomley #define LmMnFRMERR(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0xB0) 11972908d778SJames Bottomley 11982908d778SJames Bottomley #define LmACRCERR 0x00000800 11992908d778SJames Bottomley #define LmPHYOVRN 0x00000400 12002908d778SJames Bottomley #define LmOBOVRN 0x00000200 12012908d778SJames Bottomley #define LmMnZERODATA 0x00000100 12022908d778SJames Bottomley #define LmSATAINTLK 0x00000080 12032908d778SJames Bottomley #define LmMnCRCERR 0x00000020 12042908d778SJames Bottomley #define LmRRDYOVRN 0x00000010 12052908d778SJames Bottomley #define LmMISSSOAF 0x00000008 12062908d778SJames Bottomley #define LmMISSSOF 0x00000004 12072908d778SJames Bottomley #define LmMISSEOAF 0x00000002 12082908d778SJames Bottomley #define LmMISSEOF 0x00000001 12092908d778SJames Bottomley 12102908d778SJames Bottomley #define LmFRMERREN(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0xB4) 12112908d778SJames Bottomley 12122908d778SJames Bottomley #define EN_LmACRCERR 0x00000800 12132908d778SJames Bottomley #define EN_LmPHYOVRN 0x00000400 12142908d778SJames Bottomley #define EN_LmOBOVRN 0x00000200 12152908d778SJames Bottomley #define EN_LmMnZERODATA 0x00000100 12162908d778SJames Bottomley #define EN_LmSATAINTLK 0x00000080 12172908d778SJames Bottomley #define EN_LmFRMBAD 0x00000040 12182908d778SJames Bottomley #define EN_LmMnCRCERR 0x00000020 12192908d778SJames Bottomley #define EN_LmRRDYOVRN 0x00000010 12202908d778SJames Bottomley #define EN_LmMISSSOAF 0x00000008 12212908d778SJames Bottomley #define EN_LmMISSSOF 0x00000004 12222908d778SJames Bottomley #define EN_LmMISSEOAF 0x00000002 12232908d778SJames Bottomley #define EN_LmMISSEOF 0x00000001 12242908d778SJames Bottomley 12252908d778SJames Bottomley #define LmFRMERREN_MASK (EN_LmSATAINTLK | EN_LmMnCRCERR | \ 12262908d778SJames Bottomley EN_LmRRDYOVRN | EN_LmMISSSOF | \ 12272908d778SJames Bottomley EN_LmMISSEOAF | EN_LmMISSEOF | \ 12282908d778SJames Bottomley EN_LmACRCERR | LmPHYOVRN | \ 12292908d778SJames Bottomley EN_LmOBOVRN | EN_LmMnZERODATA) 12302908d778SJames Bottomley 12312908d778SJames Bottomley #define LmHWTSTATEN(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0xC5) 12322908d778SJames Bottomley 12332908d778SJames Bottomley #define EN_LmDONETO 0x80 12342908d778SJames Bottomley #define EN_LmINVDISP 0x40 12352908d778SJames Bottomley #define EN_LmINVDW 0x20 12362908d778SJames Bottomley #define EN_LmDWSEVENT 0x08 12372908d778SJames Bottomley #define EN_LmCRTTTO 0x04 12382908d778SJames Bottomley #define EN_LmANTTTO 0x02 12392908d778SJames Bottomley #define EN_LmBITLTTO 0x01 12402908d778SJames Bottomley 12412908d778SJames Bottomley #define LmHWTSTATEN_MASK (EN_LmINVDISP | EN_LmINVDW | \ 12422908d778SJames Bottomley EN_LmDWSEVENT | EN_LmCRTTTO | \ 12432908d778SJames Bottomley EN_LmANTTTO | EN_LmDONETO | \ 12442908d778SJames Bottomley EN_LmBITLTTO) 12452908d778SJames Bottomley 12462908d778SJames Bottomley #define LmHWTSTAT(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0xC7) 12472908d778SJames Bottomley 12482908d778SJames Bottomley #define LmDONETO 0x80 12492908d778SJames Bottomley #define LmINVDISP 0x40 12502908d778SJames Bottomley #define LmINVDW 0x20 12512908d778SJames Bottomley #define LmDWSEVENT 0x08 12522908d778SJames Bottomley #define LmCRTTTO 0x04 12532908d778SJames Bottomley #define LmANTTTO 0x02 12542908d778SJames Bottomley #define LmBITLTTO 0x01 12552908d778SJames Bottomley 12562908d778SJames Bottomley #define LmMnDATABUFADR(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0xC8) 12572908d778SJames Bottomley #define LmDATABUFADR_MASK 0x0FFF 12582908d778SJames Bottomley 12592908d778SJames Bottomley #define LmMnDATABUF(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0xCA) 12602908d778SJames Bottomley 12612908d778SJames Bottomley #define LmPRIMSTAT0EN(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0xE0) 12622908d778SJames Bottomley 12632908d778SJames Bottomley #define EN_LmUNKNOWNP 0x20000000 12642908d778SJames Bottomley #define EN_LmBREAK 0x10000000 12652908d778SJames Bottomley #define EN_LmDONE 0x08000000 12662908d778SJames Bottomley #define EN_LmOPENACPT 0x04000000 12672908d778SJames Bottomley #define EN_LmOPENRJCT 0x02000000 12682908d778SJames Bottomley #define EN_LmOPENRTRY 0x01000000 12692908d778SJames Bottomley #define EN_LmCLOSERV1 0x00800000 12702908d778SJames Bottomley #define EN_LmCLOSERV0 0x00400000 12712908d778SJames Bottomley #define EN_LmCLOSENORM 0x00200000 12722908d778SJames Bottomley #define EN_LmCLOSECLAF 0x00100000 12732908d778SJames Bottomley #define EN_LmNOTIFYRV2 0x00080000 12742908d778SJames Bottomley #define EN_LmNOTIFYRV1 0x00040000 12752908d778SJames Bottomley #define EN_LmNOTIFYRV0 0x00020000 12762908d778SJames Bottomley #define EN_LmNOTIFYSPIN 0x00010000 12772908d778SJames Bottomley #define EN_LmBROADRV4 0x00008000 12782908d778SJames Bottomley #define EN_LmBROADRV3 0x00004000 12792908d778SJames Bottomley #define EN_LmBROADRV2 0x00002000 12802908d778SJames Bottomley #define EN_LmBROADRV1 0x00001000 12812908d778SJames Bottomley #define EN_LmBROADRV0 0x00000800 12822908d778SJames Bottomley #define EN_LmBROADRVCH1 0x00000400 12832908d778SJames Bottomley #define EN_LmBROADRVCH0 0x00000200 12842908d778SJames Bottomley #define EN_LmBROADCH 0x00000100 12852908d778SJames Bottomley #define EN_LmAIPRVWP 0x00000080 12862908d778SJames Bottomley #define EN_LmAIPWP 0x00000040 12872908d778SJames Bottomley #define EN_LmAIPWD 0x00000020 12882908d778SJames Bottomley #define EN_LmAIPWC 0x00000010 12892908d778SJames Bottomley #define EN_LmAIPRV2 0x00000008 12902908d778SJames Bottomley #define EN_LmAIPRV1 0x00000004 12912908d778SJames Bottomley #define EN_LmAIPRV0 0x00000002 12922908d778SJames Bottomley #define EN_LmAIPNRML 0x00000001 12932908d778SJames Bottomley 12942908d778SJames Bottomley #define LmPRIMSTAT0EN_MASK (EN_LmBREAK | \ 12952908d778SJames Bottomley EN_LmDONE | EN_LmOPENACPT | \ 12962908d778SJames Bottomley EN_LmOPENRJCT | EN_LmOPENRTRY | \ 12972908d778SJames Bottomley EN_LmCLOSERV1 | EN_LmCLOSERV0 | \ 12982908d778SJames Bottomley EN_LmCLOSENORM | EN_LmCLOSECLAF | \ 12992908d778SJames Bottomley EN_LmBROADRV4 | EN_LmBROADRV3 | \ 13002908d778SJames Bottomley EN_LmBROADRV2 | EN_LmBROADRV1 | \ 13012908d778SJames Bottomley EN_LmBROADRV0 | EN_LmBROADRVCH1 | \ 13022908d778SJames Bottomley EN_LmBROADRVCH0 | EN_LmBROADCH | \ 13032908d778SJames Bottomley EN_LmAIPRVWP | EN_LmAIPWP | \ 13042908d778SJames Bottomley EN_LmAIPWD | EN_LmAIPWC | \ 13052908d778SJames Bottomley EN_LmAIPRV2 | EN_LmAIPRV1 | \ 13062908d778SJames Bottomley EN_LmAIPRV0 | EN_LmAIPNRML) 13072908d778SJames Bottomley 13082908d778SJames Bottomley #define LmPRIMSTAT1EN(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0xE4) 13092908d778SJames Bottomley 13102908d778SJames Bottomley #define EN_LmXRDY 0x00040000 13112908d778SJames Bottomley #define EN_LmSYNCSRST 0x00020000 13122908d778SJames Bottomley #define EN_LmSYNC 0x00010000 13132908d778SJames Bottomley #define EN_LmXHOLD 0x00008000 13142908d778SJames Bottomley #define EN_LmRRDY 0x00004000 13152908d778SJames Bottomley #define EN_LmHOLD 0x00002000 13162908d778SJames Bottomley #define EN_LmROK 0x00001000 13172908d778SJames Bottomley #define EN_LmRIP 0x00000800 13182908d778SJames Bottomley #define EN_LmCRBLK 0x00000400 13192908d778SJames Bottomley #define EN_LmACK 0x00000200 13202908d778SJames Bottomley #define EN_LmNAK 0x00000100 13212908d778SJames Bottomley #define EN_LmHARDRST 0x00000080 13222908d778SJames Bottomley #define EN_LmERROR 0x00000040 13232908d778SJames Bottomley #define EN_LmRERR 0x00000020 13242908d778SJames Bottomley #define EN_LmPMREQP 0x00000010 13252908d778SJames Bottomley #define EN_LmPMREQS 0x00000008 13262908d778SJames Bottomley #define EN_LmPMACK 0x00000004 13272908d778SJames Bottomley #define EN_LmPMNAK 0x00000002 13282908d778SJames Bottomley #define EN_LmDMAT 0x00000001 13292908d778SJames Bottomley 13302908d778SJames Bottomley #define LmPRIMSTAT1EN_MASK (EN_LmHARDRST | \ 13312908d778SJames Bottomley EN_LmSYNCSRST | \ 13322908d778SJames Bottomley EN_LmPMREQP | EN_LmPMREQS | \ 13332908d778SJames Bottomley EN_LmPMACK | EN_LmPMNAK) 13342908d778SJames Bottomley 13352908d778SJames Bottomley #define LmSMSTATE(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0xE8) 13362908d778SJames Bottomley 13372908d778SJames Bottomley #define LmSMSTATEBRK(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0xEC) 13382908d778SJames Bottomley 13392908d778SJames Bottomley #define LmSMDBGCTL(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0xF0) 13402908d778SJames Bottomley 13412908d778SJames Bottomley 13422908d778SJames Bottomley /* 13432908d778SJames Bottomley * LmSEQ CIO Bus Mode 3 Register. 13442908d778SJames Bottomley * Mode 3: Configuration and Setup, IOP Context SCB. 13452908d778SJames Bottomley */ 13462908d778SJames Bottomley #define LmM3SATATIMER(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0x48) 13472908d778SJames Bottomley 13482908d778SJames Bottomley #define LmM3INTVEC0(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0x90) 13492908d778SJames Bottomley 13502908d778SJames Bottomley #define LmM3INTVEC1(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0x92) 13512908d778SJames Bottomley 13522908d778SJames Bottomley #define LmM3INTVEC2(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0x94) 13532908d778SJames Bottomley 13542908d778SJames Bottomley #define LmM3INTVEC3(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0x96) 13552908d778SJames Bottomley 13562908d778SJames Bottomley #define LmM3INTVEC4(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0x98) 13572908d778SJames Bottomley 13582908d778SJames Bottomley #define LmM3INTVEC5(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0x9A) 13592908d778SJames Bottomley 13602908d778SJames Bottomley #define LmM3INTVEC6(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0x9C) 13612908d778SJames Bottomley 13622908d778SJames Bottomley #define LmM3INTVEC7(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0x9E) 13632908d778SJames Bottomley 13642908d778SJames Bottomley #define LmM3INTVEC8(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0xA4) 13652908d778SJames Bottomley 13662908d778SJames Bottomley #define LmM3INTVEC9(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0xA6) 13672908d778SJames Bottomley 13682908d778SJames Bottomley #define LmM3INTVEC10(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0xB0) 13692908d778SJames Bottomley 13702908d778SJames Bottomley #define LmM3FRMGAP(LinkNum) LmSEQ_PHY_REG(3, LinkNum, 0xB4) 13712908d778SJames Bottomley 13722908d778SJames Bottomley #define LmBITL_TIMER(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0xA2) 13732908d778SJames Bottomley 13742908d778SJames Bottomley #define LmWWN(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0xA8) 13752908d778SJames Bottomley 13762908d778SJames Bottomley 13772908d778SJames Bottomley /* 13782908d778SJames Bottomley * LmSEQ CIO Bus Mode 5 Registers. 13792908d778SJames Bottomley * Mode 5: Phy/OOB Control and Status. 13802908d778SJames Bottomley */ 13812908d778SJames Bottomley #define LmSEQ_OOB_REG(phy_id, reg) LmSEQ_PHY_REG(5, (phy_id), (reg)) 13822908d778SJames Bottomley 13832908d778SJames Bottomley #define OOB_BFLTR 0x100 13842908d778SJames Bottomley 13852908d778SJames Bottomley #define BFLTR_THR_MASK 0xF0 13862908d778SJames Bottomley #define BFLTR_TC_MASK 0x0F 13872908d778SJames Bottomley 13882908d778SJames Bottomley #define OOB_INIT_MIN 0x102 13892908d778SJames Bottomley 13902908d778SJames Bottomley #define OOB_INIT_MAX 0x104 13912908d778SJames Bottomley 13922908d778SJames Bottomley #define OOB_INIT_NEG 0x106 13932908d778SJames Bottomley 13942908d778SJames Bottomley #define OOB_SAS_MIN 0x108 13952908d778SJames Bottomley 13962908d778SJames Bottomley #define OOB_SAS_MAX 0x10A 13972908d778SJames Bottomley 13982908d778SJames Bottomley #define OOB_SAS_NEG 0x10C 13992908d778SJames Bottomley 14002908d778SJames Bottomley #define OOB_WAKE_MIN 0x10E 14012908d778SJames Bottomley 14022908d778SJames Bottomley #define OOB_WAKE_MAX 0x110 14032908d778SJames Bottomley 14042908d778SJames Bottomley #define OOB_WAKE_NEG 0x112 14052908d778SJames Bottomley 14062908d778SJames Bottomley #define OOB_IDLE_MAX 0x114 14072908d778SJames Bottomley 14082908d778SJames Bottomley #define OOB_BURST_MAX 0x116 14092908d778SJames Bottomley 14102908d778SJames Bottomley #define OOB_DATA_KBITS 0x126 14112908d778SJames Bottomley 14122908d778SJames Bottomley #define OOB_ALIGN_0_DATA 0x12C 14132908d778SJames Bottomley 14142908d778SJames Bottomley #define OOB_ALIGN_1_DATA 0x130 14152908d778SJames Bottomley 14162908d778SJames Bottomley #define D10_2_DATA_k 0x00 14172908d778SJames Bottomley #define SYNC_DATA_k 0x02 14182908d778SJames Bottomley #define ALIGN_1_DATA_k 0x04 14192908d778SJames Bottomley #define ALIGN_0_DATA_k 0x08 14202908d778SJames Bottomley #define BURST_DATA_k 0x10 14212908d778SJames Bottomley 14222908d778SJames Bottomley #define OOB_PHY_RESET_COUNT 0x13C 14232908d778SJames Bottomley 14242908d778SJames Bottomley #define OOB_SIG_GEN 0x140 14252908d778SJames Bottomley 14262908d778SJames Bottomley #define START_OOB 0x80 14272908d778SJames Bottomley #define START_DWS 0x40 14282908d778SJames Bottomley #define ALIGN_CNT3 0x30 14292908d778SJames Bottomley #define ALIGN_CNT2 0x20 14302908d778SJames Bottomley #define ALIGN_CNT1 0x10 14312908d778SJames Bottomley #define ALIGN_CNT4 0x00 14322908d778SJames Bottomley #define STOP_DWS 0x08 14332908d778SJames Bottomley #define SEND_COMSAS 0x04 14342908d778SJames Bottomley #define SEND_COMINIT 0x02 14352908d778SJames Bottomley #define SEND_COMWAKE 0x01 14362908d778SJames Bottomley 14372908d778SJames Bottomley #define OOB_XMIT 0x141 14382908d778SJames Bottomley 14392908d778SJames Bottomley #define TX_ENABLE 0x80 14402908d778SJames Bottomley #define XMIT_OOB_BURST 0x10 14412908d778SJames Bottomley #define XMIT_D10_2 0x08 14422908d778SJames Bottomley #define XMIT_SYNC 0x04 14432908d778SJames Bottomley #define XMIT_ALIGN_1 0x02 14442908d778SJames Bottomley #define XMIT_ALIGN_0 0x01 14452908d778SJames Bottomley 14462908d778SJames Bottomley #define FUNCTION_MASK 0x142 14472908d778SJames Bottomley 14482908d778SJames Bottomley #define SAS_MODE_DIS 0x80 14492908d778SJames Bottomley #define SATA_MODE_DIS 0x40 14502908d778SJames Bottomley #define SPINUP_HOLD_DIS 0x20 14512908d778SJames Bottomley #define HOT_PLUG_DIS 0x10 14522908d778SJames Bottomley #define SATA_PS_DIS 0x08 14532908d778SJames Bottomley #define FUNCTION_MASK_DEFAULT (SPINUP_HOLD_DIS | SATA_PS_DIS) 14542908d778SJames Bottomley 14552908d778SJames Bottomley #define OOB_MODE 0x143 14562908d778SJames Bottomley 14572908d778SJames Bottomley #define SAS_MODE 0x80 14582908d778SJames Bottomley #define SATA_MODE 0x40 14592908d778SJames Bottomley #define SLOW_CLK 0x20 14602908d778SJames Bottomley #define FORCE_XMIT_15 0x08 14612908d778SJames Bottomley #define PHY_SPEED_60 0x04 14622908d778SJames Bottomley #define PHY_SPEED_30 0x02 14632908d778SJames Bottomley #define PHY_SPEED_15 0x01 14642908d778SJames Bottomley 14652908d778SJames Bottomley #define CURRENT_STATUS 0x144 14662908d778SJames Bottomley 14672908d778SJames Bottomley #define CURRENT_OOB_DONE 0x80 14682908d778SJames Bottomley #define CURRENT_LOSS_OF_SIGNAL 0x40 14692908d778SJames Bottomley #define CURRENT_SPINUP_HOLD 0x20 14702908d778SJames Bottomley #define CURRENT_HOT_PLUG_CNCT 0x10 14712908d778SJames Bottomley #define CURRENT_GTO_TIMEOUT 0x08 14722908d778SJames Bottomley #define CURRENT_OOB_TIMEOUT 0x04 14732908d778SJames Bottomley #define CURRENT_DEVICE_PRESENT 0x02 14742908d778SJames Bottomley #define CURRENT_OOB_ERROR 0x01 14752908d778SJames Bottomley 14762908d778SJames Bottomley #define CURRENT_OOB1_ERROR (CURRENT_HOT_PLUG_CNCT | \ 14772908d778SJames Bottomley CURRENT_GTO_TIMEOUT) 14782908d778SJames Bottomley 14792908d778SJames Bottomley #define CURRENT_OOB2_ERROR (CURRENT_HOT_PLUG_CNCT | \ 14802908d778SJames Bottomley CURRENT_OOB_ERROR) 14812908d778SJames Bottomley 14822908d778SJames Bottomley #define DEVICE_ADDED_W_CNT (CURRENT_OOB_DONE | \ 14832908d778SJames Bottomley CURRENT_HOT_PLUG_CNCT | \ 14842908d778SJames Bottomley CURRENT_DEVICE_PRESENT) 14852908d778SJames Bottomley 14862908d778SJames Bottomley #define DEVICE_ADDED_WO_CNT (CURRENT_OOB_DONE | \ 14872908d778SJames Bottomley CURRENT_DEVICE_PRESENT) 14882908d778SJames Bottomley 14892908d778SJames Bottomley #define DEVICE_REMOVED CURRENT_LOSS_OF_SIGNAL 14902908d778SJames Bottomley 14912908d778SJames Bottomley #define CURRENT_PHY_MASK (CURRENT_OOB_DONE | \ 14922908d778SJames Bottomley CURRENT_LOSS_OF_SIGNAL | \ 14932908d778SJames Bottomley CURRENT_SPINUP_HOLD | \ 14942908d778SJames Bottomley CURRENT_HOT_PLUG_CNCT | \ 14952908d778SJames Bottomley CURRENT_GTO_TIMEOUT | \ 14962908d778SJames Bottomley CURRENT_DEVICE_PRESENT | \ 14972908d778SJames Bottomley CURRENT_OOB_ERROR ) 14982908d778SJames Bottomley 14992908d778SJames Bottomley #define CURRENT_ERR_MASK (CURRENT_LOSS_OF_SIGNAL | \ 15002908d778SJames Bottomley CURRENT_GTO_TIMEOUT | \ 15012908d778SJames Bottomley CURRENT_OOB_TIMEOUT | \ 15022908d778SJames Bottomley CURRENT_OOB_ERROR ) 15032908d778SJames Bottomley 15042908d778SJames Bottomley #define SPEED_MASK 0x145 15052908d778SJames Bottomley 15062908d778SJames Bottomley #define SATA_SPEED_30_DIS 0x10 15072908d778SJames Bottomley #define SATA_SPEED_15_DIS 0x08 15082908d778SJames Bottomley #define SAS_SPEED_60_DIS 0x04 15092908d778SJames Bottomley #define SAS_SPEED_30_DIS 0x02 15102908d778SJames Bottomley #define SAS_SPEED_15_DIS 0x01 15112908d778SJames Bottomley #define SAS_SPEED_MASK_DEFAULT 0x00 15122908d778SJames Bottomley 15132908d778SJames Bottomley #define OOB_TIMER_ENABLE 0x14D 15142908d778SJames Bottomley 15152908d778SJames Bottomley #define HOT_PLUG_EN 0x80 15162908d778SJames Bottomley #define RCD_EN 0x40 15172908d778SJames Bottomley #define COMTIMER_EN 0x20 15182908d778SJames Bottomley #define SNTT_EN 0x10 15192908d778SJames Bottomley #define SNLT_EN 0x04 15202908d778SJames Bottomley #define SNWT_EN 0x02 15212908d778SJames Bottomley #define ALIGN_EN 0x01 15222908d778SJames Bottomley 15232908d778SJames Bottomley #define OOB_STATUS 0x14E 15242908d778SJames Bottomley 15252908d778SJames Bottomley #define OOB_DONE 0x80 15262908d778SJames Bottomley #define LOSS_OF_SIGNAL 0x40 /* ro */ 15272908d778SJames Bottomley #define SPINUP_HOLD 0x20 15282908d778SJames Bottomley #define HOT_PLUG_CNCT 0x10 /* ro */ 15292908d778SJames Bottomley #define GTO_TIMEOUT 0x08 /* ro */ 15302908d778SJames Bottomley #define OOB_TIMEOUT 0x04 /* ro */ 15312908d778SJames Bottomley #define DEVICE_PRESENT 0x02 /* ro */ 15322908d778SJames Bottomley #define OOB_ERROR 0x01 /* ro */ 15332908d778SJames Bottomley 15342908d778SJames Bottomley #define OOB_STATUS_ERROR_MASK (LOSS_OF_SIGNAL | GTO_TIMEOUT | \ 15352908d778SJames Bottomley OOB_TIMEOUT | OOB_ERROR) 15362908d778SJames Bottomley 15372908d778SJames Bottomley #define OOB_STATUS_CLEAR 0x14F 15382908d778SJames Bottomley 15392908d778SJames Bottomley #define OOB_DONE_CLR 0x80 15402908d778SJames Bottomley #define LOSS_OF_SIGNAL_CLR 0x40 15412908d778SJames Bottomley #define SPINUP_HOLD_CLR 0x20 15422908d778SJames Bottomley #define HOT_PLUG_CNCT_CLR 0x10 15432908d778SJames Bottomley #define GTO_TIMEOUT_CLR 0x08 15442908d778SJames Bottomley #define OOB_TIMEOUT_CLR 0x04 15452908d778SJames Bottomley #define OOB_ERROR_CLR 0x01 15462908d778SJames Bottomley 15472908d778SJames Bottomley #define HOT_PLUG_DELAY 0x150 15482908d778SJames Bottomley /* In 5 ms units. 20 = 100 ms. */ 15492908d778SJames Bottomley #define HOTPLUG_DELAY_TIMEOUT 20 15502908d778SJames Bottomley 15512908d778SJames Bottomley 15522908d778SJames Bottomley #define INT_ENABLE_2 0x15A 15532908d778SJames Bottomley 15542908d778SJames Bottomley #define OOB_DONE_EN 0x80 15552908d778SJames Bottomley #define LOSS_OF_SIGNAL_EN 0x40 15562908d778SJames Bottomley #define SPINUP_HOLD_EN 0x20 15572908d778SJames Bottomley #define HOT_PLUG_CNCT_EN 0x10 15582908d778SJames Bottomley #define GTO_TIMEOUT_EN 0x08 15592908d778SJames Bottomley #define OOB_TIMEOUT_EN 0x04 15602908d778SJames Bottomley #define DEVICE_PRESENT_EN 0x02 15612908d778SJames Bottomley #define OOB_ERROR_EN 0x01 15622908d778SJames Bottomley 15632908d778SJames Bottomley #define PHY_CONTROL_0 0x160 15642908d778SJames Bottomley 15652908d778SJames Bottomley #define PHY_LOWPWREN_TX 0x80 15662908d778SJames Bottomley #define PHY_LOWPWREN_RX 0x40 15672908d778SJames Bottomley #define SPARE_REG_160_B5 0x20 15682908d778SJames Bottomley #define OFFSET_CANCEL_RX 0x10 15692908d778SJames Bottomley 15702908d778SJames Bottomley /* bits 3:2 */ 15712908d778SJames Bottomley #define PHY_RXCOMCENTER_60V 0x00 15722908d778SJames Bottomley #define PHY_RXCOMCENTER_70V 0x04 15732908d778SJames Bottomley #define PHY_RXCOMCENTER_80V 0x08 15742908d778SJames Bottomley #define PHY_RXCOMCENTER_90V 0x0C 15752908d778SJames Bottomley #define PHY_RXCOMCENTER_MASK 0x0C 15762908d778SJames Bottomley 15772908d778SJames Bottomley #define PHY_RESET 0x02 15782908d778SJames Bottomley #define SAS_DEFAULT_SEL 0x01 15792908d778SJames Bottomley 15802908d778SJames Bottomley #define PHY_CONTROL_1 0x161 15812908d778SJames Bottomley 15822908d778SJames Bottomley /* bits 2:0 */ 15832908d778SJames Bottomley #define SATA_PHY_DETLEVEL_50mv 0x00 15842908d778SJames Bottomley #define SATA_PHY_DETLEVEL_75mv 0x01 15852908d778SJames Bottomley #define SATA_PHY_DETLEVEL_100mv 0x02 15862908d778SJames Bottomley #define SATA_PHY_DETLEVEL_125mv 0x03 15872908d778SJames Bottomley #define SATA_PHY_DETLEVEL_150mv 0x04 15882908d778SJames Bottomley #define SATA_PHY_DETLEVEL_175mv 0x05 15892908d778SJames Bottomley #define SATA_PHY_DETLEVEL_200mv 0x06 15902908d778SJames Bottomley #define SATA_PHY_DETLEVEL_225mv 0x07 15912908d778SJames Bottomley #define SATA_PHY_DETLEVEL_MASK 0x07 15922908d778SJames Bottomley 15932908d778SJames Bottomley /* bits 5:3 */ 15942908d778SJames Bottomley #define SAS_PHY_DETLEVEL_50mv 0x00 15952908d778SJames Bottomley #define SAS_PHY_DETLEVEL_75mv 0x08 15962908d778SJames Bottomley #define SAS_PHY_DETLEVEL_100mv 0x10 15972908d778SJames Bottomley #define SAS_PHY_DETLEVEL_125mv 0x11 15982908d778SJames Bottomley #define SAS_PHY_DETLEVEL_150mv 0x20 15992908d778SJames Bottomley #define SAS_PHY_DETLEVEL_175mv 0x21 16002908d778SJames Bottomley #define SAS_PHY_DETLEVEL_200mv 0x30 16012908d778SJames Bottomley #define SAS_PHY_DETLEVEL_225mv 0x31 16022908d778SJames Bottomley #define SAS_PHY_DETLEVEL_MASK 0x38 16032908d778SJames Bottomley 16042908d778SJames Bottomley #define PHY_CONTROL_2 0x162 16052908d778SJames Bottomley 16062908d778SJames Bottomley /* bits 7:5 */ 16072908d778SJames Bottomley #define SATA_PHY_DRV_400mv 0x00 16082908d778SJames Bottomley #define SATA_PHY_DRV_450mv 0x20 16092908d778SJames Bottomley #define SATA_PHY_DRV_500mv 0x40 16102908d778SJames Bottomley #define SATA_PHY_DRV_550mv 0x60 16112908d778SJames Bottomley #define SATA_PHY_DRV_600mv 0x80 16122908d778SJames Bottomley #define SATA_PHY_DRV_650mv 0xA0 16132908d778SJames Bottomley #define SATA_PHY_DRV_725mv 0xC0 16142908d778SJames Bottomley #define SATA_PHY_DRV_800mv 0xE0 16152908d778SJames Bottomley #define SATA_PHY_DRV_MASK 0xE0 16162908d778SJames Bottomley 16172908d778SJames Bottomley /* bits 4:3 */ 16182908d778SJames Bottomley #define SATA_PREEMP_0 0x00 16192908d778SJames Bottomley #define SATA_PREEMP_1 0x08 16202908d778SJames Bottomley #define SATA_PREEMP_2 0x10 16212908d778SJames Bottomley #define SATA_PREEMP_3 0x18 16222908d778SJames Bottomley #define SATA_PREEMP_MASK 0x18 16232908d778SJames Bottomley 16242908d778SJames Bottomley #define SATA_CMSH1P5 0x04 16252908d778SJames Bottomley 16262908d778SJames Bottomley /* bits 1:0 */ 16272908d778SJames Bottomley #define SATA_SLEW_0 0x00 16282908d778SJames Bottomley #define SATA_SLEW_1 0x01 16292908d778SJames Bottomley #define SATA_SLEW_2 0x02 16302908d778SJames Bottomley #define SATA_SLEW_3 0x03 16312908d778SJames Bottomley #define SATA_SLEW_MASK 0x03 16322908d778SJames Bottomley 16332908d778SJames Bottomley #define PHY_CONTROL_3 0x163 16342908d778SJames Bottomley 16352908d778SJames Bottomley /* bits 7:5 */ 16362908d778SJames Bottomley #define SAS_PHY_DRV_400mv 0x00 16372908d778SJames Bottomley #define SAS_PHY_DRV_450mv 0x20 16382908d778SJames Bottomley #define SAS_PHY_DRV_500mv 0x40 16392908d778SJames Bottomley #define SAS_PHY_DRV_550mv 0x60 16402908d778SJames Bottomley #define SAS_PHY_DRV_600mv 0x80 16412908d778SJames Bottomley #define SAS_PHY_DRV_650mv 0xA0 16422908d778SJames Bottomley #define SAS_PHY_DRV_725mv 0xC0 16432908d778SJames Bottomley #define SAS_PHY_DRV_800mv 0xE0 16442908d778SJames Bottomley #define SAS_PHY_DRV_MASK 0xE0 16452908d778SJames Bottomley 16462908d778SJames Bottomley /* bits 4:3 */ 16472908d778SJames Bottomley #define SAS_PREEMP_0 0x00 16482908d778SJames Bottomley #define SAS_PREEMP_1 0x08 16492908d778SJames Bottomley #define SAS_PREEMP_2 0x10 16502908d778SJames Bottomley #define SAS_PREEMP_3 0x18 16512908d778SJames Bottomley #define SAS_PREEMP_MASK 0x18 16522908d778SJames Bottomley 16532908d778SJames Bottomley #define SAS_CMSH1P5 0x04 16542908d778SJames Bottomley 16552908d778SJames Bottomley /* bits 1:0 */ 16562908d778SJames Bottomley #define SAS_SLEW_0 0x00 16572908d778SJames Bottomley #define SAS_SLEW_1 0x01 16582908d778SJames Bottomley #define SAS_SLEW_2 0x02 16592908d778SJames Bottomley #define SAS_SLEW_3 0x03 16602908d778SJames Bottomley #define SAS_SLEW_MASK 0x03 16612908d778SJames Bottomley 16622908d778SJames Bottomley #define PHY_CONTROL_4 0x168 16632908d778SJames Bottomley 16642908d778SJames Bottomley #define PHY_DONE_CAL_TX 0x80 16652908d778SJames Bottomley #define PHY_DONE_CAL_RX 0x40 16662908d778SJames Bottomley #define RX_TERM_LOAD_DIS 0x20 16672908d778SJames Bottomley #define TX_TERM_LOAD_DIS 0x10 16682908d778SJames Bottomley #define AUTO_TERM_CAL_DIS 0x08 16692908d778SJames Bottomley #define PHY_SIGDET_FLTR_EN 0x04 16702908d778SJames Bottomley #define OSC_FREQ 0x02 16712908d778SJames Bottomley #define PHY_START_CAL 0x01 16722908d778SJames Bottomley 16732908d778SJames Bottomley /* 1674b595076aSUwe Kleine-König * HST_PCIX2 Registers, Address Range: (0x00-0xFC) 16752908d778SJames Bottomley */ 16762908d778SJames Bottomley #define PCIX_REG_BASE_ADR 0xB8040000 16772908d778SJames Bottomley 16782908d778SJames Bottomley #define PCIC_VENDOR_ID 0x00 16792908d778SJames Bottomley 16802908d778SJames Bottomley #define PCIC_DEVICE_ID 0x02 16812908d778SJames Bottomley 16822908d778SJames Bottomley #define PCIC_COMMAND 0x04 16832908d778SJames Bottomley 16842908d778SJames Bottomley #define INT_DIS 0x0400 16852908d778SJames Bottomley #define FBB_EN 0x0200 /* ro */ 16862908d778SJames Bottomley #define SERR_EN 0x0100 16872908d778SJames Bottomley #define STEP_EN 0x0080 /* ro */ 16882908d778SJames Bottomley #define PERR_EN 0x0040 16892908d778SJames Bottomley #define VGA_EN 0x0020 /* ro */ 16902908d778SJames Bottomley #define MWI_EN 0x0010 16912908d778SJames Bottomley #define SPC_EN 0x0008 16922908d778SJames Bottomley #define MST_EN 0x0004 16932908d778SJames Bottomley #define MEM_EN 0x0002 16942908d778SJames Bottomley #define IO_EN 0x0001 16952908d778SJames Bottomley 16962908d778SJames Bottomley #define PCIC_STATUS 0x06 16972908d778SJames Bottomley 16982908d778SJames Bottomley #define PERR_DET 0x8000 16992908d778SJames Bottomley #define SERR_GEN 0x4000 17002908d778SJames Bottomley #define MABT_DET 0x2000 17012908d778SJames Bottomley #define TABT_DET 0x1000 17022908d778SJames Bottomley #define TABT_GEN 0x0800 17032908d778SJames Bottomley #define DPERR_DET 0x0100 17042908d778SJames Bottomley #define CAP_LIST 0x0010 17052908d778SJames Bottomley #define INT_STAT 0x0008 17062908d778SJames Bottomley 17072908d778SJames Bottomley #define PCIC_DEVREV_ID 0x08 17082908d778SJames Bottomley 17092908d778SJames Bottomley #define PCIC_CLASS_CODE 0x09 17102908d778SJames Bottomley 17112908d778SJames Bottomley #define PCIC_CACHELINE_SIZE 0x0C 17122908d778SJames Bottomley 17132908d778SJames Bottomley #define PCIC_MBAR0 0x10 17142908d778SJames Bottomley 17152908d778SJames Bottomley #define PCIC_MBAR0_OFFSET 0 17162908d778SJames Bottomley 17172908d778SJames Bottomley #define PCIC_MBAR1 0x18 17182908d778SJames Bottomley 17192908d778SJames Bottomley #define PCIC_MBAR1_OFFSET 2 17202908d778SJames Bottomley 17212908d778SJames Bottomley #define PCIC_IOBAR 0x20 17222908d778SJames Bottomley 17232908d778SJames Bottomley #define PCIC_IOBAR_OFFSET 4 17242908d778SJames Bottomley 17252908d778SJames Bottomley #define PCIC_SUBVENDOR_ID 0x2C 17262908d778SJames Bottomley 17272908d778SJames Bottomley #define PCIC_SUBSYTEM_ID 0x2E 17282908d778SJames Bottomley 17292908d778SJames Bottomley #define PCIX_STATUS 0x44 17302908d778SJames Bottomley #define RCV_SCE 0x20000000 17312908d778SJames Bottomley #define UNEXP_SC 0x00080000 17322908d778SJames Bottomley #define SC_DISCARD 0x00040000 17332908d778SJames Bottomley 17342908d778SJames Bottomley #define ECC_CTRL_STAT 0x48 17352908d778SJames Bottomley #define UNCOR_ECCERR 0x00000008 17362908d778SJames Bottomley 17372908d778SJames Bottomley #define PCIC_PM_CSR 0x5C 17382908d778SJames Bottomley 17392908d778SJames Bottomley #define PWR_STATE_D0 0 17402908d778SJames Bottomley #define PWR_STATE_D1 1 /* not supported */ 17412908d778SJames Bottomley #define PWR_STATE_D2 2 /* not supported */ 17422908d778SJames Bottomley #define PWR_STATE_D3 3 17432908d778SJames Bottomley 17442908d778SJames Bottomley #define PCIC_BASE1 0x6C /* internal use only */ 17452908d778SJames Bottomley 17462908d778SJames Bottomley #define BASE1_RSVD 0xFFFFFFF8 17472908d778SJames Bottomley 17482908d778SJames Bottomley #define PCIC_BASEA 0x70 /* internal use only */ 17492908d778SJames Bottomley 17502908d778SJames Bottomley #define BASEA_RSVD 0xFFFFFFC0 17512908d778SJames Bottomley #define BASEA_START 0 17522908d778SJames Bottomley 17532908d778SJames Bottomley #define PCIC_BASEB 0x74 /* internal use only */ 17542908d778SJames Bottomley 17552908d778SJames Bottomley #define BASEB_RSVD 0xFFFFFF80 17562908d778SJames Bottomley #define BASEB_IOMAP_MASK 0x7F 17572908d778SJames Bottomley #define BASEB_START 0x80 17582908d778SJames Bottomley 17592908d778SJames Bottomley #define PCIC_BASEC 0x78 /* internal use only */ 17602908d778SJames Bottomley 17612908d778SJames Bottomley #define BASEC_RSVD 0xFFFFFFFC 17622908d778SJames Bottomley #define BASEC_MASK 0x03 17632908d778SJames Bottomley #define BASEC_START 0x58 17642908d778SJames Bottomley 17652908d778SJames Bottomley #define PCIC_MBAR_KEY 0x7C /* internal use only */ 17662908d778SJames Bottomley 17672908d778SJames Bottomley #define MBAR_KEY_MASK 0xFFFFFFFF 17682908d778SJames Bottomley 17692908d778SJames Bottomley #define PCIC_HSTPCIX_CNTRL 0xA0 17702908d778SJames Bottomley 17712908d778SJames Bottomley #define REWIND_DIS 0x0800 17722908d778SJames Bottomley #define SC_TMR_DIS 0x04000000 17732908d778SJames Bottomley 17742908d778SJames Bottomley #define PCIC_MBAR0_MASK 0xA8 17752908d778SJames Bottomley #define PCIC_MBAR0_SIZE_MASK 0x1FFFE000 17762908d778SJames Bottomley #define PCIC_MBAR0_SIZE_SHIFT 13 17772908d778SJames Bottomley #define PCIC_MBAR0_SIZE(val) \ 17782908d778SJames Bottomley (((val) & PCIC_MBAR0_SIZE_MASK) >> PCIC_MBAR0_SIZE_SHIFT) 17792908d778SJames Bottomley 17802908d778SJames Bottomley #define PCIC_FLASH_MBAR 0xB8 17812908d778SJames Bottomley 17822908d778SJames Bottomley #define PCIC_INTRPT_STAT 0xD4 17832908d778SJames Bottomley 17842908d778SJames Bottomley #define PCIC_TP_CTRL 0xFC 17852908d778SJames Bottomley 17862908d778SJames Bottomley /* 1787b595076aSUwe Kleine-König * EXSI Registers, Address Range: (0x00-0xFC) 17882908d778SJames Bottomley */ 17892908d778SJames Bottomley #define EXSI_REG_BASE_ADR REG_BASE_ADDR_EXSI 17902908d778SJames Bottomley 17912908d778SJames Bottomley #define EXSICNFGR (EXSI_REG_BASE_ADR + 0x00) 17922908d778SJames Bottomley 17932908d778SJames Bottomley #define OCMINITIALIZED 0x80000000 17942908d778SJames Bottomley #define ASIEN 0x00400000 17952908d778SJames Bottomley #define HCMODE 0x00200000 17962908d778SJames Bottomley #define PCIDEF 0x00100000 17972908d778SJames Bottomley #define COMSTOCK 0x00080000 17982908d778SJames Bottomley #define SEEPROMEND 0x00040000 17992908d778SJames Bottomley #define MSTTIMEN 0x00020000 18002908d778SJames Bottomley #define XREGEX 0x00000200 18012908d778SJames Bottomley #define NVRAMW 0x00000100 18022908d778SJames Bottomley #define NVRAMEX 0x00000080 18032908d778SJames Bottomley #define SRAMW 0x00000040 18042908d778SJames Bottomley #define SRAMEX 0x00000020 18052908d778SJames Bottomley #define FLASHW 0x00000010 18062908d778SJames Bottomley #define FLASHEX 0x00000008 18072908d778SJames Bottomley #define SEEPROMCFG 0x00000004 18082908d778SJames Bottomley #define SEEPROMTYP 0x00000002 18092908d778SJames Bottomley #define SEEPROMEX 0x00000001 18102908d778SJames Bottomley 18112908d778SJames Bottomley 18122908d778SJames Bottomley #define EXSICNTRLR (EXSI_REG_BASE_ADR + 0x04) 18132908d778SJames Bottomley 18142908d778SJames Bottomley #define MODINT_EN 0x00000001 18152908d778SJames Bottomley 18162908d778SJames Bottomley 18172908d778SJames Bottomley #define PMSTATR (EXSI_REG_BASE_ADR + 0x10) 18182908d778SJames Bottomley 18192908d778SJames Bottomley #define FLASHRST 0x00000002 18202908d778SJames Bottomley #define FLASHRDY 0x00000001 18212908d778SJames Bottomley 18222908d778SJames Bottomley 18232908d778SJames Bottomley #define FLCNFGR (EXSI_REG_BASE_ADR + 0x14) 18242908d778SJames Bottomley 18252908d778SJames Bottomley #define FLWEH_MASK 0x30000000 18262908d778SJames Bottomley #define FLWESU_MASK 0x0C000000 18272908d778SJames Bottomley #define FLWEPW_MASK 0x03F00000 18282908d778SJames Bottomley #define FLOEH_MASK 0x000C0000 18292908d778SJames Bottomley #define FLOESU_MASK 0x00030000 18302908d778SJames Bottomley #define FLOEPW_MASK 0x0000FC00 18312908d778SJames Bottomley #define FLCSH_MASK 0x00000300 18322908d778SJames Bottomley #define FLCSSU_MASK 0x000000C0 18332908d778SJames Bottomley #define FLCSPW_MASK 0x0000003F 18342908d778SJames Bottomley 18352908d778SJames Bottomley #define SRCNFGR (EXSI_REG_BASE_ADR + 0x18) 18362908d778SJames Bottomley 18372908d778SJames Bottomley #define SRWEH_MASK 0x30000000 18382908d778SJames Bottomley #define SRWESU_MASK 0x0C000000 18392908d778SJames Bottomley #define SRWEPW_MASK 0x03F00000 18402908d778SJames Bottomley 18412908d778SJames Bottomley #define SROEH_MASK 0x000C0000 18422908d778SJames Bottomley #define SROESU_MASK 0x00030000 18432908d778SJames Bottomley #define SROEPW_MASK 0x0000FC00 18442908d778SJames Bottomley #define SRCSH_MASK 0x00000300 18452908d778SJames Bottomley #define SRCSSU_MASK 0x000000C0 18462908d778SJames Bottomley #define SRCSPW_MASK 0x0000003F 18472908d778SJames Bottomley 18482908d778SJames Bottomley #define NVCNFGR (EXSI_REG_BASE_ADR + 0x1C) 18492908d778SJames Bottomley 18502908d778SJames Bottomley #define NVWEH_MASK 0x30000000 18512908d778SJames Bottomley #define NVWESU_MASK 0x0C000000 18522908d778SJames Bottomley #define NVWEPW_MASK 0x03F00000 18532908d778SJames Bottomley #define NVOEH_MASK 0x000C0000 18542908d778SJames Bottomley #define NVOESU_MASK 0x00030000 18552908d778SJames Bottomley #define NVOEPW_MASK 0x0000FC00 18562908d778SJames Bottomley #define NVCSH_MASK 0x00000300 18572908d778SJames Bottomley #define NVCSSU_MASK 0x000000C0 18582908d778SJames Bottomley #define NVCSPW_MASK 0x0000003F 18592908d778SJames Bottomley 18602908d778SJames Bottomley #define XRCNFGR (EXSI_REG_BASE_ADR + 0x20) 18612908d778SJames Bottomley 18622908d778SJames Bottomley #define XRWEH_MASK 0x30000000 18632908d778SJames Bottomley #define XRWESU_MASK 0x0C000000 18642908d778SJames Bottomley #define XRWEPW_MASK 0x03F00000 18652908d778SJames Bottomley #define XROEH_MASK 0x000C0000 18662908d778SJames Bottomley #define XROESU_MASK 0x00030000 18672908d778SJames Bottomley #define XROEPW_MASK 0x0000FC00 18682908d778SJames Bottomley #define XRCSH_MASK 0x00000300 18692908d778SJames Bottomley #define XRCSSU_MASK 0x000000C0 18702908d778SJames Bottomley #define XRCSPW_MASK 0x0000003F 18712908d778SJames Bottomley 18722908d778SJames Bottomley #define XREGADDR (EXSI_REG_BASE_ADR + 0x24) 18732908d778SJames Bottomley 18742908d778SJames Bottomley #define XRADDRINCEN 0x80000000 18752908d778SJames Bottomley #define XREGADD_MASK 0x007FFFFF 18762908d778SJames Bottomley 18772908d778SJames Bottomley 18782908d778SJames Bottomley #define XREGDATAR (EXSI_REG_BASE_ADR + 0x28) 18792908d778SJames Bottomley 18802908d778SJames Bottomley #define XREGDATA_MASK 0x0000FFFF 18812908d778SJames Bottomley 18822908d778SJames Bottomley #define GPIOOER (EXSI_REG_BASE_ADR + 0x40) 18832908d778SJames Bottomley 18842908d778SJames Bottomley #define GPIOODENR (EXSI_REG_BASE_ADR + 0x44) 18852908d778SJames Bottomley 18862908d778SJames Bottomley #define GPIOINVR (EXSI_REG_BASE_ADR + 0x48) 18872908d778SJames Bottomley 18882908d778SJames Bottomley #define GPIODATAOR (EXSI_REG_BASE_ADR + 0x4C) 18892908d778SJames Bottomley 18902908d778SJames Bottomley #define GPIODATAIR (EXSI_REG_BASE_ADR + 0x50) 18912908d778SJames Bottomley 18922908d778SJames Bottomley #define GPIOCNFGR (EXSI_REG_BASE_ADR + 0x54) 18932908d778SJames Bottomley 18942908d778SJames Bottomley #define GPIO_EXTSRC 0x00000001 18952908d778SJames Bottomley 18962908d778SJames Bottomley #define SCNTRLR (EXSI_REG_BASE_ADR + 0xA0) 18972908d778SJames Bottomley 18982908d778SJames Bottomley #define SXFERDONE 0x00000100 18992908d778SJames Bottomley #define SXFERCNT_MASK 0x000000E0 19002908d778SJames Bottomley #define SCMDTYP_MASK 0x0000001C 19012908d778SJames Bottomley #define SXFERSTART 0x00000002 19022908d778SJames Bottomley #define SXFEREN 0x00000001 19032908d778SJames Bottomley 19042908d778SJames Bottomley #define SRATER (EXSI_REG_BASE_ADR + 0xA4) 19052908d778SJames Bottomley 19062908d778SJames Bottomley #define SADDRR (EXSI_REG_BASE_ADR + 0xA8) 19072908d778SJames Bottomley 19082908d778SJames Bottomley #define SADDR_MASK 0x0000FFFF 19092908d778SJames Bottomley 19102908d778SJames Bottomley #define SDATAOR (EXSI_REG_BASE_ADR + 0xAC) 19112908d778SJames Bottomley 19122908d778SJames Bottomley #define SDATAOR0 (EXSI_REG_BASE_ADR + 0xAC) 19132908d778SJames Bottomley #define SDATAOR1 (EXSI_REG_BASE_ADR + 0xAD) 19142908d778SJames Bottomley #define SDATAOR2 (EXSI_REG_BASE_ADR + 0xAE) 19152908d778SJames Bottomley #define SDATAOR3 (EXSI_REG_BASE_ADR + 0xAF) 19162908d778SJames Bottomley 19172908d778SJames Bottomley #define SDATAIR (EXSI_REG_BASE_ADR + 0xB0) 19182908d778SJames Bottomley 19192908d778SJames Bottomley #define SDATAIR0 (EXSI_REG_BASE_ADR + 0xB0) 19202908d778SJames Bottomley #define SDATAIR1 (EXSI_REG_BASE_ADR + 0xB1) 19212908d778SJames Bottomley #define SDATAIR2 (EXSI_REG_BASE_ADR + 0xB2) 19222908d778SJames Bottomley #define SDATAIR3 (EXSI_REG_BASE_ADR + 0xB3) 19232908d778SJames Bottomley 19242908d778SJames Bottomley #define ASISTAT0R (EXSI_REG_BASE_ADR + 0xD0) 19252908d778SJames Bottomley #define ASIFMTERR 0x00000400 19262908d778SJames Bottomley #define ASISEECHKERR 0x00000200 19272908d778SJames Bottomley #define ASIERR 0x00000100 19282908d778SJames Bottomley 19292908d778SJames Bottomley #define ASISTAT1R (EXSI_REG_BASE_ADR + 0xD4) 19302908d778SJames Bottomley #define CHECKSUM_MASK 0x0000FFFF 19312908d778SJames Bottomley 19322908d778SJames Bottomley #define ASIERRADDR (EXSI_REG_BASE_ADR + 0xD8) 19332908d778SJames Bottomley #define ASIERRDATAR (EXSI_REG_BASE_ADR + 0xDC) 19342908d778SJames Bottomley #define ASIERRSTATR (EXSI_REG_BASE_ADR + 0xE0) 19352908d778SJames Bottomley #define CPI2ASIBYTECNT_MASK 0x00070000 19362908d778SJames Bottomley #define CPI2ASIBYTEEN_MASK 0x0000F000 19372908d778SJames Bottomley #define CPI2ASITARGERR_MASK 0x00000F00 19382908d778SJames Bottomley #define CPI2ASITARGMID_MASK 0x000000F0 19392908d778SJames Bottomley #define CPI2ASIMSTERR_MASK 0x0000000F 19402908d778SJames Bottomley 19412908d778SJames Bottomley /* 19422908d778SJames Bottomley * XSRAM, External SRAM (DWord and any BE pattern accessible) 19432908d778SJames Bottomley */ 19442908d778SJames Bottomley #define XSRAM_REG_BASE_ADDR 0xB8100000 19452908d778SJames Bottomley #define XSRAM_SIZE 0x100000 19462908d778SJames Bottomley 19472908d778SJames Bottomley /* 19482908d778SJames Bottomley * NVRAM Registers, Address Range: (0x00000 - 0x3FFFF). 19492908d778SJames Bottomley */ 19502908d778SJames Bottomley #define NVRAM_REG_BASE_ADR 0xBF800000 19512908d778SJames Bottomley #define NVRAM_MAX_BASE_ADR 0x003FFFFF 19522908d778SJames Bottomley 19532908d778SJames Bottomley /* OCM base address */ 19542908d778SJames Bottomley #define OCM_BASE_ADDR 0xA0000000 19552908d778SJames Bottomley #define OCM_MAX_SIZE 0x20000 19562908d778SJames Bottomley 19572908d778SJames Bottomley /* 19582908d778SJames Bottomley * Sequencers (Central and Link) Scratch RAM page definitions. 19592908d778SJames Bottomley */ 19602908d778SJames Bottomley 19612908d778SJames Bottomley /* 19622908d778SJames Bottomley * The Central Management Sequencer (CSEQ) Scratch Memory is a 1024 19632908d778SJames Bottomley * byte memory. It is dword accessible and has byte parity 19642908d778SJames Bottomley * protection. The CSEQ accesses it in 32 byte windows, either as mode 19652908d778SJames Bottomley * dependent or mode independent memory. Each mode has 96 bytes, 19662908d778SJames Bottomley * (three 32 byte pages 0-2, not contiguous), leaving 128 bytes of 19672908d778SJames Bottomley * Mode Independent memory (four 32 byte pages 3-7). Note that mode 19682908d778SJames Bottomley * dependent scratch memory, Mode 8, page 0-3 overlaps mode 19692908d778SJames Bottomley * independent scratch memory, pages 0-3. 19702908d778SJames Bottomley * - 896 bytes of mode dependent scratch, 96 bytes per Modes 0-7, and 19712908d778SJames Bottomley * 128 bytes in mode 8, 19722908d778SJames Bottomley * - 259 bytes of mode independent scratch, common to modes 0-15. 19732908d778SJames Bottomley * 19742908d778SJames Bottomley * Sequencer scratch RAM is 1024 bytes. This scratch memory is 19752908d778SJames Bottomley * divided into mode dependent and mode independent scratch with this 19762908d778SJames Bottomley * memory further subdivided into pages of size 32 bytes. There are 5 19772908d778SJames Bottomley * pages (160 bytes) of mode independent scratch and 3 pages of 19782908d778SJames Bottomley * dependent scratch memory for modes 0-7 (768 bytes). Mode 8 pages 19792908d778SJames Bottomley * 0-2 dependent scratch overlap with pages 0-2 of mode independent 19802908d778SJames Bottomley * scratch memory. 19812908d778SJames Bottomley * 19822908d778SJames Bottomley * The host accesses this scratch in a different manner from the 19832908d778SJames Bottomley * central sequencer. The sequencer has to use CSEQ registers CSCRPAGE 19842908d778SJames Bottomley * and CMnSCRPAGE to access the scratch memory. A flat mapping of the 19850779bf2dSMatt LaPlante * scratch memory is available for software convenience and to prevent 19862908d778SJames Bottomley * corruption while the sequencer is running. This memory is mapped 19872908d778SJames Bottomley * onto addresses 800h - BFFh, total of 400h bytes. 19882908d778SJames Bottomley * 19892908d778SJames Bottomley * These addresses are mapped as follows: 19902908d778SJames Bottomley * 19912908d778SJames Bottomley * 800h-83Fh Mode Dependent Scratch Mode 0 Pages 0-1 19922908d778SJames Bottomley * 840h-87Fh Mode Dependent Scratch Mode 1 Pages 0-1 19932908d778SJames Bottomley * 880h-8BFh Mode Dependent Scratch Mode 2 Pages 0-1 19942908d778SJames Bottomley * 8C0h-8FFh Mode Dependent Scratch Mode 3 Pages 0-1 19952908d778SJames Bottomley * 900h-93Fh Mode Dependent Scratch Mode 4 Pages 0-1 19962908d778SJames Bottomley * 940h-97Fh Mode Dependent Scratch Mode 5 Pages 0-1 19972908d778SJames Bottomley * 980h-9BFh Mode Dependent Scratch Mode 6 Pages 0-1 19982908d778SJames Bottomley * 9C0h-9FFh Mode Dependent Scratch Mode 7 Pages 0-1 19992908d778SJames Bottomley * A00h-A5Fh Mode Dependent Scratch Mode 8 Pages 0-2 20002908d778SJames Bottomley * Mode Independent Scratch Pages 0-2 20012908d778SJames Bottomley * A60h-A7Fh Mode Dependent Scratch Mode 8 Page 3 20022908d778SJames Bottomley * Mode Independent Scratch Page 3 20032908d778SJames Bottomley * A80h-AFFh Mode Independent Scratch Pages 4-7 20042908d778SJames Bottomley * B00h-B1Fh Mode Dependent Scratch Mode 0 Page 2 20052908d778SJames Bottomley * B20h-B3Fh Mode Dependent Scratch Mode 1 Page 2 20062908d778SJames Bottomley * B40h-B5Fh Mode Dependent Scratch Mode 2 Page 2 20072908d778SJames Bottomley * B60h-B7Fh Mode Dependent Scratch Mode 3 Page 2 20082908d778SJames Bottomley * B80h-B9Fh Mode Dependent Scratch Mode 4 Page 2 20092908d778SJames Bottomley * BA0h-BBFh Mode Dependent Scratch Mode 5 Page 2 20102908d778SJames Bottomley * BC0h-BDFh Mode Dependent Scratch Mode 6 Page 2 20112908d778SJames Bottomley * BE0h-BFFh Mode Dependent Scratch Mode 7 Page 2 20122908d778SJames Bottomley */ 20132908d778SJames Bottomley 20142908d778SJames Bottomley /* General macros */ 20152908d778SJames Bottomley #define CSEQ_PAGE_SIZE 32 /* Scratch page size (in bytes) */ 20162908d778SJames Bottomley 20172908d778SJames Bottomley /* All macros start with offsets from base + 0x800 (CMAPPEDSCR). 20182908d778SJames Bottomley * Mode dependent scratch page 0, mode 0. 20192908d778SJames Bottomley * For modes 1-7 you have to do arithmetic. */ 20202908d778SJames Bottomley #define CSEQ_LRM_SAVE_SINDEX (CMAPPEDSCR + 0x0000) 20212908d778SJames Bottomley #define CSEQ_LRM_SAVE_SCBPTR (CMAPPEDSCR + 0x0002) 20222908d778SJames Bottomley #define CSEQ_Q_LINK_HEAD (CMAPPEDSCR + 0x0004) 20232908d778SJames Bottomley #define CSEQ_Q_LINK_TAIL (CMAPPEDSCR + 0x0006) 20242908d778SJames Bottomley #define CSEQ_LRM_SAVE_SCRPAGE (CMAPPEDSCR + 0x0008) 20252908d778SJames Bottomley 20262908d778SJames Bottomley /* Mode dependent scratch page 0 mode 8 macros. */ 20272908d778SJames Bottomley #define CSEQ_RET_ADDR (CMAPPEDSCR + 0x0200) 20282908d778SJames Bottomley #define CSEQ_RET_SCBPTR (CMAPPEDSCR + 0x0202) 20292908d778SJames Bottomley #define CSEQ_SAVE_SCBPTR (CMAPPEDSCR + 0x0204) 20302908d778SJames Bottomley #define CSEQ_EMPTY_TRANS_CTX (CMAPPEDSCR + 0x0206) 20312908d778SJames Bottomley #define CSEQ_RESP_LEN (CMAPPEDSCR + 0x0208) 20322908d778SJames Bottomley #define CSEQ_TMF_SCBPTR (CMAPPEDSCR + 0x020A) 20332908d778SJames Bottomley #define CSEQ_GLOBAL_PREV_SCB (CMAPPEDSCR + 0x020C) 20342908d778SJames Bottomley #define CSEQ_GLOBAL_HEAD (CMAPPEDSCR + 0x020E) 20352908d778SJames Bottomley #define CSEQ_CLEAR_LU_HEAD (CMAPPEDSCR + 0x0210) 20362908d778SJames Bottomley #define CSEQ_TMF_OPCODE (CMAPPEDSCR + 0x0212) 20372908d778SJames Bottomley #define CSEQ_SCRATCH_FLAGS (CMAPPEDSCR + 0x0213) 20382908d778SJames Bottomley #define CSEQ_HSB_SITE (CMAPPEDSCR + 0x021A) 20392908d778SJames Bottomley #define CSEQ_FIRST_INV_SCB_SITE (CMAPPEDSCR + 0x021C) 20402908d778SJames Bottomley #define CSEQ_FIRST_INV_DDB_SITE (CMAPPEDSCR + 0x021E) 20412908d778SJames Bottomley 20422908d778SJames Bottomley /* Mode dependent scratch page 1 mode 8 macros. */ 20432908d778SJames Bottomley #define CSEQ_LUN_TO_CLEAR (CMAPPEDSCR + 0x0220) 20442908d778SJames Bottomley #define CSEQ_LUN_TO_CHECK (CMAPPEDSCR + 0x0228) 20452908d778SJames Bottomley 20462908d778SJames Bottomley /* Mode dependent scratch page 2 mode 8 macros */ 20472908d778SJames Bottomley #define CSEQ_HQ_NEW_POINTER (CMAPPEDSCR + 0x0240) 20482908d778SJames Bottomley #define CSEQ_HQ_DONE_BASE (CMAPPEDSCR + 0x0248) 20492908d778SJames Bottomley #define CSEQ_HQ_DONE_POINTER (CMAPPEDSCR + 0x0250) 20502908d778SJames Bottomley #define CSEQ_HQ_DONE_PASS (CMAPPEDSCR + 0x0254) 20512908d778SJames Bottomley 20522908d778SJames Bottomley /* Mode independent scratch page 4 macros. */ 20532908d778SJames Bottomley #define CSEQ_Q_EXE_HEAD (CMAPPEDSCR + 0x0280) 20542908d778SJames Bottomley #define CSEQ_Q_EXE_TAIL (CMAPPEDSCR + 0x0282) 20552908d778SJames Bottomley #define CSEQ_Q_DONE_HEAD (CMAPPEDSCR + 0x0284) 20562908d778SJames Bottomley #define CSEQ_Q_DONE_TAIL (CMAPPEDSCR + 0x0286) 20572908d778SJames Bottomley #define CSEQ_Q_SEND_HEAD (CMAPPEDSCR + 0x0288) 20582908d778SJames Bottomley #define CSEQ_Q_SEND_TAIL (CMAPPEDSCR + 0x028A) 20592908d778SJames Bottomley #define CSEQ_Q_DMA2CHIM_HEAD (CMAPPEDSCR + 0x028C) 20602908d778SJames Bottomley #define CSEQ_Q_DMA2CHIM_TAIL (CMAPPEDSCR + 0x028E) 20612908d778SJames Bottomley #define CSEQ_Q_COPY_HEAD (CMAPPEDSCR + 0x0290) 20622908d778SJames Bottomley #define CSEQ_Q_COPY_TAIL (CMAPPEDSCR + 0x0292) 20632908d778SJames Bottomley #define CSEQ_REG0 (CMAPPEDSCR + 0x0294) 20642908d778SJames Bottomley #define CSEQ_REG1 (CMAPPEDSCR + 0x0296) 20652908d778SJames Bottomley #define CSEQ_REG2 (CMAPPEDSCR + 0x0298) 20662908d778SJames Bottomley #define CSEQ_LINK_CTL_Q_MAP (CMAPPEDSCR + 0x029C) 20672908d778SJames Bottomley #define CSEQ_MAX_CSEQ_MODE (CMAPPEDSCR + 0x029D) 20682908d778SJames Bottomley #define CSEQ_FREE_LIST_HACK_COUNT (CMAPPEDSCR + 0x029E) 20692908d778SJames Bottomley 20702908d778SJames Bottomley /* Mode independent scratch page 5 macros. */ 20712908d778SJames Bottomley #define CSEQ_EST_NEXUS_REQ_QUEUE (CMAPPEDSCR + 0x02A0) 20722908d778SJames Bottomley #define CSEQ_EST_NEXUS_REQ_COUNT (CMAPPEDSCR + 0x02A8) 20732908d778SJames Bottomley #define CSEQ_Q_EST_NEXUS_HEAD (CMAPPEDSCR + 0x02B0) 20742908d778SJames Bottomley #define CSEQ_Q_EST_NEXUS_TAIL (CMAPPEDSCR + 0x02B2) 20752908d778SJames Bottomley #define CSEQ_NEED_EST_NEXUS_SCB (CMAPPEDSCR + 0x02B4) 20762908d778SJames Bottomley #define CSEQ_EST_NEXUS_REQ_HEAD (CMAPPEDSCR + 0x02B6) 20772908d778SJames Bottomley #define CSEQ_EST_NEXUS_REQ_TAIL (CMAPPEDSCR + 0x02B7) 20782908d778SJames Bottomley #define CSEQ_EST_NEXUS_SCB_OFFSET (CMAPPEDSCR + 0x02B8) 20792908d778SJames Bottomley 20802908d778SJames Bottomley /* Mode independent scratch page 6 macros. */ 20812908d778SJames Bottomley #define CSEQ_INT_ROUT_RET_ADDR0 (CMAPPEDSCR + 0x02C0) 20822908d778SJames Bottomley #define CSEQ_INT_ROUT_RET_ADDR1 (CMAPPEDSCR + 0x02C2) 20832908d778SJames Bottomley #define CSEQ_INT_ROUT_SCBPTR (CMAPPEDSCR + 0x02C4) 20842908d778SJames Bottomley #define CSEQ_INT_ROUT_MODE (CMAPPEDSCR + 0x02C6) 20852908d778SJames Bottomley #define CSEQ_ISR_SCRATCH_FLAGS (CMAPPEDSCR + 0x02C7) 20862908d778SJames Bottomley #define CSEQ_ISR_SAVE_SINDEX (CMAPPEDSCR + 0x02C8) 20872908d778SJames Bottomley #define CSEQ_ISR_SAVE_DINDEX (CMAPPEDSCR + 0x02CA) 20882908d778SJames Bottomley #define CSEQ_Q_MONIRTT_HEAD (CMAPPEDSCR + 0x02D0) 20892908d778SJames Bottomley #define CSEQ_Q_MONIRTT_TAIL (CMAPPEDSCR + 0x02D2) 20902908d778SJames Bottomley #define CSEQ_FREE_SCB_MASK (CMAPPEDSCR + 0x02D5) 20912908d778SJames Bottomley #define CSEQ_BUILTIN_FREE_SCB_HEAD (CMAPPEDSCR + 0x02D6) 20922908d778SJames Bottomley #define CSEQ_BUILTIN_FREE_SCB_TAIL (CMAPPEDSCR + 0x02D8) 20932908d778SJames Bottomley #define CSEQ_EXTENDED_FREE_SCB_HEAD (CMAPPEDSCR + 0x02DA) 20942908d778SJames Bottomley #define CSEQ_EXTENDED_FREE_SCB_TAIL (CMAPPEDSCR + 0x02DC) 20952908d778SJames Bottomley 20962908d778SJames Bottomley /* Mode independent scratch page 7 macros. */ 20972908d778SJames Bottomley #define CSEQ_EMPTY_REQ_QUEUE (CMAPPEDSCR + 0x02E0) 20982908d778SJames Bottomley #define CSEQ_EMPTY_REQ_COUNT (CMAPPEDSCR + 0x02E8) 20992908d778SJames Bottomley #define CSEQ_Q_EMPTY_HEAD (CMAPPEDSCR + 0x02F0) 21002908d778SJames Bottomley #define CSEQ_Q_EMPTY_TAIL (CMAPPEDSCR + 0x02F2) 21012908d778SJames Bottomley #define CSEQ_NEED_EMPTY_SCB (CMAPPEDSCR + 0x02F4) 21022908d778SJames Bottomley #define CSEQ_EMPTY_REQ_HEAD (CMAPPEDSCR + 0x02F6) 21032908d778SJames Bottomley #define CSEQ_EMPTY_REQ_TAIL (CMAPPEDSCR + 0x02F7) 21042908d778SJames Bottomley #define CSEQ_EMPTY_SCB_OFFSET (CMAPPEDSCR + 0x02F8) 21052908d778SJames Bottomley #define CSEQ_PRIMITIVE_DATA (CMAPPEDSCR + 0x02FA) 21062908d778SJames Bottomley #define CSEQ_TIMEOUT_CONST (CMAPPEDSCR + 0x02FC) 21072908d778SJames Bottomley 21082908d778SJames Bottomley /*************************************************************************** 21092908d778SJames Bottomley * Link m Sequencer scratch RAM is 512 bytes. 21102908d778SJames Bottomley * This scratch memory is divided into mode dependent and mode 21112908d778SJames Bottomley * independent scratch with this memory further subdivided into 21122908d778SJames Bottomley * pages of size 32 bytes. There are 4 pages (128 bytes) of 21132908d778SJames Bottomley * mode independent scratch and 4 pages of dependent scratch 21142908d778SJames Bottomley * memory for modes 0-2 (384 bytes). 21152908d778SJames Bottomley * 21162908d778SJames Bottomley * The host accesses this scratch in a different manner from the 21172908d778SJames Bottomley * link sequencer. The sequencer has to use LSEQ registers 21182908d778SJames Bottomley * LmSCRPAGE and LmMnSCRPAGE to access the scratch memory. A flat 211925985edcSLucas De Marchi * mapping of the scratch memory is available for software 21202908d778SJames Bottomley * convenience and to prevent corruption while the sequencer is 21212908d778SJames Bottomley * running. This memory is mapped onto addresses 800h - 9FFh. 21222908d778SJames Bottomley * 21232908d778SJames Bottomley * These addresses are mapped as follows: 21242908d778SJames Bottomley * 21252908d778SJames Bottomley * 800h-85Fh Mode Dependent Scratch Mode 0 Pages 0-2 21262908d778SJames Bottomley * 860h-87Fh Mode Dependent Scratch Mode 0 Page 3 21272908d778SJames Bottomley * Mode Dependent Scratch Mode 5 Page 0 21282908d778SJames Bottomley * 880h-8DFh Mode Dependent Scratch Mode 1 Pages 0-2 21292908d778SJames Bottomley * 8E0h-8FFh Mode Dependent Scratch Mode 1 Page 3 21302908d778SJames Bottomley * Mode Dependent Scratch Mode 5 Page 1 21312908d778SJames Bottomley * 900h-95Fh Mode Dependent Scratch Mode 2 Pages 0-2 21322908d778SJames Bottomley * 960h-97Fh Mode Dependent Scratch Mode 2 Page 3 21332908d778SJames Bottomley * Mode Dependent Scratch Mode 5 Page 2 21342908d778SJames Bottomley * 980h-9DFh Mode Independent Scratch Pages 0-3 21352908d778SJames Bottomley * 9E0h-9FFh Mode Independent Scratch Page 3 21362908d778SJames Bottomley * Mode Dependent Scratch Mode 5 Page 3 21372908d778SJames Bottomley * 21382908d778SJames Bottomley ****************************************************************************/ 21392908d778SJames Bottomley /* General macros */ 21402908d778SJames Bottomley #define LSEQ_MODE_SCRATCH_SIZE 0x80 /* Size of scratch RAM per mode */ 21412908d778SJames Bottomley #define LSEQ_PAGE_SIZE 0x20 /* Scratch page size (in bytes) */ 21422908d778SJames Bottomley #define LSEQ_MODE5_PAGE0_OFFSET 0x60 21432908d778SJames Bottomley 21442908d778SJames Bottomley /* Common mode dependent scratch page 0 macros for modes 0,1,2, and 5 */ 21452908d778SJames Bottomley /* Indexed using LSEQ_MODE_SCRATCH_SIZE * mode, for modes 0,1,2. */ 21462908d778SJames Bottomley #define LmSEQ_RET_ADDR(LinkNum) (LmSCRATCH(LinkNum) + 0x0000) 21472908d778SJames Bottomley #define LmSEQ_REG0_MODE(LinkNum) (LmSCRATCH(LinkNum) + 0x0002) 21482908d778SJames Bottomley #define LmSEQ_MODE_FLAGS(LinkNum) (LmSCRATCH(LinkNum) + 0x0004) 21492908d778SJames Bottomley 21502908d778SJames Bottomley /* Mode flag macros (byte 0) */ 21512908d778SJames Bottomley #define SAS_SAVECTX_OCCURRED 0x80 21522908d778SJames Bottomley #define SAS_OOBSVC_OCCURRED 0x40 21532908d778SJames Bottomley #define SAS_OOB_DEVICE_PRESENT 0x20 21542908d778SJames Bottomley #define SAS_CFGHDR_OCCURRED 0x10 21552908d778SJames Bottomley #define SAS_RCV_INTS_ARE_DISABLED 0x08 21562908d778SJames Bottomley #define SAS_OOB_HOT_PLUG_CNCT 0x04 21572908d778SJames Bottomley #define SAS_AWAIT_OPEN_CONNECTION 0x02 21582908d778SJames Bottomley #define SAS_CFGCMPLT_OCCURRED 0x01 21592908d778SJames Bottomley 21602908d778SJames Bottomley /* Mode flag macros (byte 1) */ 21612908d778SJames Bottomley #define SAS_RLSSCB_OCCURRED 0x80 21622908d778SJames Bottomley #define SAS_FORCED_HEADER_MISS 0x40 21632908d778SJames Bottomley 21642908d778SJames Bottomley #define LmSEQ_RET_ADDR2(LinkNum) (LmSCRATCH(LinkNum) + 0x0006) 21652908d778SJames Bottomley #define LmSEQ_RET_ADDR1(LinkNum) (LmSCRATCH(LinkNum) + 0x0008) 21662908d778SJames Bottomley #define LmSEQ_OPCODE_TO_CSEQ(LinkNum) (LmSCRATCH(LinkNum) + 0x000B) 21672908d778SJames Bottomley #define LmSEQ_DATA_TO_CSEQ(LinkNum) (LmSCRATCH(LinkNum) + 0x000C) 21682908d778SJames Bottomley 21692908d778SJames Bottomley /* Mode dependent scratch page 0 macros for mode 0 (non-common) */ 21702908d778SJames Bottomley /* Absolute offsets */ 21712908d778SJames Bottomley #define LmSEQ_FIRST_INV_DDB_SITE(LinkNum) (LmSCRATCH(LinkNum) + 0x000E) 21722908d778SJames Bottomley #define LmSEQ_EMPTY_TRANS_CTX(LinkNum) (LmSCRATCH(LinkNum) + 0x0010) 21732908d778SJames Bottomley #define LmSEQ_RESP_LEN(LinkNum) (LmSCRATCH(LinkNum) + 0x0012) 21742908d778SJames Bottomley #define LmSEQ_FIRST_INV_SCB_SITE(LinkNum) (LmSCRATCH(LinkNum) + 0x0014) 21752908d778SJames Bottomley #define LmSEQ_INTEN_SAVE(LinkNum) (LmSCRATCH(LinkNum) + 0x0016) 21762908d778SJames Bottomley #define LmSEQ_LINK_RST_FRM_LEN(LinkNum) (LmSCRATCH(LinkNum) + 0x001A) 21772908d778SJames Bottomley #define LmSEQ_LINK_RST_PROTOCOL(LinkNum) (LmSCRATCH(LinkNum) + 0x001B) 21782908d778SJames Bottomley #define LmSEQ_RESP_STATUS(LinkNum) (LmSCRATCH(LinkNum) + 0x001C) 21792908d778SJames Bottomley #define LmSEQ_LAST_LOADED_SGE(LinkNum) (LmSCRATCH(LinkNum) + 0x001D) 21802908d778SJames Bottomley #define LmSEQ_SAVE_SCBPTR(LinkNum) (LmSCRATCH(LinkNum) + 0x001E) 21812908d778SJames Bottomley 21822908d778SJames Bottomley /* Mode dependent scratch page 0 macros for mode 1 (non-common) */ 21832908d778SJames Bottomley /* Absolute offsets */ 21842908d778SJames Bottomley #define LmSEQ_Q_XMIT_HEAD(LinkNum) (LmSCRATCH(LinkNum) + 0x008E) 21852908d778SJames Bottomley #define LmSEQ_M1_EMPTY_TRANS_CTX(LinkNum) (LmSCRATCH(LinkNum) + 0x0090) 21862908d778SJames Bottomley #define LmSEQ_INI_CONN_TAG(LinkNum) (LmSCRATCH(LinkNum) + 0x0092) 21872908d778SJames Bottomley #define LmSEQ_FAILED_OPEN_STATUS(LinkNum) (LmSCRATCH(LinkNum) + 0x009A) 21882908d778SJames Bottomley #define LmSEQ_XMIT_REQUEST_TYPE(LinkNum) (LmSCRATCH(LinkNum) + 0x009B) 21892908d778SJames Bottomley #define LmSEQ_M1_RESP_STATUS(LinkNum) (LmSCRATCH(LinkNum) + 0x009C) 21902908d778SJames Bottomley #define LmSEQ_M1_LAST_LOADED_SGE(LinkNum) (LmSCRATCH(LinkNum) + 0x009D) 21912908d778SJames Bottomley #define LmSEQ_M1_SAVE_SCBPTR(LinkNum) (LmSCRATCH(LinkNum) + 0x009E) 21922908d778SJames Bottomley 21932908d778SJames Bottomley /* Mode dependent scratch page 0 macros for mode 2 (non-common) */ 21942908d778SJames Bottomley #define LmSEQ_PORT_COUNTER(LinkNum) (LmSCRATCH(LinkNum) + 0x010E) 21952908d778SJames Bottomley #define LmSEQ_PM_TABLE_PTR(LinkNum) (LmSCRATCH(LinkNum) + 0x0110) 21962908d778SJames Bottomley #define LmSEQ_SATA_INTERLOCK_TMR_SAVE(LinkNum) (LmSCRATCH(LinkNum) + 0x0112) 21972908d778SJames Bottomley #define LmSEQ_IP_BITL(LinkNum) (LmSCRATCH(LinkNum) + 0x0114) 21982908d778SJames Bottomley #define LmSEQ_COPY_SMP_CONN_TAG(LinkNum) (LmSCRATCH(LinkNum) + 0x0116) 21992908d778SJames Bottomley #define LmSEQ_P0M2_OFFS1AH(LinkNum) (LmSCRATCH(LinkNum) + 0x011A) 22002908d778SJames Bottomley 22012908d778SJames Bottomley /* Mode dependent scratch page 0 macros for modes 4/5 (non-common) */ 22022908d778SJames Bottomley /* Absolute offsets */ 22032908d778SJames Bottomley #define LmSEQ_SAVED_OOB_STATUS(LinkNum) (LmSCRATCH(LinkNum) + 0x006E) 22042908d778SJames Bottomley #define LmSEQ_SAVED_OOB_MODE(LinkNum) (LmSCRATCH(LinkNum) + 0x006F) 22052908d778SJames Bottomley #define LmSEQ_Q_LINK_HEAD(LinkNum) (LmSCRATCH(LinkNum) + 0x0070) 22062908d778SJames Bottomley #define LmSEQ_LINK_RST_ERR(LinkNum) (LmSCRATCH(LinkNum) + 0x0072) 22072908d778SJames Bottomley #define LmSEQ_SAVED_OOB_SIGNALS(LinkNum) (LmSCRATCH(LinkNum) + 0x0073) 22082908d778SJames Bottomley #define LmSEQ_SAS_RESET_MODE(LinkNum) (LmSCRATCH(LinkNum) + 0x0074) 22092908d778SJames Bottomley #define LmSEQ_LINK_RESET_RETRY_COUNT(LinkNum) (LmSCRATCH(LinkNum) + 0x0075) 22102908d778SJames Bottomley #define LmSEQ_NUM_LINK_RESET_RETRIES(LinkNum) (LmSCRATCH(LinkNum) + 0x0076) 2211083d1631SWu, Gilbert #define LmSEQ_OOB_INT_ENABLES(LinkNum) (LmSCRATCH(LinkNum) + 0x0078) 2212083d1631SWu, Gilbert #define LmSEQ_NOTIFY_TIMER_DOWN_COUNT(LinkNum) (LmSCRATCH(LinkNum) + 0x007A) 22132908d778SJames Bottomley #define LmSEQ_NOTIFY_TIMER_TIMEOUT(LinkNum) (LmSCRATCH(LinkNum) + 0x007C) 2214083d1631SWu, Gilbert #define LmSEQ_NOTIFY_TIMER_INITIAL_COUNT(LinkNum) (LmSCRATCH(LinkNum) + 0x007E) 22152908d778SJames Bottomley 22162908d778SJames Bottomley /* Mode dependent scratch page 1, mode 0 and mode 1 */ 22172908d778SJames Bottomley #define LmSEQ_SG_LIST_PTR_ADDR0(LinkNum) (LmSCRATCH(LinkNum) + 0x0020) 22182908d778SJames Bottomley #define LmSEQ_SG_LIST_PTR_ADDR1(LinkNum) (LmSCRATCH(LinkNum) + 0x0030) 22192908d778SJames Bottomley #define LmSEQ_M1_SG_LIST_PTR_ADDR0(LinkNum) (LmSCRATCH(LinkNum) + 0x00A0) 22202908d778SJames Bottomley #define LmSEQ_M1_SG_LIST_PTR_ADDR1(LinkNum) (LmSCRATCH(LinkNum) + 0x00B0) 22212908d778SJames Bottomley 22222908d778SJames Bottomley /* Mode dependent scratch page 1 macros for mode 2 */ 22232908d778SJames Bottomley /* Absolute offsets */ 22242908d778SJames Bottomley #define LmSEQ_INVALID_DWORD_COUNT(LinkNum) (LmSCRATCH(LinkNum) + 0x0120) 22252908d778SJames Bottomley #define LmSEQ_DISPARITY_ERROR_COUNT(LinkNum) (LmSCRATCH(LinkNum) + 0x0124) 22262908d778SJames Bottomley #define LmSEQ_LOSS_OF_SYNC_COUNT(LinkNum) (LmSCRATCH(LinkNum) + 0x0128) 22272908d778SJames Bottomley 22282908d778SJames Bottomley /* Mode dependent scratch page 1 macros for mode 4/5 */ 22292908d778SJames Bottomley #define LmSEQ_FRAME_TYPE_MASK(LinkNum) (LmSCRATCH(LinkNum) + 0x00E0) 22302908d778SJames Bottomley #define LmSEQ_HASHED_DEST_ADDR_MASK(LinkNum) (LmSCRATCH(LinkNum) + 0x00E1) 22312908d778SJames Bottomley #define LmSEQ_HASHED_SRC_ADDR_MASK_PRINT(LinkNum) (LmSCRATCH(LinkNum) + 0x00E4) 22322908d778SJames Bottomley #define LmSEQ_HASHED_SRC_ADDR_MASK(LinkNum) (LmSCRATCH(LinkNum) + 0x00E5) 22332908d778SJames Bottomley #define LmSEQ_NUM_FILL_BYTES_MASK(LinkNum) (LmSCRATCH(LinkNum) + 0x00EB) 22342908d778SJames Bottomley #define LmSEQ_TAG_MASK(LinkNum) (LmSCRATCH(LinkNum) + 0x00F0) 22352908d778SJames Bottomley #define LmSEQ_TARGET_PORT_XFER_TAG(LinkNum) (LmSCRATCH(LinkNum) + 0x00F2) 22362908d778SJames Bottomley #define LmSEQ_DATA_OFFSET(LinkNum) (LmSCRATCH(LinkNum) + 0x00F4) 22372908d778SJames Bottomley 22382908d778SJames Bottomley /* Mode dependent scratch page 2 macros for mode 0 */ 22392908d778SJames Bottomley /* Absolute offsets */ 22402908d778SJames Bottomley #define LmSEQ_SMP_RCV_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x0040) 22412908d778SJames Bottomley #define LmSEQ_DEVICE_BITS(LinkNum) (LmSCRATCH(LinkNum) + 0x005B) 22422908d778SJames Bottomley #define LmSEQ_SDB_DDB(LinkNum) (LmSCRATCH(LinkNum) + 0x005C) 22432908d778SJames Bottomley #define LmSEQ_SDB_NUM_TAGS(LinkNum) (LmSCRATCH(LinkNum) + 0x005E) 22442908d778SJames Bottomley #define LmSEQ_SDB_CURR_TAG(LinkNum) (LmSCRATCH(LinkNum) + 0x005F) 22452908d778SJames Bottomley 22462908d778SJames Bottomley /* Mode dependent scratch page 2 macros for mode 1 */ 22472908d778SJames Bottomley /* Absolute offsets */ 22482908d778SJames Bottomley /* byte 0 bits 1-0 are domain select. */ 22492908d778SJames Bottomley #define LmSEQ_TX_ID_ADDR_FRAME(LinkNum) (LmSCRATCH(LinkNum) + 0x00C0) 22502908d778SJames Bottomley #define LmSEQ_OPEN_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x00C8) 22512908d778SJames Bottomley #define LmSEQ_SRST_AS_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x00CC) 22522908d778SJames Bottomley #define LmSEQ_LAST_LOADED_SG_EL(LinkNum) (LmSCRATCH(LinkNum) + 0x00D4) 22532908d778SJames Bottomley 22542908d778SJames Bottomley /* Mode dependent scratch page 2 macros for mode 2 */ 22552908d778SJames Bottomley /* Absolute offsets */ 22562908d778SJames Bottomley #define LmSEQ_STP_SHUTDOWN_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x0140) 22572908d778SJames Bottomley #define LmSEQ_CLOSE_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x0144) 22582908d778SJames Bottomley #define LmSEQ_BREAK_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x0148) 22592908d778SJames Bottomley #define LmSEQ_DWS_RESET_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x014C) 22602908d778SJames Bottomley #define LmSEQ_SATA_INTERLOCK_TIMER_TERM_TS(LinkNum) \ 22612908d778SJames Bottomley (LmSCRATCH(LinkNum) + 0x0150) 22622908d778SJames Bottomley #define LmSEQ_MCTL_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x0154) 22632908d778SJames Bottomley 22642908d778SJames Bottomley /* Mode dependent scratch page 2 macros for mode 5 */ 22652908d778SJames Bottomley #define LmSEQ_COMINIT_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x0160) 22662908d778SJames Bottomley #define LmSEQ_RCV_ID_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x0164) 22672908d778SJames Bottomley #define LmSEQ_RCV_FIS_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x0168) 22682908d778SJames Bottomley #define LmSEQ_DEV_PRES_TIMER_TERM_TS(LinkNum) (LmSCRATCH(LinkNum) + 0x016C) 22692908d778SJames Bottomley 22702908d778SJames Bottomley /* Mode dependent scratch page 3 macros for modes 0 and 1 */ 22712908d778SJames Bottomley /* None defined */ 22722908d778SJames Bottomley 22732908d778SJames Bottomley /* Mode dependent scratch page 3 macros for modes 2 and 5 */ 22742908d778SJames Bottomley /* None defined */ 22752908d778SJames Bottomley 22762908d778SJames Bottomley /* Mode Independent Scratch page 0 macros. */ 22772908d778SJames Bottomley #define LmSEQ_Q_TGTXFR_HEAD(LinkNum) (LmSCRATCH(LinkNum) + 0x0180) 22782908d778SJames Bottomley #define LmSEQ_Q_TGTXFR_TAIL(LinkNum) (LmSCRATCH(LinkNum) + 0x0182) 22792908d778SJames Bottomley #define LmSEQ_LINK_NUMBER(LinkNum) (LmSCRATCH(LinkNum) + 0x0186) 22802908d778SJames Bottomley #define LmSEQ_SCRATCH_FLAGS(LinkNum) (LmSCRATCH(LinkNum) + 0x0187) 22812908d778SJames Bottomley /* 22822908d778SJames Bottomley * Currently only bit 0, SAS_DWSAQD, is used. 22832908d778SJames Bottomley */ 22842908d778SJames Bottomley #define SAS_DWSAQD 0x01 /* 22852908d778SJames Bottomley * DWSSTATUS: DWSAQD 22862908d778SJames Bottomley * bit las read in ISR. 22872908d778SJames Bottomley */ 22882908d778SJames Bottomley #define LmSEQ_CONNECTION_STATE(LinkNum) (LmSCRATCH(LinkNum) + 0x0188) 22892908d778SJames Bottomley /* Connection states (byte 0) */ 22902908d778SJames Bottomley #define SAS_WE_OPENED_CS 0x01 22912908d778SJames Bottomley #define SAS_DEVICE_OPENED_CS 0x02 22922908d778SJames Bottomley #define SAS_WE_SENT_DONE_CS 0x04 22932908d778SJames Bottomley #define SAS_DEVICE_SENT_DONE_CS 0x08 22942908d778SJames Bottomley #define SAS_WE_SENT_CLOSE_CS 0x10 22952908d778SJames Bottomley #define SAS_DEVICE_SENT_CLOSE_CS 0x20 22962908d778SJames Bottomley #define SAS_WE_SENT_BREAK_CS 0x40 22972908d778SJames Bottomley #define SAS_DEVICE_SENT_BREAK_CS 0x80 22982908d778SJames Bottomley /* Connection states (byte 1) */ 22992908d778SJames Bottomley #define SAS_OPN_TIMEOUT_OR_OPN_RJCT_CS 0x01 23002908d778SJames Bottomley #define SAS_AIP_RECEIVED_CS 0x02 23012908d778SJames Bottomley #define SAS_CREDIT_TIMEOUT_OCCURRED_CS 0x04 23022908d778SJames Bottomley #define SAS_ACKNAK_TIMEOUT_OCCURRED_CS 0x08 23032908d778SJames Bottomley #define SAS_SMPRSP_TIMEOUT_OCCURRED_CS 0x10 23042908d778SJames Bottomley #define SAS_DONE_TIMEOUT_OCCURRED_CS 0x20 23052908d778SJames Bottomley /* Connection states (byte 2) */ 23062908d778SJames Bottomley #define SAS_SMP_RESPONSE_RECEIVED_CS 0x01 23072908d778SJames Bottomley #define SAS_INTLK_TIMEOUT_OCCURRED_CS 0x02 23082908d778SJames Bottomley #define SAS_DEVICE_SENT_DMAT_CS 0x04 23092908d778SJames Bottomley #define SAS_DEVICE_SENT_SYNCSRST_CS 0x08 23102908d778SJames Bottomley #define SAS_CLEARING_AFFILIATION_CS 0x20 23112908d778SJames Bottomley #define SAS_RXTASK_ACTIVE_CS 0x40 23122908d778SJames Bottomley #define SAS_TXTASK_ACTIVE_CS 0x80 23132908d778SJames Bottomley /* Connection states (byte 3) */ 23142908d778SJames Bottomley #define SAS_PHY_LOSS_OF_SIGNAL_CS 0x01 23152908d778SJames Bottomley #define SAS_DWS_TIMER_EXPIRED_CS 0x02 23162908d778SJames Bottomley #define SAS_LINK_RESET_NOT_COMPLETE_CS 0x04 23172908d778SJames Bottomley #define SAS_PHY_DISABLED_CS 0x08 23182908d778SJames Bottomley #define SAS_LINK_CTL_TASK_ACTIVE_CS 0x10 23192908d778SJames Bottomley #define SAS_PHY_EVENT_TASK_ACTIVE_CS 0x20 23202908d778SJames Bottomley #define SAS_DEVICE_SENT_ID_FRAME_CS 0x40 23212908d778SJames Bottomley #define SAS_DEVICE_SENT_REG_FIS_CS 0x40 23222908d778SJames Bottomley #define SAS_DEVICE_SENT_HARD_RESET_CS 0x80 23232908d778SJames Bottomley #define SAS_PHY_IS_DOWN_FLAGS (SAS_PHY_LOSS_OF_SIGNAL_CS|\ 23242908d778SJames Bottomley SAS_DWS_TIMER_EXPIRED_CS |\ 23252908d778SJames Bottomley SAS_LINK_RESET_NOT_COMPLETE_CS|\ 23262908d778SJames Bottomley SAS_PHY_DISABLED_CS) 23272908d778SJames Bottomley 23282908d778SJames Bottomley #define SAS_LINK_CTL_PHY_EVENT_FLAGS (SAS_LINK_CTL_TASK_ACTIVE_CS |\ 23292908d778SJames Bottomley SAS_PHY_EVENT_TASK_ACTIVE_CS |\ 23302908d778SJames Bottomley SAS_DEVICE_SENT_ID_FRAME_CS |\ 23312908d778SJames Bottomley SAS_DEVICE_SENT_HARD_RESET_CS) 23322908d778SJames Bottomley 23332908d778SJames Bottomley #define LmSEQ_CONCTL(LinkNum) (LmSCRATCH(LinkNum) + 0x018C) 23342908d778SJames Bottomley #define LmSEQ_CONSTAT(LinkNum) (LmSCRATCH(LinkNum) + 0x018E) 23352908d778SJames Bottomley #define LmSEQ_CONNECTION_MODES(LinkNum) (LmSCRATCH(LinkNum) + 0x018F) 23362908d778SJames Bottomley #define LmSEQ_REG1_ISR(LinkNum) (LmSCRATCH(LinkNum) + 0x0192) 23372908d778SJames Bottomley #define LmSEQ_REG2_ISR(LinkNum) (LmSCRATCH(LinkNum) + 0x0194) 23382908d778SJames Bottomley #define LmSEQ_REG3_ISR(LinkNum) (LmSCRATCH(LinkNum) + 0x0196) 23392908d778SJames Bottomley #define LmSEQ_REG0_ISR(LinkNum) (LmSCRATCH(LinkNum) + 0x0198) 23402908d778SJames Bottomley 23412908d778SJames Bottomley /* Mode independent scratch page 1 macros. */ 23422908d778SJames Bottomley #define LmSEQ_EST_NEXUS_SCBPTR0(LinkNum) (LmSCRATCH(LinkNum) + 0x01A0) 23432908d778SJames Bottomley #define LmSEQ_EST_NEXUS_SCBPTR1(LinkNum) (LmSCRATCH(LinkNum) + 0x01A2) 23442908d778SJames Bottomley #define LmSEQ_EST_NEXUS_SCBPTR2(LinkNum) (LmSCRATCH(LinkNum) + 0x01A4) 23452908d778SJames Bottomley #define LmSEQ_EST_NEXUS_SCBPTR3(LinkNum) (LmSCRATCH(LinkNum) + 0x01A6) 23462908d778SJames Bottomley #define LmSEQ_EST_NEXUS_SCB_OPCODE0(LinkNum) (LmSCRATCH(LinkNum) + 0x01A8) 23472908d778SJames Bottomley #define LmSEQ_EST_NEXUS_SCB_OPCODE1(LinkNum) (LmSCRATCH(LinkNum) + 0x01A9) 23482908d778SJames Bottomley #define LmSEQ_EST_NEXUS_SCB_OPCODE2(LinkNum) (LmSCRATCH(LinkNum) + 0x01AA) 23492908d778SJames Bottomley #define LmSEQ_EST_NEXUS_SCB_OPCODE3(LinkNum) (LmSCRATCH(LinkNum) + 0x01AB) 23502908d778SJames Bottomley #define LmSEQ_EST_NEXUS_SCB_HEAD(LinkNum) (LmSCRATCH(LinkNum) + 0x01AC) 23512908d778SJames Bottomley #define LmSEQ_EST_NEXUS_SCB_TAIL(LinkNum) (LmSCRATCH(LinkNum) + 0x01AD) 23522908d778SJames Bottomley #define LmSEQ_EST_NEXUS_BUF_AVAIL(LinkNum) (LmSCRATCH(LinkNum) + 0x01AE) 23532908d778SJames Bottomley #define LmSEQ_TIMEOUT_CONST(LinkNum) (LmSCRATCH(LinkNum) + 0x01B8) 23542908d778SJames Bottomley #define LmSEQ_ISR_SAVE_SINDEX(LinkNum) (LmSCRATCH(LinkNum) + 0x01BC) 23552908d778SJames Bottomley #define LmSEQ_ISR_SAVE_DINDEX(LinkNum) (LmSCRATCH(LinkNum) + 0x01BE) 23562908d778SJames Bottomley 23572908d778SJames Bottomley /* Mode independent scratch page 2 macros. */ 23582908d778SJames Bottomley #define LmSEQ_EMPTY_SCB_PTR0(LinkNum) (LmSCRATCH(LinkNum) + 0x01C0) 23592908d778SJames Bottomley #define LmSEQ_EMPTY_SCB_PTR1(LinkNum) (LmSCRATCH(LinkNum) + 0x01C2) 23602908d778SJames Bottomley #define LmSEQ_EMPTY_SCB_PTR2(LinkNum) (LmSCRATCH(LinkNum) + 0x01C4) 23612908d778SJames Bottomley #define LmSEQ_EMPTY_SCB_PTR3(LinkNum) (LmSCRATCH(LinkNum) + 0x01C6) 23622908d778SJames Bottomley #define LmSEQ_EMPTY_SCB_OPCD0(LinkNum) (LmSCRATCH(LinkNum) + 0x01C8) 23632908d778SJames Bottomley #define LmSEQ_EMPTY_SCB_OPCD1(LinkNum) (LmSCRATCH(LinkNum) + 0x01C9) 23642908d778SJames Bottomley #define LmSEQ_EMPTY_SCB_OPCD2(LinkNum) (LmSCRATCH(LinkNum) + 0x01CA) 23652908d778SJames Bottomley #define LmSEQ_EMPTY_SCB_OPCD3(LinkNum) (LmSCRATCH(LinkNum) + 0x01CB) 23662908d778SJames Bottomley #define LmSEQ_EMPTY_SCB_HEAD(LinkNum) (LmSCRATCH(LinkNum) + 0x01CC) 23672908d778SJames Bottomley #define LmSEQ_EMPTY_SCB_TAIL(LinkNum) (LmSCRATCH(LinkNum) + 0x01CD) 23682908d778SJames Bottomley #define LmSEQ_EMPTY_BUFS_AVAIL(LinkNum) (LmSCRATCH(LinkNum) + 0x01CE) 23692908d778SJames Bottomley #define LmSEQ_ATA_SCR_REGS(LinkNum) (LmSCRATCH(LinkNum) + 0x01D4) 23702908d778SJames Bottomley 23712908d778SJames Bottomley /* Mode independent scratch page 3 macros. */ 23722908d778SJames Bottomley #define LmSEQ_DEV_PRES_TMR_TOUT_CONST(LinkNum) (LmSCRATCH(LinkNum) + 0x01E0) 23732908d778SJames Bottomley #define LmSEQ_SATA_INTERLOCK_TIMEOUT(LinkNum) (LmSCRATCH(LinkNum) + 0x01E4) 23742908d778SJames Bottomley #define LmSEQ_STP_SHUTDOWN_TIMEOUT(LinkNum) (LmSCRATCH(LinkNum) + 0x01E8) 23752908d778SJames Bottomley #define LmSEQ_SRST_ASSERT_TIMEOUT(LinkNum) (LmSCRATCH(LinkNum) + 0x01EC) 23762908d778SJames Bottomley #define LmSEQ_RCV_FIS_TIMEOUT(LinkNum) (LmSCRATCH(LinkNum) + 0x01F0) 23772908d778SJames Bottomley #define LmSEQ_ONE_MILLISEC_TIMEOUT(LinkNum) (LmSCRATCH(LinkNum) + 0x01F4) 23782908d778SJames Bottomley #define LmSEQ_TEN_MS_COMINIT_TIMEOUT(LinkNum) (LmSCRATCH(LinkNum) + 0x01F8) 23792908d778SJames Bottomley #define LmSEQ_SMP_RCV_TIMEOUT(LinkNum) (LmSCRATCH(LinkNum) + 0x01FC) 23802908d778SJames Bottomley 23812908d778SJames Bottomley #endif 2382