Commit e7d43f1f authored by Mamta Shukla's avatar Mamta Shukla

Enable FPGA-FLASH mode to identify SPI Flash chip correctly

The SPI connection to the FLASH has 3 different configuration: FPGA-FLASH, GENNUM-FLASH, GENNUM-FPGA
to program the FPGA  from the FEC ,GENNUM-FGPA mode is needed, but to use the MTD driver
FPGA-FLASH mode is required.
Hence, enforce bootsel(GPIO) to FPGA-FLASH mode after firmware is loaded in GENNUM-FPGA mode and before
initiating SPI communication & initializing the FPGA through spec_fpga_init(spec_gn412x) , to identify
flash chip id from spi-ocores and m25p80 driver.
Signed-off-by: Mamta Shukla's avatarMamta Shukla <mamta.ramendra.shukla@cern.ch>
Suggested-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 00fa08a6
...@@ -562,7 +562,6 @@ static const char *spec_fw_name_init_get(struct spec_gn412x *spec_gn412x) ...@@ -562,7 +562,6 @@ static const char *spec_fw_name_init_get(struct spec_gn412x *spec_gn412x)
*/ */
static int spec_fw_load(struct spec_gn412x *spec_gn412x, const char *name) static int spec_fw_load(struct spec_gn412x *spec_gn412x, const char *name)
{ {
enum spec_fpga_select sel;
int err; int err;
dev_dbg(&spec_gn412x->pdev->dev, "Writing firmware '%s'\n", name); dev_dbg(&spec_gn412x->pdev->dev, "Writing firmware '%s'\n", name);
...@@ -575,7 +574,6 @@ static int spec_fw_load(struct spec_gn412x *spec_gn412x, const char *name) ...@@ -575,7 +574,6 @@ static int spec_fw_load(struct spec_gn412x *spec_gn412x, const char *name)
mutex_lock(&spec_gn412x->mtx); mutex_lock(&spec_gn412x->mtx);
sel = spec_bootsel_get(spec_gn412x);
spec_bootsel_set(spec_gn412x, SPEC_FPGA_SELECT_GN4124_FPGA); spec_bootsel_set(spec_gn412x, SPEC_FPGA_SELECT_GN4124_FPGA);
...@@ -585,13 +583,13 @@ static int spec_fw_load(struct spec_gn412x *spec_gn412x, const char *name) ...@@ -585,13 +583,13 @@ static int spec_fw_load(struct spec_gn412x *spec_gn412x, const char *name)
if (err) if (err)
goto out; goto out;
spec_bootsel_set(spec_gn412x, SPEC_FPGA_SELECT_FPGA_FLASH);
err = spec_fpga_init(spec_gn412x); err = spec_fpga_init(spec_gn412x);
if (err) if (err)
dev_warn(&spec_gn412x->pdev->dev, dev_warn(&spec_gn412x->pdev->dev,
"FPGA incorrectly programmed %d\n", err); "FPGA incorrectly programmed %d\n", err);
out: out:
spec_bootsel_set(spec_gn412x, sel);
mutex_unlock(&spec_gn412x->mtx); mutex_unlock(&spec_gn412x->mtx);
return err; return err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment