- reintroduce localTileId final reset in reboot.xc

This commit is contained in:
Luciano Martin
2017-12-11 11:34:00 +00:00
parent f799a0b345
commit 00ccec07b4

View File

@@ -20,6 +20,17 @@ unsigned get_tile_id(tileref);
extern tileref tile[]; extern tileref tile[];
/* Function to reset the given tile */
void reset_tile(unsigned tileId)
{
unsigned int pllVal;
/* Cannot cast tileref to unsigned! */
read_sswitch_reg(tileId, 6, pllVal);
pllVal &= PLL_MASK;
write_sswitch_reg_no_ack(tileId, 6, pllVal);
}
void device_reboot_aux(void) void device_reboot_aux(void)
{ {
#if (XUD_SERIES_SUPPORT == 1) #if (XUD_SERIES_SUPPORT == 1)
@@ -31,8 +42,8 @@ void device_reboot_aux(void)
/* Disable USB and issue reset to xcore only - not analogue chip */ /* Disable USB and issue reset to xcore only - not analogue chip */
write_node_config_reg(usb_tile, XS1_SU_CFG_RST_MISC_NUM,0b10); write_node_config_reg(usb_tile, XS1_SU_CFG_RST_MISC_NUM,0b10);
#else #else
unsigned int pllVal;
unsigned int tileId; unsigned int tileId;
unsigned int localTileId = get_local_tile_id();
unsigned int tileArrayLength; unsigned int tileArrayLength;
#if (XUD_SERIES_SUPPORT == 4) #if (XUD_SERIES_SUPPORT == 4)
@@ -44,21 +55,22 @@ void device_reboot_aux(void)
/* Find size of tile array - note in future tools versions this will be available from platform.h */ /* Find size of tile array - note in future tools versions this will be available from platform.h */
asm volatile ("ldc %0, tile.globound":"=r"(tileArrayLength)); asm volatile ("ldc %0, tile.globound":"=r"(tileArrayLength));
/* Reset all tiles, starting from the remote ones */
#ifndef __XS2A__ #ifndef __XS2A__
/* Reset all tiles, starting from the remote ones */
for(int i = tileArrayLength-1; i>=0; i--) for(int i = tileArrayLength-1; i>=0; i--)
#else #else
/* Reset all even tiles, starting from the remote ones */ /* Reset all even tiles, starting from the remote ones */
for(int i = tileArrayLength-2; i>=0; i=i-2) for(int i = tileArrayLength-2; i>=0; i=i-2)
#endif #endif
{ {
/* Cannot cast tileref to unsigned! */ /* Do not reboot local tile yet! */
tileId = get_tile_id(tile[i]); if(localTileId != tileId)
read_sswitch_reg(tileId, 6, pllVal); {
pllVal &= PLL_MASK; reset_tile(tileId);
write_sswitch_reg_no_ack(tileId, 6, pllVal); }
} }
/* Finally reboot this tile! */
reset_tile(localTileId);
#endif #endif
} }