diff options
author | Federico Vaga <federico.vaga@cern.ch> | 2017-07-18 09:33:24 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-28 17:24:22 +0300 |
commit | 9c0dda14951e9ed30b6f04e14bf64a3c69686c5b (patch) | |
tree | 2562d71e9f38eb5a6db7e0fff7519c926969f4c9 /drivers/fmc/fmc-core.c | |
parent | 15b1b0f0d87e34a87172d9b83bd260543a991c2e (diff) | |
download | linux-9c0dda14951e9ed30b6f04e14bf64a3c69686c5b.tar.xz |
drivers/fmc: carrier can program FPGA on registration
The initial FPGA may require programming before it is useful.
Signed-off-by: Federico Vaga <federico.vaga@cern.ch>
Tested-by: Pat Riehecky <riehecky@fnal.gov>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fmc/fmc-core.c')
-rw-r--r-- | drivers/fmc/fmc-core.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/fmc/fmc-core.c b/drivers/fmc/fmc-core.c index eabeac04ddda..cec3b8db0d69 100644 --- a/drivers/fmc/fmc-core.c +++ b/drivers/fmc/fmc-core.c @@ -280,6 +280,21 @@ int fmc_device_register_n_gw(struct fmc_device **devs, int n, else dev_set_name(&fmc->dev, "%s-%04x", fmc->mezzanine_name, device_id); + + if (gw) { + /* + * The carrier already know the bitstream to load + * for this set of FMC mezzanines. + */ + ret = fmc->op->reprogram_raw(fmc, NULL, + gw->bitstream, gw->len); + if (ret) { + dev_warn(fmc->hwdev, + "Invalid gateware for FMC mezzanine\n"); + goto out; + } + } + ret = device_add(&fmc->dev); if (ret < 0) { dev_err(fmc->hwdev, "Slot %i: Failed in registering " @@ -300,9 +315,6 @@ int fmc_device_register_n_gw(struct fmc_device **devs, int n, out1: device_del(&fmc->dev); out: - fmc_free_id_info(fmc); - put_device(&fmc->dev); - kfree(devarray); for (i--; i >= 0; i--) { fmc_debug_exit(devs[i]); |