Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 1 | /* |
| 2 | * amirix.c: ppcboot platform support for AMIRIX board |
| 3 | * |
| 4 | * Copyright 2002 Mind NV |
| 5 | * Copyright 2003 AMIRIX Systems Inc. |
| 6 | * |
| 7 | * http://www.mind.be/ |
| 8 | * http://www.amirix.com/ |
| 9 | * |
| 10 | * Author : Peter De Schrijver (p2@mind.be) |
| 11 | * Frank Smith (smith@amirix.com) |
| 12 | * |
| 13 | * Derived from : Other platform support files in this tree, ml2 |
| 14 | * |
| 15 | * This software may be used and distributed according to the terms of |
| 16 | * the GNU General Public License (GPL) version 2, incorporated herein by |
| 17 | * reference. Drivers based on or derived from this code fall under the GPL |
| 18 | * and must retain the authorship, copyright and this license notice. This |
| 19 | * file is not a complete program and may only be used when the entire |
| 20 | * program is licensed under the GPL. |
| 21 | * |
| 22 | */ |
| 23 | |
| 24 | #include <common.h> |
| 25 | #include <command.h> |
Ben Warren | 050019d | 2008-08-31 10:44:19 -0700 | [diff] [blame] | 26 | #include <netdev.h> |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 27 | #include <asm/processor.h> |
| 28 | |
| 29 | #include "powerspan.h" |
| 30 | #include "ap1000.h" |
| 31 | |
| 32 | int board_pre_init (void) |
| 33 | { |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 34 | return 0; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | /** serial number and platform display at startup */ |
| 38 | int checkboard (void) |
| 39 | { |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 40 | char buf[64]; |
| 41 | int l = getenv_f("serial#", buf, sizeof(buf)); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 42 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 43 | /* After a loadace command, the SystemAce control register is left in a wonky state. */ |
| 44 | /* this code did not work in board_pre_init */ |
| 45 | unsigned char *p = (unsigned char *) AP1000_SYSACE_REGBASE; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 46 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 47 | p[SYSACE_CTRLREG0] = 0x0; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 48 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 49 | /* add platform and device to banner */ |
| 50 | switch (get_device ()) { |
| 51 | case AP1xx_AP107_TARGET: |
| 52 | puts (AP1xx_AP107_TARGET_STR); |
| 53 | break; |
| 54 | case AP1xx_AP120_TARGET: |
| 55 | puts (AP1xx_AP120_TARGET_STR); |
| 56 | break; |
| 57 | case AP1xx_AP130_TARGET: |
| 58 | puts (AP1xx_AP130_TARGET_STR); |
| 59 | break; |
| 60 | case AP1xx_AP1070_TARGET: |
| 61 | puts (AP1xx_AP1070_TARGET_STR); |
| 62 | break; |
| 63 | case AP1xx_AP1100_TARGET: |
| 64 | puts (AP1xx_AP1100_TARGET_STR); |
| 65 | break; |
| 66 | default: |
| 67 | puts (AP1xx_UNKNOWN_STR); |
| 68 | break; |
| 69 | } |
| 70 | puts (AP1xx_TARGET_STR); |
| 71 | puts (" with "); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 72 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 73 | switch (get_platform ()) { |
| 74 | case AP100_BASELINE_PLATFORM: |
| 75 | case AP1000_BASELINE_PLATFORM: |
| 76 | puts (AP1xx_BASELINE_PLATFORM_STR); |
| 77 | break; |
| 78 | case AP1xx_QUADGE_PLATFORM: |
| 79 | puts (AP1xx_QUADGE_PLATFORM_STR); |
| 80 | break; |
| 81 | case AP1xx_MGT_REF_PLATFORM: |
| 82 | puts (AP1xx_MGT_REF_PLATFORM_STR); |
| 83 | break; |
| 84 | case AP1xx_STANDARD_PLATFORM: |
| 85 | puts (AP1xx_STANDARD_PLATFORM_STR); |
| 86 | break; |
| 87 | case AP1xx_DUAL_PLATFORM: |
| 88 | puts (AP1xx_DUAL_PLATFORM_STR); |
| 89 | break; |
| 90 | case AP1xx_BASE_SRAM_PLATFORM: |
| 91 | puts (AP1xx_BASE_SRAM_PLATFORM_STR); |
| 92 | break; |
| 93 | case AP1xx_PCI_PCB_TESTPLATFORM: |
| 94 | case AP1000_PCI_PCB_TESTPLATFORM: |
| 95 | puts (AP1xx_PCI_PCB_TESTPLATFORM_STR); |
| 96 | break; |
| 97 | case AP1xx_DUAL_GE_MEZZ_TESTPLATFORM: |
| 98 | puts (AP1xx_DUAL_GE_MEZZ_TESTPLATFORM_STR); |
| 99 | break; |
| 100 | case AP1xx_SFP_MEZZ_TESTPLATFORM: |
| 101 | puts (AP1xx_SFP_MEZZ_TESTPLATFORM_STR); |
| 102 | break; |
| 103 | default: |
| 104 | puts (AP1xx_UNKNOWN_STR); |
| 105 | break; |
| 106 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 107 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 108 | if ((get_platform () & AP1xx_TESTPLATFORM_MASK) != 0) { |
| 109 | puts (AP1xx_TESTPLATFORM_STR); |
| 110 | } else { |
| 111 | puts (AP1xx_PLATFORM_STR); |
| 112 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 113 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 114 | putc ('\n'); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 115 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 116 | puts ("Serial#: "); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 117 | |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 118 | if (l < 0) { |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 119 | printf ("### No HW ID - assuming AMIRIX"); |
| 120 | } else { |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 121 | int i; |
| 122 | |
| 123 | for (i = 0; i < l; ++i) { |
| 124 | if (buf[i] == ' ') { |
| 125 | buf[i] = '\0'; |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 126 | break; |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 127 | } |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 128 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 129 | |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 130 | puts(buf); |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 131 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 132 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 133 | putc ('\n'); |
| 134 | |
| 135 | return (0); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | |
Becky Bruce | bd99ae7 | 2008-06-09 16:03:40 -0500 | [diff] [blame] | 139 | phys_size_t initdram (int board_type) |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 140 | { |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 141 | char buf[64]; |
| 142 | int i = getenv_f("dramsize", buf, sizeof(buf)); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 143 | |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 144 | if (i > 0) { |
| 145 | char *s = buf; |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 146 | if ((s[0] == '0') && ((s[1] == 'x') || (s[1] == 'X'))) { |
| 147 | s += 2; |
| 148 | } |
Stefan Roese | 1586ded | 2006-01-18 20:06:44 +0100 | [diff] [blame] | 149 | return (long int)simple_strtoul (s, NULL, 16); |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 150 | } else { |
| 151 | /* give all 64 MB */ |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 152 | return 64 * 1024 * 1024; |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 153 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 154 | } |
| 155 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 156 | unsigned int get_platform (void) |
| 157 | { |
| 158 | unsigned int *revision_reg_ptr = (unsigned int *) AP1xx_FPGA_REV_ADDR; |
| 159 | |
| 160 | return (*revision_reg_ptr & AP1xx_PLATFORM_MASK); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 161 | } |
| 162 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 163 | unsigned int get_device (void) |
| 164 | { |
| 165 | unsigned int *revision_reg_ptr = (unsigned int *) AP1xx_FPGA_REV_ADDR; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 166 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 167 | return (*revision_reg_ptr & AP1xx_TARGET_MASK); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 168 | } |
| 169 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 170 | #if 0 /* loadace is not working; it appears to be a hardware issue with the system ace. */ |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 171 | /* |
| 172 | This function loads FPGA configurations from the SystemACE CompactFlash |
| 173 | */ |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 174 | int do_loadace (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 175 | { |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 176 | unsigned char *p = (unsigned char *) AP1000_SYSACE_REGBASE; |
| 177 | int cfg; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 178 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 179 | if ((p[SYSACE_STATREG0] & 0x10) == 0) { |
| 180 | p[SYSACE_CTRLREG0] = 0x80; |
| 181 | printf ("\nNo CompactFlash Detected\n\n"); |
| 182 | p[SYSACE_CTRLREG0] = 0x00; |
| 183 | return 1; |
| 184 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 185 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 186 | /* reset configuration controller: | 0x80 */ |
| 187 | /* select cpflash & ~0x40 */ |
| 188 | /* cfg start | 0x20 */ |
| 189 | /* wait for cfgstart & ~0x10 */ |
| 190 | /* force cfgmode: | 0x08 */ |
| 191 | /* do no force cfgaddr: & ~0x04 */ |
| 192 | /* clear mpulock: & ~0x02 */ |
| 193 | /* do not force lock request & ~0x01 */ |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 194 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 195 | p[SYSACE_CTRLREG0] = 0x80 | 0x20 | 0x08; |
| 196 | p[SYSACE_CTRLREG1] = 0x00; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 197 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 198 | /* force config address if arg2 exists */ |
| 199 | if (argc == 2) { |
| 200 | cfg = simple_strtoul (argv[1], NULL, 10); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 201 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 202 | if (cfg > 7) { |
| 203 | printf ("\nInvalid Configuration\n\n"); |
| 204 | p[SYSACE_CTRLREG0] = 0x00; |
| 205 | return 1; |
| 206 | } |
| 207 | /* Set config address */ |
| 208 | p[SYSACE_CTRLREG1] = (cfg << 5); |
| 209 | /* force cfgaddr */ |
| 210 | p[SYSACE_CTRLREG0] |= 0x04; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 211 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 212 | } else { |
| 213 | cfg = (p[SYSACE_STATREG1] & 0xE0) >> 5; |
| 214 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 215 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 216 | /* release configuration controller */ |
| 217 | printf ("\nLoading V2PRO with config %d...\n", cfg); |
| 218 | p[SYSACE_CTRLREG0] &= ~0x80; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 219 | |
| 220 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 221 | while ((p[SYSACE_STATREG1] & 0x01) == 0) { |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 222 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 223 | if (p[SYSACE_ERRREG0] & 0x80) { |
| 224 | /* attempting to load an invalid configuration makes the cpflash */ |
| 225 | /* appear to be removed. Reset here to avoid that problem */ |
| 226 | p[SYSACE_CTRLREG0] = 0x80; |
| 227 | printf ("\nConfiguration %d Read Error\n\n", cfg); |
| 228 | p[SYSACE_CTRLREG0] = 0x00; |
| 229 | return 1; |
| 230 | } |
| 231 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 232 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 233 | p[SYSACE_CTRLREG0] |= 0x20; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 234 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 235 | return 0; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 236 | } |
| 237 | #endif |
| 238 | |
| 239 | /** Console command to display and set the software reconfigure byte |
| 240 | * <pre> |
| 241 | * swconfig - display the current value of the software reconfigure byte |
| 242 | * swconfig [#] - change the software reconfigure byte to # |
| 243 | * </pre> |
| 244 | * @param *cmdtp [IN] as passed by run_command (ignored) |
| 245 | * @param flag [IN] as passed by run_command (ignored) |
| 246 | * @param argc [IN] as passed by run_command if 1, display, if 2 change |
| 247 | * @param *argv[] [IN] contains the parameters to use |
| 248 | * @return |
| 249 | * <pre> |
| 250 | * 0 if passed |
| 251 | * -1 if failed |
| 252 | * </pre> |
| 253 | */ |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 254 | int do_swconfigbyte (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 255 | { |
| 256 | unsigned char *sector_buffer = NULL; |
| 257 | unsigned char input_char; |
| 258 | int write_result; |
| 259 | unsigned int input_uint; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 260 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 261 | /* display value if no argument */ |
| 262 | if (argc < 2) { |
| 263 | printf ("Software configuration byte is currently: 0x%02x\n", |
| 264 | *((unsigned char *) (SW_BYTE_SECTOR_ADDR + |
| 265 | SW_BYTE_SECTOR_OFFSET))); |
| 266 | return 0; |
| 267 | } else if (argc > 3) { |
| 268 | printf ("Too many arguments\n"); |
| 269 | return -1; |
| 270 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 271 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 272 | /* if 3 arguments, 3rd argument is the address to use */ |
| 273 | if (argc == 3) { |
| 274 | input_uint = simple_strtoul (argv[1], NULL, 16); |
| 275 | sector_buffer = (unsigned char *) input_uint; |
| 276 | } else { |
| 277 | sector_buffer = (unsigned char *) DEFAULT_TEMP_ADDR; |
| 278 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 279 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 280 | input_char = simple_strtoul (argv[1], NULL, 0); |
| 281 | if ((input_char & ~SW_BYTE_MASK) != 0) { |
| 282 | printf ("Input of 0x%02x will be masked to 0x%02x\n", |
| 283 | input_char, (input_char & SW_BYTE_MASK)); |
| 284 | input_char = input_char & SW_BYTE_MASK; |
| 285 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 286 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 287 | memcpy (sector_buffer, (void *) SW_BYTE_SECTOR_ADDR, |
| 288 | SW_BYTE_SECTOR_SIZE); |
| 289 | sector_buffer[SW_BYTE_SECTOR_OFFSET] = input_char; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 290 | |
| 291 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 292 | printf ("Erasing Flash..."); |
| 293 | if (flash_sect_erase |
| 294 | (SW_BYTE_SECTOR_ADDR, |
| 295 | (SW_BYTE_SECTOR_ADDR + SW_BYTE_SECTOR_OFFSET))) { |
| 296 | return -1; |
| 297 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 298 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 299 | printf ("Writing to Flash... "); |
| 300 | write_result = |
Stefan Roese | 1586ded | 2006-01-18 20:06:44 +0100 | [diff] [blame] | 301 | flash_write ((char *)sector_buffer, SW_BYTE_SECTOR_ADDR, |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 302 | SW_BYTE_SECTOR_SIZE); |
| 303 | if (write_result != 0) { |
| 304 | flash_perror (write_result); |
| 305 | return -1; |
| 306 | } else { |
| 307 | printf ("done\n"); |
| 308 | printf ("Software configuration byte is now: 0x%02x\n", |
| 309 | *((unsigned char *) (SW_BYTE_SECTOR_ADDR + |
| 310 | SW_BYTE_SECTOR_OFFSET))); |
| 311 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 312 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 313 | return 0; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 314 | } |
| 315 | |
| 316 | #define ONE_SECOND 1000000 |
| 317 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 318 | int do_pause (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 319 | { |
| 320 | int pause_time; |
| 321 | unsigned int delay_time; |
| 322 | int break_loop = 0; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 323 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 324 | /* display value if no argument */ |
| 325 | if (argc < 2) { |
| 326 | pause_time = 1; |
| 327 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 328 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 329 | else if (argc > 2) { |
| 330 | printf ("Too many arguments\n"); |
| 331 | return -1; |
| 332 | } else { |
| 333 | pause_time = simple_strtoul (argv[1], NULL, 0); |
| 334 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 335 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 336 | printf ("Pausing with a poll time of %d, press any key to reactivate\n", pause_time); |
| 337 | delay_time = pause_time * ONE_SECOND; |
| 338 | while (break_loop == 0) { |
| 339 | udelay (delay_time); |
| 340 | if (serial_tstc () != 0) { |
| 341 | break_loop = 1; |
| 342 | /* eat user key presses */ |
| 343 | while (serial_tstc () != 0) { |
| 344 | serial_getc (); |
| 345 | } |
| 346 | } |
| 347 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 348 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 349 | return 0; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 350 | } |
| 351 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 352 | int do_swreconfig (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 353 | { |
| 354 | printf ("Triggering software reconfigure (software config byte is 0x%02x)...\n", |
| 355 | *((unsigned char *) (SW_BYTE_SECTOR_ADDR + SW_BYTE_SECTOR_OFFSET))); |
| 356 | udelay (1000); |
| 357 | *((unsigned char *) AP1000_CPLD_BASE) = 1; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 358 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 359 | return 0; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 360 | } |
| 361 | |
| 362 | #define GET_DECIMAL(low_byte) ((low_byte >> 5) * 125) |
| 363 | #define TEMP_BUSY_BIT 0x80 |
| 364 | #define TEMP_LHIGH_BIT 0x40 |
| 365 | #define TEMP_LLOW_BIT 0x20 |
| 366 | #define TEMP_EHIGH_BIT 0x10 |
| 367 | #define TEMP_ELOW_BIT 0x08 |
| 368 | #define TEMP_OPEN_BIT 0x04 |
| 369 | #define TEMP_ETHERM_BIT 0x02 |
| 370 | #define TEMP_LTHERM_BIT 0x01 |
| 371 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 372 | int do_temp_sensor (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 373 | { |
| 374 | char cmd; |
| 375 | int ret_val = 0; |
| 376 | unsigned char temp_byte; |
| 377 | int temp; |
| 378 | int temp_low; |
| 379 | int low; |
| 380 | int low_low; |
| 381 | int high; |
| 382 | int high_low; |
| 383 | int therm; |
| 384 | unsigned char user_data[4] = { 0 }; |
| 385 | int user_data_count = 0; |
| 386 | int ii; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 387 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 388 | if (argc > 1) { |
| 389 | cmd = argv[1][0]; |
| 390 | } else { |
| 391 | cmd = 's'; /* default to status */ |
| 392 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 393 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 394 | user_data_count = argc - 2; |
| 395 | for (ii = 0; ii < user_data_count; ii++) { |
| 396 | user_data[ii] = simple_strtoul (argv[2 + ii], NULL, 0); |
| 397 | } |
| 398 | switch (cmd) { |
| 399 | case 's': |
| 400 | if (I2CAccess |
| 401 | (0x2, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 402 | &temp_byte, I2C_READ) != 0) { |
| 403 | goto fail; |
| 404 | } |
| 405 | printf ("Status : 0x%02x ", temp_byte); |
| 406 | if (temp_byte & TEMP_BUSY_BIT) |
| 407 | printf ("BUSY "); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 408 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 409 | if (temp_byte & TEMP_LHIGH_BIT) |
| 410 | printf ("LHIGH "); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 411 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 412 | if (temp_byte & TEMP_LLOW_BIT) |
| 413 | printf ("LLOW "); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 414 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 415 | if (temp_byte & TEMP_EHIGH_BIT) |
| 416 | printf ("EHIGH "); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 417 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 418 | if (temp_byte & TEMP_ELOW_BIT) |
| 419 | printf ("ELOW "); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 420 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 421 | if (temp_byte & TEMP_OPEN_BIT) |
| 422 | printf ("OPEN "); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 423 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 424 | if (temp_byte & TEMP_ETHERM_BIT) |
| 425 | printf ("ETHERM "); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 426 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 427 | if (temp_byte & TEMP_LTHERM_BIT) |
| 428 | printf ("LTHERM"); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 429 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 430 | printf ("\n"); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 431 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 432 | if (I2CAccess |
| 433 | (0x3, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 434 | &temp_byte, I2C_READ) != 0) { |
| 435 | goto fail; |
| 436 | } |
| 437 | printf ("Config : 0x%02x ", temp_byte); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 438 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 439 | if (I2CAccess |
| 440 | (0x4, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 441 | &temp_byte, I2C_READ) != 0) { |
| 442 | printf ("\n"); |
| 443 | goto fail; |
| 444 | } |
| 445 | printf ("Conversion: 0x%02x\n", temp_byte); |
| 446 | if (I2CAccess |
| 447 | (0x22, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 448 | &temp_byte, I2C_READ) != 0) { |
| 449 | goto fail; |
| 450 | } |
| 451 | printf ("Cons Alert: 0x%02x ", temp_byte); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 452 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 453 | if (I2CAccess |
| 454 | (0x21, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 455 | &temp_byte, I2C_READ) != 0) { |
| 456 | printf ("\n"); |
| 457 | goto fail; |
| 458 | } |
| 459 | printf ("Therm Hyst: %d\n", temp_byte); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 460 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 461 | if (I2CAccess |
| 462 | (0x0, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 463 | &temp_byte, I2C_READ) != 0) { |
| 464 | goto fail; |
| 465 | } |
| 466 | temp = temp_byte; |
| 467 | if (I2CAccess |
| 468 | (0x6, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 469 | &temp_byte, I2C_READ) != 0) { |
| 470 | goto fail; |
| 471 | } |
| 472 | low = temp_byte; |
| 473 | if (I2CAccess |
| 474 | (0x5, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 475 | &temp_byte, I2C_READ) != 0) { |
| 476 | goto fail; |
| 477 | } |
| 478 | high = temp_byte; |
| 479 | if (I2CAccess |
| 480 | (0x20, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 481 | &temp_byte, I2C_READ) != 0) { |
| 482 | goto fail; |
| 483 | } |
| 484 | therm = temp_byte; |
| 485 | printf ("Local Temp: %2d Low: %2d High: %2d THERM: %2d\n", temp, low, high, therm); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 486 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 487 | if (I2CAccess |
| 488 | (0x1, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 489 | &temp_byte, I2C_READ) != 0) { |
| 490 | goto fail; |
| 491 | } |
| 492 | temp = temp_byte; |
| 493 | if (I2CAccess |
| 494 | (0x10, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 495 | &temp_byte, I2C_READ) != 0) { |
| 496 | goto fail; |
| 497 | } |
| 498 | temp_low = temp_byte; |
| 499 | if (I2CAccess |
| 500 | (0x8, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 501 | &temp_byte, I2C_READ) != 0) { |
| 502 | goto fail; |
| 503 | } |
| 504 | low = temp_byte; |
| 505 | if (I2CAccess |
| 506 | (0x14, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 507 | &temp_byte, I2C_READ) != 0) { |
| 508 | goto fail; |
| 509 | } |
| 510 | low_low = temp_byte; |
| 511 | if (I2CAccess |
| 512 | (0x7, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 513 | &temp_byte, I2C_READ) != 0) { |
| 514 | goto fail; |
| 515 | } |
| 516 | high = temp_byte; |
| 517 | if (I2CAccess |
| 518 | (0x13, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 519 | &temp_byte, I2C_READ) != 0) { |
| 520 | goto fail; |
| 521 | } |
| 522 | high_low = temp_byte; |
| 523 | if (I2CAccess |
| 524 | (0x19, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 525 | &temp_byte, I2C_READ) != 0) { |
| 526 | goto fail; |
| 527 | } |
| 528 | therm = temp_byte; |
| 529 | if (I2CAccess |
| 530 | (0x11, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 531 | &temp_byte, I2C_READ) != 0) { |
| 532 | goto fail; |
| 533 | } |
| 534 | printf ("Ext Temp : %2d.%03d Low: %2d.%03d High: %2d.%03d THERM: %2d Offset: %2d\n", temp, GET_DECIMAL (temp_low), low, GET_DECIMAL (low_low), high, GET_DECIMAL (high_low), therm, temp_byte); |
| 535 | break; |
| 536 | case 'l': /* alter local limits : low, high, therm */ |
| 537 | if (argc < 3) { |
| 538 | goto usage; |
| 539 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 540 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 541 | /* low */ |
| 542 | if (I2CAccess |
| 543 | (0xC, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 544 | &user_data[0], I2C_WRITE) != 0) { |
| 545 | goto fail; |
| 546 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 547 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 548 | if (user_data_count > 1) { |
| 549 | /* high */ |
| 550 | if (I2CAccess |
| 551 | (0xB, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 552 | &user_data[1], I2C_WRITE) != 0) { |
| 553 | goto fail; |
| 554 | } |
| 555 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 556 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 557 | if (user_data_count > 2) { |
| 558 | /* therm */ |
| 559 | if (I2CAccess |
| 560 | (0x20, I2C_SENSOR_DEV, |
| 561 | I2C_SENSOR_CHIP_SEL, &user_data[2], |
| 562 | I2C_WRITE) != 0) { |
| 563 | goto fail; |
| 564 | } |
| 565 | } |
| 566 | break; |
| 567 | case 'e': /* alter external limits: low, high, therm, offset */ |
| 568 | if (argc < 3) { |
| 569 | goto usage; |
| 570 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 571 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 572 | /* low */ |
| 573 | if (I2CAccess |
| 574 | (0xE, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 575 | &user_data[0], I2C_WRITE) != 0) { |
| 576 | goto fail; |
| 577 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 578 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 579 | if (user_data_count > 1) { |
| 580 | /* high */ |
| 581 | if (I2CAccess |
| 582 | (0xD, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 583 | &user_data[1], I2C_WRITE) != 0) { |
| 584 | goto fail; |
| 585 | } |
| 586 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 587 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 588 | if (user_data_count > 2) { |
| 589 | /* therm */ |
| 590 | if (I2CAccess |
| 591 | (0x19, I2C_SENSOR_DEV, |
| 592 | I2C_SENSOR_CHIP_SEL, &user_data[2], |
| 593 | I2C_WRITE) != 0) { |
| 594 | goto fail; |
| 595 | } |
| 596 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 597 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 598 | if (user_data_count > 3) { |
| 599 | /* offset */ |
| 600 | if (I2CAccess |
| 601 | (0x11, I2C_SENSOR_DEV, |
| 602 | I2C_SENSOR_CHIP_SEL, &user_data[3], |
| 603 | I2C_WRITE) != 0) { |
| 604 | goto fail; |
| 605 | } |
| 606 | } |
| 607 | break; |
| 608 | case 'c': /* alter config settings: config, conv, cons alert, therm hyst */ |
| 609 | if (argc < 3) { |
| 610 | goto usage; |
| 611 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 612 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 613 | /* config */ |
| 614 | if (I2CAccess |
| 615 | (0x9, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 616 | &user_data[0], I2C_WRITE) != 0) { |
| 617 | goto fail; |
| 618 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 619 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 620 | if (user_data_count > 1) { |
| 621 | /* conversion */ |
| 622 | if (I2CAccess |
| 623 | (0xA, I2C_SENSOR_DEV, I2C_SENSOR_CHIP_SEL, |
| 624 | &user_data[1], I2C_WRITE) != 0) { |
| 625 | goto fail; |
| 626 | } |
| 627 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 628 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 629 | if (user_data_count > 2) { |
| 630 | /* cons alert */ |
| 631 | if (I2CAccess |
| 632 | (0x22, I2C_SENSOR_DEV, |
| 633 | I2C_SENSOR_CHIP_SEL, &user_data[2], |
| 634 | I2C_WRITE) != 0) { |
| 635 | goto fail; |
| 636 | } |
| 637 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 638 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 639 | if (user_data_count > 3) { |
| 640 | /* therm hyst */ |
| 641 | if (I2CAccess |
| 642 | (0x21, I2C_SENSOR_DEV, |
| 643 | I2C_SENSOR_CHIP_SEL, &user_data[3], |
| 644 | I2C_WRITE) != 0) { |
| 645 | goto fail; |
| 646 | } |
| 647 | } |
| 648 | break; |
| 649 | default: |
| 650 | goto usage; |
| 651 | } |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 652 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 653 | goto done; |
| 654 | fail: |
| 655 | printf ("Access to sensor failed\n"); |
| 656 | ret_val = -1; |
| 657 | goto done; |
| 658 | usage: |
| 659 | printf ("Usage:\n%s\n", cmdtp->help); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 660 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 661 | done: |
| 662 | return ret_val; |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 663 | } |
| 664 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 665 | U_BOOT_CMD (temp, 6, 0, do_temp_sensor, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 666 | "interact with the temperature sensor", |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 667 | "temp [s]\n" |
| 668 | " - Show status.\n" |
| 669 | "temp l LOW [HIGH] [THERM]\n" |
| 670 | " - Set local limits.\n" |
| 671 | "temp e LOW [HIGH] [THERM] [OFFSET]\n" |
| 672 | " - Set external limits.\n" |
| 673 | "temp c CONFIG [CONVERSION] [CONS. ALERT] [THERM HYST]\n" |
| 674 | " - Set config options.\n" |
| 675 | "\n" |
| 676 | "All values can be decimal or hex (hex preceded with 0x).\n" |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 677 | "Only whole numbers are supported for external limits."); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 678 | |
| 679 | #if 0 |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 680 | U_BOOT_CMD (loadace, 2, 0, do_loadace, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 681 | "load fpga configuration from System ACE compact flash", |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 682 | "N\n" |
| 683 | " - Load configuration N (0-7) from System ACE compact flash\n" |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 684 | "loadace\n" " - loads default configuration"); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 685 | #endif |
| 686 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 687 | U_BOOT_CMD (swconfig, 2, 0, do_swconfigbyte, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 688 | "display or modify the software configuration byte", |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 689 | "N [ADDRESS]\n" |
| 690 | " - set software configuration byte to N, optionally use ADDRESS as\n" |
| 691 | " location of buffer for flash copy\n" |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 692 | "swconfig\n" " - display software configuration byte"); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 693 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 694 | U_BOOT_CMD (pause, 2, 0, do_pause, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 695 | "sleep processor until any key is pressed with poll time of N seconds", |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 696 | "N\n" |
| 697 | " - sleep processor until any key is pressed with poll time of N seconds\n" |
| 698 | "pause\n" |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 699 | " - sleep processor until any key is pressed with poll time of 1 second"); |
Wolfgang Denk | 56811f6 | 2005-10-09 01:04:33 +0200 | [diff] [blame] | 700 | |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 701 | U_BOOT_CMD (swrecon, 1, 0, do_swreconfig, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 702 | "trigger a board reconfigure to the software selected configuration", |
Wolfgang Denk | 3193a65 | 2005-10-09 01:41:48 +0200 | [diff] [blame] | 703 | "\n" |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 704 | " - trigger a board reconfigure to the software selected configuration"); |
Ben Warren | 050019d | 2008-08-31 10:44:19 -0700 | [diff] [blame] | 705 | |
| 706 | int board_eth_init(bd_t *bis) |
| 707 | { |
| 708 | return pci_eth_init(bis); |
| 709 | } |