ata-pci.h revision 224270
1111188Ssos/*- 2178067Ssos * Copyright (c) 2003 - 2008 S�ren Schmidt <sos@FreeBSD.org> 3111188Ssos * All rights reserved. 4111188Ssos * 5111188Ssos * Redistribution and use in source and binary forms, with or without 6111188Ssos * modification, are permitted provided that the following conditions 7111188Ssos * are met: 8111188Ssos * 1. Redistributions of source code must retain the above copyright 9111188Ssos * notice, this list of conditions and the following disclaimer, 10111188Ssos * without modification, immediately at the beginning of the file. 11111188Ssos * 2. Redistributions in binary form must reproduce the above copyright 12111188Ssos * notice, this list of conditions and the following disclaimer in the 13111188Ssos * documentation and/or other materials provided with the distribution. 14111188Ssos * 15111188Ssos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16111188Ssos * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17111188Ssos * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18111188Ssos * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19111188Ssos * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20111188Ssos * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21111188Ssos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22111188Ssos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23111188Ssos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24111188Ssos * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25111188Ssos * 26111188Ssos * $FreeBSD: head/sys/dev/ata/ata-pci.h 224270 2011-07-22 16:37:04Z mav $ 27111188Ssos */ 28111188Ssos 29111188Ssos/* structure holding chipset config info */ 30111188Ssosstruct ata_chip_id { 31144330Ssos u_int32_t chipid; 32144330Ssos u_int8_t chiprev; 33144330Ssos int cfg1; 34144330Ssos int cfg2; 35144330Ssos u_int8_t max_dma; 36144330Ssos char *text; 37111188Ssos}; 38111188Ssos 39199322Smav#define ATA_PCI_MAX_CH 8 40199322Smav 41111188Ssos/* structure describing a PCI ATA controller */ 42111188Ssosstruct ata_pci_controller { 43144330Ssos device_t dev; 44144330Ssos int r_type1; 45144330Ssos int r_rid1; 46144330Ssos struct resource *r_res1; 47144330Ssos int r_type2; 48144330Ssos int r_rid2; 49144330Ssos struct resource *r_res2; 50188655Smav int r_irq_rid; 51144330Ssos struct resource *r_irq; 52144330Ssos void *handle; 53144330Ssos struct ata_chip_id *chip; 54186182Smav int legacy; 55144330Ssos int channels; 56188694Smav int ichannels; 57144330Ssos int (*chipinit)(device_t); 58224270Smav int (*chipdeinit)(device_t); 59183141Ssos int (*suspend)(device_t); 60183141Ssos int (*resume)(device_t); 61188765Smav int (*ch_attach)(device_t); 62188765Smav int (*ch_detach)(device_t); 63190581Smav int (*ch_suspend)(device_t); 64190581Smav int (*ch_resume)(device_t); 65145713Ssos int (*locking)(device_t, int); 66145713Ssos void (*reset)(device_t); 67200171Smav int (*setmode)(device_t, int, int); 68200171Smav int (*getrev)(device_t, int); 69111188Ssos struct { 70144330Ssos void (*function)(void *); 71144330Ssos void *argument; 72199322Smav } interrupt[ATA_PCI_MAX_CH]; 73192105Sjhb void *chipset_data; 74111188Ssos}; 75111188Ssos 76111188Ssos/* defines for known chipset PCI id's */ 77144330Ssos#define ATA_ACARD_ID 0x1191 78144330Ssos#define ATA_ATP850 0x00021191 79144330Ssos#define ATA_ATP850A 0x00041191 80144330Ssos#define ATA_ATP850R 0x00051191 81144330Ssos#define ATA_ATP860A 0x00061191 82144330Ssos#define ATA_ATP860R 0x00071191 83144330Ssos#define ATA_ATP865A 0x00081191 84144330Ssos#define ATA_ATP865R 0x00091191 85111188Ssos 86178375Ssos#define ATA_ACER_LABS_ID 0x10b9 87178375Ssos#define ATA_ALI_1533 0x153310b9 88204509Smav#define ATA_ALI_5228 0x522810b9 89178375Ssos#define ATA_ALI_5229 0x522910b9 90178375Ssos#define ATA_ALI_5281 0x528110b9 91178375Ssos#define ATA_ALI_5287 0x528710b9 92178375Ssos#define ATA_ALI_5288 0x528810b9 93178375Ssos#define ATA_ALI_5289 0x528910b9 94178375Ssos 95144330Ssos#define ATA_AMD_ID 0x1022 96144330Ssos#define ATA_AMD755 0x74011022 97144330Ssos#define ATA_AMD756 0x74091022 98144330Ssos#define ATA_AMD766 0x74111022 99144330Ssos#define ATA_AMD768 0x74411022 100144330Ssos#define ATA_AMD8111 0x74691022 101172436Sphk#define ATA_AMD5536 0x209a1022 102111188Ssos 103178375Ssos#define ATA_ADAPTEC_ID 0x9005 104178375Ssos#define ATA_ADAPTEC_1420 0x02419005 105198700Smav#define ATA_ADAPTEC_1430 0x02439005 106111188Ssos 107154515Ssos#define ATA_ATI_ID 0x1002 108154515Ssos#define ATA_ATI_IXP200 0x43491002 109154515Ssos#define ATA_ATI_IXP300 0x43691002 110173734Ssos#define ATA_ATI_IXP300_S1 0x436e1002 111154515Ssos#define ATA_ATI_IXP400 0x43761002 112154515Ssos#define ATA_ATI_IXP400_S1 0x43791002 113154515Ssos#define ATA_ATI_IXP400_S2 0x437a1002 114173734Ssos#define ATA_ATI_IXP600 0x438c1002 115176891Ssos#define ATA_ATI_IXP600_S1 0x43801002 116173734Ssos#define ATA_ATI_IXP700 0x439c1002 117176891Ssos#define ATA_ATI_IXP700_S1 0x43901002 118191568Sjkim#define ATA_ATI_IXP700_S2 0x43911002 119191568Sjkim#define ATA_ATI_IXP700_S3 0x43921002 120191568Sjkim#define ATA_ATI_IXP700_S4 0x43931002 121191568Sjkim#define ATA_ATI_IXP800_S1 0x43941002 122191568Sjkim#define ATA_ATI_IXP800_S2 0x43951002 123151267Ssos 124144330Ssos#define ATA_CENATEK_ID 0x16ca 125144330Ssos#define ATA_CENATEK_ROCKET 0x000116ca 126138555Ssos 127144330Ssos#define ATA_CYRIX_ID 0x1078 128144330Ssos#define ATA_CYRIX_5530 0x01021078 129111188Ssos 130144330Ssos#define ATA_CYPRESS_ID 0x1080 131144330Ssos#define ATA_CYPRESS_82C693 0xc6931080 132111188Ssos 133144330Ssos#define ATA_DEC_21150 0x00221011 134144330Ssos#define ATA_DEC_21150_1 0x00231011 135111188Ssos 136144330Ssos#define ATA_HIGHPOINT_ID 0x1103 137144330Ssos#define ATA_HPT366 0x00041103 138144330Ssos#define ATA_HPT372 0x00051103 139144330Ssos#define ATA_HPT302 0x00061103 140144330Ssos#define ATA_HPT371 0x00071103 141144330Ssos#define ATA_HPT374 0x00081103 142111188Ssos 143144330Ssos#define ATA_INTEL_ID 0x8086 144144330Ssos#define ATA_I960RM 0x09628086 145144330Ssos#define ATA_I82371FB 0x12308086 146144330Ssos#define ATA_I82371SB 0x70108086 147144330Ssos#define ATA_I82371AB 0x71118086 148144330Ssos#define ATA_I82443MX 0x71998086 149144330Ssos#define ATA_I82451NX 0x84ca8086 150144330Ssos#define ATA_I82372FB 0x76018086 151144330Ssos#define ATA_I82801AB 0x24218086 152144330Ssos#define ATA_I82801AA 0x24118086 153144330Ssos#define ATA_I82801BA 0x244a8086 154144330Ssos#define ATA_I82801BA_1 0x244b8086 155144330Ssos#define ATA_I82801CA 0x248a8086 156144330Ssos#define ATA_I82801CA_1 0x248b8086 157144330Ssos#define ATA_I82801DB 0x24cb8086 158144330Ssos#define ATA_I82801DB_1 0x24ca8086 159144330Ssos#define ATA_I82801EB 0x24db8086 160144330Ssos#define ATA_I82801EB_S1 0x24d18086 161144330Ssos#define ATA_I82801EB_R1 0x24df8086 162144330Ssos#define ATA_I6300ESB 0x25a28086 163144330Ssos#define ATA_I6300ESB_S1 0x25a38086 164144330Ssos#define ATA_I6300ESB_R1 0x25b08086 165161291Ssos#define ATA_I63XXESB2 0x269e8086 166161291Ssos#define ATA_I63XXESB2_S1 0x26808086 167161291Ssos#define ATA_I63XXESB2_S2 0x26818086 168161291Ssos#define ATA_I63XXESB2_R1 0x26828086 169161291Ssos#define ATA_I63XXESB2_R2 0x26838086 170144330Ssos#define ATA_I82801FB 0x266f8086 171144330Ssos#define ATA_I82801FB_S1 0x26518086 172144330Ssos#define ATA_I82801FB_R1 0x26528086 173161291Ssos#define ATA_I82801FBM 0x26538086 174146266Ssos#define ATA_I82801GB 0x27df8086 175146266Ssos#define ATA_I82801GB_S1 0x27c08086 176161291Ssos#define ATA_I82801GB_AH 0x27c18086 177146266Ssos#define ATA_I82801GB_R1 0x27c38086 178161291Ssos#define ATA_I82801GBM_S1 0x27c48086 179161291Ssos#define ATA_I82801GBM_AH 0x27c58086 180161291Ssos#define ATA_I82801GBM_R1 0x27c68086 181161291Ssos#define ATA_I82801HB_S1 0x28208086 182161291Ssos#define ATA_I82801HB_AH6 0x28218086 183161291Ssos#define ATA_I82801HB_R1 0x28228086 184161291Ssos#define ATA_I82801HB_AH4 0x28248086 185161291Ssos#define ATA_I82801HB_S2 0x28258086 186180383Sremko#define ATA_I82801HBM 0x28508086 187180437Sremko#define ATA_I82801HBM_S1 0x28288086 188180437Sremko#define ATA_I82801HBM_S2 0x28298086 189180437Sremko#define ATA_I82801HBM_S3 0x282a8086 190172134Ssimon#define ATA_I82801IB_S1 0x29208086 191220920Smav#define ATA_I82801IB_S3 0x29218086 192172134Ssimon#define ATA_I82801IB_AH6 0x29228086 193172134Ssimon#define ATA_I82801IB_AH4 0x29238086 194180382Sremko#define ATA_I82801IB_R1 0x29258086 195172134Ssimon#define ATA_I82801IB_S2 0x29268086 196183552Ssos#define ATA_I82801JIB_S1 0x3a208086 197183552Ssos#define ATA_I82801JIB_AH 0x3a228086 198183552Ssos#define ATA_I82801JIB_R1 0x3a258086 199183552Ssos#define ATA_I82801JIB_S2 0x3a268086 200183552Ssos#define ATA_I82801JD_S1 0x3a008086 201183552Ssos#define ATA_I82801JD_AH 0x3a028086 202183552Ssos#define ATA_I82801JD_R1 0x3a058086 203183552Ssos#define ATA_I82801JD_S2 0x3a068086 204199074Smav#define ATA_I82801JI_S1 0x3a208086 205199074Smav#define ATA_I82801JI_AH 0x3a228086 206199074Smav#define ATA_I82801JI_R1 0x3a258086 207199074Smav#define ATA_I82801JI_S2 0x3a268086 208211920Smav 209211920Smav#define ATA_5Series_S1 0x3b208086 210211920Smav#define ATA_5Series_S2 0x3b218086 211211920Smav#define ATA_5Series_AH1 0x3b228086 212211920Smav#define ATA_5Series_AH2 0x3b238086 213211920Smav#define ATA_5Series_R1 0x3b258086 214211920Smav#define ATA_5Series_S3 0x3b268086 215211920Smav#define ATA_5Series_S4 0x3b288086 216211920Smav#define ATA_5Series_AH3 0x3b298086 217211920Smav#define ATA_5Series_R2 0x3b2c8086 218211920Smav#define ATA_5Series_S5 0x3b2d8086 219211920Smav#define ATA_5Series_S6 0x3b2e8086 220211920Smav#define ATA_5Series_AH4 0x3b2f8086 221211920Smav 222211920Smav#define ATA_CPT_S1 0x1c008086 223211920Smav#define ATA_CPT_S2 0x1c018086 224211920Smav#define ATA_CPT_AH1 0x1c028086 225211920Smav#define ATA_CPT_AH2 0x1c038086 226211920Smav#define ATA_CPT_R1 0x1c048086 227211920Smav#define ATA_CPT_R2 0x1c058086 228211920Smav#define ATA_CPT_S3 0x1c088086 229211920Smav#define ATA_CPT_S4 0x1c098086 230211920Smav 231218149Sjfv#define ATA_PBG_S1 0x1d008086 232218149Sjfv#define ATA_PBG_AH1 0x1d028086 233218149Sjfv#define ATA_PBG_R1 0x1d048086 234218149Sjfv#define ATA_PBG_R2 0x1d068086 235218149Sjfv#define ATA_PBG_S2 0x1d088086 236218149Sjfv 237221789Sjfv#define ATA_PPT_S1 0x1e008086 238221789Sjfv#define ATA_PPT_S2 0x1e018086 239221789Sjfv#define ATA_PPT_AH1 0x1e028086 240221789Sjfv#define ATA_PPT_AH2 0x1e038086 241221789Sjfv#define ATA_PPT_R1 0x1e048086 242221789Sjfv#define ATA_PPT_R2 0x1e058086 243221789Sjfv#define ATA_PPT_R3 0x1e068086 244221789Sjfv#define ATA_PPT_R4 0x1e078086 245221789Sjfv#define ATA_PPT_S3 0x1e088086 246221789Sjfv#define ATA_PPT_S4 0x1e098086 247221789Sjfv#define ATA_PPT_R5 0x1e0e8086 248221789Sjfv#define ATA_PPT_R6 0x1e0f8086 249221789Sjfv 250154515Ssos#define ATA_I31244 0x32008086 251200857Smav#define ATA_ISCH 0x811a8086 252218140Sjfv#define ATA_DH89XXCC 0x23238086 253111188Ssos 254144330Ssos#define ATA_ITE_ID 0x1283 255148731Ssos#define ATA_IT8211F 0x82111283 256144330Ssos#define ATA_IT8212F 0x82121283 257183380Ssos#define ATA_IT8213F 0x82131283 258138555Ssos 259161291Ssos#define ATA_JMICRON_ID 0x197b 260161291Ssos#define ATA_JMB360 0x2360197b 261161291Ssos#define ATA_JMB361 0x2361197b 262161291Ssos#define ATA_JMB363 0x2363197b 263161291Ssos#define ATA_JMB365 0x2365197b 264161291Ssos#define ATA_JMB366 0x2366197b 265165759Ssos#define ATA_JMB368 0x2368197b 266154829Ssos 267153753Ssos#define ATA_MARVELL_ID 0x11ab 268153753Ssos#define ATA_M88SX5040 0x504011ab 269153753Ssos#define ATA_M88SX5041 0x504111ab 270153753Ssos#define ATA_M88SX5080 0x508011ab 271153753Ssos#define ATA_M88SX5081 0x508111ab 272153753Ssos#define ATA_M88SX6041 0x604111ab 273198700Smav#define ATA_M88SX6042 0x604211ab 274153753Ssos#define ATA_M88SX6081 0x608111ab 275198700Smav#define ATA_M88SX7042 0x704211ab 276165768Ssos#define ATA_M88SX6101 0x610111ab 277199259Smav#define ATA_M88SX6102 0x610211ab 278199259Smav#define ATA_M88SX6111 0x611111ab 279185268Srpaulo#define ATA_M88SX6121 0x612111ab 280199259Smav#define ATA_M88SX6141 0x614111ab 281165768Ssos#define ATA_M88SX6145 0x614511ab 282203030Smav#define ATA_MARVELL2_ID 0x1b4b 283153753Ssos 284144330Ssos#define ATA_MICRON_ID 0x1042 285144330Ssos#define ATA_MICRON_RZ1000 0x10001042 286144330Ssos#define ATA_MICRON_RZ1001 0x10011042 287119404Ssos 288144330Ssos#define ATA_NATIONAL_ID 0x100b 289144330Ssos#define ATA_SC1100 0x0502100b 290111188Ssos 291166477Srink#define ATA_NETCELL_ID 0x169c 292166477Srink#define ATA_NETCELL_SR 0x0044169c 293166477Srink 294144330Ssos#define ATA_NVIDIA_ID 0x10de 295144330Ssos#define ATA_NFORCE1 0x01bc10de 296144330Ssos#define ATA_NFORCE2 0x006510de 297153473Ssos#define ATA_NFORCE2_PRO 0x008510de 298153473Ssos#define ATA_NFORCE2_PRO_S1 0x008e10de 299144330Ssos#define ATA_NFORCE3 0x00d510de 300144330Ssos#define ATA_NFORCE3_PRO 0x00e510de 301144330Ssos#define ATA_NFORCE3_PRO_S1 0x00e310de 302144330Ssos#define ATA_NFORCE3_PRO_S2 0x00ee10de 303153473Ssos#define ATA_NFORCE_MCP04 0x003510de 304153473Ssos#define ATA_NFORCE_MCP04_S1 0x003610de 305153473Ssos#define ATA_NFORCE_MCP04_S2 0x003e10de 306153473Ssos#define ATA_NFORCE_CK804 0x005310de 307153473Ssos#define ATA_NFORCE_CK804_S1 0x005410de 308153473Ssos#define ATA_NFORCE_CK804_S2 0x005510de 309153473Ssos#define ATA_NFORCE_MCP51 0x026510de 310153473Ssos#define ATA_NFORCE_MCP51_S1 0x026610de 311153473Ssos#define ATA_NFORCE_MCP51_S2 0x026710de 312153473Ssos#define ATA_NFORCE_MCP55 0x036e10de 313153473Ssos#define ATA_NFORCE_MCP55_S1 0x037e10de 314153473Ssos#define ATA_NFORCE_MCP55_S2 0x037f10de 315171025Ssos#define ATA_NFORCE_MCP61 0x03ec10de 316171025Ssos#define ATA_NFORCE_MCP61_S1 0x03e710de 317171025Ssos#define ATA_NFORCE_MCP61_S2 0x03f610de 318171025Ssos#define ATA_NFORCE_MCP61_S3 0x03f710de 319173734Ssos#define ATA_NFORCE_MCP65 0x044810de 320198818Smav#define ATA_NFORCE_MCP65_A0 0x044c10de 321198818Smav#define ATA_NFORCE_MCP65_A1 0x044d10de 322198818Smav#define ATA_NFORCE_MCP65_A2 0x044e10de 323198818Smav#define ATA_NFORCE_MCP65_A3 0x044f10de 324198818Smav#define ATA_NFORCE_MCP65_A4 0x045c10de 325198818Smav#define ATA_NFORCE_MCP65_A5 0x045d10de 326198818Smav#define ATA_NFORCE_MCP65_A6 0x045e10de 327198818Smav#define ATA_NFORCE_MCP65_A7 0x045f10de 328198818Smav#define ATA_NFORCE_MCP67 0x056010de 329188846Smav#define ATA_NFORCE_MCP67_A0 0x055010de 330188846Smav#define ATA_NFORCE_MCP67_A1 0x055110de 331188846Smav#define ATA_NFORCE_MCP67_A2 0x055210de 332188846Smav#define ATA_NFORCE_MCP67_A3 0x055310de 333188846Smav#define ATA_NFORCE_MCP67_A4 0x055410de 334188846Smav#define ATA_NFORCE_MCP67_A5 0x055510de 335188846Smav#define ATA_NFORCE_MCP67_A6 0x055610de 336188846Smav#define ATA_NFORCE_MCP67_A7 0x055710de 337188846Smav#define ATA_NFORCE_MCP67_A8 0x055810de 338188846Smav#define ATA_NFORCE_MCP67_A9 0x055910de 339188846Smav#define ATA_NFORCE_MCP67_AA 0x055A10de 340188846Smav#define ATA_NFORCE_MCP67_AB 0x055B10de 341193716Sariff#define ATA_NFORCE_MCP67_AC 0x058410de 342173734Ssos#define ATA_NFORCE_MCP73 0x056c10de 343188846Smav#define ATA_NFORCE_MCP73_A0 0x07f010de 344188846Smav#define ATA_NFORCE_MCP73_A1 0x07f110de 345188846Smav#define ATA_NFORCE_MCP73_A2 0x07f210de 346188846Smav#define ATA_NFORCE_MCP73_A3 0x07f310de 347188846Smav#define ATA_NFORCE_MCP73_A4 0x07f410de 348188846Smav#define ATA_NFORCE_MCP73_A5 0x07f510de 349188846Smav#define ATA_NFORCE_MCP73_A6 0x07f610de 350188846Smav#define ATA_NFORCE_MCP73_A7 0x07f710de 351188846Smav#define ATA_NFORCE_MCP73_A8 0x07f810de 352188846Smav#define ATA_NFORCE_MCP73_A9 0x07f910de 353188846Smav#define ATA_NFORCE_MCP73_AA 0x07fa10de 354188846Smav#define ATA_NFORCE_MCP73_AB 0x07fb10de 355173734Ssos#define ATA_NFORCE_MCP77 0x075910de 356198818Smav#define ATA_NFORCE_MCP77_A0 0x0ad010de 357198818Smav#define ATA_NFORCE_MCP77_A1 0x0ad110de 358198818Smav#define ATA_NFORCE_MCP77_A2 0x0ad210de 359198818Smav#define ATA_NFORCE_MCP77_A3 0x0ad310de 360198818Smav#define ATA_NFORCE_MCP77_A4 0x0ad410de 361198818Smav#define ATA_NFORCE_MCP77_A5 0x0ad510de 362198818Smav#define ATA_NFORCE_MCP77_A6 0x0ad610de 363198818Smav#define ATA_NFORCE_MCP77_A7 0x0ad710de 364198818Smav#define ATA_NFORCE_MCP77_A8 0x0ad810de 365198818Smav#define ATA_NFORCE_MCP77_A9 0x0ad910de 366198818Smav#define ATA_NFORCE_MCP77_AA 0x0ada10de 367198818Smav#define ATA_NFORCE_MCP77_AB 0x0adb10de 368198818Smav#define ATA_NFORCE_MCP79_A0 0x0ab410de 369198818Smav#define ATA_NFORCE_MCP79_A1 0x0ab510de 370198818Smav#define ATA_NFORCE_MCP79_A2 0x0ab610de 371198818Smav#define ATA_NFORCE_MCP79_A3 0x0ab710de 372198818Smav#define ATA_NFORCE_MCP79_A4 0x0ab810de 373198818Smav#define ATA_NFORCE_MCP79_A5 0x0ab910de 374198818Smav#define ATA_NFORCE_MCP79_A6 0x0aba10de 375198818Smav#define ATA_NFORCE_MCP79_A7 0x0abb10de 376198818Smav#define ATA_NFORCE_MCP79_A8 0x0abc10de 377198818Smav#define ATA_NFORCE_MCP79_A9 0x0abd10de 378198818Smav#define ATA_NFORCE_MCP79_AA 0x0abe10de 379198818Smav#define ATA_NFORCE_MCP79_AB 0x0abf10de 380198818Smav#define ATA_NFORCE_MCP89_A0 0x0d8410de 381198818Smav#define ATA_NFORCE_MCP89_A1 0x0d8510de 382198818Smav#define ATA_NFORCE_MCP89_A2 0x0d8610de 383198818Smav#define ATA_NFORCE_MCP89_A3 0x0d8710de 384198818Smav#define ATA_NFORCE_MCP89_A4 0x0d8810de 385198818Smav#define ATA_NFORCE_MCP89_A5 0x0d8910de 386198818Smav#define ATA_NFORCE_MCP89_A6 0x0d8a10de 387198818Smav#define ATA_NFORCE_MCP89_A7 0x0d8b10de 388198818Smav#define ATA_NFORCE_MCP89_A8 0x0d8c10de 389198818Smav#define ATA_NFORCE_MCP89_A9 0x0d8d10de 390198818Smav#define ATA_NFORCE_MCP89_AA 0x0d8e10de 391198818Smav#define ATA_NFORCE_MCP89_AB 0x0d8f10de 392134687Ssos 393144330Ssos#define ATA_PROMISE_ID 0x105a 394144330Ssos#define ATA_PDC20246 0x4d33105a 395144330Ssos#define ATA_PDC20262 0x4d38105a 396144330Ssos#define ATA_PDC20263 0x0d38105a 397144330Ssos#define ATA_PDC20265 0x0d30105a 398144330Ssos#define ATA_PDC20267 0x4d30105a 399144330Ssos#define ATA_PDC20268 0x4d68105a 400144330Ssos#define ATA_PDC20269 0x4d69105a 401144330Ssos#define ATA_PDC20270 0x6268105a 402144330Ssos#define ATA_PDC20271 0x6269105a 403144330Ssos#define ATA_PDC20275 0x1275105a 404144330Ssos#define ATA_PDC20276 0x5275105a 405144330Ssos#define ATA_PDC20277 0x7275105a 406144330Ssos#define ATA_PDC20318 0x3318105a 407144330Ssos#define ATA_PDC20319 0x3319105a 408144330Ssos#define ATA_PDC20371 0x3371105a 409144330Ssos#define ATA_PDC20375 0x3375105a 410144330Ssos#define ATA_PDC20376 0x3376105a 411144330Ssos#define ATA_PDC20377 0x3377105a 412144330Ssos#define ATA_PDC20378 0x3373105a 413144330Ssos#define ATA_PDC20379 0x3372105a 414144330Ssos#define ATA_PDC20571 0x3571105a 415144330Ssos#define ATA_PDC20575 0x3d75105a 416144330Ssos#define ATA_PDC20579 0x3574105a 417154515Ssos#define ATA_PDC20771 0x3570105a 418144330Ssos#define ATA_PDC40518 0x3d18105a 419145191Ssos#define ATA_PDC40519 0x3519105a 420148992Ssos#define ATA_PDC40718 0x3d17105a 421148992Ssos#define ATA_PDC40719 0x3515105a 422154515Ssos#define ATA_PDC40775 0x3d73105a 423154515Ssos#define ATA_PDC40779 0x3577105a 424144330Ssos#define ATA_PDC20617 0x6617105a 425144330Ssos#define ATA_PDC20618 0x6626105a 426144330Ssos#define ATA_PDC20619 0x6629105a 427144330Ssos#define ATA_PDC20620 0x6620105a 428144330Ssos#define ATA_PDC20621 0x6621105a 429144330Ssos#define ATA_PDC20622 0x6622105a 430154515Ssos#define ATA_PDC20624 0x6624105a 431154515Ssos#define ATA_PDC81518 0x8002105a 432111188Ssos 433144330Ssos#define ATA_SERVERWORKS_ID 0x1166 434144330Ssos#define ATA_ROSB4_ISA 0x02001166 435144330Ssos#define ATA_ROSB4 0x02111166 436144330Ssos#define ATA_CSB5 0x02121166 437144330Ssos#define ATA_CSB6 0x02131166 438144330Ssos#define ATA_CSB6_1 0x02171166 439161291Ssos#define ATA_HT1000 0x02141166 440161291Ssos#define ATA_HT1000_S1 0x024b1166 441161291Ssos#define ATA_HT1000_S2 0x024a1166 442162230Ssos#define ATA_K2 0x02401166 443162230Ssos#define ATA_FRODO4 0x02411166 444162230Ssos#define ATA_FRODO8 0x02421166 445111188Ssos 446144330Ssos#define ATA_SILICON_IMAGE_ID 0x1095 447144330Ssos#define ATA_SII3114 0x31141095 448144330Ssos#define ATA_SII3512 0x35121095 449144330Ssos#define ATA_SII3112 0x31121095 450144330Ssos#define ATA_SII3112_1 0x02401095 451167386Ssos#define ATA_SII3124 0x31241095 452167386Ssos#define ATA_SII3132 0x31321095 453182749Smav#define ATA_SII3132_1 0x02421095 454191897Smav#define ATA_SII3132_2 0x02441095 455144330Ssos#define ATA_SII0680 0x06801095 456144330Ssos#define ATA_CMD646 0x06461095 457144330Ssos#define ATA_CMD648 0x06481095 458144330Ssos#define ATA_CMD649 0x06491095 459111188Ssos 460144330Ssos#define ATA_SIS_ID 0x1039 461144330Ssos#define ATA_SISSOUTH 0x00081039 462144330Ssos#define ATA_SIS5511 0x55111039 463144330Ssos#define ATA_SIS5513 0x55131039 464144330Ssos#define ATA_SIS5517 0x55171039 465144330Ssos#define ATA_SIS5518 0x55181039 466144330Ssos#define ATA_SIS5571 0x55711039 467144330Ssos#define ATA_SIS5591 0x55911039 468144330Ssos#define ATA_SIS5596 0x55961039 469144330Ssos#define ATA_SIS5597 0x55971039 470144330Ssos#define ATA_SIS5598 0x55981039 471144330Ssos#define ATA_SIS5600 0x56001039 472144330Ssos#define ATA_SIS530 0x05301039 473144330Ssos#define ATA_SIS540 0x05401039 474144330Ssos#define ATA_SIS550 0x05501039 475144330Ssos#define ATA_SIS620 0x06201039 476144330Ssos#define ATA_SIS630 0x06301039 477144330Ssos#define ATA_SIS635 0x06351039 478144330Ssos#define ATA_SIS633 0x06331039 479144330Ssos#define ATA_SIS640 0x06401039 480144330Ssos#define ATA_SIS645 0x06451039 481144330Ssos#define ATA_SIS646 0x06461039 482144330Ssos#define ATA_SIS648 0x06481039 483144330Ssos#define ATA_SIS650 0x06501039 484144330Ssos#define ATA_SIS651 0x06511039 485144330Ssos#define ATA_SIS652 0x06521039 486144330Ssos#define ATA_SIS655 0x06551039 487144330Ssos#define ATA_SIS658 0x06581039 488144330Ssos#define ATA_SIS661 0x06611039 489144330Ssos#define ATA_SIS730 0x07301039 490144330Ssos#define ATA_SIS733 0x07331039 491144330Ssos#define ATA_SIS735 0x07351039 492144330Ssos#define ATA_SIS740 0x07401039 493144330Ssos#define ATA_SIS745 0x07451039 494144330Ssos#define ATA_SIS746 0x07461039 495144330Ssos#define ATA_SIS748 0x07481039 496144330Ssos#define ATA_SIS750 0x07501039 497144330Ssos#define ATA_SIS751 0x07511039 498144330Ssos#define ATA_SIS752 0x07521039 499144330Ssos#define ATA_SIS755 0x07551039 500144330Ssos#define ATA_SIS961 0x09611039 501144330Ssos#define ATA_SIS962 0x09621039 502144330Ssos#define ATA_SIS963 0x09631039 503144330Ssos#define ATA_SIS964 0x09641039 504144382Ssos#define ATA_SIS965 0x09651039 505144330Ssos#define ATA_SIS180 0x01801039 506144330Ssos#define ATA_SIS181 0x01811039 507144382Ssos#define ATA_SIS182 0x01821039 508111188Ssos 509144330Ssos#define ATA_VIA_ID 0x1106 510144330Ssos#define ATA_VIA82C571 0x05711106 511144330Ssos#define ATA_VIA82C586 0x05861106 512144330Ssos#define ATA_VIA82C596 0x05961106 513144330Ssos#define ATA_VIA82C686 0x06861106 514144330Ssos#define ATA_VIA8231 0x82311106 515144330Ssos#define ATA_VIA8233 0x30741106 516144330Ssos#define ATA_VIA8233A 0x31471106 517144330Ssos#define ATA_VIA8233C 0x31091106 518144330Ssos#define ATA_VIA8235 0x31771106 519144330Ssos#define ATA_VIA8237 0x32271106 520161883Ssos#define ATA_VIA8237A 0x05911106 521172446Ssos#define ATA_VIA8237S 0x53371106 522198481Smav#define ATA_VIA8237_5372 0x53721106 523198481Smav#define ATA_VIA8237_7372 0x73721106 524153415Ssos#define ATA_VIA8251 0x33491106 525144330Ssos#define ATA_VIA8361 0x31121106 526144330Ssos#define ATA_VIA8363 0x03051106 527144330Ssos#define ATA_VIA8371 0x03911106 528144330Ssos#define ATA_VIA8662 0x31021106 529144330Ssos#define ATA_VIA6410 0x31641106 530144330Ssos#define ATA_VIA6420 0x31491106 531144808Ssos#define ATA_VIA6421 0x32491106 532200754Smav#define ATA_VIACX700IDE 0x05811106 533200754Smav#define ATA_VIACX700 0x83241106 534200754Smav#define ATA_VIASATAIDE 0x53241106 535200754Smav#define ATA_VIAVX800 0x83531106 536215431Smav#define ATA_VIASATAIDE2 0xc4091106 537200754Smav#define ATA_VIAVX855 0x84091106 538215431Smav#define ATA_VIASATAIDE3 0x90011106 539215431Smav#define ATA_VIAVX900 0x84101106 540144330Ssos 541144330Ssos/* global prototypes ata-pci.c */ 542144330Ssosint ata_pci_probe(device_t dev); 543144330Ssosint ata_pci_attach(device_t dev); 544144330Ssosint ata_pci_detach(device_t dev); 545183141Ssosint ata_pci_suspend(device_t dev); 546183141Ssosint ata_pci_resume(device_t dev); 547199322Smavint ata_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); 548199322Smavint ata_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value); 549199322Smavuint32_t ata_pci_read_config(device_t dev, device_t child, int reg, int width); 550199322Smavvoid ata_pci_write_config(device_t dev, device_t child, int reg, 551199322Smav uint32_t val, int width); 552208410Smavint ata_pci_child_location_str(device_t dev, device_t child, char *buf, 553208410Smav size_t buflen); 554144330Ssosstruct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); 555144330Ssosint ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); 556166901Spisoint ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep); 557144330Ssos int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); 558188765Smavint ata_pci_ch_attach(device_t dev); 559188769Smavint ata_pci_ch_detach(device_t dev); 560178156Ssosint ata_pci_status(device_t dev); 561154507Ssosvoid ata_pci_hw(device_t dev); 562173734Ssosvoid ata_pci_dmainit(device_t dev); 563188769Smavvoid ata_pci_dmafini(device_t dev); 564173734Ssoschar *ata_pcivendor2str(device_t dev); 565183724Ssosint ata_legacy(device_t); 566183724Ssosvoid ata_generic_intr(void *data); 567200171Smavint ata_generic_chipinit(device_t dev); 568200171Smavint ata_generic_setmode(device_t dev, int target, int mode); 569183724Ssosint ata_setup_interrupt(device_t dev, void *intr_func); 570183724Ssosvoid ata_set_desc(device_t dev); 571183724Ssosstruct ata_chip_id *ata_match_chip(device_t dev, struct ata_chip_id *index); 572183724Ssosstruct ata_chip_id *ata_find_chip(device_t dev, struct ata_chip_id *index, int slot); 573183724Ssosint ata_mode2idx(int mode); 574128530Ssos 575183724Ssos/* global prototypes from chipsets/ata-*.c */ 576183724Ssosint ata_ahci_chipinit(device_t); 577183724Ssosint ata_marvell_edma_chipinit(device_t); 578183724Ssosint ata_sii_chipinit(device_t); 579144330Ssos 580183724Ssos/* externs */ 581183724Ssosextern devclass_t ata_pci_devclass; 582183724Ssos 583224270SmavMALLOC_DECLARE(M_ATAPCI); 584224270Smav 585183724Ssos/* macro for easy definition of all driver module stuff */ 586183724Ssos#define ATA_DECLARE_DRIVER(dname) \ 587183724Ssosstatic device_method_t __CONCAT(dname,_methods)[] = { \ 588183724Ssos DEVMETHOD(device_probe, __CONCAT(dname,_probe)), \ 589183724Ssos DEVMETHOD(device_attach, ata_pci_attach), \ 590183724Ssos DEVMETHOD(device_detach, ata_pci_detach), \ 591185500Smav DEVMETHOD(device_suspend, ata_pci_suspend), \ 592185500Smav DEVMETHOD(device_resume, ata_pci_resume), \ 593183724Ssos DEVMETHOD(device_shutdown, bus_generic_shutdown), \ 594199322Smav DEVMETHOD(bus_read_ivar, ata_pci_read_ivar), \ 595199322Smav DEVMETHOD(bus_write_ivar, ata_pci_write_ivar), \ 596183724Ssos DEVMETHOD(bus_alloc_resource, ata_pci_alloc_resource), \ 597183724Ssos DEVMETHOD(bus_release_resource, ata_pci_release_resource), \ 598183724Ssos DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), \ 599183724Ssos DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), \ 600183724Ssos DEVMETHOD(bus_setup_intr, ata_pci_setup_intr), \ 601183724Ssos DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), \ 602199322Smav DEVMETHOD(pci_read_config, ata_pci_read_config), \ 603199322Smav DEVMETHOD(pci_write_config, ata_pci_write_config), \ 604208410Smav DEVMETHOD(bus_child_location_str, ata_pci_child_location_str), \ 605183724Ssos { 0, 0 } \ 606183724Ssos}; \ 607183724Ssosstatic driver_t __CONCAT(dname,_driver) = { \ 608183724Ssos "atapci", \ 609183724Ssos __CONCAT(dname,_methods), \ 610183724Ssos sizeof(struct ata_pci_controller) \ 611183724Ssos}; \ 612183724SsosDRIVER_MODULE(dname, pci, __CONCAT(dname,_driver), ata_pci_devclass, 0, 0); \ 613183724SsosMODULE_VERSION(dname, 1); \ 614183724SsosMODULE_DEPEND(dname, ata, 1, 1, 1); \ 615183724SsosMODULE_DEPEND(dname, atapci, 1, 1, 1); 616183724Ssos 617