#if defined(CONFIG_CMD_BOOTB)
int do_bootb_kintex7(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
- u32 FrameBuffer[8];
- u32 BootAddress = simple_strtoul(argv[1], NULL, 16);
- u32 Index = 0;
- u32 Count;
-
- if (argc < 2)
+ u32 framebuffer[8];
+ u32 bootaddress = simple_strtoul(argv[1], NULL, 16);
+ u32 index = 0;
+ u32 count;
+
+ if (argc < 2)
+ return -1;
+
+ if ((bootaddress < CONFIG_SYS_FLASH_BASE) ||
+ (bootaddress > (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE)))
return -1;
-
- if ((BootAddress < CONFIG_SYS_FLASH_BASE) || (BootAddress > (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE)))
- {
- return -1;
- }
- /*
+ /*
* Create the data to be written to the ICAP.
*/
- FrameBuffer[Index++] = XHI_DUMMY_PACKET;
- FrameBuffer[Index++] = XHI_SYNC_PACKET;
- FrameBuffer[Index++] = XHI_NOOP_PACKET;
- FrameBuffer[Index++] = 0x30020001; /* Type 1 write to WBSTAR */
- FrameBuffer[Index++] = BootAddress;
- FrameBuffer[Index++] = 0x30008001; /* Type 1 Write to CMD */
- FrameBuffer[Index++] = XHI_CMD_IPROG;
- FrameBuffer[Index++] = XHI_NOOP_PACKET;
-
- /*
- * Fill the FIFO with as many words as it will take (or as many as we have to send).
- */
- while(Index > XHwIcap_GetWrFifoVacancy(HWICAP_BASEADDR));
- for (Count = 0; Count < Index; Count++)
- {
- XHwIcap_FifoWrite(HWICAP_BASEADDR, FrameBuffer[Count]);
- }
-
- /*
+ framebuffer[index++] = XHI_DUMMY_PACKET;
+ framebuffer[index++] = XHI_SYNC_PACKET;
+ framebuffer[index++] = XHI_NOOP_PACKET;
+ framebuffer[index++] = 0x30020001; /* Type 1 write to WBSTAR */
+ framebuffer[index++] = bootaddress;
+ framebuffer[index++] = 0x30008001; /* Type 1 Write to CMD */
+ framebuffer[index++] = XHI_CMD_IPROG;
+ framebuffer[index++] = XHI_NOOP_PACKET;
+
+ /*
+ * Fill the FIFO with as many words as it will take
+ * (or as many as we have to send).
+ */
+ while (index > XHwIcap_GetWrFifoVacancy(HWICAP_BASEADDR))
+ ;
+ for (count = 0; count < index; count++)
+ XHwIcap_FifoWrite(HWICAP_BASEADDR, framebuffer[count]);
+
+
+ /*
* Start the transfer of the data from the FIFO to the ICAP device.
*/
XHwIcap_StartConfig(HWICAP_BASEADDR);
- while ((XHwIcap_ReadReg(HWICAP_BASEADDR,XHI_CR_OFFSET)) & XHI_CR_WRITE_MASK);
-
- while (XHwIcap_IsDeviceBusy(HWICAP_BASEADDR) != 0);
- while (XHwIcap_ReadReg(HWICAP_BASEADDR, XHI_CR_OFFSET) & XHI_CR_WRITE_MASK);
-
- /* The code should never get here sice the FPGA should reset */
- return -1;
+ while ((XHwIcap_ReadReg(HWICAP_BASEADDR, XHI_CR_OFFSET)) &
+ XHI_CR_WRITE_MASK)
+ ;
+
+ while (XHwIcap_IsDeviceBusy(HWICAP_BASEADDR) != 0)
+ ;
+ while (XHwIcap_ReadReg(HWICAP_BASEADDR, XHI_CR_OFFSET) &
+ XHI_CR_WRITE_MASK)
+ ;
+
+ /* The code should never get here sice the FPGA should reset */
+ return -1;
}
U_BOOT_CMD(