Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2007 |
| 3 | * Stefan Roese, DENX Software Engineering, sr@denx.de. |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <command.h> |
| 10 | #include <malloc.h> |
| 11 | #include <environment.h> |
| 12 | #include <logbuff.h> |
| 13 | #include <post.h> |
| 14 | |
| 15 | #include <asm/processor.h> |
| 16 | #include <asm/io.h> |
Stefan Roese | 0988776 | 2010-09-16 14:30:37 +0200 | [diff] [blame] | 17 | #include <asm/ppc4xx-gpio.h> |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 18 | |
| 19 | DECLARE_GLOBAL_DATA_PTR; |
| 20 | |
| 21 | #define REBOOT_MAGIC 0x07081967 |
| 22 | #define REBOOT_NOP 0x00000000 |
| 23 | #define REBOOT_DO_POST 0x00000001 |
| 24 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 25 | extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */ |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 26 | |
| 27 | ulong flash_get_size(ulong base, int banknum); |
| 28 | void env_crc_update(void); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 29 | |
| 30 | static u32 start_time; |
| 31 | |
| 32 | int board_early_init_f(void) |
| 33 | { |
Stefan Roese | 952e776 | 2009-09-24 09:55:50 +0200 | [diff] [blame] | 34 | mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */ |
| 35 | mtdcr(UIC0ER, 0x00000000); /* disable all ints */ |
| 36 | mtdcr(UIC0CR, 0x00000000); |
| 37 | mtdcr(UIC0PR, 0xFFFF7F00); /* set int polarities */ |
| 38 | mtdcr(UIC0TR, 0x00000000); /* set int trigger levels */ |
| 39 | mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */ |
| 40 | mtdcr(UIC0VCR, 0x00000001); /* set vect base=0,INT0 highest priority */ |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 41 | |
| 42 | /* |
| 43 | * Configure CPC0_PCI to enable PerWE as output |
| 44 | */ |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 45 | mtdcr(CPC0_PCI, CPC0_PCI_SPE); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 46 | |
| 47 | return 0; |
| 48 | } |
| 49 | |
| 50 | int misc_init_r(void) |
| 51 | { |
| 52 | u32 pbcr; |
| 53 | int size_val = 0; |
| 54 | u32 post_magic; |
| 55 | u32 post_val; |
| 56 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 57 | post_magic = in_be32((void *)CONFIG_SYS_POST_MAGIC); |
| 58 | post_val = in_be32((void *)CONFIG_SYS_POST_VAL); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 59 | if ((post_magic == REBOOT_MAGIC) && (post_val == REBOOT_DO_POST)) { |
| 60 | /* |
| 61 | * Set special bootline bootparameter to pass this POST boot |
| 62 | * mode to Linux to reset the username/password |
| 63 | */ |
| 64 | setenv("addmisc", "setenv bootargs \\${bootargs} factory_reset=yes"); |
| 65 | |
| 66 | /* |
| 67 | * Normally don't run POST tests, only when enabled |
| 68 | * via the sw-reset button. So disable further tests |
| 69 | * upon next bootup here. |
| 70 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 71 | out_be32((void *)CONFIG_SYS_POST_VAL, REBOOT_NOP); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 72 | } else { |
| 73 | /* |
| 74 | * Only run POST when initiated via the sw-reset button mechanism |
| 75 | */ |
| 76 | post_word_store(0); |
| 77 | } |
| 78 | |
| 79 | /* |
| 80 | * Get current time |
| 81 | */ |
| 82 | start_time = get_timer(0); |
| 83 | |
| 84 | /* |
| 85 | * FLASH stuff... |
| 86 | */ |
| 87 | |
| 88 | /* Re-do sizing to get full correct info */ |
| 89 | |
| 90 | /* adjust flash start and offset */ |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 91 | mfebc(PB0CR, pbcr); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 92 | switch (gd->bd->bi_flashsize) { |
| 93 | case 1 << 20: |
| 94 | size_val = 0; |
| 95 | break; |
| 96 | case 2 << 20: |
| 97 | size_val = 1; |
| 98 | break; |
| 99 | case 4 << 20: |
| 100 | size_val = 2; |
| 101 | break; |
| 102 | case 8 << 20: |
| 103 | size_val = 3; |
| 104 | break; |
| 105 | case 16 << 20: |
| 106 | size_val = 4; |
| 107 | break; |
| 108 | case 32 << 20: |
| 109 | size_val = 5; |
| 110 | break; |
| 111 | case 64 << 20: |
| 112 | size_val = 6; |
| 113 | break; |
| 114 | case 128 << 20: |
| 115 | size_val = 7; |
| 116 | break; |
| 117 | } |
| 118 | pbcr = (pbcr & 0x0001ffff) | gd->bd->bi_flashstart | (size_val << 17); |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 119 | mtebc(PB0CR, pbcr); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 120 | |
| 121 | /* |
| 122 | * Re-check to get correct base address |
| 123 | */ |
| 124 | flash_get_size(gd->bd->bi_flashstart, 0); |
| 125 | |
| 126 | /* Monitor protection ON by default */ |
| 127 | (void)flash_protect(FLAG_PROTECT_SET, |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 128 | -CONFIG_SYS_MONITOR_LEN, |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 129 | 0xffffffff, |
| 130 | &flash_info[0]); |
| 131 | |
| 132 | /* Env protection ON by default */ |
| 133 | (void)flash_protect(FLAG_PROTECT_SET, |
Jean-Christophe PLAGNIOL-VILLARD | 0e8d158 | 2008-09-10 22:48:06 +0200 | [diff] [blame] | 134 | CONFIG_ENV_ADDR_REDUND, |
| 135 | CONFIG_ENV_ADDR_REDUND + 2*CONFIG_ENV_SECT_SIZE - 1, |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 136 | &flash_info[0]); |
| 137 | |
| 138 | return 0; |
| 139 | } |
| 140 | |
| 141 | /* |
| 142 | * Check Board Identity: |
| 143 | */ |
| 144 | int checkboard(void) |
| 145 | { |
Wolfgang Denk | f0c0b3a | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 146 | char buf[64]; |
| 147 | int i = getenv_f("serial#", buf, sizeof(buf)); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 148 | |
| 149 | puts("Board: Zeus-"); |
| 150 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 151 | if (in_be32((void *)GPIO0_IR) & GPIO_VAL(CONFIG_SYS_GPIO_ZEUS_PE)) |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 152 | puts("PE"); |
| 153 | else |
| 154 | puts("CE"); |
| 155 | |
| 156 | puts(" of BulletEndPoint"); |
| 157 | |
Wolfgang Denk | f0c0b3a | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 158 | if (i > 0) { |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 159 | puts(", serial# "); |
Wolfgang Denk | f0c0b3a | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 160 | puts(buf); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 161 | } |
| 162 | putc('\n'); |
| 163 | |
| 164 | /* both LED's off */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 165 | gpio_write_bit(CONFIG_SYS_GPIO_LED_RED, 0); |
| 166 | gpio_write_bit(CONFIG_SYS_GPIO_LED_GREEN, 0); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 167 | udelay(10000); |
| 168 | /* and on again */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 169 | gpio_write_bit(CONFIG_SYS_GPIO_LED_RED, 1); |
| 170 | gpio_write_bit(CONFIG_SYS_GPIO_LED_GREEN, 1); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 171 | |
| 172 | return (0); |
| 173 | } |
| 174 | |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 175 | static int default_env_var(char *buf, char *var) |
| 176 | { |
| 177 | char *ptr; |
| 178 | char *val; |
| 179 | |
| 180 | /* |
| 181 | * Find env variable |
| 182 | */ |
| 183 | ptr = strstr(buf + 4, var); |
| 184 | if (ptr == NULL) { |
| 185 | printf("ERROR: %s not found!\n", var); |
| 186 | return -1; |
| 187 | } |
| 188 | ptr += strlen(var) + 1; |
| 189 | |
| 190 | /* |
| 191 | * Now the ethaddr needs to be updated in the "normal" |
| 192 | * environment storage -> redundant flash. |
| 193 | */ |
| 194 | val = ptr; |
| 195 | setenv(var, val); |
| 196 | printf("Updated %s from eeprom to %s!\n", var, val); |
| 197 | |
| 198 | return 0; |
| 199 | } |
| 200 | |
| 201 | static int restore_default(void) |
| 202 | { |
| 203 | char *buf; |
| 204 | char *buf_save; |
| 205 | u32 crc; |
| 206 | |
Wolfgang Denk | ea882ba | 2010-06-20 23:33:59 +0200 | [diff] [blame] | 207 | set_default_env(""); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 208 | |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 209 | gd->env_valid = 1; |
| 210 | |
| 211 | /* |
| 212 | * Read board specific values from I2C EEPROM |
| 213 | * and set env variables accordingly |
| 214 | * -> ethaddr, eth1addr, serial# |
| 215 | */ |
| 216 | buf = buf_save = malloc(FACTORY_RESET_ENV_SIZE); |
Wolfgang Denk | ea882ba | 2010-06-20 23:33:59 +0200 | [diff] [blame] | 217 | if (buf == NULL) { |
| 218 | printf("ERROR: malloc() failed\n"); |
| 219 | return -1; |
| 220 | } |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 221 | if (eeprom_read(FACTORY_RESET_I2C_EEPROM, FACTORY_RESET_ENV_OFFS, |
| 222 | (u8 *)buf, FACTORY_RESET_ENV_SIZE)) { |
| 223 | puts("\nError reading EEPROM!\n"); |
| 224 | } else { |
| 225 | crc = crc32(0, (u8 *)(buf + 4), FACTORY_RESET_ENV_SIZE - 4); |
| 226 | if (crc != *(u32 *)buf) { |
Stefan Roese | b002144 | 2008-07-10 09:58:06 +0200 | [diff] [blame] | 227 | printf("ERROR: crc mismatch %08x %08x\n", crc, *(u32 *)buf); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 228 | return -1; |
| 229 | } |
| 230 | |
| 231 | default_env_var(buf, "ethaddr"); |
| 232 | buf += 8 + 18; |
| 233 | default_env_var(buf, "eth1addr"); |
| 234 | buf += 9 + 18; |
| 235 | default_env_var(buf, "serial#"); |
| 236 | } |
| 237 | |
| 238 | /* |
| 239 | * Finally save updated env variables back to flash |
| 240 | */ |
| 241 | saveenv(); |
| 242 | |
| 243 | free(buf_save); |
| 244 | |
| 245 | return 0; |
| 246 | } |
| 247 | |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 248 | int do_set_default(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 249 | { |
| 250 | char *buf; |
| 251 | char *buf_save; |
| 252 | char str[32]; |
| 253 | u32 crc; |
| 254 | char var[32]; |
| 255 | |
| 256 | if (argc < 4) { |
| 257 | puts("ERROR!\n"); |
| 258 | return -1; |
| 259 | } |
| 260 | |
| 261 | buf = buf_save = malloc(FACTORY_RESET_ENV_SIZE); |
| 262 | memset(buf, 0, FACTORY_RESET_ENV_SIZE); |
| 263 | |
| 264 | strcpy(var, "ethaddr"); |
| 265 | printf("Setting %s to %s\n", var, argv[1]); |
| 266 | sprintf(str, "%s=%s", var, argv[1]); |
| 267 | strcpy(buf + 4, str); |
| 268 | buf += strlen(str) + 1; |
| 269 | |
| 270 | strcpy(var, "eth1addr"); |
| 271 | printf("Setting %s to %s\n", var, argv[2]); |
| 272 | sprintf(str, "%s=%s", var, argv[2]); |
| 273 | strcpy(buf + 4, str); |
| 274 | buf += strlen(str) + 1; |
| 275 | |
| 276 | strcpy(var, "serial#"); |
| 277 | printf("Setting %s to %s\n", var, argv[3]); |
| 278 | sprintf(str, "%s=%s", var, argv[3]); |
| 279 | strcpy(buf + 4, str); |
| 280 | |
| 281 | crc = crc32(0, (u8 *)(buf_save + 4), FACTORY_RESET_ENV_SIZE - 4); |
| 282 | *(u32 *)buf_save = crc; |
| 283 | |
| 284 | if (eeprom_write(FACTORY_RESET_I2C_EEPROM, FACTORY_RESET_ENV_OFFS, |
| 285 | (u8 *)buf_save, FACTORY_RESET_ENV_SIZE)) { |
| 286 | puts("\nError writing EEPROM!\n"); |
| 287 | return -1; |
| 288 | } |
| 289 | |
| 290 | free(buf_save); |
| 291 | |
| 292 | return 0; |
| 293 | } |
| 294 | |
| 295 | U_BOOT_CMD( |
| 296 | setdef, 4, 1, do_set_default, |
Peter Tyser | 2fb2604 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 297 | "write board-specific values to EEPROM (ethaddr...)", |
Wolfgang Denk | a89c33d | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 298 | "ethaddr eth1addr serial#\n - write board-specific values to EEPROM" |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 299 | ); |
| 300 | |
| 301 | static inline int sw_reset_pressed(void) |
| 302 | { |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 303 | return !(in_be32((void *)GPIO0_IR) & GPIO_VAL(CONFIG_SYS_GPIO_SW_RESET)); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 304 | } |
| 305 | |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 306 | int do_chkreset(cmd_tbl_t* cmdtp, int flag, int argc, char * const argv[]) |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 307 | { |
| 308 | int delta; |
| 309 | int count = 0; |
| 310 | int post = 0; |
| 311 | int factory_reset = 0; |
| 312 | |
| 313 | if (!sw_reset_pressed()) { |
| 314 | printf("SW-Reset already high (Button released)\n"); |
| 315 | printf("-> No action taken!\n"); |
| 316 | return 0; |
| 317 | } |
| 318 | |
| 319 | printf("Waiting for SW-Reset button to be released."); |
| 320 | |
| 321 | while (1) { |
| 322 | delta = get_timer(start_time); |
| 323 | if (!sw_reset_pressed()) |
| 324 | break; |
| 325 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 326 | if ((delta > CONFIG_SYS_TIME_POST) && !post) { |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 327 | printf("\nWhen released now, POST tests will be started."); |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 328 | gpio_write_bit(CONFIG_SYS_GPIO_LED_GREEN, 0); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 329 | post = 1; |
| 330 | } |
| 331 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 332 | if ((delta > CONFIG_SYS_TIME_FACTORY_RESET) && !factory_reset) { |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 333 | printf("\nWhen released now, factory default values" |
| 334 | " will be restored."); |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 335 | gpio_write_bit(CONFIG_SYS_GPIO_LED_RED, 0); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 336 | factory_reset = 1; |
| 337 | } |
| 338 | |
| 339 | udelay(1000); |
| 340 | if (!(count++ % 1000)) |
| 341 | printf("."); |
| 342 | } |
| 343 | |
| 344 | |
| 345 | printf("\nSW-Reset Button released after %d milli-seconds!\n", delta); |
| 346 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 347 | if (delta > CONFIG_SYS_TIME_FACTORY_RESET) { |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 348 | printf("Starting factory reset value restoration...\n"); |
| 349 | |
| 350 | /* |
| 351 | * Restore default setting |
| 352 | */ |
| 353 | restore_default(); |
| 354 | |
| 355 | /* |
| 356 | * Reset the board for default to become valid |
| 357 | */ |
| 358 | do_reset(NULL, 0, 0, NULL); |
| 359 | |
| 360 | return 0; |
| 361 | } |
| 362 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 363 | if (delta > CONFIG_SYS_TIME_POST) { |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 364 | printf("Starting POST configuration...\n"); |
| 365 | |
| 366 | /* |
| 367 | * Enable POST upon next bootup |
| 368 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 369 | out_be32((void *)CONFIG_SYS_POST_MAGIC, REBOOT_MAGIC); |
| 370 | out_be32((void *)CONFIG_SYS_POST_VAL, REBOOT_DO_POST); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 371 | post_bootmode_init(); |
| 372 | |
| 373 | /* |
| 374 | * Reset the logbuffer for a clean start |
| 375 | */ |
| 376 | logbuff_reset(); |
| 377 | |
| 378 | do_reset(NULL, 0, 0, NULL); |
| 379 | |
| 380 | return 0; |
| 381 | } |
| 382 | |
| 383 | return 0; |
| 384 | } |
| 385 | |
| 386 | U_BOOT_CMD ( |
| 387 | chkreset, 1, 1, do_chkreset, |
Peter Tyser | 2fb2604 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 388 | "Check for status of SW-reset button and act accordingly", |
Wolfgang Denk | a89c33d | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 389 | "" |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 390 | ); |
| 391 | |
| 392 | #if defined(CONFIG_POST) |
| 393 | /* |
| 394 | * Returns 1 if keys pressed to start the power-on long-running tests |
| 395 | * Called from board_init_f(). |
| 396 | */ |
| 397 | int post_hotkeys_pressed(void) |
| 398 | { |
| 399 | u32 post_magic; |
| 400 | u32 post_val; |
| 401 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 402 | post_magic = in_be32((void *)CONFIG_SYS_POST_MAGIC); |
| 403 | post_val = in_be32((void *)CONFIG_SYS_POST_VAL); |
Stefan Roese | 779e975 | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 404 | |
| 405 | if ((post_magic == REBOOT_MAGIC) && (post_val == REBOOT_DO_POST)) |
| 406 | return 1; |
| 407 | else |
| 408 | return 0; |
| 409 | } |
| 410 | #endif /* CONFIG_POST */ |