wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | /* |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 2 | * (C) Copyright 2000-2007 |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | /* |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 9 | * CPU specific code |
| 10 | * |
| 11 | * written or collected and sometimes rewritten by |
| 12 | * Magnus Damm <damm@bitsmart.com> |
| 13 | * |
| 14 | * minor modifications by |
| 15 | * Wolfgang Denk <wd@denx.de> |
| 16 | */ |
| 17 | |
| 18 | #include <common.h> |
| 19 | #include <watchdog.h> |
| 20 | #include <command.h> |
| 21 | #include <asm/cache.h> |
Stefan Roese | b36df56 | 2010-09-09 19:18:00 +0200 | [diff] [blame] | 22 | #include <asm/ppc4xx.h> |
Ben Warren | 25a8590 | 2008-10-27 23:53:17 -0700 | [diff] [blame] | 23 | #include <netdev.h> |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 24 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 25 | DECLARE_GLOBAL_DATA_PTR; |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 26 | |
Stefan Roese | f344386 | 2006-10-07 11:30:52 +0200 | [diff] [blame] | 27 | void board_reset(void); |
Stefan Roese | f344386 | 2006-10-07 11:30:52 +0200 | [diff] [blame] | 28 | |
Adam Graham | c9c11d7 | 2008-10-08 10:13:19 -0700 | [diff] [blame] | 29 | /* |
| 30 | * To provide an interface to detect CPU number for boards that support |
| 31 | * more then one CPU, we implement the "weak" default functions here. |
| 32 | * |
| 33 | * Returns CPU number |
| 34 | */ |
| 35 | int __get_cpu_num(void) |
| 36 | { |
| 37 | return NA_OR_UNKNOWN_CPU; |
| 38 | } |
| 39 | int get_cpu_num(void) __attribute__((weak, alias("__get_cpu_num"))); |
| 40 | |
Stefan Roese | 20b3c4b | 2009-07-06 11:44:33 +0200 | [diff] [blame] | 41 | #if defined(CONFIG_PCI) |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 42 | #if defined(CONFIG_405GP) || \ |
| 43 | defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ |
| 44 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 45 | |
| 46 | #define PCI_ASYNC |
| 47 | |
Stefan Roese | c7f69c3 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 48 | static int pci_async_enabled(void) |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 49 | { |
| 50 | #if defined(CONFIG_405GP) |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 51 | return (mfdcr(CPC0_PSR) & PSR_PCI_ASYNC_EN); |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 52 | #endif |
| 53 | |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 54 | #if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 55 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \ |
| 56 | defined(CONFIG_460EX) || defined(CONFIG_460GT) |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 57 | unsigned long val; |
| 58 | |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 59 | mfsdr(SDR0_SDSTP1, val); |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 60 | return (val & SDR0_SDSTP1_PAME_MASK); |
| 61 | #endif |
| 62 | } |
| 63 | #endif |
Stefan Roese | 20b3c4b | 2009-07-06 11:44:33 +0200 | [diff] [blame] | 64 | #endif /* CONFIG_PCI */ |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 65 | |
Stefan Roese | 99bcad1 | 2012-09-19 14:33:52 +0200 | [diff] [blame] | 66 | #if defined(CONFIG_PCI) && \ |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 67 | !defined(CONFIG_405) && !defined(CONFIG_405EX) |
Stefan Roese | a760b02 | 2009-11-12 16:41:09 +0100 | [diff] [blame] | 68 | int pci_arbiter_enabled(void) |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 69 | { |
| 70 | #if defined(CONFIG_405GP) |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 71 | return (mfdcr(CPC0_PSR) & PSR_PCI_ARBIT_EN); |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 72 | #endif |
| 73 | |
| 74 | #if defined(CONFIG_405EP) |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 75 | return (mfdcr(CPC0_PCI) & CPC0_PCI_ARBIT_EN); |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 76 | #endif |
| 77 | |
| 78 | #if defined(CONFIG_440GP) |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 79 | return (mfdcr(CPC0_STRP1) & CPC0_STRP1_PAE_MASK); |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 80 | #endif |
| 81 | |
Stefan Roese | 7372ca6 | 2007-02-02 12:44:22 +0100 | [diff] [blame] | 82 | #if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE) |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 83 | unsigned long val; |
| 84 | |
Stefan Roese | 5e7abce | 2010-09-11 09:31:43 +0200 | [diff] [blame] | 85 | mfsdr(SDR0_XCR0, val); |
| 86 | return (val & SDR0_XCR0_PAE_MASK); |
Stefan Roese | 7372ca6 | 2007-02-02 12:44:22 +0100 | [diff] [blame] | 87 | #endif |
| 88 | #if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 89 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \ |
| 90 | defined(CONFIG_460EX) || defined(CONFIG_460GT) |
Stefan Roese | 7372ca6 | 2007-02-02 12:44:22 +0100 | [diff] [blame] | 91 | unsigned long val; |
| 92 | |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 93 | mfsdr(SDR0_PCI0, val); |
Stefan Roese | 5e7abce | 2010-09-11 09:31:43 +0200 | [diff] [blame] | 94 | return (val & SDR0_PCI0_PAE_MASK); |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 95 | #endif |
| 96 | } |
| 97 | #endif |
| 98 | |
Stefan Roese | c7f69c3 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 99 | #if defined(CONFIG_405EP) |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 100 | #define I2C_BOOTROM |
| 101 | |
Stefan Roese | c7f69c3 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 102 | static int i2c_bootrom_enabled(void) |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 103 | { |
| 104 | #if defined(CONFIG_405EP) |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 105 | return (mfdcr(CPC0_BOOT) & CPC0_BOOT_SEP); |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 106 | #else |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 107 | unsigned long val; |
| 108 | |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 109 | mfsdr(SDR0_SDCS0, val); |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 110 | return (val & SDR0_SDCS_SDD); |
| 111 | #endif |
| 112 | } |
Stefan Roese | 90e6f41 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 113 | #endif |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 114 | |
| 115 | #if defined(CONFIG_440GX) |
| 116 | #define SDR0_PINSTP_SHIFT 29 |
| 117 | static char *bootstrap_str[] = { |
| 118 | "EBC (16 bits)", |
| 119 | "EBC (8 bits)", |
| 120 | "EBC (32 bits)", |
| 121 | "EBC (8 bits)", |
| 122 | "PCI", |
| 123 | "I2C (Addr 0x54)", |
| 124 | "Reserved", |
| 125 | "I2C (Addr 0x50)", |
| 126 | }; |
BenoƮt Monin | e3cbe1f | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 127 | static char bootstrap_char[] = { 'A', 'B', 'C', 'B', 'D', 'E', 'x', 'F' }; |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 128 | #endif |
| 129 | |
| 130 | #if defined(CONFIG_440SP) || defined(CONFIG_440SPE) |
| 131 | #define SDR0_PINSTP_SHIFT 30 |
| 132 | static char *bootstrap_str[] = { |
| 133 | "EBC (8 bits)", |
| 134 | "PCI", |
| 135 | "I2C (Addr 0x54)", |
| 136 | "I2C (Addr 0x50)", |
| 137 | }; |
BenoƮt Monin | e3cbe1f | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 138 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D'}; |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 139 | #endif |
| 140 | |
| 141 | #if defined(CONFIG_440EP) || defined(CONFIG_440GR) |
| 142 | #define SDR0_PINSTP_SHIFT 29 |
| 143 | static char *bootstrap_str[] = { |
| 144 | "EBC (8 bits)", |
| 145 | "PCI", |
| 146 | "NAND (8 bits)", |
| 147 | "EBC (16 bits)", |
| 148 | "EBC (16 bits)", |
| 149 | "I2C (Addr 0x54)", |
| 150 | "PCI", |
| 151 | "I2C (Addr 0x52)", |
| 152 | }; |
BenoƮt Monin | e3cbe1f | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 153 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' }; |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 154 | #endif |
| 155 | |
| 156 | #if defined(CONFIG_440EPX) || defined(CONFIG_440GRX) |
| 157 | #define SDR0_PINSTP_SHIFT 29 |
| 158 | static char *bootstrap_str[] = { |
| 159 | "EBC (8 bits)", |
| 160 | "EBC (16 bits)", |
| 161 | "EBC (16 bits)", |
| 162 | "NAND (8 bits)", |
| 163 | "PCI", |
| 164 | "I2C (Addr 0x54)", |
| 165 | "PCI", |
| 166 | "I2C (Addr 0x52)", |
| 167 | }; |
BenoƮt Monin | e3cbe1f | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 168 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' }; |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 169 | #endif |
| 170 | |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 171 | #if defined(CONFIG_460EX) || defined(CONFIG_460GT) |
| 172 | #define SDR0_PINSTP_SHIFT 29 |
| 173 | static char *bootstrap_str[] = { |
| 174 | "EBC (8 bits)", |
| 175 | "EBC (16 bits)", |
| 176 | "PCI", |
| 177 | "PCI", |
| 178 | "EBC (16 bits)", |
| 179 | "NAND (8 bits)", |
| 180 | "I2C (Addr 0x54)", /* A8 */ |
| 181 | "I2C (Addr 0x52)", /* A4 */ |
| 182 | }; |
Felix Radensky | d98964a | 2010-01-19 17:37:13 +0200 | [diff] [blame] | 183 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' }; |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 184 | #endif |
| 185 | |
Feng Kan | 7d30793 | 2008-07-08 22:47:31 -0700 | [diff] [blame] | 186 | #if defined(CONFIG_460SX) |
| 187 | #define SDR0_PINSTP_SHIFT 29 |
| 188 | static char *bootstrap_str[] = { |
| 189 | "EBC (8 bits)", |
| 190 | "EBC (16 bits)", |
| 191 | "EBC (32 bits)", |
| 192 | "NAND (8 bits)", |
| 193 | "I2C (Addr 0x54)", /* A8 */ |
| 194 | "I2C (Addr 0x52)", /* A4 */ |
| 195 | }; |
| 196 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G' }; |
| 197 | #endif |
| 198 | |
Stefan Roese | 90e6f41 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 199 | #if defined(CONFIG_405EZ) |
| 200 | #define SDR0_PINSTP_SHIFT 28 |
| 201 | static char *bootstrap_str[] = { |
| 202 | "EBC (8 bits)", |
| 203 | "SPI (fast)", |
| 204 | "NAND (512 page, 4 addr cycle)", |
| 205 | "I2C (Addr 0x50)", |
| 206 | "EBC (32 bits)", |
| 207 | "I2C (Addr 0x50)", |
| 208 | "NAND (2K page, 5 addr cycle)", |
| 209 | "I2C (Addr 0x50)", |
| 210 | "EBC (16 bits)", |
| 211 | "Reserved", |
| 212 | "NAND (2K page, 4 addr cycle)", |
| 213 | "I2C (Addr 0x50)", |
| 214 | "NAND (512 page, 3 addr cycle)", |
| 215 | "I2C (Addr 0x50)", |
| 216 | "SPI (slow)", |
| 217 | "I2C (Addr 0x50)", |
| 218 | }; |
BenoƮt Monin | e3cbe1f | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 219 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', \ |
| 220 | 'I', 'x', 'K', 'L', 'M', 'N', 'O', 'P' }; |
Stefan Roese | 90e6f41 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 221 | #endif |
| 222 | |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 223 | #if defined(CONFIG_405EX) |
| 224 | #define SDR0_PINSTP_SHIFT 29 |
| 225 | static char *bootstrap_str[] = { |
| 226 | "EBC (8 bits)", |
| 227 | "EBC (16 bits)", |
| 228 | "EBC (16 bits)", |
| 229 | "NAND (8 bits)", |
| 230 | "NAND (8 bits)", |
| 231 | "I2C (Addr 0x54)", |
| 232 | "EBC (8 bits)", |
| 233 | "I2C (Addr 0x52)", |
| 234 | }; |
| 235 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' }; |
| 236 | #endif |
| 237 | |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 238 | #if defined(SDR0_PINSTP_SHIFT) |
| 239 | static int bootstrap_option(void) |
| 240 | { |
| 241 | unsigned long val; |
| 242 | |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 243 | mfsdr(SDR0_PINSTP, val); |
Stefan Roese | 90e6f41 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 244 | return ((val & 0xf0000000) >> SDR0_PINSTP_SHIFT); |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 245 | } |
| 246 | #endif /* SDR0_PINSTP_SHIFT */ |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 247 | |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 248 | |
Stefan Roese | 5e7abce | 2010-09-11 09:31:43 +0200 | [diff] [blame] | 249 | #if defined(CONFIG_440GP) |
Stefan Roese | c7f69c3 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 250 | static int do_chip_reset (unsigned long sys0, unsigned long sys1) |
| 251 | { |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 252 | /* Changes to CPC0_SYS0 and CPC0_SYS1 require chip |
Stefan Roese | c7f69c3 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 253 | * reset. |
| 254 | */ |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 255 | mtdcr (CPC0_CR0, mfdcr (CPC0_CR0) | 0x80000000); /* Set SWE */ |
| 256 | mtdcr (CPC0_SYS0, sys0); |
| 257 | mtdcr (CPC0_SYS1, sys1); |
| 258 | mtdcr (CPC0_CR0, mfdcr (CPC0_CR0) & ~0x80000000); /* Clr SWE */ |
Matthias Fuchs | 58ea142 | 2009-07-22 17:27:56 +0200 | [diff] [blame] | 259 | mtspr (SPRN_DBCR0, 0x20000000); /* Reset the chip */ |
Stefan Roese | c7f69c3 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 260 | |
| 261 | return 1; |
| 262 | } |
Stefan Roese | 5e7abce | 2010-09-11 09:31:43 +0200 | [diff] [blame] | 263 | #endif /* CONFIG_440GP */ |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 264 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 265 | |
| 266 | int checkcpu (void) |
| 267 | { |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 268 | #if !defined(CONFIG_405) /* not used on Xilinx 405 FPGA implementations */ |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 269 | uint pvr = get_pvr(); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 270 | ulong clock = gd->cpu_clk; |
| 271 | char buf[32]; |
Stefan Roese | 89bcc48 | 2009-07-29 08:45:27 +0200 | [diff] [blame] | 272 | #if defined(CONFIG_460EX) || defined(CONFIG_460GT) |
| 273 | u32 reg; |
| 274 | #endif |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 275 | |
Wolfgang Denk | ba999c5 | 2006-10-20 17:54:33 +0200 | [diff] [blame] | 276 | char addstr[64] = ""; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 277 | sys_info_t sys_info; |
Adam Graham | c9c11d7 | 2008-10-08 10:13:19 -0700 | [diff] [blame] | 278 | int cpu_num; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 279 | |
Adam Graham | c9c11d7 | 2008-10-08 10:13:19 -0700 | [diff] [blame] | 280 | cpu_num = get_cpu_num(); |
| 281 | if (cpu_num >= 0) |
| 282 | printf("CPU%d: ", cpu_num); |
| 283 | else |
| 284 | puts("CPU: "); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 285 | |
| 286 | get_sys_info(&sys_info); |
| 287 | |
Ricardo Ribalda Delgado | d865fd0 | 2008-07-17 11:44:12 +0200 | [diff] [blame] | 288 | #if defined(CONFIG_XILINX_440) |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 289 | puts("IBM PowerPC "); |
Ricardo Ribalda Delgado | d865fd0 | 2008-07-17 11:44:12 +0200 | [diff] [blame] | 290 | #else |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 291 | puts("AMCC PowerPC "); |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 292 | #endif |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 293 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 294 | switch (pvr) { |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 295 | |
| 296 | #if !defined(CONFIG_440) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 297 | case PVR_405GP_RB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 298 | puts("405GP Rev. B"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 299 | break; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 300 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 301 | case PVR_405GP_RC: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 302 | puts("405GP Rev. C"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 303 | break; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 304 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 305 | case PVR_405GP_RD: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 306 | puts("405GP Rev. D"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 307 | break; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 308 | |
Matthias Fuchs | 3fb8588 | 2013-08-07 12:10:38 +0200 | [diff] [blame] | 309 | case PVR_405GP_RE: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 310 | puts("405GP Rev. E"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 311 | break; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 312 | |
| 313 | case PVR_405GPR_RB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 314 | puts("405GPr Rev. B"); |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 315 | break; |
| 316 | |
stroese | b867d70 | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 317 | case PVR_405EP_RB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 318 | puts("405EP Rev. B"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 319 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 320 | |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 321 | case PVR_405EZ_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 322 | puts("405EZ Rev. A"); |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 323 | break; |
| 324 | |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 325 | case PVR_405EX1_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 326 | puts("405EX Rev. A"); |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 327 | strcpy(addstr, "Security support"); |
| 328 | break; |
| 329 | |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 330 | case PVR_405EXR2_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 331 | puts("405EXr Rev. A"); |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 332 | strcpy(addstr, "No Security support"); |
| 333 | break; |
| 334 | |
Stefan Roese | 70fab19 | 2008-05-13 20:22:01 +0200 | [diff] [blame] | 335 | case PVR_405EX1_RC: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 336 | puts("405EX Rev. C"); |
Stefan Roese | 70fab19 | 2008-05-13 20:22:01 +0200 | [diff] [blame] | 337 | strcpy(addstr, "Security support"); |
| 338 | break; |
| 339 | |
| 340 | case PVR_405EX2_RC: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 341 | puts("405EX Rev. C"); |
Stefan Roese | 70fab19 | 2008-05-13 20:22:01 +0200 | [diff] [blame] | 342 | strcpy(addstr, "No Security support"); |
| 343 | break; |
| 344 | |
| 345 | case PVR_405EXR1_RC: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 346 | puts("405EXr Rev. C"); |
Stefan Roese | 70fab19 | 2008-05-13 20:22:01 +0200 | [diff] [blame] | 347 | strcpy(addstr, "Security support"); |
| 348 | break; |
| 349 | |
| 350 | case PVR_405EXR2_RC: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 351 | puts("405EXr Rev. C"); |
Stefan Roese | 70fab19 | 2008-05-13 20:22:01 +0200 | [diff] [blame] | 352 | strcpy(addstr, "No Security support"); |
| 353 | break; |
| 354 | |
Stefan Roese | 56f1481 | 2009-10-06 07:21:08 +0200 | [diff] [blame] | 355 | case PVR_405EX1_RD: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 356 | puts("405EX Rev. D"); |
Stefan Roese | 56f1481 | 2009-10-06 07:21:08 +0200 | [diff] [blame] | 357 | strcpy(addstr, "Security support"); |
| 358 | break; |
| 359 | |
| 360 | case PVR_405EX2_RD: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 361 | puts("405EX Rev. D"); |
Stefan Roese | 56f1481 | 2009-10-06 07:21:08 +0200 | [diff] [blame] | 362 | strcpy(addstr, "No Security support"); |
| 363 | break; |
| 364 | |
| 365 | case PVR_405EXR1_RD: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 366 | puts("405EXr Rev. D"); |
Stefan Roese | 56f1481 | 2009-10-06 07:21:08 +0200 | [diff] [blame] | 367 | strcpy(addstr, "Security support"); |
| 368 | break; |
| 369 | |
| 370 | case PVR_405EXR2_RD: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 371 | puts("405EXr Rev. D"); |
Stefan Roese | 56f1481 | 2009-10-06 07:21:08 +0200 | [diff] [blame] | 372 | strcpy(addstr, "No Security support"); |
| 373 | break; |
| 374 | |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 375 | #else /* CONFIG_440 */ |
| 376 | |
Stefan Roese | 5e7abce | 2010-09-11 09:31:43 +0200 | [diff] [blame] | 377 | #if defined(CONFIG_440GP) |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 378 | case PVR_440GP_RB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 379 | puts("440GP Rev. B"); |
wdenk | 4d81677 | 2003-09-03 14:03:26 +0000 | [diff] [blame] | 380 | /* See errata 1.12: CHIP_4 */ |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 381 | if ((mfdcr(CPC0_SYS0) != mfdcr(CPC0_STRP0)) || |
| 382 | (mfdcr(CPC0_SYS1) != mfdcr(CPC0_STRP1)) ){ |
wdenk | 4d81677 | 2003-09-03 14:03:26 +0000 | [diff] [blame] | 383 | puts ( "\n\t CPC0_SYSx DCRs corrupted. " |
| 384 | "Resetting chip ...\n"); |
| 385 | udelay( 1000 * 1000 ); /* Give time for serial buf to clear */ |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 386 | do_chip_reset ( mfdcr(CPC0_STRP0), |
| 387 | mfdcr(CPC0_STRP1) ); |
wdenk | 4d81677 | 2003-09-03 14:03:26 +0000 | [diff] [blame] | 388 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 389 | break; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 390 | |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 391 | case PVR_440GP_RC: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 392 | puts("440GP Rev. C"); |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 393 | break; |
Stefan Roese | 5e7abce | 2010-09-11 09:31:43 +0200 | [diff] [blame] | 394 | #endif /* CONFIG_440GP */ |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 395 | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 396 | case PVR_440GX_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 397 | puts("440GX Rev. A"); |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 398 | break; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 399 | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 400 | case PVR_440GX_RB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 401 | puts("440GX Rev. B"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 402 | break; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 403 | |
stroese | 0a7c539 | 2005-04-07 05:33:41 +0000 | [diff] [blame] | 404 | case PVR_440GX_RC: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 405 | puts("440GX Rev. C"); |
stroese | 0a7c539 | 2005-04-07 05:33:41 +0000 | [diff] [blame] | 406 | break; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 407 | |
Stefan Roese | 57275b6 | 2005-11-01 10:08:03 +0100 | [diff] [blame] | 408 | case PVR_440GX_RF: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 409 | puts("440GX Rev. F"); |
Stefan Roese | 57275b6 | 2005-11-01 10:08:03 +0100 | [diff] [blame] | 410 | break; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 411 | |
Stefan Roese | c157d8e | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 412 | case PVR_440EP_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 413 | puts("440EP Rev. A"); |
Stefan Roese | c157d8e | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 414 | break; |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 415 | |
Stefan Roese | 9a8d82f | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 416 | #ifdef CONFIG_440EP |
| 417 | case PVR_440EP_RB: /* 440EP rev B and 440GR rev A have same PVR */ |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 418 | puts("440EP Rev. B"); |
Stefan Roese | c157d8e | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 419 | break; |
Stefan Roese | 512f8d5 | 2006-05-10 14:10:41 +0200 | [diff] [blame] | 420 | |
| 421 | case PVR_440EP_RC: /* 440EP rev C and 440GR rev B have same PVR */ |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 422 | puts("440EP Rev. C"); |
Stefan Roese | 512f8d5 | 2006-05-10 14:10:41 +0200 | [diff] [blame] | 423 | break; |
Stefan Roese | 9a8d82f | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 424 | #endif /* CONFIG_440EP */ |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 425 | |
Stefan Roese | 9a8d82f | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 426 | #ifdef CONFIG_440GR |
| 427 | case PVR_440GR_RA: /* 440EP rev B and 440GR rev A have same PVR */ |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 428 | puts("440GR Rev. A"); |
Stefan Roese | 9a8d82f | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 429 | break; |
Stefan Roese | 512f8d5 | 2006-05-10 14:10:41 +0200 | [diff] [blame] | 430 | |
Stefan Roese | 5770a1e | 2006-05-18 19:21:53 +0200 | [diff] [blame] | 431 | case PVR_440GR_RB: /* 440EP rev C and 440GR rev B have same PVR */ |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 432 | puts("440GR Rev. B"); |
Stefan Roese | 512f8d5 | 2006-05-10 14:10:41 +0200 | [diff] [blame] | 433 | break; |
Stefan Roese | 9a8d82f | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 434 | #endif /* CONFIG_440GR */ |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 435 | |
Stefan Roese | 2902fad | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 436 | #ifdef CONFIG_440EPX |
| 437 | case PVR_440EPX1_RA: /* 440EPx rev A and 440GRx rev A have same PVR */ |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 438 | puts("440EPx Rev. A"); |
Stefan Roese | edf0b54 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 439 | strcpy(addstr, "Security/Kasumi support"); |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 440 | break; |
| 441 | |
Stefan Roese | 2902fad | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 442 | case PVR_440EPX2_RA: /* 440EPx rev A and 440GRx rev A have same PVR */ |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 443 | puts("440EPx Rev. A"); |
Stefan Roese | edf0b54 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 444 | strcpy(addstr, "No Security/Kasumi support"); |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 445 | break; |
Stefan Roese | 2902fad | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 446 | #endif /* CONFIG_440EPX */ |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 447 | |
Stefan Roese | 2902fad | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 448 | #ifdef CONFIG_440GRX |
| 449 | case PVR_440GRX1_RA: /* 440EPx rev A and 440GRx rev A have same PVR */ |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 450 | puts("440GRx Rev. A"); |
Stefan Roese | edf0b54 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 451 | strcpy(addstr, "Security/Kasumi support"); |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 452 | break; |
| 453 | |
Stefan Roese | 2902fad | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 454 | case PVR_440GRX2_RA: /* 440EPx rev A and 440GRx rev A have same PVR */ |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 455 | puts("440GRx Rev. A"); |
Stefan Roese | edf0b54 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 456 | strcpy(addstr, "No Security/Kasumi support"); |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 457 | break; |
Stefan Roese | 2902fad | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 458 | #endif /* CONFIG_440GRX */ |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 459 | |
Stefan Roese | 9598177 | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 460 | case PVR_440SP_6_RAB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 461 | puts("440SP Rev. A/B"); |
Stefan Roese | 9598177 | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 462 | strcpy(addstr, "RAID 6 support"); |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 463 | break; |
| 464 | |
Stefan Roese | 9598177 | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 465 | case PVR_440SP_RAB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 466 | puts("440SP Rev. A/B"); |
Stefan Roese | 9598177 | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 467 | strcpy(addstr, "No RAID 6 support"); |
| 468 | break; |
| 469 | |
| 470 | case PVR_440SP_6_RC: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 471 | puts("440SP Rev. C"); |
Stefan Roese | 9598177 | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 472 | strcpy(addstr, "RAID 6 support"); |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 473 | break; |
| 474 | |
Stefan Roese | e732fae | 2006-11-28 16:09:24 +0100 | [diff] [blame] | 475 | case PVR_440SP_RC: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 476 | puts("440SP Rev. C"); |
Stefan Roese | 9598177 | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 477 | strcpy(addstr, "No RAID 6 support"); |
| 478 | break; |
| 479 | |
| 480 | case PVR_440SPe_6_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 481 | puts("440SPe Rev. A"); |
Stefan Roese | 9598177 | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 482 | strcpy(addstr, "RAID 6 support"); |
Stefan Roese | e732fae | 2006-11-28 16:09:24 +0100 | [diff] [blame] | 483 | break; |
| 484 | |
Marian Balakowicz | 6c5879f | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 485 | case PVR_440SPe_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 486 | puts("440SPe Rev. A"); |
Stefan Roese | 9598177 | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 487 | strcpy(addstr, "No RAID 6 support"); |
| 488 | break; |
| 489 | |
| 490 | case PVR_440SPe_6_RB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 491 | puts("440SPe Rev. B"); |
Stefan Roese | 9598177 | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 492 | strcpy(addstr, "RAID 6 support"); |
Marian Balakowicz | 6c5879f | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 493 | break; |
Marian Balakowicz | fe84b48 | 2006-07-03 23:42:36 +0200 | [diff] [blame] | 494 | |
Marian Balakowicz | 6c5879f | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 495 | case PVR_440SPe_RB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 496 | puts("440SPe Rev. B"); |
Stefan Roese | 9598177 | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 497 | strcpy(addstr, "No RAID 6 support"); |
Marian Balakowicz | 6c5879f | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 498 | break; |
Marian Balakowicz | fe84b48 | 2006-07-03 23:42:36 +0200 | [diff] [blame] | 499 | |
Stefan Roese | 89bcc48 | 2009-07-29 08:45:27 +0200 | [diff] [blame] | 500 | #if defined(CONFIG_460EX) || defined(CONFIG_460GT) |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 501 | case PVR_460EX_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 502 | puts("460EX Rev. A"); |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 503 | strcpy(addstr, "No Security/Kasumi support"); |
| 504 | break; |
| 505 | |
| 506 | case PVR_460EX_SE_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 507 | puts("460EX Rev. A"); |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 508 | strcpy(addstr, "Security/Kasumi support"); |
| 509 | break; |
| 510 | |
Stefan Roese | 89bcc48 | 2009-07-29 08:45:27 +0200 | [diff] [blame] | 511 | case PVR_460EX_RB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 512 | puts("460EX Rev. B"); |
Stefan Roese | 89bcc48 | 2009-07-29 08:45:27 +0200 | [diff] [blame] | 513 | mfsdr(SDR0_ECID3, reg); |
| 514 | if (reg & 0x00100000) |
| 515 | strcpy(addstr, "No Security/Kasumi support"); |
| 516 | else |
| 517 | strcpy(addstr, "Security/Kasumi support"); |
| 518 | break; |
| 519 | |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 520 | case PVR_460GT_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 521 | puts("460GT Rev. A"); |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 522 | strcpy(addstr, "No Security/Kasumi support"); |
| 523 | break; |
| 524 | |
| 525 | case PVR_460GT_SE_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 526 | puts("460GT Rev. A"); |
Stefan Roese | 2801b2d | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 527 | strcpy(addstr, "Security/Kasumi support"); |
| 528 | break; |
| 529 | |
Stefan Roese | 89bcc48 | 2009-07-29 08:45:27 +0200 | [diff] [blame] | 530 | case PVR_460GT_RB: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 531 | puts("460GT Rev. B"); |
Stefan Roese | 89bcc48 | 2009-07-29 08:45:27 +0200 | [diff] [blame] | 532 | mfsdr(SDR0_ECID3, reg); |
| 533 | if (reg & 0x00100000) |
| 534 | strcpy(addstr, "No Security/Kasumi support"); |
| 535 | else |
| 536 | strcpy(addstr, "Security/Kasumi support"); |
| 537 | break; |
| 538 | #endif |
| 539 | |
Feng Kan | 7d30793 | 2008-07-08 22:47:31 -0700 | [diff] [blame] | 540 | case PVR_460SX_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 541 | puts("460SX Rev. A"); |
Feng Kan | 7d30793 | 2008-07-08 22:47:31 -0700 | [diff] [blame] | 542 | strcpy(addstr, "Security support"); |
| 543 | break; |
| 544 | |
| 545 | case PVR_460SX_RA_V1: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 546 | puts("460SX Rev. A"); |
Feng Kan | 7d30793 | 2008-07-08 22:47:31 -0700 | [diff] [blame] | 547 | strcpy(addstr, "No Security support"); |
| 548 | break; |
| 549 | |
| 550 | case PVR_460GX_RA: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 551 | puts("460GX Rev. A"); |
Feng Kan | 7d30793 | 2008-07-08 22:47:31 -0700 | [diff] [blame] | 552 | strcpy(addstr, "Security support"); |
| 553 | break; |
| 554 | |
| 555 | case PVR_460GX_RA_V1: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 556 | puts("460GX Rev. A"); |
Feng Kan | 7d30793 | 2008-07-08 22:47:31 -0700 | [diff] [blame] | 557 | strcpy(addstr, "No Security support"); |
| 558 | break; |
| 559 | |
Tirumala Marri | 1b8fec1 | 2010-09-28 14:15:14 -0700 | [diff] [blame] | 560 | case PVR_APM821XX_RA: |
| 561 | puts("APM821XX Rev. A"); |
| 562 | strcpy(addstr, "Security support"); |
| 563 | break; |
| 564 | |
Ricardo Ribalda Delgado | d865fd0 | 2008-07-17 11:44:12 +0200 | [diff] [blame] | 565 | case PVR_VIRTEX5: |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 566 | puts("440x5 VIRTEX5"); |
Ricardo Ribalda Delgado | d865fd0 | 2008-07-17 11:44:12 +0200 | [diff] [blame] | 567 | break; |
Stefan Roese | e02d449 | 2010-09-03 13:27:02 +0200 | [diff] [blame] | 568 | #endif /* CONFIG_440 */ |
Ricardo Ribalda Delgado | d865fd0 | 2008-07-17 11:44:12 +0200 | [diff] [blame] | 569 | |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 570 | default: |
Stefan Roese | 17f50f22 | 2005-08-04 17:09:16 +0200 | [diff] [blame] | 571 | printf (" UNKNOWN (PVR=%08x)", pvr); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 572 | break; |
| 573 | } |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 574 | |
Stefan Roese | 08c6a26 | 2009-10-19 14:44:11 +0200 | [diff] [blame] | 575 | printf (" at %s MHz (PLB=%lu OPB=%lu EBC=%lu", |
| 576 | strmhz(buf, clock), |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 577 | sys_info.freqPLB / 1000000, |
| 578 | get_OPB_freq() / 1000000, |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 579 | sys_info.freqEBC / 1000000); |
Stefan Roese | 08c6a26 | 2009-10-19 14:44:11 +0200 | [diff] [blame] | 580 | #if defined(CONFIG_PCI) && \ |
| 581 | (defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \ |
| 582 | defined(CONFIG_440GR) || defined(CONFIG_440GRX)) |
| 583 | printf(" PCI=%lu MHz", sys_info.freqPCI / 1000000); |
| 584 | #endif |
| 585 | printf(")\n"); |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 586 | |
Stefan Roese | edf0b54 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 587 | if (addstr[0] != 0) |
| 588 | printf(" %s\n", addstr); |
| 589 | |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 590 | #if defined(I2C_BOOTROM) |
| 591 | printf (" I2C boot EEPROM %sabled\n", i2c_bootrom_enabled() ? "en" : "dis"); |
Stefan Roese | 90e6f41 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 592 | #endif /* I2C_BOOTROM */ |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 593 | #if defined(SDR0_PINSTP_SHIFT) |
BenoƮt Monin | e3cbe1f | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 594 | printf (" Bootstrap Option %c - ", bootstrap_char[bootstrap_option()]); |
Stefan Roese | cf94098 | 2009-04-15 10:50:48 +0200 | [diff] [blame] | 595 | printf ("Boot ROM Location %s", bootstrap_str[bootstrap_option()]); |
Stefan Roese | cf94098 | 2009-04-15 10:50:48 +0200 | [diff] [blame] | 596 | putc('\n'); |
Wolfgang Denk | ba999c5 | 2006-10-20 17:54:33 +0200 | [diff] [blame] | 597 | #endif /* SDR0_PINSTP_SHIFT */ |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 598 | |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 599 | #if defined(CONFIG_PCI) && !defined(CONFIG_405EX) |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 600 | printf (" Internal PCI arbiter %sabled", pci_arbiter_enabled() ? "en" : "dis"); |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 601 | #endif |
| 602 | |
Stefan Roese | 1bbae2b | 2009-05-27 10:34:32 +0200 | [diff] [blame] | 603 | #if defined(CONFIG_PCI) && defined(PCI_ASYNC) |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 604 | if (pci_async_enabled()) { |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 605 | printf (", PCI async ext clock used"); |
| 606 | } else { |
| 607 | printf (", PCI sync clock at %lu MHz", |
| 608 | sys_info.freqPLB / sys_info.pllPciDiv / 1000000); |
| 609 | } |
| 610 | #endif |
| 611 | |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 612 | #if defined(CONFIG_PCI) && !defined(CONFIG_405EX) |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 613 | putc('\n'); |
| 614 | #endif |
| 615 | |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 616 | #if defined(CONFIG_405EP) || defined(CONFIG_405EZ) || defined(CONFIG_405EX) |
Shruti Kanetkar | 6b44d9e | 2013-08-15 11:25:38 -0500 | [diff] [blame] | 617 | printf(" 16 KiB I-Cache 16 KiB D-Cache"); |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 618 | #elif defined(CONFIG_440) |
Shruti Kanetkar | 6b44d9e | 2013-08-15 11:25:38 -0500 | [diff] [blame] | 619 | printf(" 32 KiB I-Cache 32 KiB D-Cache"); |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 620 | #else |
Shruti Kanetkar | 6b44d9e | 2013-08-15 11:25:38 -0500 | [diff] [blame] | 621 | printf(" 16 KiB I-Cache %d KiB D-Cache", |
| 622 | ((pvr | 0x00000001) == PVR_405GPR_RB) ? 16 : 8); |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 623 | #endif |
Stefan Roese | 3d9569b | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 624 | |
| 625 | #endif /* !defined(CONFIG_405) */ |
| 626 | |
| 627 | putc ('\n'); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 628 | |
| 629 | return 0; |
| 630 | } |
| 631 | |
Rafal Jaworowski | 692519b | 2006-08-10 12:43:17 +0200 | [diff] [blame] | 632 | int ppc440spe_revB() { |
| 633 | unsigned int pvr; |
| 634 | |
| 635 | pvr = get_pvr(); |
Stefan Roese | 5a5c569 | 2007-01-15 09:46:29 +0100 | [diff] [blame] | 636 | if ((pvr == PVR_440SPe_6_RB) || (pvr == PVR_440SPe_RB)) |
Rafal Jaworowski | 692519b | 2006-08-10 12:43:17 +0200 | [diff] [blame] | 637 | return 1; |
| 638 | else |
| 639 | return 0; |
| 640 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 641 | |
| 642 | /* ------------------------------------------------------------------------- */ |
| 643 | |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 644 | int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 645 | { |
Stefan Roese | 1f94d16 | 2006-11-27 14:48:41 +0100 | [diff] [blame] | 646 | #if defined(CONFIG_BOARD_RESET) |
| 647 | board_reset(); |
Stefan Roese | 1729b92 | 2006-11-27 14:52:04 +0100 | [diff] [blame] | 648 | #else |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 649 | #if defined(CONFIG_SYS_4xx_RESET_TYPE) |
Matthias Fuchs | 58ea142 | 2009-07-22 17:27:56 +0200 | [diff] [blame] | 650 | mtspr(SPRN_DBCR0, CONFIG_SYS_4xx_RESET_TYPE << 28); |
Stefan Roese | c157d8e | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 651 | #else |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 652 | /* |
| 653 | * Initiate system reset in debug control register DBCR |
| 654 | */ |
Matthias Fuchs | 58ea142 | 2009-07-22 17:27:56 +0200 | [diff] [blame] | 655 | mtspr(SPRN_DBCR0, 0x30000000); |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 656 | #endif /* defined(CONFIG_SYS_4xx_RESET_TYPE) */ |
Stefan Roese | f344386 | 2006-10-07 11:30:52 +0200 | [diff] [blame] | 657 | #endif /* defined(CONFIG_BOARD_RESET) */ |
Stefan Roese | c157d8e | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 658 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 659 | return 1; |
| 660 | } |
| 661 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 662 | |
| 663 | /* |
| 664 | * Get timebase clock frequency |
| 665 | */ |
| 666 | unsigned long get_tbclk (void) |
| 667 | { |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 668 | sys_info_t sys_info; |
| 669 | |
| 670 | get_sys_info(&sys_info); |
| 671 | return (sys_info.freqProcessor); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 672 | } |
| 673 | |
| 674 | |
| 675 | #if defined(CONFIG_WATCHDOG) |
Stefan Roese | c7f69c3 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 676 | void watchdog_reset(void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 677 | { |
| 678 | int re_enable = disable_interrupts(); |
| 679 | reset_4xx_watchdog(); |
| 680 | if (re_enable) enable_interrupts(); |
| 681 | } |
| 682 | |
Stefan Roese | c7f69c3 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 683 | void reset_4xx_watchdog(void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 684 | { |
| 685 | /* |
| 686 | * Clear TSR(WIS) bit |
| 687 | */ |
Matthias Fuchs | 58ea142 | 2009-07-22 17:27:56 +0200 | [diff] [blame] | 688 | mtspr(SPRN_TSR, 0x40000000); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 689 | } |
| 690 | #endif /* CONFIG_WATCHDOG */ |
Ben Warren | 25a8590 | 2008-10-27 23:53:17 -0700 | [diff] [blame] | 691 | |
| 692 | /* |
| 693 | * Initializes on-chip ethernet controllers. |
| 694 | * to override, implement board_eth_init() |
| 695 | */ |
| 696 | int cpu_eth_init(bd_t *bis) |
| 697 | { |
| 698 | #if defined(CONFIG_PPC4xx_EMAC) |
| 699 | ppc_4xx_eth_initialize(bis); |
| 700 | #endif |
| 701 | return 0; |
| 702 | } |