Module Name: src Committed By: kiyohara Date: Mon Jul 4 15:35:55 UTC 2016
Modified Files: src/sys/arch/arm/omap: files.omap2 omap_edma.c tiotg.c src/sys/arch/evbarm/conf: BEAGLEBONE Log Message: Attach edma and tiotg at mainbus instead of obio0. And splits obio0 to obio[012], like OMAP3530. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/omap/files.omap2 cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/omap_edma.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/omap/tiotg.c cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/conf/BEAGLEBONE Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/omap/files.omap2 diff -u src/sys/arch/arm/omap/files.omap2:1.32 src/sys/arch/arm/omap/files.omap2:1.33 --- src/sys/arch/arm/omap/files.omap2:1.32 Mon Nov 2 00:48:45 2015 +++ src/sys/arch/arm/omap/files.omap2 Mon Jul 4 15:35:55 2016 @@ -1,4 +1,4 @@ -# $NetBSD: files.omap2,v 1.32 2015/11/02 00:48:45 jmcneill Exp $ +# $NetBSD: files.omap2,v 1.33 2016/07/04 15:35:55 kiyohara Exp $ # # Configuration info for Texas Instruments OMAP2/OMAP3 CPU support # Based on xscale/files.pxa2x0 @@ -122,6 +122,17 @@ device gpmc { [addr=-1], [size=0], [intr attach gpmc at mainbus file arch/arm/omap/omap2_gpmc.c gpmc +device edma +attach edma at mainbus +file arch/arm/omap/omap_edma.c edma needs-flag + +# TI OTG controller +define tiotg_port {[port = -1], [mode = -1]} +device tiotg: tiotg_port +attach tiotg at mainbus +file arch/arm/omap/tiotg.c tiotg +attach motg at tiotg_port + # SDMMC controller attach sdhc at obio with obiosdhc file arch/arm/omap/omap3_sdhc.c obiosdhc @@ -144,13 +155,6 @@ file arch/arm/omap/obio_ohci.c obioohci attach ehci at obio with omap3_ehci file arch/arm/omap/omap3_ehci.c omap3_ehci -# TI OTG controller -define tiotg_port {[port = -1], [mode = -1]} -device tiotg: tiotg_port -attach tiotg at obio -file arch/arm/omap/tiotg.c tiotg -attach motg at tiotg_port - attach ahcisata at obio with omap5_ahcisata file arch/arm/omap/omap5_ahcisata.c omap5_ahcisata @@ -171,10 +175,6 @@ device omapdma attach omapdma at obio file arch/arm/omap/omap3_sdma.c omapdma needs-flag -device edma -attach edma at obio -file arch/arm/omap/omap_edma.c edma needs-flag - device trng attach trng at obio file arch/arm/omap/am335x_trng.c trng Index: src/sys/arch/arm/omap/omap_edma.c diff -u src/sys/arch/arm/omap/omap_edma.c:1.1 src/sys/arch/arm/omap/omap_edma.c:1.2 --- src/sys/arch/arm/omap/omap_edma.c:1.1 Tue Apr 14 18:37:43 2015 +++ src/sys/arch/arm/omap/omap_edma.c Mon Jul 4 15:35:55 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: omap_edma.c,v 1.1 2015/04/14 18:37:43 bouyer Exp $ */ +/* $NetBSD: omap_edma.c,v 1.2 2016/07/04 15:35:55 kiyohara Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill <jmcne...@invisible.ca> @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: omap_edma.c,v 1.1 2015/04/14 18:37:43 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: omap_edma.c,v 1.2 2016/07/04 15:35:55 kiyohara Exp $"); #include "opt_omap.h" @@ -39,14 +39,16 @@ __KERNEL_RCSID(0, "$NetBSD: omap_edma.c, #include <sys/bus.h> #include <sys/bitops.h> +#include <arm/mainbus/mainbus.h> + #include <arm/omap/am335x_prcm.h> #include <arm/omap/omap2_prcm.h> #include <arm/omap/sitara_cm.h> #include <arm/omap/sitara_cmreg.h> #include <arm/omap/omap2_reg.h> -#include <arm/omap/omap2_obiovar.h> #include <arm/omap/omap_edma.h> +#include <arm/omap/omap_var.h> #ifdef TI_AM335X static const struct omap_module edma3cc_module = @@ -120,12 +122,12 @@ CFATTACH_DECL_NEW(edma, sizeof(struct ed static int edma_match(device_t parent, cfdata_t match, void *aux) { - struct obio_attach_args *obio = aux; + struct mainbus_attach_args *mb = aux; #ifdef TI_AM335X - if (obio->obio_addr == AM335X_TPCC_BASE && - obio->obio_size == AM335X_TPCC_SIZE && - obio->obio_intrbase == AM335X_INT_EDMACOMPINT) + if (mb->mb_iobase == AM335X_TPCC_BASE && + mb->mb_iosize == AM335X_TPCC_SIZE && + mb->mb_intrbase == AM335X_INT_EDMACOMPINT) return 1; #endif @@ -136,13 +138,13 @@ static void edma_attach(device_t parent, device_t self, void *aux) { struct edma_softc *sc = device_private(self); - struct obio_attach_args *obio = aux; + struct mainbus_attach_args *mb = aux; int idx; sc->sc_dev = self; - sc->sc_iot = obio->obio_iot; + sc->sc_iot = &omap_bs_tag; mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_SCHED); - if (bus_space_map(obio->obio_iot, obio->obio_addr, obio->obio_size, + if (bus_space_map(sc->sc_iot, mb->mb_iobase, mb->mb_iosize, 0, &sc->sc_ioh) != 0) { aprint_error(": couldn't map address spcae\n"); return; @@ -163,13 +165,13 @@ edma_attach(device_t parent, device_t se edma_init(sc); - sc->sc_ih = intr_establish(obio->obio_intrbase + 0, + sc->sc_ih = intr_establish(mb->mb_intrbase + 0, IPL_SCHED, IST_LEVEL, edma_intr, sc); KASSERT(sc->sc_ih != NULL); - sc->sc_mperr_ih = intr_establish(obio->obio_intrbase + 1, + sc->sc_mperr_ih = intr_establish(mb->mb_intrbase + 1, IPL_SCHED, IST_LEVEL, edma_mperr_intr, sc); - sc->sc_errint_ih = intr_establish(obio->obio_intrbase + 2, + sc->sc_errint_ih = intr_establish(mb->mb_intrbase + 2, IPL_SCHED, IST_LEVEL, edma_errint_intr, sc); } Index: src/sys/arch/arm/omap/tiotg.c diff -u src/sys/arch/arm/omap/tiotg.c:1.3 src/sys/arch/arm/omap/tiotg.c:1.4 --- src/sys/arch/arm/omap/tiotg.c:1.3 Sat Apr 23 10:15:28 2016 +++ src/sys/arch/arm/omap/tiotg.c Mon Jul 4 15:35:55 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: tiotg.c,v 1.3 2016/04/23 10:15:28 skrll Exp $ */ +/* $NetBSD: tiotg.c,v 1.4 2016/07/04 15:35:55 kiyohara Exp $ */ /* * Copyright (c) 2013 Manuel Bouyer. All rights reserved. * @@ -24,7 +24,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tiotg.c,v 1.3 2016/04/23 10:15:28 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tiotg.c,v 1.4 2016/07/04 15:35:55 kiyohara Exp $"); #include "opt_omap.h" #include "locators.h" @@ -38,7 +38,8 @@ __KERNEL_RCSID(0, "$NetBSD: tiotg.c,v 1. #include <sys/kernel.h> #include <sys/mutex.h> #include <sys/condvar.h> -#include <arm/omap/omap2_obiovar.h> +#include <arm/mainbus/mainbus.h> +#include <arm/omap/omap_var.h> #include <arm/omap/omap2_reg.h> #include <arm/omap/tiotgreg.h> @@ -127,10 +128,11 @@ CFATTACH_DECL2_NEW(motg, sizeof(struct t static int tiotg_match(device_t parent, cfdata_t match, void *aux) { - struct obio_attach_args *obio = aux; + struct mainbus_attach_args *mb = aux; - if ((obio->obio_addr == -1) || (obio->obio_size == 0) || - (obio->obio_intrbase == -1)) + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT || + mb->mb_iosize == MAINBUSCF_SIZE_DEFAULT || + mb->mb_intrbase == MAINBUSCF_INTRBASE_DEFAULT) return 0; return 1; } @@ -139,21 +141,21 @@ static void tiotg_attach(device_t parent, device_t self, void *aux) { struct tiotg_softc *sc = device_private(self); - struct obio_attach_args *obio = aux; + struct mainbus_attach_args *mb = aux; uint32_t val; - sc->sc_iot = obio->obio_iot; - sc->sc_dmat = obio->obio_dmat; + sc->sc_iot = &omap_bs_tag; + sc->sc_dmat = &omap_bus_dma_tag; sc->sc_dev = self; - if (bus_space_map(obio->obio_iot, obio->obio_addr, obio->obio_size, 0, + if (bus_space_map(sc->sc_iot, mb->mb_iobase, mb->mb_iosize, 0, &sc->sc_ioh)) { aprint_error(": couldn't map register space\n"); return; } - sc->sc_intrbase = obio->obio_intrbase; - sc->sc_ih = intr_establish(obio->obio_intrbase, IPL_USB, IST_LEVEL, + sc->sc_intrbase = mb->mb_intrbase; + sc->sc_ih = intr_establish(mb->mb_intrbase, IPL_USB, IST_LEVEL, tiotg_intr, sc); KASSERT(sc->sc_ih != NULL); aprint_normal(": TI dual-port USB controller"); Index: src/sys/arch/evbarm/conf/BEAGLEBONE diff -u src/sys/arch/evbarm/conf/BEAGLEBONE:1.34 src/sys/arch/evbarm/conf/BEAGLEBONE:1.35 --- src/sys/arch/evbarm/conf/BEAGLEBONE:1.34 Mon Nov 2 00:49:24 2015 +++ src/sys/arch/evbarm/conf/BEAGLEBONE Mon Jul 4 15:35:55 2016 @@ -1,5 +1,5 @@ # -# $NetBSD: BEAGLEBONE,v 1.34 2015/11/02 00:49:24 jmcneill Exp $ +# $NetBSD: BEAGLEBONE,v 1.35 2016/07/04 15:35:55 kiyohara Exp $ # # BEAGLEBONE -- TI AM335x board Kernel # @@ -176,18 +176,18 @@ cpu0 at mainbus? #L3i0 at mainbus? # OBIO -obio0 at mainbus? base 0x44000000 size 0x0c000000 -#obio0 at mainbus? base 0x44c00000 size 0x00400000 # L4_WKUP -#obio1 at mainbus? base 0x48000000 size 0x01000000 # L4_PER -#obio2 at mainbus? base 0x4a000000 size 0x01000000 # L4_FAST - +obio0 at mainbus? base 0x44c00000 size 0x00400000 # L4_WKUP +obio1 at mainbus? base 0x48000000 size 0x01000000 # L4_PER +obio2 at mainbus? base 0x4a000000 size 0x01000000 # L4_FAST +# Enhanced Direct Memory Access controller +edma0 at mainbus? base 0x49000000 size 0x100000 intrbase 12 # General Purpose Memory Controller gpmc0 at mainbus? base 0x50000000 # Interrupt Controller -omapicu0 at obio0 addr 0x48200000 size 0x1000 intrbase 0 +omapicu0 at obio1 addr 0x48200000 size 0x1000 intrbase 0 # Power, Reset and Clock Management prcm0 at obio0 addr 0x44e00000 size 0x2000 # PRM Module @@ -195,17 +195,14 @@ prcm0 at obio0 addr 0x44e00000 size 0x2 # Control Module sitaracm0 at obio0 addr 0x44e10000 size 0x2000 -# Enhanced Direct Memory Access controller -edma0 at obio0 addr 0x49000000 size 0x100000 intrbase 12 - # SDHC controllers # XXX Kludge -- the am335x's mmc registers start at an offset of #x100 # from other omap3. (What about omap4?) Need to adapt the omap sdhc # driver to handle this. -sdhc0 at obio0 addr 0x48060100 size 0x0f00 intr 64 edmabase 24 +sdhc0 at obio1 addr 0x48060100 size 0x0f00 intr 64 edmabase 24 sdmmc0 at sdhc0 ld0 at sdmmc0 -sdhc1 at obio0 addr 0x481d8100 size 0x0f00 intr 28 edmabase 2 # BB Black +sdhc1 at obio1 addr 0x481d8100 size 0x0f00 intr 28 edmabase 2 # BB Black sdmmc1 at sdhc1 ld1 at sdmmc1 #sdhc2 at obio0 addr 0x47810100 size 0xff00 intr 29 @@ -219,11 +216,11 @@ ld* at sdmmc? # General-purpose I/O pins omapgpio0 at obio0 addr 0x44e07000 size 0x1000 # intrbase 128 intr 29 gpio0 at omapgpio0 -omapgpio1 at obio0 addr 0x4804c000 size 0x1000 # intrbase 160 intr 30 +omapgpio1 at obio1 addr 0x4804c000 size 0x1000 # intrbase 160 intr 30 gpio1 at omapgpio1 -omapgpio2 at obio0 addr 0x481ac000 size 0x1000 # intrbase 192 intr 32 +omapgpio2 at obio1 addr 0x481ac000 size 0x1000 # intrbase 192 intr 32 gpio2 at omapgpio2 -omapgpio3 at obio0 addr 0x481ae000 size 0x1000 # intrbase 224 intr 32 +omapgpio3 at obio1 addr 0x481ae000 size 0x1000 # intrbase 224 intr 32 gpio3 at omapgpio3 # I2C Controller @@ -242,22 +239,22 @@ options CONSADDR=0x44e09000, CONSPEED=1 # choice. # Hardclock timer -omapdmtimer0 at obio0 addr 0x48040000 size 0x1000 intr 68 # DM Timer 2 +omapdmtimer0 at obio1 addr 0x48040000 size 0x1000 intr 68 # DM Timer 2 # Time counter omapdmtimer1 at obio0 addr 0x44e31000 size 0x1000 intr 67 # DM Timer 1ms # Statclock timer -omapdmtimer2 at obio0 addr 0x48044000 size 0x1000 intr 92 # DM Timer 4 +omapdmtimer2 at obio1 addr 0x48044000 size 0x1000 intr 92 # DM Timer 4 # Watchdog timers omapwdt32k* at obio0 addr 0x44e35000 size 0x1000 # WDT1 # Random number generator -trng* at obio0 addr 0x48310000 size 0x2000 intr 111 # TRNG +trng* at obio1 addr 0x48310000 size 0x2000 intr 111 # TRNG # onboard video, experimental. Video mode is hardcoded in the driver -#tifb* at obio0 addr 0x4830E000 size 0x1000 intr 36 +#tifb* at obio1 addr 0x4830E000 size 0x1000 intr 36 # make sure the console display is always wsdisplay0 #wsdisplay* at wsemuldisplaydev? @@ -280,7 +277,7 @@ pseudo-device wsmux # mouse & keyboard pseudo-device wsfont # On-board USB. Experimental -tiotg* at obio0 addr 0x47400000 size 0x5000 intrbase 17 +tiotg* at mainbus? base 0x47400000 size 0x5000 intrbase 17 motg* at tiotg? port ? usb* at motg? uhub* at usb? @@ -339,7 +336,7 @@ sd* at scsibus? target ? lun ? # S axe* at uhub? port ? configuration ? interface ? # Ethernet -cpsw* at obio0 addr 0x4a100000 size 0x8000 intrbase 40 +cpsw* at obio2 addr 0x4a100000 size 0x8000 intrbase 40 ukphy* at mii? # Pseudo-Devices