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