Commit 9b3a10cf authored by Alessandro Rubini's avatar Alessandro Rubini

spec-core: use lm32= parameter, don't load by default

parent 9892fa07
......@@ -142,7 +142,7 @@ turn perform the following actions:
@itemize @bullet
@item Program a @i{firmware} (or @i{gateware}) file in the FPGA
@item Load program code for the internal CPU (if any)
@item Load program code for the internal CPU (if any and if requested)
@item Load a sub-module for driving the FMC card (if any).
@end itemize
......@@ -152,6 +152,13 @@ may have its program already included in the @i{gateware} file);
similarly you may not need a sub-driver, because the card is
stand-alone and needs no Linux driver.
Please note that the CPU program file is not loaded by default any
more: you must explicitely request it to be loaded with a module
parameter. If you pass ``lm32=1'' as a parameter, it will try to load
at the default address (0x80000). IF you you pass a different value
than 1, it will be used as the load address (for example:
``@code{insmod lm32=0xc0000}'').
@b{Note:} all three files are looked-for in @i{/lib/firmware/fmc},
because our own installations share firmware for COTS peripherals
but mount a host-specific NFS subdirectory. This is incompatible
......
......@@ -26,6 +26,9 @@
static char *spec_name = "%b";
module_param_named(name, spec_name, charp, 0444);
static int spec_lm32_addr = -1;
module_param_named(lm32, spec_lm32_addr, int, 0444);
/*
* A procedure to build the names associated with the device. This
* copies the spec_name. With "spec-" prefix, expanding %P
......@@ -142,6 +145,15 @@ int spec_load_lm32(struct spec_dev *dev)
const struct firmware *fw;
int err, off;
if (spec_lm32_addr < 0) {
/* Not loading lm32 code unless we get the parameter */
return 0;
}
if (spec_lm32_addr == 1) {
/* "insmod lm32=1" loads at the default address */
spec_lm32_addr = SPEC_DEFAULT_LM32_ADDR;
}
err = request_firmware(&fw, dev->names[SPEC_NAME_PROG],
&dev->pdev->dev);
if (err < 0)
......@@ -157,7 +169,7 @@ int spec_load_lm32(struct spec_dev *dev)
uint32_t datum;
datum = get_unaligned_be32(fw->data + off);
writel(datum, dev->remap[0] + 0x80000 + off);
writel(datum, dev->remap[0] + spec_lm32_addr + off);
}
/* Unreset the LM32 */
writel(0xdeadbee, dev->remap[0] + 0xA0400);
......
......@@ -20,6 +20,8 @@
#define PCI_VENDOR_ID_GENNUM 0x1a39
#define PCI_DEVICE_ID_GN4124 0x0004
#define SPEC_DEFAULT_LM32_ADDR 0x80000 /* used if "1" is passed */
#define SPEC_MAX_BOARDS 8
enum spec_names {
......
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