Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Attach edma and tiotg at mainbus instead of obio0.
details: https://anonhg.NetBSD.org/src/rev/e642de4b3bb6
branches: trunk
changeset: 346277:e642de4b3bb6
user: kiyohara <kiyohara%NetBSD.org@localhost>
date: Mon Jul 04 15:35:55 2016 +0000
description:
Attach edma and tiotg at mainbus instead of obio0.
And splits obio0 to obio[012], like OMAP3530.
diffstat:
sys/arch/arm/omap/files.omap2 | 24 ++++++++++++------------
sys/arch/arm/omap/omap_edma.c | 28 +++++++++++++++-------------
sys/arch/arm/omap/tiotg.c | 26 ++++++++++++++------------
sys/arch/evbarm/conf/BEAGLEBONE | 39 ++++++++++++++++++---------------------
4 files changed, 59 insertions(+), 58 deletions(-)
diffs (truncated from 325 to 300 lines):
diff -r d8a4e520c8ba -r e642de4b3bb6 sys/arch/arm/omap/files.omap2
--- a/sys/arch/arm/omap/files.omap2 Mon Jul 04 15:20:16 2016 +0000
+++ b/sys/arch/arm/omap/files.omap2 Mon Jul 04 15:35:55 2016 +0000
@@ -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 @@
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 @@
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 @@
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
diff -r d8a4e520c8ba -r e642de4b3bb6 sys/arch/arm/omap/omap_edma.c
--- a/sys/arch/arm/omap/omap_edma.c Mon Jul 04 15:20:16 2016 +0000
+++ b/sys/arch/arm/omap/omap_edma.c Mon Jul 04 15:35:55 2016 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
#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 @@
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 @@
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_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);
}
diff -r d8a4e520c8ba -r e642de4b3bb6 sys/arch/arm/omap/tiotg.c
--- a/sys/arch/arm/omap/tiotg.c Mon Jul 04 15:20:16 2016 +0000
+++ b/sys/arch/arm/omap/tiotg.c Mon Jul 04 15:35:55 2016 +0000
@@ -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 @@
#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 @@
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 @@
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");
diff -r d8a4e520c8ba -r e642de4b3bb6 sys/arch/evbarm/conf/BEAGLEBONE
--- a/sys/arch/evbarm/conf/BEAGLEBONE Mon Jul 04 15:20:16 2016 +0000
+++ b/sys/arch/evbarm/conf/BEAGLEBONE Mon Jul 04 15:35:55 2016 +0000
@@ -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 @@
#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 @@
# 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 @@
# 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 @@
# 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
Home |
Main Index |
Thread Index |
Old Index