Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/ahci/ahci_hw.h

    reb3683a rae3ff9f5  
    374374} ahci_ghc_ghc_t;
    375375
     376/** AHCI GHC register offset. */
     377#define AHCI_GHC_GHC_REGISTER_OFFSET  1
     378
    376379/** AHCI Enable mask bit. */
    377380#define AHCI_GHC_GHC_AE  0x80000000
     
    381384
    382385/** AHCI Memory register Interrupt pending register. */
    383 typedef uint32_t ahci_ghc_is_t;
     386typedef struct {
     387        /** Interrupt pending status, if set, indicates that
     388         * the corresponding port has an interrupt pending.
     389         */
     390        uint32_t u32;
     391} ahci_ghc_is_t;
    384392
    385393/** AHCI GHC register offset. */
    386 #define AHCI_GHC_IS_REGISTER_OFFSET  2
    387 
    388 /** AHCI ports registers offset. */
    389 #define AHCI_PORTS_REGISTERS_OFFSET  64
    390 
    391 /** AHCI port registers size. */
    392 #define AHCI_PORT_REGISTERS_SIZE  32
    393 
    394 /** AHCI port IS register offset. */
    395 #define AHCI_PORT_IS_REGISTER_OFFSET  4
     394#define AHCI_GHC_IS_REGISTER_OFFSET  2 
    396395
    397396/** AHCI Memory register Ports implemented. */
     
    532531        uint32_t ghc;
    533532        /** Interrupt Status */
    534         ahci_ghc_is_t is;
     533        uint32_t is;
    535534        /** Ports Implemented */
    536535        uint32_t pi;
     
    604603
    605604/** AHCI Memory register Port x Interrupt Status. */
    606 typedef uint32_t ahci_port_is_t;
     605typedef union {
     606        struct {
     607                /** Device to Host Register FIS Interrupt. */
     608                unsigned int dhrs : 1;
     609                /** PIO Setup FIS Interrupt. */
     610                unsigned int pss : 1;
     611                /** DMA Setup FIS Interrupt. */
     612                unsigned int dss : 1;
     613                /** Set Device Bits Interrupt. */
     614                unsigned int sdbs : 1;
     615                /** Unknown FIS Interrupt. */
     616                unsigned int ufs : 1;
     617                /** Descriptor Processed. */
     618                unsigned int dps : 1;
     619                /** Port Connect Change Status. */
     620                unsigned int pcs : 1;
     621                /** Device Mechanical Presence Status. */
     622                unsigned int dmps : 1;
     623                /** Reserved. */
     624                unsigned int reserved1 : 14;
     625                /** PhyRdy Change Status. */
     626                unsigned int prcs : 1;
     627                /** Incorrect Port Multiplier Status. */
     628                unsigned int ipms : 1;
     629                /** Overflow Status. */
     630                unsigned int ofs : 1;
     631                /** Reserved. */
     632                unsigned int reserved2 : 1;
     633                /** Interface Non-fatal Error Status. */
     634                unsigned int infs : 1;
     635                /** Interface Fatal Error Status. */
     636                unsigned int ifs : 1;
     637                /** Host Bus Data Error Status. */
     638                unsigned int hbds : 1;
     639                /** Host Bus Fatal Error Status. */
     640                unsigned int hbfs : 1;
     641                /** Task File Error Status. */
     642                unsigned int tfes : 1;
     643                /** Cold Port Detect Status. */
     644                unsigned int cpds : 1;
     645        };
     646        uint32_t u32;
     647} ahci_port_is_t;
    607648
    608649#define AHCI_PORT_IS_DHRS  (1 << 0)
     
    659700static inline int ahci_port_is_end_of_operation(ahci_port_is_t port_is)
    660701{
    661         return port_is & AHCI_PORT_END_OF_OPERATION;
     702        return port_is.u32 & AHCI_PORT_END_OF_OPERATION;
    662703}
    663704
     
    671712static inline int ahci_port_is_error(ahci_port_is_t port_is)
    672713{
    673         return port_is & AHCI_PORT_IS_ERROR;
     714        return port_is.u32 & AHCI_PORT_IS_ERROR;
    674715}
    675716
     
    683724static inline int ahci_port_is_permanent_error(ahci_port_is_t port_is)
    684725{
    685         return port_is & AHCI_PORT_IS_PERMANENT_ERROR;
     726        return port_is.u32 & AHCI_PORT_IS_PERMANENT_ERROR;
    686727}
    687728
     
    695736static inline int ahci_port_is_tfes(ahci_port_is_t port_is)
    696737{
    697         return port_is & AHCI_PORT_IS_TFES;
     738        return port_is.u32 & AHCI_PORT_IS_TFES;
    698739}
    699740
     
    953994        uint32_t pxfbu;
    954995        /** Port x Interrupt Status. */
    955         ahci_port_is_t pxis;
     996        uint32_t pxis;
    956997        /** Port x Interrupt Enable. */
    957998        uint32_t pxie;
     
    9891030        ahci_ghc_t ghc;
    9901031        /** Reserved. */
    991         uint32_t reserved[13];
     1032        uint32_t reserved[13]; 
    9921033        /** Reserved for NVMHCI. */
    9931034        uint32_t reservedfornvmhci[16];
     
    9951036        uint32_t vendorspecificsregs[24];
    9961037        /** Ports. */
    997         ahci_port_t ports[AHCI_MAX_PORTS];
     1038        ahci_port_t ports[32];
    9981039} ahci_memregs_t;
    9991040
Note: See TracChangeset for help on using the changeset viewer.