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> |
| 38 | #include <ppc4xx.h> |
| 39 | |
Wolfgang Denk | 6405a15 | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 40 | DECLARE_GLOBAL_DATA_PTR; |
Wolfgang Denk | 6405a15 | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 41 | |
Stefan Roese | 0368775 | 2006-10-07 11:30:52 +0200 | [diff] [blame] | 42 | void board_reset(void); |
Stefan Roese | 0368775 | 2006-10-07 11:30:52 +0200 | [diff] [blame] | 43 | |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 44 | #if defined(CONFIG_405GP) || \ |
| 45 | defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ |
| 46 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 47 | |
| 48 | #define PCI_ASYNC |
| 49 | |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 50 | static int pci_async_enabled(void) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 51 | { |
| 52 | #if defined(CONFIG_405GP) |
| 53 | return (mfdcr(strap) & PSR_PCI_ASYNC_EN); |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 54 | #endif |
| 55 | |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 56 | #if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 57 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \ |
| 58 | defined(CONFIG_460EX) || defined(CONFIG_460GT) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 59 | unsigned long val; |
| 60 | |
Wolfgang Denk | aaa7c00 | 2005-12-12 16:06:05 +0100 | [diff] [blame] | 61 | mfsdr(sdr_sdstp1, val); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 62 | return (val & SDR0_SDSTP1_PAME_MASK); |
| 63 | #endif |
| 64 | } |
| 65 | #endif |
| 66 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 67 | #if defined(CONFIG_PCI) && !defined(CONFIG_IOP480) && \ |
| 68 | !defined(CONFIG_405) && !defined(CONFIG_405EX) |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 69 | static int pci_arbiter_enabled(void) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 70 | { |
| 71 | #if defined(CONFIG_405GP) |
| 72 | return (mfdcr(strap) & PSR_PCI_ARBIT_EN); |
| 73 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 74 | |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 75 | #if defined(CONFIG_405EP) |
| 76 | return (mfdcr(cpc0_pci) & CPC0_PCI_ARBIT_EN); |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 77 | #endif |
| 78 | |
| 79 | #if defined(CONFIG_440GP) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 80 | return (mfdcr(cpc0_strp1) & CPC0_STRP1_PAE_MASK); |
| 81 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 82 | |
Stefan Roese | 8438243 | 2007-02-02 12:44:22 +0100 | [diff] [blame] | 83 | #if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 84 | unsigned long val; |
| 85 | |
Stefan Roese | 8438243 | 2007-02-02 12:44:22 +0100 | [diff] [blame] | 86 | mfsdr(sdr_xcr, val); |
| 87 | return (val & 0x80000000); |
| 88 | #endif |
| 89 | #if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 90 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \ |
| 91 | defined(CONFIG_460EX) || defined(CONFIG_460GT) |
Stefan Roese | 8438243 | 2007-02-02 12:44:22 +0100 | [diff] [blame] | 92 | unsigned long val; |
| 93 | |
| 94 | mfsdr(sdr_pci0, val); |
| 95 | return (val & 0x80000000); |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 96 | #endif |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 97 | } |
| 98 | #endif |
| 99 | |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 100 | #if defined(CONFIG_405EP) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 101 | #define I2C_BOOTROM |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 102 | |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 103 | static int i2c_bootrom_enabled(void) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 104 | { |
| 105 | #if defined(CONFIG_405EP) |
| 106 | return (mfdcr(cpc0_boot) & CPC0_BOOT_SEP); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 107 | #else |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 108 | unsigned long val; |
| 109 | |
| 110 | mfsdr(sdr_sdcs, val); |
| 111 | return (val & SDR0_SDCS_SDD); |
| 112 | #endif |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 113 | } |
Stefan Roese | 3a75ac1 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 114 | #endif |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 115 | |
| 116 | #if defined(CONFIG_440GX) |
| 117 | #define SDR0_PINSTP_SHIFT 29 |
| 118 | static char *bootstrap_str[] = { |
| 119 | "EBC (16 bits)", |
| 120 | "EBC (8 bits)", |
| 121 | "EBC (32 bits)", |
| 122 | "EBC (8 bits)", |
| 123 | "PCI", |
| 124 | "I2C (Addr 0x54)", |
| 125 | "Reserved", |
| 126 | "I2C (Addr 0x50)", |
| 127 | }; |
Benoît Monin | 1a70cf2 | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 128 | static char bootstrap_char[] = { 'A', 'B', 'C', 'B', 'D', 'E', 'x', 'F' }; |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 129 | #endif |
| 130 | |
| 131 | #if defined(CONFIG_440SP) || defined(CONFIG_440SPE) |
| 132 | #define SDR0_PINSTP_SHIFT 30 |
| 133 | static char *bootstrap_str[] = { |
| 134 | "EBC (8 bits)", |
| 135 | "PCI", |
| 136 | "I2C (Addr 0x54)", |
| 137 | "I2C (Addr 0x50)", |
| 138 | }; |
Benoît Monin | 1a70cf2 | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 139 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D'}; |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 140 | #endif |
| 141 | |
| 142 | #if defined(CONFIG_440EP) || defined(CONFIG_440GR) |
| 143 | #define SDR0_PINSTP_SHIFT 29 |
| 144 | static char *bootstrap_str[] = { |
| 145 | "EBC (8 bits)", |
| 146 | "PCI", |
| 147 | "NAND (8 bits)", |
| 148 | "EBC (16 bits)", |
| 149 | "EBC (16 bits)", |
| 150 | "I2C (Addr 0x54)", |
| 151 | "PCI", |
| 152 | "I2C (Addr 0x52)", |
| 153 | }; |
Benoît Monin | 1a70cf2 | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 154 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' }; |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 155 | #endif |
| 156 | |
| 157 | #if defined(CONFIG_440EPX) || defined(CONFIG_440GRX) |
| 158 | #define SDR0_PINSTP_SHIFT 29 |
| 159 | static char *bootstrap_str[] = { |
| 160 | "EBC (8 bits)", |
| 161 | "EBC (16 bits)", |
| 162 | "EBC (16 bits)", |
| 163 | "NAND (8 bits)", |
| 164 | "PCI", |
| 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 | |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 172 | #if defined(CONFIG_460EX) || defined(CONFIG_460GT) |
| 173 | #define SDR0_PINSTP_SHIFT 29 |
| 174 | static char *bootstrap_str[] = { |
| 175 | "EBC (8 bits)", |
| 176 | "EBC (16 bits)", |
| 177 | "PCI", |
| 178 | "PCI", |
| 179 | "EBC (16 bits)", |
| 180 | "NAND (8 bits)", |
| 181 | "I2C (Addr 0x54)", /* A8 */ |
| 182 | "I2C (Addr 0x52)", /* A4 */ |
| 183 | }; |
| 184 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' }; |
| 185 | #endif |
| 186 | |
Feng Kan | 224bc96 | 2008-07-08 22:47:31 -0700 | [diff] [blame] | 187 | #if defined(CONFIG_460SX) |
| 188 | #define SDR0_PINSTP_SHIFT 29 |
| 189 | static char *bootstrap_str[] = { |
| 190 | "EBC (8 bits)", |
| 191 | "EBC (16 bits)", |
| 192 | "EBC (32 bits)", |
| 193 | "NAND (8 bits)", |
| 194 | "I2C (Addr 0x54)", /* A8 */ |
| 195 | "I2C (Addr 0x52)", /* A4 */ |
| 196 | }; |
| 197 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G' }; |
| 198 | #endif |
| 199 | |
Stefan Roese | 3a75ac1 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 200 | #if defined(CONFIG_405EZ) |
| 201 | #define SDR0_PINSTP_SHIFT 28 |
| 202 | static char *bootstrap_str[] = { |
| 203 | "EBC (8 bits)", |
| 204 | "SPI (fast)", |
| 205 | "NAND (512 page, 4 addr cycle)", |
| 206 | "I2C (Addr 0x50)", |
| 207 | "EBC (32 bits)", |
| 208 | "I2C (Addr 0x50)", |
| 209 | "NAND (2K page, 5 addr cycle)", |
| 210 | "I2C (Addr 0x50)", |
| 211 | "EBC (16 bits)", |
| 212 | "Reserved", |
| 213 | "NAND (2K page, 4 addr cycle)", |
| 214 | "I2C (Addr 0x50)", |
| 215 | "NAND (512 page, 3 addr cycle)", |
| 216 | "I2C (Addr 0x50)", |
| 217 | "SPI (slow)", |
| 218 | "I2C (Addr 0x50)", |
| 219 | }; |
Benoît Monin | 1a70cf2 | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 220 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', \ |
| 221 | 'I', 'x', 'K', 'L', 'M', 'N', 'O', 'P' }; |
Stefan Roese | 3a75ac1 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 222 | #endif |
| 223 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 224 | #if defined(CONFIG_405EX) |
| 225 | #define SDR0_PINSTP_SHIFT 29 |
| 226 | static char *bootstrap_str[] = { |
| 227 | "EBC (8 bits)", |
| 228 | "EBC (16 bits)", |
| 229 | "EBC (16 bits)", |
| 230 | "NAND (8 bits)", |
| 231 | "NAND (8 bits)", |
| 232 | "I2C (Addr 0x54)", |
| 233 | "EBC (8 bits)", |
| 234 | "I2C (Addr 0x52)", |
| 235 | }; |
| 236 | static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' }; |
| 237 | #endif |
| 238 | |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 239 | #if defined(SDR0_PINSTP_SHIFT) |
| 240 | static int bootstrap_option(void) |
| 241 | { |
| 242 | unsigned long val; |
| 243 | |
Stefan Roese | 3a75ac1 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 244 | mfsdr(SDR_PINSTP, val); |
| 245 | return ((val & 0xf0000000) >> SDR0_PINSTP_SHIFT); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 246 | } |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 247 | #endif /* SDR0_PINSTP_SHIFT */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 248 | |
| 249 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 250 | #if defined(CONFIG_440) |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 251 | static int do_chip_reset (unsigned long sys0, unsigned long sys1) |
| 252 | { |
| 253 | /* Changes to cpc0_sys0 and cpc0_sys1 require chip |
| 254 | * reset. |
| 255 | */ |
| 256 | mtdcr (cntrl0, mfdcr (cntrl0) | 0x80000000); /* Set SWE */ |
| 257 | mtdcr (cpc0_sys0, sys0); |
| 258 | mtdcr (cpc0_sys1, sys1); |
| 259 | mtdcr (cntrl0, mfdcr (cntrl0) & ~0x80000000); /* Clr SWE */ |
| 260 | mtspr (dbcr0, 0x20000000); /* Reset the chip */ |
| 261 | |
| 262 | return 1; |
| 263 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 264 | #endif |
| 265 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 266 | |
| 267 | int checkcpu (void) |
| 268 | { |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 269 | #if !defined(CONFIG_405) /* not used on Xilinx 405 FPGA implementations */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 270 | uint pvr = get_pvr(); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 271 | ulong clock = gd->cpu_clk; |
| 272 | char buf[32]; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 273 | |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 274 | #if !defined(CONFIG_IOP480) |
Wolfgang Denk | 6550543 | 2006-10-20 17:54:33 +0200 | [diff] [blame] | 275 | char addstr[64] = ""; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 276 | sys_info_t sys_info; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 277 | |
| 278 | puts ("CPU: "); |
| 279 | |
| 280 | get_sys_info(&sys_info); |
| 281 | |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 282 | puts("AMCC PowerPC 4"); |
| 283 | |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 284 | #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \ |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 285 | defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \ |
| 286 | defined(CONFIG_405EX) |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 287 | puts("05"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 288 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 289 | #if defined(CONFIG_440) |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 290 | #if defined(CONFIG_460EX) || defined(CONFIG_460GT) |
| 291 | puts("60"); |
| 292 | #else |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 293 | puts("40"); |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 294 | #endif |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 295 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 296 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 297 | switch (pvr) { |
| 298 | case PVR_405GP_RB: |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 299 | puts("GP Rev. B"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 300 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 301 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 302 | case PVR_405GP_RC: |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 303 | puts("GP Rev. C"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 304 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 305 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 306 | case PVR_405GP_RD: |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 307 | puts("GP Rev. D"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 308 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 309 | |
wdenk | c35ba4e | 2004-03-14 22:25:36 +0000 | [diff] [blame] | 310 | #ifdef CONFIG_405GP |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 311 | case PVR_405GP_RE: /* 405GP rev E and 405CR rev C have same PVR */ |
| 312 | puts("GP Rev. E"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 313 | break; |
| 314 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 315 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 316 | case PVR_405CR_RA: |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 317 | puts("CR Rev. A"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 318 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 319 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 320 | case PVR_405CR_RB: |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 321 | puts("CR Rev. B"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 322 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 323 | |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 324 | #ifdef CONFIG_405CR |
| 325 | case PVR_405CR_RC: /* 405GP rev E and 405CR rev C have same PVR */ |
| 326 | puts("CR Rev. C"); |
| 327 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 328 | #endif |
| 329 | |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 330 | case PVR_405GPR_RB: |
| 331 | puts("GPr Rev. B"); |
| 332 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 333 | |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 334 | case PVR_405EP_RB: |
| 335 | puts("EP Rev. B"); |
| 336 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 337 | |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 338 | case PVR_405EZ_RA: |
| 339 | puts("EZ Rev. A"); |
| 340 | break; |
| 341 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 342 | case PVR_405EX1_RA: |
| 343 | puts("EX Rev. A"); |
| 344 | strcpy(addstr, "Security support"); |
| 345 | break; |
| 346 | |
| 347 | case PVR_405EX2_RA: |
| 348 | puts("EX Rev. A"); |
| 349 | strcpy(addstr, "No Security support"); |
| 350 | break; |
| 351 | |
| 352 | case PVR_405EXR1_RA: |
| 353 | puts("EXr Rev. A"); |
| 354 | strcpy(addstr, "Security support"); |
| 355 | break; |
| 356 | |
| 357 | case PVR_405EXR2_RA: |
| 358 | puts("EXr Rev. A"); |
| 359 | strcpy(addstr, "No Security support"); |
| 360 | break; |
| 361 | |
Stefan Roese | fbf2430 | 2008-05-13 20:22:01 +0200 | [diff] [blame] | 362 | case PVR_405EX1_RC: |
| 363 | puts("EX Rev. C"); |
| 364 | strcpy(addstr, "Security support"); |
| 365 | break; |
| 366 | |
| 367 | case PVR_405EX2_RC: |
| 368 | puts("EX Rev. C"); |
| 369 | strcpy(addstr, "No Security support"); |
| 370 | break; |
| 371 | |
| 372 | case PVR_405EXR1_RC: |
| 373 | puts("EXr Rev. C"); |
| 374 | strcpy(addstr, "Security support"); |
| 375 | break; |
| 376 | |
| 377 | case PVR_405EXR2_RC: |
| 378 | puts("EXr Rev. C"); |
| 379 | strcpy(addstr, "No Security support"); |
| 380 | break; |
| 381 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 382 | #if defined(CONFIG_440) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 383 | case PVR_440GP_RB: |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 384 | puts("GP Rev. B"); |
wdenk | a4685fe | 2003-09-03 14:03:26 +0000 | [diff] [blame] | 385 | /* See errata 1.12: CHIP_4 */ |
| 386 | if ((mfdcr(cpc0_sys0) != mfdcr(cpc0_strp0)) || |
| 387 | (mfdcr(cpc0_sys1) != mfdcr(cpc0_strp1)) ){ |
| 388 | puts ( "\n\t CPC0_SYSx DCRs corrupted. " |
| 389 | "Resetting chip ...\n"); |
| 390 | udelay( 1000 * 1000 ); /* Give time for serial buf to clear */ |
| 391 | do_chip_reset ( mfdcr(cpc0_strp0), |
| 392 | mfdcr(cpc0_strp1) ); |
| 393 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 394 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 395 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 396 | case PVR_440GP_RC: |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 397 | puts("GP Rev. C"); |
wdenk | 544e973 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 398 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 399 | |
wdenk | 544e973 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 400 | case PVR_440GX_RA: |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 401 | puts("GX Rev. A"); |
wdenk | 544e973 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 402 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 403 | |
wdenk | 544e973 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 404 | case PVR_440GX_RB: |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 405 | puts("GX Rev. B"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 406 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 407 | |
stroese | c012527 | 2005-04-07 05:33:41 +0000 | [diff] [blame] | 408 | case PVR_440GX_RC: |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 409 | puts("GX Rev. C"); |
stroese | c012527 | 2005-04-07 05:33:41 +0000 | [diff] [blame] | 410 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 411 | |
Stefan Roese | 08fb404 | 2005-11-01 10:08:03 +0100 | [diff] [blame] | 412 | case PVR_440GX_RF: |
| 413 | puts("GX Rev. F"); |
| 414 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 415 | |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 416 | case PVR_440EP_RA: |
| 417 | puts("EP Rev. A"); |
| 418 | break; |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 419 | |
Stefan Roese | 95258d5 | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 420 | #ifdef CONFIG_440EP |
| 421 | 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] | 422 | puts("EP Rev. B"); |
| 423 | break; |
Stefan Roese | 31ce7de | 2006-05-10 14:10:41 +0200 | [diff] [blame] | 424 | |
| 425 | case PVR_440EP_RC: /* 440EP rev C and 440GR rev B have same PVR */ |
| 426 | puts("EP Rev. C"); |
| 427 | break; |
Stefan Roese | 95258d5 | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 428 | #endif /* CONFIG_440EP */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 429 | |
Stefan Roese | 95258d5 | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 430 | #ifdef CONFIG_440GR |
| 431 | case PVR_440GR_RA: /* 440EP rev B and 440GR rev A have same PVR */ |
| 432 | puts("GR Rev. A"); |
| 433 | break; |
Stefan Roese | 31ce7de | 2006-05-10 14:10:41 +0200 | [diff] [blame] | 434 | |
Stefan Roese | 96467d6 | 2006-05-18 19:21:53 +0200 | [diff] [blame] | 435 | 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] | 436 | puts("GR Rev. B"); |
| 437 | break; |
Stefan Roese | 95258d5 | 2005-10-04 15:00:30 +0200 | [diff] [blame] | 438 | #endif /* CONFIG_440GR */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 439 | #endif /* CONFIG_440 */ |
| 440 | |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 441 | #ifdef CONFIG_440EPX |
| 442 | 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] | 443 | puts("EPx Rev. A"); |
| 444 | strcpy(addstr, "Security/Kasumi support"); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 445 | break; |
| 446 | |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 447 | 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] | 448 | puts("EPx Rev. A"); |
| 449 | strcpy(addstr, "No Security/Kasumi support"); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 450 | break; |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 451 | #endif /* CONFIG_440EPX */ |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 452 | |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 453 | #ifdef CONFIG_440GRX |
| 454 | 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] | 455 | puts("GRx Rev. A"); |
| 456 | strcpy(addstr, "Security/Kasumi support"); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 457 | break; |
| 458 | |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 459 | 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] | 460 | puts("GRx Rev. A"); |
| 461 | strcpy(addstr, "No Security/Kasumi support"); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 462 | break; |
Stefan Roese | 188fab6 | 2007-01-31 16:56:10 +0100 | [diff] [blame] | 463 | #endif /* CONFIG_440GRX */ |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 464 | |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 465 | case PVR_440SP_6_RAB: |
| 466 | puts("SP Rev. A/B"); |
| 467 | strcpy(addstr, "RAID 6 support"); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 468 | break; |
| 469 | |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 470 | case PVR_440SP_RAB: |
| 471 | puts("SP Rev. A/B"); |
| 472 | strcpy(addstr, "No RAID 6 support"); |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 473 | break; |
| 474 | |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 475 | case PVR_440SP_6_RC: |
| 476 | puts("SP Rev. C"); |
| 477 | strcpy(addstr, "RAID 6 support"); |
| 478 | break; |
| 479 | |
Stefan Roese | c6d5930 | 2006-11-28 16:09:24 +0100 | [diff] [blame] | 480 | case PVR_440SP_RC: |
| 481 | puts("SP Rev. C"); |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 482 | strcpy(addstr, "No RAID 6 support"); |
Stefan Roese | c6d5930 | 2006-11-28 16:09:24 +0100 | [diff] [blame] | 483 | break; |
| 484 | |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 485 | case PVR_440SPe_6_RA: |
| 486 | puts("SPe Rev. A"); |
| 487 | strcpy(addstr, "RAID 6 support"); |
| 488 | break; |
| 489 | |
Marian Balakowicz | 49d0eee | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 490 | case PVR_440SPe_RA: |
Marian Balakowicz | 11b8c43 | 2006-07-03 23:42:36 +0200 | [diff] [blame] | 491 | puts("SPe Rev. A"); |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 492 | strcpy(addstr, "No RAID 6 support"); |
| 493 | break; |
| 494 | |
| 495 | case PVR_440SPe_6_RB: |
| 496 | puts("SPe Rev. B"); |
| 497 | strcpy(addstr, "RAID 6 support"); |
Marian Balakowicz | 49d0eee | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 498 | break; |
Marian Balakowicz | 11b8c43 | 2006-07-03 23:42:36 +0200 | [diff] [blame] | 499 | |
Marian Balakowicz | 49d0eee | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 500 | case PVR_440SPe_RB: |
Marian Balakowicz | 11b8c43 | 2006-07-03 23:42:36 +0200 | [diff] [blame] | 501 | puts("SPe Rev. B"); |
Stefan Roese | f4b01bf | 2007-01-13 08:01:03 +0100 | [diff] [blame] | 502 | strcpy(addstr, "No RAID 6 support"); |
Marian Balakowicz | 49d0eee | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 503 | break; |
Marian Balakowicz | 11b8c43 | 2006-07-03 23:42:36 +0200 | [diff] [blame] | 504 | |
Stefan Roese | cc019d1 | 2008-03-11 15:05:50 +0100 | [diff] [blame] | 505 | case PVR_460EX_RA: |
| 506 | puts("EX Rev. A"); |
| 507 | strcpy(addstr, "No Security/Kasumi support"); |
| 508 | break; |
| 509 | |
| 510 | case PVR_460EX_SE_RA: |
| 511 | puts("EX Rev. A"); |
| 512 | strcpy(addstr, "Security/Kasumi support"); |
| 513 | break; |
| 514 | |
| 515 | case PVR_460GT_RA: |
| 516 | puts("GT Rev. A"); |
| 517 | strcpy(addstr, "No Security/Kasumi support"); |
| 518 | break; |
| 519 | |
| 520 | case PVR_460GT_SE_RA: |
| 521 | puts("GT Rev. A"); |
| 522 | strcpy(addstr, "Security/Kasumi support"); |
| 523 | break; |
| 524 | |
Feng Kan | 224bc96 | 2008-07-08 22:47:31 -0700 | [diff] [blame] | 525 | case PVR_460SX_RA: |
| 526 | puts("SX Rev. A"); |
| 527 | strcpy(addstr, "Security support"); |
| 528 | break; |
| 529 | |
| 530 | case PVR_460SX_RA_V1: |
| 531 | puts("SX Rev. A"); |
| 532 | strcpy(addstr, "No Security support"); |
| 533 | break; |
| 534 | |
| 535 | case PVR_460GX_RA: |
| 536 | puts("GX Rev. A"); |
| 537 | strcpy(addstr, "Security support"); |
| 538 | break; |
| 539 | |
| 540 | case PVR_460GX_RA_V1: |
| 541 | puts("GX Rev. A"); |
| 542 | strcpy(addstr, "No Security support"); |
| 543 | break; |
| 544 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 545 | default: |
Stefan Roese | 363330b | 2005-08-04 17:09:16 +0200 | [diff] [blame] | 546 | printf (" UNKNOWN (PVR=%08x)", pvr); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 547 | break; |
| 548 | } |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 549 | |
| 550 | printf (" at %s MHz (PLB=%lu, OPB=%lu, EBC=%lu MHz)\n", strmhz(buf, clock), |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 551 | sys_info.freqPLB / 1000000, |
| 552 | get_OPB_freq() / 1000000, |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 553 | sys_info.freqEBC / 1000000); |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 554 | |
Stefan Roese | 11dd881 | 2006-10-18 15:59:35 +0200 | [diff] [blame] | 555 | if (addstr[0] != 0) |
| 556 | printf(" %s\n", addstr); |
| 557 | |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 558 | #if defined(I2C_BOOTROM) |
| 559 | printf (" I2C boot EEPROM %sabled\n", i2c_bootrom_enabled() ? "en" : "dis"); |
Stefan Roese | 3a75ac1 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 560 | #endif /* I2C_BOOTROM */ |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 561 | #if defined(SDR0_PINSTP_SHIFT) |
Benoît Monin | 1a70cf2 | 2007-06-04 08:36:05 +0200 | [diff] [blame] | 562 | printf (" Bootstrap Option %c - ", bootstrap_char[bootstrap_option()]); |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 563 | printf ("Boot ROM Location %s\n", bootstrap_str[bootstrap_option()]); |
Wolfgang Denk | 6550543 | 2006-10-20 17:54:33 +0200 | [diff] [blame] | 564 | #endif /* SDR0_PINSTP_SHIFT */ |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 565 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 566 | #if defined(CONFIG_PCI) && !defined(CONFIG_405EX) |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 567 | printf (" Internal PCI arbiter %sabled", pci_arbiter_enabled() ? "en" : "dis"); |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 568 | #endif |
| 569 | |
Stefan Roese | 9964474 | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 570 | #if defined(PCI_ASYNC) |
| 571 | if (pci_async_enabled()) { |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 572 | printf (", PCI async ext clock used"); |
| 573 | } else { |
| 574 | printf (", PCI sync clock at %lu MHz", |
| 575 | sys_info.freqPLB / sys_info.pllPciDiv / 1000000); |
| 576 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 577 | #endif |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 578 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 579 | #if defined(CONFIG_PCI) && !defined(CONFIG_405EX) |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 580 | putc('\n'); |
| 581 | #endif |
| 582 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 583 | #if defined(CONFIG_405EP) || defined(CONFIG_405EZ) || defined(CONFIG_405EX) |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 584 | printf (" 16 kB I-Cache 16 kB D-Cache"); |
| 585 | #elif defined(CONFIG_440) |
| 586 | printf (" 32 kB I-Cache 32 kB D-Cache"); |
| 587 | #else |
| 588 | printf (" 16 kB I-Cache %d kB D-Cache", |
| 589 | ((pvr | 0x00000001) == PVR_405GPR_RB) ? 16 : 8); |
| 590 | #endif |
| 591 | #endif /* !defined(CONFIG_IOP480) */ |
| 592 | |
| 593 | #if defined(CONFIG_IOP480) |
| 594 | printf ("PLX IOP480 (PVR=%08x)", pvr); |
| 595 | printf (" at %s MHz:", strmhz(buf, clock)); |
| 596 | printf (" %u kB I-Cache", 4); |
| 597 | printf (" %u kB D-Cache", 2); |
| 598 | #endif |
| 599 | |
| 600 | #endif /* !defined(CONFIG_405) */ |
| 601 | |
| 602 | putc ('\n'); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 603 | |
| 604 | return 0; |
| 605 | } |
| 606 | |
Rafal Jaworowski | a2e7ef0 | 2006-08-10 12:43:17 +0200 | [diff] [blame] | 607 | int ppc440spe_revB() { |
| 608 | unsigned int pvr; |
| 609 | |
| 610 | pvr = get_pvr(); |
Stefan Roese | 1456a77 | 2007-01-15 09:46:29 +0100 | [diff] [blame] | 611 | if ((pvr == PVR_440SPe_6_RB) || (pvr == PVR_440SPe_RB)) |
Rafal Jaworowski | a2e7ef0 | 2006-08-10 12:43:17 +0200 | [diff] [blame] | 612 | return 1; |
| 613 | else |
| 614 | return 0; |
| 615 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 616 | |
| 617 | /* ------------------------------------------------------------------------- */ |
| 618 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 619 | int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 620 | { |
Stefan Roese | ecf05b2 | 2006-11-27 14:48:41 +0100 | [diff] [blame] | 621 | #if defined(CONFIG_BOARD_RESET) |
| 622 | board_reset(); |
Stefan Roese | a523295 | 2006-11-27 14:52:04 +0100 | [diff] [blame] | 623 | #else |
Stefan Roese | 2a4a943 | 2006-11-27 14:12:17 +0100 | [diff] [blame] | 624 | #if defined(CFG_4xx_RESET_TYPE) |
| 625 | mtspr(dbcr0, CFG_4xx_RESET_TYPE << 28); |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 626 | #else |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 627 | /* |
| 628 | * Initiate system reset in debug control register DBCR |
| 629 | */ |
Stefan Roese | 0368775 | 2006-10-07 11:30:52 +0200 | [diff] [blame] | 630 | mtspr(dbcr0, 0x30000000); |
Stefan Roese | a523295 | 2006-11-27 14:52:04 +0100 | [diff] [blame] | 631 | #endif /* defined(CFG_4xx_RESET_TYPE) */ |
Stefan Roese | 0368775 | 2006-10-07 11:30:52 +0200 | [diff] [blame] | 632 | #endif /* defined(CONFIG_BOARD_RESET) */ |
Stefan Roese | 326c971 | 2005-08-01 16:41:48 +0200 | [diff] [blame] | 633 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 634 | return 1; |
| 635 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 636 | |
| 637 | |
| 638 | /* |
| 639 | * Get timebase clock frequency |
| 640 | */ |
| 641 | unsigned long get_tbclk (void) |
| 642 | { |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 643 | #if !defined(CONFIG_IOP480) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 644 | sys_info_t sys_info; |
| 645 | |
| 646 | get_sys_info(&sys_info); |
| 647 | return (sys_info.freqProcessor); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 648 | #else |
Stefan Roese | 42f2a82 | 2005-11-27 19:36:26 +0100 | [diff] [blame] | 649 | return (66000000); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 650 | #endif |
| 651 | |
| 652 | } |
| 653 | |
| 654 | |
| 655 | #if defined(CONFIG_WATCHDOG) |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 656 | void watchdog_reset(void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 657 | { |
| 658 | int re_enable = disable_interrupts(); |
| 659 | reset_4xx_watchdog(); |
| 660 | if (re_enable) enable_interrupts(); |
| 661 | } |
| 662 | |
Stefan Roese | 6964fd6 | 2007-11-09 12:18:54 +0100 | [diff] [blame] | 663 | void reset_4xx_watchdog(void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 664 | { |
| 665 | /* |
| 666 | * Clear TSR(WIS) bit |
| 667 | */ |
| 668 | mtspr(tsr, 0x40000000); |
| 669 | } |
| 670 | #endif /* CONFIG_WATCHDOG */ |