Skip to content

Commit

Permalink
add quirk for armv7/sunxi ahci, this is the 'less MD' flavour of the
Browse files Browse the repository at this point in the history
diff using a flag in softc, instead of at compile-time with #ifdef.
  • Loading branch information
aalm committed Jan 16, 2014
1 parent 2425ff4 commit 6342a27
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sys/dev/ic/ahci.c
Expand Up @@ -832,6 +832,14 @@ ahci_port_start(struct ahci_port *ap, int fre_only)
{
u_int32_t r;

if (ap->ap_sc->sc_flags & AHCI_F_SUNXI_QUIRK) {
/* Setup DMA */
r = ahci_pread(ap, AHCI_PREG_SUNXI_DMA);
r &= ~AHCI_PREG_SUNXI_DMA_MASK;
r |= AHCI_PREG_SUNXI_DMA_INIT; /* XXX if fre_only? */
ahci_pwrite(ap, AHCI_PREG_SUNXI_DMA, r);
}

/* XXX FBS: possibly turn FBS on here */

/* Turn on FRE (and ST) */
Expand Down
4 changes: 4 additions & 0 deletions sys/dev/ic/ahcireg.h
Expand Up @@ -224,3 +224,7 @@
#define AHCI_PREG_FBS_SDE (1<<2) /* Single Device Error */
#define AHCI_PREG_FBS_DEC (1<<1) /* Device Error Clear */
#define AHCI_PREG_FBS_EN (1<<0) /* Enable */

#define AHCI_PREG_SUNXI_DMA 0x70 /* Vendor Spec Port DMA for armv7/sunxi */
#define AHCI_PREG_SUNXI_DMA_MASK (0xff<<8)
#define AHCI_PREG_SUNXI_DMA_INIT (0x44<<8)
1 change: 1 addition & 0 deletions sys/dev/ic/ahcivar.h
Expand Up @@ -177,6 +177,7 @@ struct ahci_softc {
#define AHCI_F_IPMS_PROBE (1<<1) /* IPMS on failed PMP probe */
#define AHCI_F_NO_PMP (1<<2) /* ignore PMP capability */
#define AHCI_F_NO_MSI (1<<3) /* disable MSI */
#define AHCI_F_SUNXI_QUIRK (1<<4) /* quirk for armv7/sunxi */

u_int sc_ncmds;

Expand Down

0 comments on commit 6342a27

Please sign in to comment.