Skip to content

Instantly share code, notes, and snippets.

@rayddteam
Created August 21, 2019 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rayddteam/ca8d8bb1382ab32ba82aa5195b01e066 to your computer and use it in GitHub Desktop.
Save rayddteam/ca8d8bb1382ab32ba82aa5195b01e066 to your computer and use it in GitHub Desktop.
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index a875b01a13..83eff8ab69 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -548,6 +548,7 @@ static int ahci_port_start(struct ahci_uc_priv *uc_priv, u8 port)
{
struct ahci_ioports *pp = &(uc_priv->port[port]);
void __iomem *port_mmio = pp->port_mmio;
+ u64 dma_addr;
u32 port_status;
void __iomem *mem;
@@ -593,16 +594,13 @@ static int ahci_port_start(struct ahci_uc_priv *uc_priv, u8 port)
pp->cmd_tbl_sg =
(struct ahci_sg *)(uintptr_t)virt_to_phys((void *)mem);
+ dma_addr = (u64)pp->cmd_slot;
+ writel_with_flush(dma_addr, port_mmio + PORT_LST_ADDR);
+ writel_with_flush(dma_addr >> 32, port_mmio + PORT_LST_ADDR_HI);
- writel_with_flush((u32)pp->cmd_slot, port_mmio + PORT_LST_ADDR);
-#ifndef CONFIG_PHYS_64BIT
- writel_with_flush(0, port_mmio + PORT_LST_ADDR_HI);
-#endif
-
- writel_with_flush(pp->rx_fis, port_mmio + PORT_FIS_ADDR);
-#ifndef CONFIG_PHYS_64BIT
- writel_with_flush(0, port_mmio + PORT_FIS_ADDR_HI);
-#endif
+ dma_addr = (u64)pp->rx_fis;
+ writel_with_flush(dma_addr, port_mmio + PORT_FIS_ADDR);
+ writel_with_flush(dma_addr >> 32, port_mmio + PORT_FIS_ADDR_HI);
#ifdef CONFIG_SUNXI_AHCI
sunxi_dma_init(port_mmio);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment