Permalink
Browse files

FogBugz #303558: ensure RBF data gets through control block

There are cases where all the RBF data might
not get clocked through the control block.  To ensure
the RBF data gets clocked through, write 10 words
of sync data, all f's, to the fpga manager
after an rbf has been written.

Signed-off-by: Matthew Gerlach <mgerlach@opensource.altera.com>
  • Loading branch information...
1 parent f6d86c3 commit 4c95599521f7ec798871e22bf5695b6c9b425a91 Matthew Gerlach committed Nov 13, 2015
@@ -158,6 +158,7 @@ int cff_from_mmc_fat(char *dev_part, const char *filename, int len)
slen = strlen(filename) + 1;
len -= slen;
filename += slen;
+ fpgamgr_program_sync();
}
/* Ensure the FPGA entering config done */
@@ -261,6 +262,8 @@ int cff_from_qspi(unsigned long flash_offset)
}
+ fpgamgr_program_sync();
+
/* Ensure the FPGA entering config done */
status = fpgamgr_program_fini();
if (status) {
@@ -417,6 +420,8 @@ int cff_from_nand(unsigned long flash_offset)
WATCHDOG_RESET();
}
+ fpgamgr_program_sync();
+
#ifdef CONFIG_CHECK_FPGA_DATA_CRC
if (datacrc != image_get_dcrc(&header)) {
printf("FPGA: Bad Data Checksum\n");
@@ -70,6 +70,17 @@ static int wait_for_user_mode(void)
return i;
}
+/* send sync words to clock data through the control block */
+void fpgamgr_program_sync(void)
+{
+ u32 sync_data = 0xffffffff;
+ int i;
+ for (i = 0; i < 10; i++) {
+ fpgamgr_program_write((const long unsigned int *)&sync_data,
+ sizeof(sync_data));
+ }
+}
+
static int wait_for_imgcfg_stat(unsigned long mask)
{
unsigned long reg, i;
@@ -108,6 +108,7 @@ int fpgamgr_program_init(u32 * rbf_data, u32 rbf_size);
int fpgamgr_program_fini(void);
void fpgamgr_program_write(const unsigned long *rbf_data,
unsigned long rbf_size);
+void fpgamgr_program_sync(void);
int fpgamgr_program_poll_cd(void);
int fpgamgr_program_poll_initphase(void);
int is_fpgamgr_user_mode(void);

0 comments on commit 4c95599

Please sign in to comment.