Date: Sun, 10 Dec 2006 05:06:08 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 111367 for review Message-ID: <200612100506.kBA5689e082011@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=111367 Change 111367 by imp@imp_lighthouse on 2006/12/10 05:05:14 First attempt to apply Daan Vreeken's usb patches to get my KB9202 working. They didn't succeed. Neither do they cause any real ill effect except for a slight delay in booting when usb is in the kernel. Committed to facilitate coordination. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91rm92reg.h#20 edit .. //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c#41 edit .. //depot/projects/arm/src/sys/arm/at91/ohci_atmelarm.c#13 edit .. //depot/projects/arm/src/sys/arm/conf/KB920X#42 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91rm92reg.h#20 (text+ko) ==== @@ -336,7 +336,8 @@ #define AT91RM92_TC1C1_BASE 0xffa4040 #define AT91RM92_TC1C2_BASE 0xffa4080 -#define AT91RM92_OHCI_BASE 0x00300000 +#define AT91RM92_OHCI_BASE 0xdfe00000 +#define AT91RM92_OHCI_PA_BASE 0x00300000 #define AT91RM92_OHCI_SIZE 0x00100000 #define AT91C_MASTER_CLOCK 60000000 ==== //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c#41 (text+ko) ==== @@ -167,14 +167,14 @@ * initialization is done. However, the AT91 resource allocation * system doesn't know how to use pmap_mapdev() yet. */ -#if 0 +#if 1 { /* * Add the ohci controller, and anything else that might be * on this chip select for a VA/PA mapping. */ AT91RM92_OHCI_BASE, - AT91RM92_OHCI_BASE, + AT91RM92_OHCI_PA_BASE, AT91RM92_OHCI_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, ==== //depot/projects/arm/src/sys/arm/at91/ohci_atmelarm.c#13 (text+ko) ==== @@ -28,7 +28,9 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/lock.h> #include <sys/module.h> +#include <sys/mutex.h> #include <sys/bus.h> #include <sys/queue.h> #include <machine/bus.h> @@ -99,6 +101,30 @@ } device_set_ivars(sc->sc_ohci.sc_bus.bdev, &sc->sc_ohci.sc_bus); + /* Allocate a parent dma tag for DMA maps */ + err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE_32BIT, USB_DMA_NSEG, BUS_SPACE_MAXSIZE_32BIT, 0, + NULL, NULL, &sc->sc_ohci.sc_bus.parent_dmatag); + if (err) { + device_printf(dev, "Could not allocate parent DMA tag (%d)\n", + err); + err = ENXIO; + goto error; + } + + /* Allocate a dma tag for transfer buffers */ + err = bus_dma_tag_create(sc->sc_ohci.sc_bus.parent_dmatag, 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE_32BIT, USB_DMA_NSEG, BUS_SPACE_MAXSIZE_32BIT, 0, + busdma_lock_mutex, &Giant, &sc->sc_ohci.sc_bus.buffer_dmatag); + if (err) { + device_printf(dev, "Could not allocate transfer tag (%d)\n", + err); + err = ENXIO; + goto error; + } + err = bus_setup_intr(dev, sc->sc_ohci.irq_res, INTR_TYPE_BIO, ohci_intr, sc, &sc->sc_ohci.ih); if (err) { @@ -158,6 +184,12 @@ bus_teardown_intr(dev, sc->sc_ohci.irq_res, sc->sc_ohci.ih); sc->sc_ohci.ih = NULL; } + + if (sc->sc_ohci.sc_bus.parent_dmatag != NULL) + bus_dma_tag_destroy(sc->sc_ohci.sc_bus.parent_dmatag); + if (sc->sc_ohci.sc_bus.buffer_dmatag != NULL) + bus_dma_tag_destroy(sc->sc_ohci.sc_bus.buffer_dmatag); + if (sc->sc_ohci.sc_bus.bdev) { device_delete_child(dev, sc->sc_ohci.sc_bus.bdev); sc->sc_ohci.sc_bus.bdev = NULL; ==== //depot/projects/arm/src/sys/arm/conf/KB920X#42 (text+ko) ==== @@ -105,3 +105,13 @@ device at91_mci device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards +# USB +device usb +device ohci +device ugen +device scbus +device da +device umass +device axe + +#device bpf
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612100506.kBA5689e082011>