#include <net/tftp.h>
#include "boot.h"
-extern int rescue;
-extern void boot_helper(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int r4, unsigned int addr);
+extern void boot_helper(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int addr);
-static void __attribute__((noreturn)) boot(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int r4, unsigned int addr)
+static void __attribute__((noreturn)) boot(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int addr)
{
printf("Executing booted program.\n");
uart_sync();
irq_setmask(0);
irq_setie(0);
- boot_helper(r1, r2, r3, r4, addr);
+ boot_helper(r1, r2, r3, addr);
while(1);
}
|((unsigned int)frame.payload[2] << 8)
|((unsigned int)frame.payload[3] << 0);
uart_write(SFL_ACK_SUCCESS);
- boot(cmdline_adr, initrdstart_adr, initrdend_adr, rescue, addr);
+ boot(cmdline_adr, initrdstart_adr, initrdend_adr, addr);
break;
}
case SFL_CMD_CMDLINE:
} else
initrdend_adr = initrdstart_adr + size;
- boot(cmdline_adr, initrdstart_adr, initrdend_adr, rescue, SDRAM_BASE);
+ boot(cmdline_adr, initrdstart_adr, initrdend_adr, SDRAM_BASE);
}
void flashboot(void)
unsigned int got_crc;
printf("Booting from flash...\n");
- if(rescue)
- flashbase = (unsigned int *)FLASH_OFFSET_RESCUE_APP;
- else
- flashbase = (unsigned int *)FLASH_OFFSET_REGULAR_APP;
+ flashbase = (unsigned int *)FLASH_OFFSET_REGULAR_APP;
length = *flashbase++;
crc = *flashbase++;
if((length < 32) || (length > 4*1024*1024)) {
printf("CRC failed (expected %08x, got %08x)\n", crc, got_crc);
return;
}
- boot(0, 0, 0, rescue, SDRAM_BASE);
+ boot(0, 0, 0, SDRAM_BASE);
}
printf("Command not found\n");
}
-int rescue;
extern unsigned int _edata;
static void crcbios(void)
* We also use the address of _edata to know the length
* of our code.
*/
- offset_bios = rescue ? FLASH_OFFSET_RESCUE_BIOS : FLASH_OFFSET_REGULAR_BIOS;
+ offset_bios = FLASH_OFFSET_REGULAR_BIOS;
expected_crc = _edata;
length = (unsigned int)&_edata - offset_bios;
actual_crc = crc32((unsigned char *)offset_bios, length);
static void boot_sequence(void)
{
if(test_user_abort()) {
- if(rescue) {
- serialboot();
- netboot();
- flashboot();
- } else {
- flashboot();
- serialboot();
- netboot();
- }
+ flashboot();
+ serialboot();
+ netboot();
printf("No boot medium found\n");
}
}
char buffer[64];
int ddr_ok;
- rescue = !((unsigned int)main > FLASH_OFFSET_REGULAR_BIOS);
-
irq_setmask(0);
irq_setie(1);
uart_init();
puts(banner);
crcbios();
- if(rescue)
- printf("Rescue mode\n");
id_print();
ethreset();
print_mac();