Hi aik,
I have some news: I modified the spl_board_init() function in spl_a10.c, changing the following lines (https://github.com/altera-opensource/u-boot-socfpga/blob/61ae22e548ebda525d5216d107e45f20eca70537/arch/arm/mach-socfpga/spl_a10.c#L126-L152) from that:
/* If the full FPGA is already loaded, ie.from EPCQ, config fpga pins */
if (is_fpgamgr_user_mode()) {
ret = config_pins(gd->fdt_blob, "shared");
if (ret)
return;
ret = config_pins(gd->fdt_blob, "fpga");
if (ret)
return;
} else if (!is_fpgamgr_early_user_mode()) {
/* Program IOSSM(early IO release) or full FPGA */
fpgamgr_program(buf, FPGA_BUFSIZ, 0);
/* Skipping double program for combined RBF */
if (!is_fpgamgr_user_mode()) {
/*
* Expect FPGA entered early user mode, so
* the flag is set to re-program IOSSM
*/
force_periph_program(true);
/* Re-program IOSSM to stabilize IO system */
fpgamgr_program(buf, FPGA_BUFSIZ, 0);
force_periph_program(false);
}
}
to this:
/* If the full FPGA is already loaded, force re-program (needed for reboot) */
if (is_fpgamgr_user_mode()) {
force_periph_program(true);
fpgamgr_program(buf, FPGA_BUFSIZ, 0);
fpgamgr_program(buf, FPGA_BUFSIZ, 0);
force_periph_program(false);
} else if (!is_fpgamgr_early_user_mode()) {
/* Program IOSSM(early IO release) or full FPGA */
fpgamgr_program(buf, FPGA_BUFSIZ, 0);
/* Skipping double program for combined RBF */
if (!is_fpgamgr_user_mode()) {
/*
* Expect FPGA entered early user mode, so
* the flag is set to re-program IOSSM
*/
force_periph_program(true);
/* Re-program IOSSM to stabilize IO system */
fpgamgr_program(buf, FPGA_BUFSIZ, 0);
force_periph_program(false);
}
}
So, in the first if I'm checking the FPGA status: since the boot is forced to SD/MMC card in my application, the FPGA can't be already loaded. This will break the compatibility with EPCQ load but in our case is not needed. Then, if it is in user mode, a reboot has been issued, forcing the reprogram. About this, I have a question: is the double programming needed for stability as suggested in the else condition below? Or a single reprogram of the peripherals is enough?
Regards.