wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | /* |
Stefan Roese | 153b3e2 | 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 | 247e9d7 | 2010-09-09 19:18:00 +0200 | [diff] [blame] | 38 | #include <asm/ppc4xx.h> |
Ben Warren | 9e37c58 | 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 | 6405a15 | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 41 | DECLARE_GLOBAL_DATA_PTR; |
Wolfgang Denk | 6405a15 | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 42 | |
Stefan Roese | 0368775 | 2006-10-07 11:30:52 +0200 | [diff] [blame] | 43 | void board_reset(void); |
Stefan Roese | 0368775 | 2006-10-07 11:30:52 +0200 | [diff] [blame] | 44 | |
Adam Graham | c31ff68 | 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 | 9f500fa | 2009-07-06 11:44:33 +0200 | [diff] [blame] | 57 | #if defined(CONFIG_PCI) |
Stefan Roese | 42fbddd | 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 | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 61 | |
| 62 | #define PCI_ASYNC |
| 63 | |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 64 | static int pci_async_enabled(void) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 65 | { |
| 66 | #if defined(CONFIG_405GP) |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 67 | return (mfdcr(CPC0_PSR) & PSR_PCI_ASYNC_EN); |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 68 | #endif |
| 69 | |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 70 | #if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ |
Stefan Roese | cc019d1 | 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 | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 73 | unsigned long val; |
| 74 | |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 75 | mfsdr(SDR0_SDSTP1, val); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 76 | return (val & SDR0_SDSTP1_PAME_MASK); |
| 77 | #endif |
| 78 | } |
| 79 | #endif |
Stefan Roese | 9f500fa | 2009-07-06 11:44:33 +0200 | [diff] [blame] | 80 | #endif /* CONFIG_PCI */ |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 81 | |
Stefan Roese | 153b3e2 | 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 | 5d8033e | 2009-11-12 16:41:09 +0100 | [diff] [blame] | 84 | int pci_arbiter_enabled(void) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 85 | { |
| 86 | #if defined(CONFIG_405GP) |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 87 | return (mfdcr(CPC0_PSR) & PSR_PCI_ARBIT_EN); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 88 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 89 | |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 90 | #if defined(CONFIG_405EP) |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 91 | return (mfdcr(CPC0_PCI) & CPC0_PCI_ARBIT_EN); |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 92 | #endif |
| 93 | |
| 94 | #if defined(CONFIG_440GP) |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 95 | return (mfdcr(CPC0_STRP1) & CPC0_STRP1_PAE_MASK); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 96 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 97 | |
Stefan Roese | 8438243 | 2007-02-02 12:44:22 +0100 | [diff] [blame] | 98 | #if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 99 | unsigned long val; |
| 100 | |
Stefan Roese | 95ca5fa | 2010-09-11 09:31:43 +0200 | [diff] [blame^] | 101 | mfsdr(SDR0_XCR0, val); |
| 102 | return (val & SDR0_XCR0_PAE_MASK); |
Stefan Roese | 8438243 | 2007-02-02 12:44:22 +0100 | [diff] [blame] | 103 | #endif |
| 104 | #if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ |
Stefan Roese | cc019d1 | 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 | 8438243 | 2007-02-02 12:44:22 +0100 | [diff] [blame] | 107 | unsigned long val; |
| 108 | |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 109 | mfsdr(SDR0_PCI0, val); |
Stefan Roese | 95ca5fa | 2010-09-11 09:31:43 +0200 | [diff] [blame^] | 110 | return (val & SDR0_PCI0_PAE_MASK); |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 111 | #endif |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 112 | } |
| 113 | #endif |
| 114 | |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 115 | #if defined(CONFIG_405EP) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 116 | #define I2C_BOOTROM |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 117 | |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 118 | static int i2c_bootrom_enabled(void) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 119 | { |
| 120 | #if defined(CONFIG_405EP) |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 121 | return (mfdcr(CPC0_BOOT) & CPC0_BOOT_SEP); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 122 | #else |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 123 | unsigned long val; |
| 124 | |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 125 | mfsdr(SDR0_SDCS0, val); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 126 | return (val & SDR0_SDCS_SDD); |
| 127 | #endif |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 128 | } |
Stefan Roese | 3a75ac1 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 129 | #endif |
Stefan Roese | 42fbddd | 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 | 1a70cf2 | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 143 | static char bootstrap_char[] = { 'A', 'B', 'C', 'B', 'D', 'E', 'x', 'F' }; |
Stefan Roese | 42fbddd | 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 | 1a70cf2 | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 154 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D'}; |
Stefan Roese | 42fbddd | 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 | 1a70cf2 | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 169 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' }; |
Stefan Roese | 42fbddd | 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 | 1a70cf2 | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 184 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' }; |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 185 | #endif |
| 186 | |
Stefan Roese | cc019d1 | 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 | e6be145 | 2010-01-19 17:37:13 +0200 | [diff] [blame] | 199 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' }; |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 200 | #endif |
| 201 | |
Feng Kan | 224bc96 | 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 | 3a75ac1 | 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 | 1a70cf2 | 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 | 3a75ac1 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 237 | #endif |
| 238 | |
Stefan Roese | 153b3e2 | 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 |
| 253 | |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 254 | #if defined(SDR0_PINSTP_SHIFT) |
| 255 | static int bootstrap_option(void) |
| 256 | { |
| 257 | unsigned long val; |
| 258 | |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 259 | mfsdr(SDR0_PINSTP, val); |
Stefan Roese | 3a75ac1 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 260 | return ((val & 0xf0000000) >> SDR0_PINSTP_SHIFT); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 261 | } |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 262 | #endif /* SDR0_PINSTP_SHIFT */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 263 | |
| 264 | |
Stefan Roese | 95ca5fa | 2010-09-11 09:31:43 +0200 | [diff] [blame^] | 265 | #if defined(CONFIG_440GP) |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 266 | static int do_chip_reset (unsigned long sys0, unsigned long sys1) |
| 267 | { |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 268 | /* Changes to CPC0_SYS0 and CPC0_SYS1 require chip |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 269 | * reset. |
| 270 | */ |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 271 | mtdcr (CPC0_CR0, mfdcr (CPC0_CR0) | 0x80000000); /* Set SWE */ |
| 272 | mtdcr (CPC0_SYS0, sys0); |
| 273 | mtdcr (CPC0_SYS1, sys1); |
| 274 | mtdcr (CPC0_CR0, mfdcr (CPC0_CR0) & ~0x80000000); /* Clr SWE */ |
Matthias Fuchs | 730b2d2 | 2009-07-22 17:27:56 +0200 | [diff] [blame] | 275 | mtspr (SPRN_DBCR0, 0x20000000); /* Reset the chip */ |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 276 | |
| 277 | return 1; |
| 278 | } |
Stefan Roese | 95ca5fa | 2010-09-11 09:31:43 +0200 | [diff] [blame^] | 279 | #endif /* CONFIG_440GP */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 280 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 281 | |
| 282 | int checkcpu (void) |
| 283 | { |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 284 | #if !defined(CONFIG_405) /* not used on Xilinx 405 FPGA implementations */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 285 | uint pvr = get_pvr(); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 286 | ulong clock = gd->cpu_clk; |
| 287 | char buf[32]; |
Stefan Roese | 048f5a6 | 2009-07-29 08:45:27 +0200 | [diff] [blame] | 288 | #if defined(CONFIG_460EX) || defined(CONFIG_460GT) |
| 289 | u32 reg; |
| 290 | #endif |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 291 | |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 292 | #if !defined(CONFIG_IOP480) |
Wolfgang Denk | 6550543 | 2006-10-20 17:54:33 +0200 | [diff] [blame] | 293 | char addstr[64] = ""; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 294 | sys_info_t sys_info; |
Adam Graham | c31ff68 | 2008-10-08 10:13:19 -0700 | [diff] [blame] | 295 | int cpu_num; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 296 | |
Adam Graham | c31ff68 | 2008-10-08 10:13:19 -0700 | [diff] [blame] | 297 | cpu_num = get_cpu_num(); |
| 298 | if (cpu_num >= 0) |
| 299 | printf("CPU%d: ", cpu_num); |
| 300 | else |
| 301 | puts("CPU: "); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 302 | |
| 303 | get_sys_info(&sys_info); |
| 304 | |
Ricardo Ribalda Delgado | 95c5020 | 2008-07-17 11:44:12 +0200 | [diff] [blame] | 305 | #if defined(CONFIG_XILINX_440) |
| 306 | puts("IBM PowerPC 4"); |
| 307 | #else |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 308 | puts("AMCC PowerPC 4"); |
Ricardo Ribalda Delgado | 95c5020 | 2008-07-17 11:44:12 +0200 | [diff] [blame] | 309 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 310 | |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 311 | #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \ |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 312 | defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \ |
| 313 | defined(CONFIG_405EX) |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 314 | puts("05"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 315 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 316 | #if defined(CONFIG_440) |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 317 | #if defined(CONFIG_460EX) || defined(CONFIG_460GT) |
| 318 | puts("60"); |
| 319 | #else |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 320 | puts("40"); |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 321 | #endif |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 322 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 323 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 324 | switch (pvr) { |
| 325 | case PVR_405GP_RB: |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 326 | puts("GP Rev. B"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 327 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 328 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 329 | case PVR_405GP_RC: |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 330 | puts("GP Rev. C"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 331 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 332 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 333 | case PVR_405GP_RD: |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 334 | puts("GP Rev. D"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 335 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 336 | |
wdenk | c35ba4e | 2004-03-14 22:25:36 +0000 | [diff] [blame] | 337 | #ifdef CONFIG_405GP |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 338 | case PVR_405GP_RE: /* 405GP rev E and 405CR rev C have same PVR */ |
| 339 | puts("GP Rev. E"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 340 | break; |
| 341 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 342 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 343 | case PVR_405CR_RA: |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 344 | puts("CR Rev. A"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 345 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 346 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 347 | case PVR_405CR_RB: |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 348 | puts("CR Rev. B"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 349 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 350 | |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 351 | #ifdef CONFIG_405CR |
| 352 | case PVR_405CR_RC: /* 405GP rev E and 405CR rev C have same PVR */ |
| 353 | puts("CR Rev. C"); |
| 354 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 355 | #endif |
| 356 | |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 357 | case PVR_405GPR_RB: |
| 358 | puts("GPr Rev. B"); |
| 359 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 360 | |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 361 | case PVR_405EP_RB: |
| 362 | puts("EP Rev. B"); |
| 363 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 364 | |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 365 | case PVR_405EZ_RA: |
| 366 | puts("EZ Rev. A"); |
| 367 | break; |
| 368 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 369 | case PVR_405EX1_RA: |
| 370 | puts("EX Rev. A"); |
| 371 | strcpy(addstr, "Security support"); |
| 372 | break; |
| 373 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 374 | case PVR_405EXR2_RA: |
| 375 | puts("EXr Rev. A"); |
| 376 | strcpy(addstr, "No Security support"); |
| 377 | break; |
| 378 | |
Stefan Roese | fbf2430 | 2008-05-13 20:22:01 +0200 | [diff] [blame] | 379 | case PVR_405EX1_RC: |
| 380 | puts("EX Rev. C"); |
| 381 | strcpy(addstr, "Security support"); |
| 382 | break; |
| 383 | |
| 384 | case PVR_405EX2_RC: |
| 385 | puts("EX Rev. C"); |
| 386 | strcpy(addstr, "No Security support"); |
| 387 | break; |
| 388 | |
| 389 | case PVR_405EXR1_RC: |
| 390 | puts("EXr Rev. C"); |
| 391 | strcpy(addstr, "Security support"); |
| 392 | break; |
| 393 | |
| 394 | case PVR_405EXR2_RC: |
| 395 | puts("EXr Rev. C"); |
| 396 | strcpy(addstr, "No Security support"); |
| 397 | break; |
| 398 | |
Stefan Roese | f1a80e4 | 2009-10-06 07:21:08 +0200 | [diff] [blame] | 399 | case PVR_405EX1_RD: |
| 400 | puts("EX Rev. D"); |
| 401 | strcpy(addstr, "Security support"); |
| 402 | break; |
| 403 | |
| 404 | case PVR_405EX2_RD: |
| 405 | puts("EX Rev. D"); |
| 406 | strcpy(addstr, "No Security support"); |
| 407 | break; |
| 408 | |
| 409 | case PVR_405EXR1_RD: |
| 410 | puts("EXr Rev. D"); |
| 411 | strcpy(addstr, "Security support"); |
| 412 | break; |
| 413 | |
| 414 | case PVR_405EXR2_RD: |
| 415 | puts("EXr Rev. D"); |
| 416 | strcpy(addstr, "No Security support"); |
| 417 | break; |
| 418 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 419 | #if defined(CONFIG_440) |
Stefan Roese | 95ca5fa | 2010-09-11 09:31:43 +0200 | [diff] [blame^] | 420 | #if defined(CONFIG_440GP) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 421 | case PVR_440GP_RB: |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 422 | puts("GP Rev. B"); |
wdenk | a4685fe | 2003-09-03 14:03:26 +0000 | [diff] [blame] | 423 | /* See errata 1.12: CHIP_4 */ |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 424 | if ((mfdcr(CPC0_SYS0) != mfdcr(CPC0_STRP0)) || |
| 425 | (mfdcr(CPC0_SYS1) != mfdcr(CPC0_STRP1)) ){ |
wdenk | a4685fe | 2003-09-03 14:03:26 +0000 | [diff] [blame] | 426 | puts ( "\n\t CPC0_SYSx DCRs corrupted. " |
| 427 | "Resetting chip ...\n"); |
| 428 | udelay( 1000 * 1000 ); /* Give time for serial buf to clear */ |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 429 | do_chip_reset ( mfdcr(CPC0_STRP0), |
| 430 | mfdcr(CPC0_STRP1) ); |
wdenk | a4685fe | 2003-09-03 14:03:26 +0000 | [diff] [blame] | 431 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 432 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 433 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 434 | case PVR_440GP_RC: |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 435 | puts("GP Rev. C"); |
wdenk | 544e973 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 436 | break; |
Stefan Roese | 95ca5fa | 2010-09-11 09:31:43 +0200 | [diff] [blame^] | 437 | #endif /* CONFIG_440GP */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 438 | |
wdenk | 544e973 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 439 | case PVR_440GX_RA: |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 440 | puts("GX Rev. A"); |
wdenk | 544e973 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 441 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 442 | |
wdenk | 544e973 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 443 | case PVR_440GX_RB: |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 444 | puts("GX Rev. B"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 445 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 446 | |
stroese | c012527 | 2005-04-07 05:33:41 +0000 | [diff] [blame] | 447 | case PVR_440GX_RC: |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 448 | puts("GX Rev. C"); |
stroese | c012527 | 2005-04-07 05:33:41 +0000 | [diff] [blame] | 449 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 450 | |
Stefan Roese | 08fb404 | 2005-11-01 10:08:03 +0100 | [diff] [blame] | 451 | case PVR_440GX_RF: |
| 452 | puts("GX Rev. F"); |
| 453 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 454 | |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 455 | case PVR_440EP_RA: |
| 456 | puts("EP Rev. A"); |
| 457 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 458 | |
Stefan Roese | 95258d5 | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 459 | #ifdef CONFIG_440EP |
| 460 | case PVR_440EP_RB: /* 440EP rev B and 440GR rev A have same PVR */ |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 461 | puts("EP Rev. B"); |
| 462 | break; |
Stefan Roese | 31ce7de | 2006-05-10 14:10:41 +0200 | [diff] [blame] | 463 | |
| 464 | case PVR_440EP_RC: /* 440EP rev C and 440GR rev B have same PVR */ |
| 465 | puts("EP Rev. C"); |
| 466 | break; |
Stefan Roese | 95258d5 | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 467 | #endif /* CONFIG_440EP */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 468 | |
Stefan Roese | 95258d5 | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 469 | #ifdef CONFIG_440GR |
| 470 | case PVR_440GR_RA: /* 440EP rev B and 440GR rev A have same PVR */ |
| 471 | puts("GR Rev. A"); |
| 472 | break; |
Stefan Roese | 31ce7de | 2006-05-10 14:10:41 +0200 | [diff] [blame] | 473 | |
Stefan Roese | 96467d6 | 2006-05-18 19:21:53 +0200 | [diff] [blame] | 474 | case PVR_440GR_RB: /* 440EP rev C and 440GR rev B have same PVR */ |
Stefan Roese | 31ce7de | 2006-05-10 14:10:41 +0200 | [diff] [blame] | 475 | puts("GR Rev. B"); |
| 476 | break; |
Stefan Roese | 95258d5 | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 477 | #endif /* CONFIG_440GR */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 478 | #endif /* CONFIG_440 */ |
| 479 | |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 480 | #ifdef CONFIG_440EPX |
| 481 | case PVR_440EPX1_RA: /* 440EPx rev A and 440GRx rev A have same PVR */ |
Stefan Roese | 11dd881 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 482 | puts("EPx Rev. A"); |
| 483 | strcpy(addstr, "Security/Kasumi support"); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 484 | break; |
| 485 | |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 486 | case PVR_440EPX2_RA: /* 440EPx rev A and 440GRx rev A have same PVR */ |
Stefan Roese | 11dd881 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 487 | puts("EPx Rev. A"); |
| 488 | strcpy(addstr, "No Security/Kasumi support"); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 489 | break; |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 490 | #endif /* CONFIG_440EPX */ |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 491 | |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 492 | #ifdef CONFIG_440GRX |
| 493 | case PVR_440GRX1_RA: /* 440EPx rev A and 440GRx rev A have same PVR */ |
Stefan Roese | 11dd881 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 494 | puts("GRx Rev. A"); |
| 495 | strcpy(addstr, "Security/Kasumi support"); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 496 | break; |
| 497 | |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 498 | case PVR_440GRX2_RA: /* 440EPx rev A and 440GRx rev A have same PVR */ |
Stefan Roese | 11dd881 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 499 | puts("GRx Rev. A"); |
| 500 | strcpy(addstr, "No Security/Kasumi support"); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 501 | break; |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 502 | #endif /* CONFIG_440GRX */ |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 503 | |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 504 | case PVR_440SP_6_RAB: |
| 505 | puts("SP Rev. A/B"); |
| 506 | strcpy(addstr, "RAID 6 support"); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 507 | break; |
| 508 | |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 509 | case PVR_440SP_RAB: |
| 510 | puts("SP Rev. A/B"); |
| 511 | strcpy(addstr, "No RAID 6 support"); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 512 | break; |
| 513 | |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 514 | case PVR_440SP_6_RC: |
| 515 | puts("SP Rev. C"); |
| 516 | strcpy(addstr, "RAID 6 support"); |
| 517 | break; |
| 518 | |
Stefan Roese | c6d5930 | 2006-11-28 16:09:24 +0100 | [diff] [blame] | 519 | case PVR_440SP_RC: |
| 520 | puts("SP Rev. C"); |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 521 | strcpy(addstr, "No RAID 6 support"); |
Stefan Roese | c6d5930 | 2006-11-28 16:09:24 +0100 | [diff] [blame] | 522 | break; |
| 523 | |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 524 | case PVR_440SPe_6_RA: |
| 525 | puts("SPe Rev. A"); |
| 526 | strcpy(addstr, "RAID 6 support"); |
| 527 | break; |
| 528 | |
Marian Balakowicz | 49d0eee | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 529 | case PVR_440SPe_RA: |
Marian Balakowicz | 11b8c43 | 2006-07-03 23:42:36 +0200 | [diff] [blame] | 530 | puts("SPe Rev. A"); |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 531 | strcpy(addstr, "No RAID 6 support"); |
| 532 | break; |
| 533 | |
| 534 | case PVR_440SPe_6_RB: |
| 535 | puts("SPe Rev. B"); |
| 536 | strcpy(addstr, "RAID 6 support"); |
Marian Balakowicz | 49d0eee | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 537 | break; |
Marian Balakowicz | 11b8c43 | 2006-07-03 23:42:36 +0200 | [diff] [blame] | 538 | |
Marian Balakowicz | 49d0eee | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 539 | case PVR_440SPe_RB: |
Marian Balakowicz | 11b8c43 | 2006-07-03 23:42:36 +0200 | [diff] [blame] | 540 | puts("SPe Rev. B"); |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 541 | strcpy(addstr, "No RAID 6 support"); |
Marian Balakowicz | 49d0eee | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 542 | break; |
Marian Balakowicz | 11b8c43 | 2006-07-03 23:42:36 +0200 | [diff] [blame] | 543 | |
Stefan Roese | 048f5a6 | 2009-07-29 08:45:27 +0200 | [diff] [blame] | 544 | #if defined(CONFIG_460EX) || defined(CONFIG_460GT) |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 545 | case PVR_460EX_RA: |
| 546 | puts("EX Rev. A"); |
| 547 | strcpy(addstr, "No Security/Kasumi support"); |
| 548 | break; |
| 549 | |
| 550 | case PVR_460EX_SE_RA: |
| 551 | puts("EX Rev. A"); |
| 552 | strcpy(addstr, "Security/Kasumi support"); |
| 553 | break; |
| 554 | |
Stefan Roese | 048f5a6 | 2009-07-29 08:45:27 +0200 | [diff] [blame] | 555 | case PVR_460EX_RB: |
| 556 | puts("EX Rev. B"); |
| 557 | mfsdr(SDR0_ECID3, reg); |
| 558 | if (reg & 0x00100000) |
| 559 | strcpy(addstr, "No Security/Kasumi support"); |
| 560 | else |
| 561 | strcpy(addstr, "Security/Kasumi support"); |
| 562 | break; |
| 563 | |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 564 | case PVR_460GT_RA: |
| 565 | puts("GT Rev. A"); |
| 566 | strcpy(addstr, "No Security/Kasumi support"); |
| 567 | break; |
| 568 | |
| 569 | case PVR_460GT_SE_RA: |
| 570 | puts("GT Rev. A"); |
| 571 | strcpy(addstr, "Security/Kasumi support"); |
| 572 | break; |
Stefan Roese | 048f5a6 | 2009-07-29 08:45:27 +0200 | [diff] [blame] | 573 | |
| 574 | case PVR_460GT_RB: |
| 575 | puts("GT Rev. B"); |
| 576 | mfsdr(SDR0_ECID3, reg); |
| 577 | if (reg & 0x00100000) |
| 578 | strcpy(addstr, "No Security/Kasumi support"); |
| 579 | else |
| 580 | strcpy(addstr, "Security/Kasumi support"); |
| 581 | break; |
| 582 | #endif |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 583 | |
Feng Kan | 224bc96 | 2008-07-08 22:47:31 -0700 | [diff] [blame] | 584 | case PVR_460SX_RA: |
| 585 | puts("SX Rev. A"); |
| 586 | strcpy(addstr, "Security support"); |
| 587 | break; |
| 588 | |
| 589 | case PVR_460SX_RA_V1: |
| 590 | puts("SX Rev. A"); |
| 591 | strcpy(addstr, "No Security support"); |
| 592 | break; |
| 593 | |
| 594 | case PVR_460GX_RA: |
| 595 | puts("GX Rev. A"); |
| 596 | strcpy(addstr, "Security support"); |
| 597 | break; |
| 598 | |
| 599 | case PVR_460GX_RA_V1: |
| 600 | puts("GX Rev. A"); |
| 601 | strcpy(addstr, "No Security support"); |
| 602 | break; |
| 603 | |
Ricardo Ribalda Delgado | 95c5020 | 2008-07-17 11:44:12 +0200 | [diff] [blame] | 604 | case PVR_VIRTEX5: |
| 605 | puts("x5 VIRTEX5"); |
| 606 | break; |
| 607 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 608 | default: |
Stefan Roese | 363330b | 2005-08-04 17:09:16 +0200 | [diff] [blame] | 609 | printf (" UNKNOWN (PVR=%08x)", pvr); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 610 | break; |
| 611 | } |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 612 | |
Stefan Roese | e620ff1 | 2009-10-19 14:44:11 +0200 | [diff] [blame] | 613 | printf (" at %s MHz (PLB=%lu OPB=%lu EBC=%lu", |
| 614 | strmhz(buf, clock), |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 615 | sys_info.freqPLB / 1000000, |
| 616 | get_OPB_freq() / 1000000, |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 617 | sys_info.freqEBC / 1000000); |
Stefan Roese | e620ff1 | 2009-10-19 14:44:11 +0200 | [diff] [blame] | 618 | #if defined(CONFIG_PCI) && \ |
| 619 | (defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \ |
| 620 | defined(CONFIG_440GR) || defined(CONFIG_440GRX)) |
| 621 | printf(" PCI=%lu MHz", sys_info.freqPCI / 1000000); |
| 622 | #endif |
| 623 | printf(")\n"); |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 624 | |
Stefan Roese | 11dd881 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 625 | if (addstr[0] != 0) |
| 626 | printf(" %s\n", addstr); |
| 627 | |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 628 | #if defined(I2C_BOOTROM) |
| 629 | printf (" I2C boot EEPROM %sabled\n", i2c_bootrom_enabled() ? "en" : "dis"); |
Stefan Roese | 3a75ac1 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 630 | #endif /* I2C_BOOTROM */ |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 631 | #if defined(SDR0_PINSTP_SHIFT) |
BenoƮt Monin | 1a70cf2 | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 632 | printf (" Bootstrap Option %c - ", bootstrap_char[bootstrap_option()]); |
Stefan Roese | 8ebdb92 | 2009-04-15 10:50:48 +0200 | [diff] [blame] | 633 | printf ("Boot ROM Location %s", bootstrap_str[bootstrap_option()]); |
| 634 | #ifdef CONFIG_NAND_U_BOOT |
| 635 | puts(", booting from NAND"); |
| 636 | #endif /* CONFIG_NAND_U_BOOT */ |
| 637 | putc('\n'); |
Wolfgang Denk | 6550543 | 2006-10-20 17:54:33 +0200 | [diff] [blame] | 638 | #endif /* SDR0_PINSTP_SHIFT */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 639 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 640 | #if defined(CONFIG_PCI) && !defined(CONFIG_405EX) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 641 | printf (" Internal PCI arbiter %sabled", pci_arbiter_enabled() ? "en" : "dis"); |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 642 | #endif |
| 643 | |
Stefan Roese | f515012 | 2009-05-27 10:34:32 +0200 | [diff] [blame] | 644 | #if defined(CONFIG_PCI) && defined(PCI_ASYNC) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 645 | if (pci_async_enabled()) { |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 646 | printf (", PCI async ext clock used"); |
| 647 | } else { |
| 648 | printf (", PCI sync clock at %lu MHz", |
| 649 | sys_info.freqPLB / sys_info.pllPciDiv / 1000000); |
| 650 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 651 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 652 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 653 | #if defined(CONFIG_PCI) && !defined(CONFIG_405EX) |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 654 | putc('\n'); |
| 655 | #endif |
| 656 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 657 | #if defined(CONFIG_405EP) || defined(CONFIG_405EZ) || defined(CONFIG_405EX) |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 658 | printf (" 16 kB I-Cache 16 kB D-Cache"); |
| 659 | #elif defined(CONFIG_440) |
| 660 | printf (" 32 kB I-Cache 32 kB D-Cache"); |
| 661 | #else |
| 662 | printf (" 16 kB I-Cache %d kB D-Cache", |
| 663 | ((pvr | 0x00000001) == PVR_405GPR_RB) ? 16 : 8); |
| 664 | #endif |
| 665 | #endif /* !defined(CONFIG_IOP480) */ |
| 666 | |
| 667 | #if defined(CONFIG_IOP480) |
| 668 | printf ("PLX IOP480 (PVR=%08x)", pvr); |
| 669 | printf (" at %s MHz:", strmhz(buf, clock)); |
| 670 | printf (" %u kB I-Cache", 4); |
| 671 | printf (" %u kB D-Cache", 2); |
| 672 | #endif |
| 673 | |
| 674 | #endif /* !defined(CONFIG_405) */ |
| 675 | |
| 676 | putc ('\n'); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 677 | |
| 678 | return 0; |
| 679 | } |
| 680 | |
Rafal Jaworowski | a2e7ef0 | 2006-08-10 12:43:17 +0200 | [diff] [blame] | 681 | int ppc440spe_revB() { |
| 682 | unsigned int pvr; |
| 683 | |
| 684 | pvr = get_pvr(); |
Stefan Roese | 1456a77 | 2007-01-15 09:46:29 +0100 | [diff] [blame] | 685 | if ((pvr == PVR_440SPe_6_RB) || (pvr == PVR_440SPe_RB)) |
Rafal Jaworowski | a2e7ef0 | 2006-08-10 12:43:17 +0200 | [diff] [blame] | 686 | return 1; |
| 687 | else |
| 688 | return 0; |
| 689 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 690 | |
| 691 | /* ------------------------------------------------------------------------- */ |
| 692 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 693 | 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] | 694 | { |
Stefan Roese | ecf05b2 | 2006-11-27 14:48:41 +0100 | [diff] [blame] | 695 | #if defined(CONFIG_BOARD_RESET) |
| 696 | board_reset(); |
Stefan Roese | a523295 | 2006-11-27 14:52:04 +0100 | [diff] [blame] | 697 | #else |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 698 | #if defined(CONFIG_SYS_4xx_RESET_TYPE) |
Matthias Fuchs | 730b2d2 | 2009-07-22 17:27:56 +0200 | [diff] [blame] | 699 | mtspr(SPRN_DBCR0, CONFIG_SYS_4xx_RESET_TYPE << 28); |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 700 | #else |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 701 | /* |
| 702 | * Initiate system reset in debug control register DBCR |
| 703 | */ |
Matthias Fuchs | 730b2d2 | 2009-07-22 17:27:56 +0200 | [diff] [blame] | 704 | mtspr(SPRN_DBCR0, 0x30000000); |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 705 | #endif /* defined(CONFIG_SYS_4xx_RESET_TYPE) */ |
Stefan Roese | 0368775 | 2006-10-07 11:30:52 +0200 | [diff] [blame] | 706 | #endif /* defined(CONFIG_BOARD_RESET) */ |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 707 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 708 | return 1; |
| 709 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 710 | |
| 711 | |
| 712 | /* |
| 713 | * Get timebase clock frequency |
| 714 | */ |
| 715 | unsigned long get_tbclk (void) |
| 716 | { |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 717 | #if !defined(CONFIG_IOP480) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 718 | sys_info_t sys_info; |
| 719 | |
| 720 | get_sys_info(&sys_info); |
| 721 | return (sys_info.freqProcessor); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 722 | #else |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 723 | return (66000000); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 724 | #endif |
| 725 | |
| 726 | } |
| 727 | |
| 728 | |
| 729 | #if defined(CONFIG_WATCHDOG) |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 730 | void watchdog_reset(void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 731 | { |
| 732 | int re_enable = disable_interrupts(); |
| 733 | reset_4xx_watchdog(); |
| 734 | if (re_enable) enable_interrupts(); |
| 735 | } |
| 736 | |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 737 | void reset_4xx_watchdog(void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 738 | { |
| 739 | /* |
| 740 | * Clear TSR(WIS) bit |
| 741 | */ |
Matthias Fuchs | 730b2d2 | 2009-07-22 17:27:56 +0200 | [diff] [blame] | 742 | mtspr(SPRN_TSR, 0x40000000); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 743 | } |
| 744 | #endif /* CONFIG_WATCHDOG */ |
Ben Warren | 9e37c58 | 2008-10-27 23:53:17 -0700 | [diff] [blame] | 745 | |
| 746 | /* |
| 747 | * Initializes on-chip ethernet controllers. |
| 748 | * to override, implement board_eth_init() |
| 749 | */ |
| 750 | int cpu_eth_init(bd_t *bis) |
| 751 | { |
| 752 | #if defined(CONFIG_PPC4xx_EMAC) |
| 753 | ppc_4xx_eth_initialize(bis); |
| 754 | #endif |
| 755 | return 0; |
| 756 | } |