ata-pci.h (183552) | ata-pci.h (183724) |
---|---|
1/*- 2 * Copyright (c) 2003 - 2008 S�ren Schmidt <sos@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2003 - 2008 S�ren Schmidt <sos@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/ata/ata-pci.h 183552 2008-10-02 19:18:28Z sos $ | 26 * $FreeBSD: head/sys/dev/ata/ata-pci.h 183724 2008-10-09 12:56:57Z sos $ |
27 */ 28 29/* structure holding chipset config info */ 30struct ata_chip_id { 31 u_int32_t chipid; 32 u_int8_t chiprev; 33 int cfg1; 34 int cfg2; --- 355 unchanged lines hidden (view full) --- 390#define ATA_VIA8361 0x31121106 391#define ATA_VIA8363 0x03051106 392#define ATA_VIA8371 0x03911106 393#define ATA_VIA8662 0x31021106 394#define ATA_VIA6410 0x31641106 395#define ATA_VIA6420 0x31491106 396#define ATA_VIA6421 0x32491106 397 | 27 */ 28 29/* structure holding chipset config info */ 30struct ata_chip_id { 31 u_int32_t chipid; 32 u_int8_t chiprev; 33 int cfg1; 34 int cfg2; --- 355 unchanged lines hidden (view full) --- 390#define ATA_VIA8361 0x31121106 391#define ATA_VIA8363 0x03051106 392#define ATA_VIA8371 0x03911106 393#define ATA_VIA8662 0x31021106 394#define ATA_VIA6410 0x31641106 395#define ATA_VIA6420 0x31491106 396#define ATA_VIA6421 0x32491106 397 |
398/* chipset setup related defines */ 399#define AHCI 1 400#define ATPOLD 1 401 402#define ALIOLD 0x01 403#define ALINEW 0x02 404#define ALISATA 0x04 405 406#define ATIPATA 0x01 407#define ATISATA 0x02 408#define ATIAHCI 0x04 409 410#define HPT366 0 411#define HPT370 1 412#define HPT372 2 413#define HPT374 3 414#define HPTOLD 0x01 415 416#define MV50XX 50 417#define MV60XX 60 418#define MV61XX 61 419 420#define PROLD 0 421#define PRNEW 1 422#define PRTX 2 423#define PRMIO 3 424#define PRTX4 0x01 425#define PRSX4X 0x02 426#define PRSX6K 0x04 427#define PRPATA 0x08 428#define PRCMBO 0x10 429#define PRCMBO2 0x20 430#define PRSATA 0x40 431#define PRSATA2 0x80 432 433#define SWKS33 0 434#define SWKS66 1 435#define SWKS100 2 436#define SWKSMIO 3 437 438#define SIIMEMIO 1 439#define SIIPRBIO 2 440#define SIIINTR 0x01 441#define SIISETCLK 0x02 442#define SIIBUG 0x04 443#define SII4CH 0x08 444 445#define SIS_SOUTH 1 446#define SISSATA 2 447#define SIS133NEW 3 448#define SIS133OLD 4 449#define SIS100NEW 5 450#define SIS100OLD 6 451#define SIS66 7 452#define SIS33 8 453 454#define VIA33 0 455#define VIA66 1 456#define VIA100 2 457#define VIA133 3 458#define AMDNVIDIA 4 459 460#define AMDCABLE 0x0001 461#define AMDBUG 0x0002 462#define NVIDIA 0x0004 463#define NV4 0x0010 464#define NVQ 0x0020 465#define VIACLK 0x0100 466#define VIABUG 0x0200 467#define VIABAR 0x0400 468#define VIAAHCI 0x0800 469 470 | |
471/* global prototypes ata-pci.c */ 472int ata_pci_probe(device_t dev); 473int ata_pci_attach(device_t dev); 474int ata_pci_detach(device_t dev); 475int ata_pci_suspend(device_t dev); 476int ata_pci_resume(device_t dev); 477struct 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); 478int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); 479int 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); 480 int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); 481int ata_pci_allocate(device_t dev); 482int ata_pci_status(device_t dev); 483void ata_pci_hw(device_t dev); 484void ata_pci_dmainit(device_t dev); 485char *ata_pcivendor2str(device_t dev); | 398/* global prototypes ata-pci.c */ 399int ata_pci_probe(device_t dev); 400int ata_pci_attach(device_t dev); 401int ata_pci_detach(device_t dev); 402int ata_pci_suspend(device_t dev); 403int ata_pci_resume(device_t dev); 404struct 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); 405int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); 406int 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); 407 int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); 408int ata_pci_allocate(device_t dev); 409int ata_pci_status(device_t dev); 410void ata_pci_hw(device_t dev); 411void ata_pci_dmainit(device_t dev); 412char *ata_pcivendor2str(device_t dev); |
413int ata_legacy(device_t); 414void ata_generic_intr(void *data); 415int ata_setup_interrupt(device_t dev, void *intr_func); 416void ata_set_desc(device_t dev); 417struct ata_chip_id *ata_match_chip(device_t dev, struct ata_chip_id *index); 418struct ata_chip_id *ata_find_chip(device_t dev, struct ata_chip_id *index, int slot); 419void ata_print_cable(device_t dev, u_int8_t *who); 420int ata_check_80pin(device_t dev, int mode); 421int ata_mode2idx(int mode); |
|
486 | 422 |
423/* global prototypes ata-sata.c */ 424void ata_sata_phy_event(void *context, int dummy); 425void ata_sata_phy_check_events(device_t dev); 426int ata_sata_phy_reset(device_t dev); 427void ata_sata_setmode(device_t dev, int mode); 428int ata_request2fis_h2d(struct ata_request *request, u_int8_t *fis); 429void ata_pm_identify(device_t dev); |
|
487 | 430 |
488/* global prototypes ata-chipset.c */ 489int ata_generic_ident(device_t); 490int ata_ahci_ident(device_t); 491int ata_acard_ident(device_t); 492int ata_ali_ident(device_t); 493int ata_amd_ident(device_t); 494int ata_adaptec_ident(device_t); 495int ata_ati_ident(device_t); 496int ata_cyrix_ident(device_t); 497int ata_cypress_ident(device_t); 498int ata_highpoint_ident(device_t); 499int ata_intel_ident(device_t); 500int ata_ite_ident(device_t); 501int ata_jmicron_ident(device_t); 502int ata_marvell_ident(device_t); 503int ata_national_ident(device_t); 504int ata_nvidia_ident(device_t); 505int ata_netcell_ident(device_t); 506int ata_promise_ident(device_t); 507int ata_serverworks_ident(device_t); 508int ata_sii_ident(device_t); 509int ata_sis_ident(device_t); 510int ata_via_ident(device_t); 511int ata_legacy(device_t); | 431/* global prototypes from chipsets/ata-*.c */ 432int ata_ahci_chipinit(device_t); 433int ata_ahci_allocate(device_t dev); 434void ata_ahci_reset(device_t dev); 435void ata_ahci_dmainit(device_t dev); 436int ata_marvell_edma_chipinit(device_t); 437int ata_sii_chipinit(device_t); |
512 513/* global prototypes ata-dma.c */ 514void ata_dmainit(device_t); | 438 439/* global prototypes ata-dma.c */ 440void ata_dmainit(device_t); |
441 442/* externs */ 443extern devclass_t ata_pci_devclass; 444 445/* macro for easy definition of all driver module stuff */ 446#define ATA_DECLARE_DRIVER(dname) \ 447static device_method_t __CONCAT(dname,_methods)[] = { \ 448 DEVMETHOD(device_probe, __CONCAT(dname,_probe)), \ 449 DEVMETHOD(device_attach, ata_pci_attach), \ 450 DEVMETHOD(device_detach, ata_pci_detach), \ 451 DEVMETHOD(device_suspend, bus_generic_suspend), \ 452 DEVMETHOD(device_resume, bus_generic_resume), \ 453 DEVMETHOD(device_shutdown, bus_generic_shutdown), \ 454 DEVMETHOD(bus_alloc_resource, ata_pci_alloc_resource), \ 455 DEVMETHOD(bus_release_resource, ata_pci_release_resource), \ 456 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), \ 457 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), \ 458 DEVMETHOD(bus_setup_intr, ata_pci_setup_intr), \ 459 DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), \ 460 { 0, 0 } \ 461}; \ 462static driver_t __CONCAT(dname,_driver) = { \ 463 "atapci", \ 464 __CONCAT(dname,_methods), \ 465 sizeof(struct ata_pci_controller) \ 466}; \ 467DRIVER_MODULE(dname, pci, __CONCAT(dname,_driver), ata_pci_devclass, 0, 0); \ 468MODULE_VERSION(dname, 1); \ 469MODULE_DEPEND(dname, ata, 1, 1, 1); \ 470MODULE_DEPEND(dname, atapci, 1, 1, 1); 471 |
|