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