diff options
author | ian <ian@FreeBSD.org> | 2013-03-17 03:04:43 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2013-03-17 03:04:43 +0000 |
commit | b2acea1ddc304f859bc444697275a81703847dda (patch) | |
tree | 9989e749f6918f95a560f20fd17ed74f3fde6004 /sys/arm/broadcom | |
parent | 0952142d826cdedb72792f3ca6ea791c6b9afb23 (diff) | |
download | FreeBSD-src-b2acea1ddc304f859bc444697275a81703847dda.zip FreeBSD-src-b2acea1ddc304f859bc444697275a81703847dda.tar.gz |
Add a macro that gets the physical address of a memory mapped device
register from a bus space resource.
Note that this macro is just for ARM, and is intended to have a short
lifespan. The DMA engines in some SoCs need the physical address of a
memory-mapped device register as one of the arguments for the transfer.
Several scattered ad-hoc solutions have been converted to use this macro,
which now also serves to mark the places where a more complete fix needs
to be applied (after that fix has been designed).
Diffstat (limited to 'sys/arm/broadcom')
-rw-r--r-- | sys/arm/broadcom/bcm2835/bcm2835_sdhci.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c index 3512954..b329e30 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c @@ -173,7 +173,6 @@ bcm_sdhci_attach(device_t dev) int default_freq; void *buffer; vm_paddr_t buffer_phys; - void *va; sc->sc_dev = dev; sc->sc_req = NULL; @@ -284,9 +283,8 @@ bcm_sdhci_attach(device_t dev) sc->sc_dma_buffer = buffer; sc->sc_dma_buffer_phys = buffer_phys; - va = (void*)rman_get_start(sc->sc_mem_res); - sc->sc_sdhci_buffer_phys = - pmap_kextract((vm_offset_t)va) + SDHCI_BUFFER; + sc->sc_sdhci_buffer_phys = BUS_SPACE_PHYSADDR(sc->sc_mem_res, + SDHCI_BUFFER); bus_generic_probe(dev); bus_generic_attach(dev); |