Updated reboot strategy for SU1

This commit is contained in:
Ross Owen
2013-01-25 10:31:32 +00:00
parent c31355aa18
commit 127711e425

View File

@@ -1,6 +1,7 @@
#include <xs1.h>
#include <platform.h>
#include <xs1_su.h>
#include <print.h>
#define XS1_SU_PERIPH_USB_ID 0x1
@@ -10,8 +11,13 @@ void device_reboot_implementation(chanend spare)
#ifdef ARCH_S
/* Disconnect from bus */
unsigned data[] = {4};
unsigned x;
write_periph_32(xs1_su, XS1_SU_PERIPH_USB_ID, XS1_SU_PER_UIFM_FUNC_CONTROL_NUM, 1, data);
#endif
/* Ideally we would reset SU1 here but then we loose power to the xcore and therefore the DFU flag */
/* Disable USB and issue reset to xcore only - not analogue chip */
write_node_config_reg(xs1_su, XS1_SU_CFG_RST_MISC_NUM,0b10);
#else
outct(spare, XS1_CT_END); // have to do this before freeing the chanend
inct(spare); // Receive end ct from usb_buffer to close down in both directions
@@ -28,4 +34,6 @@ void device_reboot_implementation(chanend spare)
write_sswitch_reg_no_ack(tile_id^0x8000, 6, pllVal);
write_sswitch_reg_no_ack(tile_id, 6, pllVal);
}
#endif
}