Deleted Added
full compact
bcm2835_sdhci.c (247497) bcm2835_sdhci.c (248407)
1/*-
2 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c 247497 2013-02-28 19:51:30Z gonzo $");
28__FBSDID("$FreeBSD: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c 248407 2013-03-17 03:04:43Z ian $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bio.h>
33#include <sys/bus.h>
34#include <sys/conf.h>
35#include <sys/endian.h>
36#include <sys/kernel.h>

--- 131 unchanged lines hidden (view full) ---

168{
169 struct bcm_sdhci_softc *sc = device_get_softc(dev);
170 int rid, err;
171 phandle_t node;
172 pcell_t cell;
173 int default_freq;
174 void *buffer;
175 vm_paddr_t buffer_phys;
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bio.h>
33#include <sys/bus.h>
34#include <sys/conf.h>
35#include <sys/endian.h>
36#include <sys/kernel.h>

--- 131 unchanged lines hidden (view full) ---

168{
169 struct bcm_sdhci_softc *sc = device_get_softc(dev);
170 int rid, err;
171 phandle_t node;
172 pcell_t cell;
173 int default_freq;
174 void *buffer;
175 vm_paddr_t buffer_phys;
176 void *va;
177
178 sc->sc_dev = dev;
179 sc->sc_req = NULL;
180 err = 0;
181
182 default_freq = BCM2835_DEFAULT_SDHCI_FREQ;
183 node = ofw_bus_get_node(sc->sc_dev);
184 if ((OF_getprop(node, "clock-frequency", &cell, sizeof(cell))) > 0)

--- 94 unchanged lines hidden (view full) ---

279 if ((uintptr_t)buffer & 3) {
280 device_printf(dev,
281 "DMA address is not word-aligned\n");
282 goto fail;
283 }
284
285 sc->sc_dma_buffer = buffer;
286 sc->sc_dma_buffer_phys = buffer_phys;
176
177 sc->sc_dev = dev;
178 sc->sc_req = NULL;
179 err = 0;
180
181 default_freq = BCM2835_DEFAULT_SDHCI_FREQ;
182 node = ofw_bus_get_node(sc->sc_dev);
183 if ((OF_getprop(node, "clock-frequency", &cell, sizeof(cell))) > 0)

--- 94 unchanged lines hidden (view full) ---

278 if ((uintptr_t)buffer & 3) {
279 device_printf(dev,
280 "DMA address is not word-aligned\n");
281 goto fail;
282 }
283
284 sc->sc_dma_buffer = buffer;
285 sc->sc_dma_buffer_phys = buffer_phys;
287 va = (void*)rman_get_start(sc->sc_mem_res);
288 sc->sc_sdhci_buffer_phys =
289 pmap_kextract((vm_offset_t)va) + SDHCI_BUFFER;
286 sc->sc_sdhci_buffer_phys = BUS_SPACE_PHYSADDR(sc->sc_mem_res,
287 SDHCI_BUFFER);
290
291 bus_generic_probe(dev);
292 bus_generic_attach(dev);
293
294 sdhci_start_slot(&sc->sc_slot);
295
296 return (0);
297

--- 397 unchanged lines hidden ---
288
289 bus_generic_probe(dev);
290 bus_generic_attach(dev);
291
292 sdhci_start_slot(&sc->sc_slot);
293
294 return (0);
295

--- 397 unchanged lines hidden ---