Wed Feb 19 23:19:16 2014 UTC ()
Fix coherent range for BCM563XX


(matt)
diff -r1.18 -r1.19 src/sys/arch/arm/broadcom/bcm53xx_board.c

cvs diff -r1.18 -r1.19 src/sys/arch/arm/broadcom/bcm53xx_board.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm53xx_board.c 2014/02/19 22:20:45 1.18
+++ src/sys/arch/arm/broadcom/bcm53xx_board.c 2014/02/19 23:19:16 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm53xx_board.c,v 1.18 2014/02/19 22:20:45 matt Exp $ */ 1/* $NetBSD: bcm53xx_board.c,v 1.19 2014/02/19 23:19:16 matt Exp $ */
2/*- 2/*-
3 * Copyright (c) 2012 The NetBSD Foundation, Inc. 3 * Copyright (c) 2012 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Matt Thomas of 3am Software Foundry. 7 * by Matt Thomas of 3am Software Foundry.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE. 28 * POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31#include "opt_broadcom.h" 31#include "opt_broadcom.h"
32#include "arml2cc.h" 32#include "arml2cc.h"
33 33
34#define _ARM32_BUS_DMA_PRIVATE 34#define _ARM32_BUS_DMA_PRIVATE
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37 37
38__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.18 2014/02/19 22:20:45 matt Exp $"); 38__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.19 2014/02/19 23:19:16 matt Exp $");
39 39
40#include <sys/param.h> 40#include <sys/param.h>
41#include <sys/bus.h> 41#include <sys/bus.h>
42#include <sys/cpu.h> 42#include <sys/cpu.h>
43#include <sys/device.h> 43#include <sys/device.h>
44 44
45#include <prop/proplib.h> 45#include <prop/proplib.h>
46 46
47#include <net/if.h> 47#include <net/if.h>
48#include <net/if_ether.h> 48#include <net/if_ether.h>
49 49
50#define CCA_PRIVATE 50#define CCA_PRIVATE
51#define CRU_PRIVATE 51#define CRU_PRIVATE
@@ -68,34 +68,34 @@ bus_space_handle_t bcm53xx_armcore_bsh; @@ -68,34 +68,34 @@ bus_space_handle_t bcm53xx_armcore_bsh;
68 68
69static struct cpu_softc cpu_softc; 69static struct cpu_softc cpu_softc;
70 70
71struct arm32_dma_range bcm53xx_dma_ranges[] = { 71struct arm32_dma_range bcm53xx_dma_ranges[] = {
72#ifdef BCM5301X 72#ifdef BCM5301X
73 [0] = { 73 [0] = {
74 .dr_sysbase = 0x80000000, 74 .dr_sysbase = 0x80000000,
75 .dr_busbase = 0x80000000, 75 .dr_busbase = 0x80000000,
76 .dr_len = 0x10000000, 76 .dr_len = 0x10000000,
77 }, [1] = { 77 }, [1] = {
78 .dr_sysbase = 0x90000000, 78 .dr_sysbase = 0x90000000,
79 .dr_busbase = 0x90000000, 79 .dr_busbase = 0x90000000,
80 }, 80 },
81#elif defined(BCM56340) 81#elif defined(BCM563XX)
82 [0] = { 82 [0] = {
83 .dr_sysbase = 0x60000000, 83 .dr_sysbase = 0x60000000,
84 .dr_busbase = 0x60000000, 84 .dr_busbase = 0x60000000,
85 .dr_len = 0x20000000, 85 .dr_len = 0x20000000,
86 }, [1] = { 86 }, [1] = {
87 .dr_sysbase = 0xa0000000, 87 .dr_sysbase = 0x80000000,
88 .dr_busbase = 0xa0000000, 88 .dr_busbase = 0x80000000,
89 }. 89 }.
90#endif 90#endif
91}; 91};
92 92
93struct arm32_bus_dma_tag bcm53xx_dma_tag = { 93struct arm32_bus_dma_tag bcm53xx_dma_tag = {
94 ._ranges = bcm53xx_dma_ranges, 94 ._ranges = bcm53xx_dma_ranges,
95 ._nranges = __arraycount(bcm53xx_dma_ranges), 95 ._nranges = __arraycount(bcm53xx_dma_ranges),
96 _BUS_DMAMAP_FUNCS, 96 _BUS_DMAMAP_FUNCS,
97 _BUS_DMAMEM_FUNCS, 97 _BUS_DMAMEM_FUNCS,
98 _BUS_DMATAG_FUNCS, 98 _BUS_DMATAG_FUNCS,
99}; 99};
100 100
101struct arm32_dma_range bcm53xx_coherent_dma_ranges[] = { 101struct arm32_dma_range bcm53xx_coherent_dma_ranges[] = {
@@ -106,28 +106,28 @@ struct arm32_dma_range bcm53xx_coherent_ @@ -106,28 +106,28 @@ struct arm32_dma_range bcm53xx_coherent_
106 .dr_len = 0x10000000, 106 .dr_len = 0x10000000,
107 .dr_flags = _BUS_DMAMAP_COHERENT, 107 .dr_flags = _BUS_DMAMAP_COHERENT,
108 }, [1] = { 108 }, [1] = {
109 .dr_sysbase = 0x90000000, 109 .dr_sysbase = 0x90000000,
110 .dr_busbase = 0x90000000, 110 .dr_busbase = 0x90000000,
111 }, 111 },
112#elif defined(BCM563XX) 112#elif defined(BCM563XX)
113 [0] = { 113 [0] = {
114 .dr_sysbase = 0x60000000, 114 .dr_sysbase = 0x60000000,
115 .dr_busbase = 0x60000000, 115 .dr_busbase = 0x60000000,
116 .dr_len = 0x20000000, 116 .dr_len = 0x20000000,
117 .dr_flags = _BUS_DMAMAP_COHERENT, 117 .dr_flags = _BUS_DMAMAP_COHERENT,
118 }, [1] = { 118 }, [1] = {
119 .dr_sysbase = 0xa0000000, 119 .dr_sysbase = 0x80000000,
120 .dr_busbase = 0xa0000000, 120 .dr_busbase = 0x80000000,
121 }, 121 },
122#endif 122#endif
123}; 123};
124 124
125struct arm32_bus_dma_tag bcm53xx_coherent_dma_tag = { 125struct arm32_bus_dma_tag bcm53xx_coherent_dma_tag = {
126 ._ranges = bcm53xx_coherent_dma_ranges, 126 ._ranges = bcm53xx_coherent_dma_ranges,
127 ._nranges = __arraycount(bcm53xx_coherent_dma_ranges), 127 ._nranges = __arraycount(bcm53xx_coherent_dma_ranges),
128 _BUS_DMAMAP_FUNCS, 128 _BUS_DMAMAP_FUNCS,
129 _BUS_DMAMEM_FUNCS, 129 _BUS_DMAMEM_FUNCS,
130 _BUS_DMATAG_FUNCS, 130 _BUS_DMATAG_FUNCS,
131}; 131};
132 132
133#ifdef _ARM32_NEED_BUS_DMA_BOUNCE 133#ifdef _ARM32_NEED_BUS_DMA_BOUNCE