Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/matt-nb6-plus]: src/sys/arch/arm/broadcom Sync with HEAD.
details: https://anonhg.NetBSD.org/src/rev/d5b17eb1d269
branches: matt-nb6-plus
changeset: 774562:d5b17eb1d269
user: matt <matt%NetBSD.org@localhost>
date: Tue Feb 19 02:22:02 2013 +0000
description:
Sync with HEAD.
diffstat:
sys/arch/arm/broadcom/bcm53xx_board.c | 33 ++++++++++++++++++++++++++++-----
sys/arch/arm/broadcom/bcm53xx_eth.c | 7 ++++++-
sys/arch/arm/broadcom/bcm53xx_pax.c | 11 ++++++++---
sys/arch/arm/broadcom/bcm53xx_var.h | 5 ++++-
4 files changed, 46 insertions(+), 10 deletions(-)
diffs (164 lines):
diff -r cfb78443db45 -r d5b17eb1d269 sys/arch/arm/broadcom/bcm53xx_board.c
--- a/sys/arch/arm/broadcom/bcm53xx_board.c Fri Feb 15 22:38:51 2013 +0000
+++ b/sys/arch/arm/broadcom/bcm53xx_board.c Tue Feb 19 02:22:02 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm53xx_board.c,v 1.8.4.4 2013/02/13 23:52:18 matt Exp $ */
+/* $NetBSD: bcm53xx_board.c,v 1.8.4.5 2013/02/19 02:22:02 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.4 2013/02/13 23:52:18 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.5 2013/02/19 02:22:02 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -91,11 +91,9 @@
.dr_busbase = 0x80000000,
.dr_len = 0x10000000,
.dr_flags = _BUS_DMAMAP_COHERENT,
-#ifndef _ARM32_NEED_BUS_DMA_BOUNCE
}, [1] = {
.dr_sysbase = 0x90000000,
.dr_busbase = 0x90000000,
-#endif
},
};
@@ -107,6 +105,25 @@
_BUS_DMATAG_FUNCS,
};
+#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+struct arm32_dma_range bcm53xx_bounce_dma_ranges[] = {
+ [0] = {
+ .dr_sysbase = 0x80000000,
+ .dr_busbase = 0x80000000,
+ .dr_len = 0x10000000,
+ .dr_flags = _BUS_DMAMAP_COHERENT,
+ },
+};
+
+struct arm32_bus_dma_tag bcm53xx_bounce_dma_tag = {
+ ._ranges = bcm53xx_bounce_dma_ranges,
+ ._nranges = __arraycount(bcm53xx_bounce_dma_ranges),
+ _BUS_DMAMAP_FUNCS,
+ _BUS_DMAMEM_FUNCS,
+ _BUS_DMATAG_FUNCS,
+};
+#endif
+
#ifdef BCM53XX_CONSOLE_EARLY
#include <dev/ic/ns16550reg.h>
#include <dev/ic/comreg.h>
@@ -529,6 +546,8 @@
bcm53xx_dma_tag._nranges = 1;
#ifndef _ARM32_NEED_BUS_DMA_BOUNCE
bcm53xx_coherent_dma_tag._nranges = 1;
+#else
+ bcm53xx_bounce_dma_ranges[0].dr_len = memsize;
#endif
} else {
/*
@@ -537,12 +556,16 @@
* below 256MB which for PCI and GMAC are coherent.
*/
bcm53xx_dma_ranges[1].dr_len = memsize - 0x10000000;
-#ifndef _ARM32_NEED_BUS_DMA_BOUNCE
bcm53xx_coherent_dma_ranges[1].dr_len = memsize - 0x10000000;
+#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+ bcm53xx_bounce_dma_ranges[1].dr_len = memsize - 0x10000000;
#endif
}
KASSERT(bcm53xx_dma_tag._ranges[0].dr_flags == 0);
KASSERT(bcm53xx_coherent_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT);
+#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+ KASSERT(bcm53xx_bounce_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT);
+#endif
}
#ifdef MULTIPROCESSOR
diff -r cfb78443db45 -r d5b17eb1d269 sys/arch/arm/broadcom/bcm53xx_eth.c
--- a/sys/arch/arm/broadcom/bcm53xx_eth.c Fri Feb 15 22:38:51 2013 +0000
+++ b/sys/arch/arm/broadcom/bcm53xx_eth.c Tue Feb 19 02:22:02 2013 +0000
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.17.2.4 2013/02/07 06:51:49 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.17.2.5 2013/02/19 02:22:02 matt Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -281,6 +281,11 @@
* We need to use the coherent dma tag for the GMAC.
*/
sc->sc_dmat = &bcm53xx_coherent_dma_tag;
+#if _ARM32_NEED_BUS_DMA_BOUNCE
+ if (device_cfdata(self)->cf_flags & 2) {
+ sc->sc_dmat = &bcm53xx_bounce_dma_tag;
+ }
+#endif
prop_data_t eaprop = prop_dictionary_get(dict, "mac-address");
if (eaprop == NULL) {
diff -r cfb78443db45 -r d5b17eb1d269 sys/arch/arm/broadcom/bcm53xx_pax.c
--- a/sys/arch/arm/broadcom/bcm53xx_pax.c Fri Feb 15 22:38:51 2013 +0000
+++ b/sys/arch/arm/broadcom/bcm53xx_pax.c Tue Feb 19 02:22:02 2013 +0000
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_pax.c,v 1.7.4.2 2012/11/28 22:40:23 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_pax.c,v 1.7.4.3 2013/02/19 02:22:02 matt Exp $");
#include <sys/bus.h>
#include <sys/device.h>
@@ -199,10 +199,15 @@
struct bcmccb_attach_args * const ccbaa = aux;
const struct bcm_locators * const loc = &ccbaa->ccbaa_loc;
const char * const xname = device_xname(self);
+ cfdata_t cf = device_cfdata(self);
sc->sc_dev = self;
- //sc->sc_dmat = ccbaa->ccbaa_dmat;
sc->sc_dmat = &bcm53xx_coherent_dma_tag;
+#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+ if (cf->cf_flags & 2) {
+ sc->sc_dmat = &bcm53xx_bounce_dma_tag;
+ }
+#endif
for (u_int i = 0; i < 4; i++) {
snprintf(sc->sc_intrstring[i], sizeof(sc->sc_intrstring[i]),
@@ -293,7 +298,7 @@
/*
* This will force the device to negotiate to a max of gen1.
*/
- if (device_cfdata(self)->cf_flags & 1) {
+ if (cf->cf_flags & 1) {
bcmpax_conf_write(sc, 0, offset + PCI_PCIE_LCSR2, 1);
}
diff -r cfb78443db45 -r d5b17eb1d269 sys/arch/arm/broadcom/bcm53xx_var.h
--- a/sys/arch/arm/broadcom/bcm53xx_var.h Fri Feb 15 22:38:51 2013 +0000
+++ b/sys/arch/arm/broadcom/bcm53xx_var.h Tue Feb 19 02:22:02 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm53xx_var.h,v 1.4.4.2 2012/11/28 22:40:24 matt Exp $ */
+/* $NetBSD: bcm53xx_var.h,v 1.4.4.3 2013/02/19 02:22:02 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -115,6 +115,9 @@
void bcm53xx_srab_write_4(u_int, uint32_t);
void bcm53xx_srab_write_8(u_int, uint64_t);
extern struct arm32_bus_dma_tag bcm53xx_dma_tag, bcm53xx_coherent_dma_tag;
+#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+extern struct arm32_bus_dma_tag bcm53xx_bounce_dma_tag;
+#endif
extern struct bus_space bcmgen_bs_tag;
extern bus_space_tag_t bcm53xx_ioreg_bst;
extern bus_space_handle_t bcm53xx_ioreg_bsh;
Home |
Main Index |
Thread Index |
Old Index