From 3dd74062fc6cfad68a62faac6669bada96f3aecf Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Thu, 21 Apr 2011 19:45:05 -0700 Subject: N210: Moved u2p_init into main app and changed bootloader behavior to not load safe fw if safe mode button pressed --- firmware/zpu/usrp2p/bootloader/udp_bootloader.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'firmware/zpu/usrp2p/bootloader') diff --git a/firmware/zpu/usrp2p/bootloader/udp_bootloader.c b/firmware/zpu/usrp2p/bootloader/udp_bootloader.c index 00b54f364..118de2ae9 100644 --- a/firmware/zpu/usrp2p/bootloader/udp_bootloader.c +++ b/firmware/zpu/usrp2p/bootloader/udp_bootloader.c @@ -51,6 +51,8 @@ #include #include +#define BUTTON_PUSHED ((router_status->irqs & PIC_BUTTON) ? 0 : 1) + static void handle_inp_packet(uint32_t *buff, size_t num_lines){ //test if its an ip recovery packet @@ -97,8 +99,11 @@ static void do_the_bootload_thing(void) { set_safe_booted_flag(0); //haven't booted yet if(BUTTON_PUSHED) { //see memory_map.h - puts("Starting USRP2+ in safe mode."); - if(is_valid_fw_image(SAFE_FW_IMAGE_LOCATION_ADDR)) { + puts("Starting USRP2+ in safe mode. I am a brick. Feel free to reprogram me via the UDP burner."); + return; + //no longer necessary since we can just burn from UDP via the bootloader now +/* + if(is_valid_fw_image(SAFE_FW_IMAGE_LOCATION_ADDR)) { set_safe_booted_flag(1); //let the firmware know it's the safe image spi_flash_read(SAFE_FW_IMAGE_LOCATION_ADDR, FW_IMAGE_SIZE_BYTES, (void *)RAM_BASE); start_program(); @@ -108,6 +113,7 @@ static void do_the_bootload_thing(void) { puts("ERROR: no safe firmware image available. I am a brick. Feel free to reprogram me via the UDP burner."); return; } +*/ } if(!production_image) { @@ -150,6 +156,7 @@ int main(void) { u2_init(); + spif_init(); set_default_mac_addr(); set_default_ip_addr(); -- cgit v1.2.3