mv_common.c (186909) | mv_common.c (191140) |
---|---|
1/*- 2 * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. 3 * All rights reserved. 4 * 5 * Developed by Semihalf. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 16 unchanged lines hidden (view full) --- 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. 3 * All rights reserved. 4 * 5 * Developed by Semihalf. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 16 unchanged lines hidden (view full) --- 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/arm/mv/common.c 186909 2009-01-08 18:31:43Z raj $"); | 33__FBSDID("$FreeBSD: head/sys/arm/mv/common.c 191140 2009-04-16 11:20:18Z raj $"); |
34 35#include <sys/systm.h> 36#include <sys/bus.h> 37 38#include <machine/bus.h> 39 40#include <arm/mv/mvreg.h> 41#include <arm/mv/mvvar.h> --- 44 unchanged lines hidden (view full) --- 86 87uint32_t 88cpu_extra_feat(void) 89{ 90 uint32_t dev, rev; 91 uint32_t ef = 0; 92 93 soc_id(&dev, &rev); | 34 35#include <sys/systm.h> 36#include <sys/bus.h> 37 38#include <machine/bus.h> 39 40#include <arm/mv/mvreg.h> 41#include <arm/mv/mvvar.h> --- 44 unchanged lines hidden (view full) --- 86 87uint32_t 88cpu_extra_feat(void) 89{ 90 uint32_t dev, rev; 91 uint32_t ef = 0; 92 93 soc_id(&dev, &rev); |
94 if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100) | 94 if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100_Z0 || 95 dev == MV_DEV_MV78100) |
95 __asm __volatile("mrc p15, 1, %0, c15, c1, 0" : "=r" (ef)); 96 else if (dev == MV_DEV_88F5182 || dev == MV_DEV_88F5281) 97 __asm __volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (ef)); 98 else if (bootverbose) 99 printf("This ARM Core does not support any extra features\n"); 100 101 return (ef); 102} --- 58 unchanged lines hidden (view full) --- 161 break; 162 case MV_DEV_88F6281: 163 dev = "Marvell 88F6281"; 164 if (r == 0) 165 rev = "Z0"; 166 else if (r == 2) 167 rev = "A0"; 168 break; | 96 __asm __volatile("mrc p15, 1, %0, c15, c1, 0" : "=r" (ef)); 97 else if (dev == MV_DEV_88F5182 || dev == MV_DEV_88F5281) 98 __asm __volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (ef)); 99 else if (bootverbose) 100 printf("This ARM Core does not support any extra features\n"); 101 102 return (ef); 103} --- 58 unchanged lines hidden (view full) --- 162 break; 163 case MV_DEV_88F6281: 164 dev = "Marvell 88F6281"; 165 if (r == 0) 166 rev = "Z0"; 167 else if (r == 2) 168 rev = "A0"; 169 break; |
170 case MV_DEV_MV78100_Z0: 171 dev = "Marvell MV78100 Z0"; 172 break; |
|
169 case MV_DEV_MV78100: 170 dev = "Marvell MV78100"; 171 break; 172 default: 173 dev = "UNKNOWN"; 174 break; 175 } 176 --- 17 unchanged lines hidden (view full) --- 194 decode_win_eth_valid() != 1 || decode_win_idma_valid() != 1 || 195 decode_win_pcie_valid() != 1 || decode_win_sata_valid() != 1 || 196 decode_win_cesa_valid() != 1) 197 return(-1); 198 199 decode_win_cpu_setup(); 200 decode_win_usb_setup(); 201 decode_win_eth_setup(MV_ETH0_BASE); | 173 case MV_DEV_MV78100: 174 dev = "Marvell MV78100"; 175 break; 176 default: 177 dev = "UNKNOWN"; 178 break; 179 } 180 --- 17 unchanged lines hidden (view full) --- 198 decode_win_eth_valid() != 1 || decode_win_idma_valid() != 1 || 199 decode_win_pcie_valid() != 1 || decode_win_sata_valid() != 1 || 200 decode_win_cesa_valid() != 1) 201 return(-1); 202 203 decode_win_cpu_setup(); 204 decode_win_usb_setup(); 205 decode_win_eth_setup(MV_ETH0_BASE); |
202 if (dev == MV_DEV_MV78100) | 206 if (dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) |
203 decode_win_eth_setup(MV_ETH1_BASE); | 207 decode_win_eth_setup(MV_ETH1_BASE); |
204 if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100) | 208 if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100 || 209 dev == MV_DEV_MV78100_Z0) |
205 decode_win_cesa_setup(); 206 207 decode_win_idma_setup(); 208 decode_win_xor_setup(); 209 | 210 decode_win_cesa_setup(); 211 212 decode_win_idma_setup(); 213 decode_win_xor_setup(); 214 |
210 if (dev == MV_DEV_MV78100) { | 215 if (dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) { |
211 decode_win_pcie_setup(MV_PCIE00_BASE); 212 decode_win_pcie_setup(MV_PCIE01_BASE); 213 decode_win_pcie_setup(MV_PCIE02_BASE); 214 decode_win_pcie_setup(MV_PCIE03_BASE); 215 decode_win_pcie_setup(MV_PCIE10_BASE); 216 decode_win_pcie_setup(MV_PCIE11_BASE); 217 decode_win_pcie_setup(MV_PCIE12_BASE); 218 decode_win_pcie_setup(MV_PCIE13_BASE); --- 136 unchanged lines hidden (view full) --- 355 uint32_t dev, rev; 356 357 soc_id(&dev, &rev); 358 359 /* Depending on the SoC certain windows have remap capability */ 360 if ((dev == MV_DEV_88F5182 && i < 2) || 361 (dev == MV_DEV_88F5281 && i < 4) || 362 (dev == MV_DEV_88F6281 && i < 4) || | 216 decode_win_pcie_setup(MV_PCIE00_BASE); 217 decode_win_pcie_setup(MV_PCIE01_BASE); 218 decode_win_pcie_setup(MV_PCIE02_BASE); 219 decode_win_pcie_setup(MV_PCIE03_BASE); 220 decode_win_pcie_setup(MV_PCIE10_BASE); 221 decode_win_pcie_setup(MV_PCIE11_BASE); 222 decode_win_pcie_setup(MV_PCIE12_BASE); 223 decode_win_pcie_setup(MV_PCIE13_BASE); --- 136 unchanged lines hidden (view full) --- 360 uint32_t dev, rev; 361 362 soc_id(&dev, &rev); 363 364 /* Depending on the SoC certain windows have remap capability */ 365 if ((dev == MV_DEV_88F5182 && i < 2) || 366 (dev == MV_DEV_88F5281 && i < 4) || 367 (dev == MV_DEV_88F6281 && i < 4) || |
363 (dev == MV_DEV_MV78100 && i < 8)) | 368 (dev == MV_DEV_MV78100 && i < 8) || 369 (dev == MV_DEV_MV78100_Z0 && i < 8)) |
364 return (1); 365 366 return (0); 367} 368 369/* XXX This should check for overlapping remap fields too.. */ 370int 371decode_win_overlap(int win, int win_no, const struct decode_win *wintab) --- 213 unchanged lines hidden (view full) --- 585} 586 587static __inline int 588usb_max_ports(void) 589{ 590 uint32_t dev, rev; 591 592 soc_id(&dev, &rev); | 370 return (1); 371 372 return (0); 373} 374 375/* XXX This should check for overlapping remap fields too.. */ 376int 377decode_win_overlap(int win, int win_no, const struct decode_win *wintab) --- 213 unchanged lines hidden (view full) --- 591} 592 593static __inline int 594usb_max_ports(void) 595{ 596 uint32_t dev, rev; 597 598 soc_id(&dev, &rev); |
593 return (dev == MV_DEV_MV78100 ? 3 : 1); | 599 return ((dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) ? 3 : 1); |
594} 595 596static void 597decode_win_usb_dump(void) 598{ 599 int i, p, m; 600 601 m = usb_max_ports(); --- 502 unchanged lines hidden (view full) --- 1104 1105 /* XOR decode windows 0-3 have remap capability */ 1106 if (i < 4) 1107 return (1); 1108 1109 return (0); 1110} 1111 | 600} 601 602static void 603decode_win_usb_dump(void) 604{ 605 int i, p, m; 606 607 m = usb_max_ports(); --- 502 unchanged lines hidden (view full) --- 1110 1111 /* XOR decode windows 0-3 have remap capability */ 1112 if (i < 4) 1113 return (1); 1114 1115 return (0); 1116} 1117 |
1112static __inline int | 1118static int |
1113xor_max_eng(void) 1114{ 1115 uint32_t dev, rev; 1116 1117 soc_id(&dev, &rev); | 1119xor_max_eng(void) 1120{ 1121 uint32_t dev, rev; 1122 1123 soc_id(&dev, &rev); |
1118 return ((dev == MV_DEV_88F6281) ? 2 : 1119 (dev == MV_DEV_MV78100) ? 1 : 0); | 1124 if (dev == MV_DEV_88F6281) 1125 return (2); 1126 else if ((dev == MV_DEV_MV78100) || (dev == MV_DEV_MV78100_Z0)) 1127 return (1); 1128 else 1129 return (0); |
1120} 1121 1122static void 1123xor_active_dram(int c, int e, int *window) 1124{ 1125 uint32_t br, sz; 1126 int i, m, w; 1127 --- 330 unchanged lines hidden --- | 1130} 1131 1132static void 1133xor_active_dram(int c, int e, int *window) 1134{ 1135 uint32_t br, sz; 1136 int i, m, w; 1137 --- 330 unchanged lines hidden --- |