diff options
author | Becky Bruce <beckyb@kernel.crashing.org> | 2009-02-03 18:10:55 -0600 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-02-10 00:31:05 +0100 |
commit | 1785dbeed43599eed1d8875673c96912cd770141 (patch) | |
tree | f9c23e25ad9dcda073b714d8e64c922dc063c421 /drivers/block | |
parent | d591a80e74091e7a0658d165721e6c7de2ef0bcd (diff) | |
download | u-boot-1785dbeed43599eed1d8875673c96912cd770141.tar.gz u-boot-1785dbeed43599eed1d8875673c96912cd770141.tar.xz u-boot-1785dbeed43599eed1d8875673c96912cd770141.zip |
drivers/block/ahci: Fix pci mapping bug
The code assumes that the pci bus address and the virtual
address used to access a region are the same, but they might
not be. Fix this assumption.
Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/ahci.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c index 2445e8c62e..e1b66fd4b6 100644 --- a/drivers/block/ahci.c +++ b/drivers/block/ahci.c @@ -251,7 +251,6 @@ static void ahci_print_info(struct ahci_probe_ent *probe_ent) static int ahci_init_one(pci_dev_t pdev) { - u32 iobase; u16 vendor; int rc; @@ -261,9 +260,6 @@ static int ahci_init_one(pci_dev_t pdev) memset(probe_ent, 0, sizeof(struct ahci_probe_ent)); probe_ent->dev = pdev; - pci_read_config_dword(pdev, AHCI_PCI_BAR, &iobase); - iobase &= ~0xf; - probe_ent->host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO @@ -272,7 +268,8 @@ static int ahci_init_one(pci_dev_t pdev) probe_ent->pio_mask = 0x1f; probe_ent->udma_mask = 0x7f; /*Fixme,assume to support UDMA6 */ - probe_ent->mmio_base = iobase; + probe_ent->mmio_base = (u32)pci_map_bar(pdev, AHCI_PCI_BAR, + PCI_REGION_MEM); /* Take from kernel: * JMicron-specific fixup: |