Commit 9805701f authored by Alessandro Rubini's avatar Alessandro Rubini Committed by Federico Vaga

kernel: use PARAM_GATEWARE and official fmc names

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 97d81951
...@@ -19,10 +19,6 @@ static struct fmc_driver fa_dev_drv; ...@@ -19,10 +19,6 @@ static struct fmc_driver fa_dev_drv;
FMC_PARAM_BUSID(fa_dev_drv); FMC_PARAM_BUSID(fa_dev_drv);
FMC_PARAM_GATEWARE(fa_dev_drv); FMC_PARAM_GATEWARE(fa_dev_drv);
static char *fa_binary = FA_GATEWARE_DEFAULT_NAME;
module_param_named(file, fa_binary, charp, 0444);
static const int zfad_hw_range[] = { static const int zfad_hw_range[] = {
[ZFA_RANGE_10V] = 0x45, [ZFA_RANGE_10V] = 0x45,
[ZFA_RANGE_1V] = 0x11, [ZFA_RANGE_1V] = 0x11,
...@@ -264,6 +260,7 @@ int fa_probe(struct fmc_device *fmc) ...@@ -264,6 +260,7 @@ int fa_probe(struct fmc_device *fmc)
struct fa_modlist *m = NULL; struct fa_modlist *m = NULL;
struct fa_dev *fa; struct fa_dev *fa;
int err, i = 0; int err, i = 0;
char *fwname;
/* Validate the new FMC device */ /* Validate the new FMC device */
i = fmc->op->validate(fmc, &fa_dev_drv); i = fmc->op->validate(fmc, &fa_dev_drv);
...@@ -273,7 +270,6 @@ int fa_probe(struct fmc_device *fmc) ...@@ -273,7 +270,6 @@ int fa_probe(struct fmc_device *fmc)
return -ENODEV; return -ENODEV;
} }
pr_info("%s:%d\n", __func__, __LINE__);
/* Driver data */ /* Driver data */
fa = devm_kzalloc(&fmc->dev, sizeof(struct fa_dev), GFP_KERNEL); fa = devm_kzalloc(&fmc->dev, sizeof(struct fa_dev), GFP_KERNEL);
if (!fa) if (!fa)
...@@ -281,13 +277,19 @@ int fa_probe(struct fmc_device *fmc) ...@@ -281,13 +277,19 @@ int fa_probe(struct fmc_device *fmc)
fmc_set_drvdata(fmc, fa); fmc_set_drvdata(fmc, fa);
fa->fmc = fmc; fa->fmc = fmc;
if (fa_dev_drv.gw_n)
fwname = ""; /* reprogram will pick from module parameter */
else
fwname = FA_GATEWARE_DEFAULT_NAME;
dev_info(fmc->hwdev, "Gateware (%s)\n", fwname);
/* We first write a new binary (and lm32) within the carrier */ /* We first write a new binary (and lm32) within the carrier */
err = fmc->op->reprogram(fmc, &fa_dev_drv, fa_binary); err = fmc->op->reprogram(fmc, &fa_dev_drv, fwname);
if (err) { if (err) {
dev_err(fmc->hwdev, "write firmware \"%s\": error %i\n", dev_err(fmc->hwdev, "write firmware \"%s\": error %i\n",
fa_binary, err); fwname, err);
goto out; goto out;
} }
dev_info(fmc->hwdev, "Gateware successfully loaded\n");
/* init all subsystems */ /* init all subsystems */
for (i = 0, m = mods; i < ARRAY_SIZE(mods); i++, m++) { for (i = 0, m = mods; i < ARRAY_SIZE(mods); i++, m++) {
......
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