Commit 800739b1 authored by Alessandro Rubini's avatar Alessandro Rubini

doc: documented fmc_reprogram() and dump parameters

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent a923be64
......@@ -168,6 +168,9 @@ to work, and a few more:
void fmc_writel(struct fmc_device *fmc, uint32_t val, int off);
void *fmc_get_drvdata(struct fmc_device *fmc);
void fmc_set_drvdata(struct fmc_device *fmc, void *data);
int fmc_reprogram(struct fmc_device *f, struct fmc_driver *d, char *gw,
int sdb_entry);
@end smallexample
The data structure that describe a device is detailed in @ref{FMC
......@@ -186,6 +189,82 @@ If a carrier hosts slots that are driven by different @sc{fpga} devices,
it should register as a group only mezzanines that are driven by the same
@sc{fpga}, for the reason outlined above.
Finally, the @i{fmc_reprogram} function calls the @i{reprogram} method
(see @ref{The API Offered by Carriers} and also scans the memory area
for an @sc{sdb} tree. You can pass -1 as @t{sdb_entry} to disable such
scan. Otherwise, the function fails if no tree is found at the
specified entry point. The function is meant to factorize common
code, and by the time you read this it is already used by the
@i{spec-sw} and @i{fine-delay} modules.
@c ##########################################################################
@node Module Parameters in fmc.ko
@chapter Module Parameters in fmc.ko
The core driver receives two module parameters, meant to help
debugging client modules. Both parameters can be modified by writing to
@i{/sys/module/fmc/parameters/}, because they are used when client
drivers are devices are registered, not when @t{fmc.ko} is loaded.
@table @code
@item dump_eeprom=
If not zero, the parameter asks the bus controller to dump
the @sc{eeprom} of any device that is registered, using @i{printk}.
@item dump_sdb=
If not zero, the parameter prints the @sc{sdb} tree of every
@sc{fpga} it is loaded by @t{fmc_reprogram()}. If greater
than one, it asks to dump the binary content of @sc{sdb} records.
This currently only dumps the top-level @sc{sdb} array, though.
@end table
@sc{eeprom} dumping avoids repeating lines, since most of the contents
is usually empty and all bits are one or zero. This is an example of
the output:
@smallexample
[ 6625.850480] spec 0000:02:00.0: FPGA programming successful
[ 6626.139949] spec 0000:02:00.0: Manufacturer: CERN
[ 6626.144666] spec 0000:02:00.0: Product name: FmcDelay1ns4cha
[ 6626.150370] FMC: mezzanine 0: 0000:02:00.0 on SPEC
[ 6626.155179] FMC: dumping eeprom 0x2000 (8192) bytes
[ 6626.160087] 0000: 01 00 00 01 00 0b 00 f3 01 0a 00 a5 85 87 c4 43
[ 6626.167069] 0010: 45 52 4e cf 46 6d 63 44 65 6c 61 79 31 6e 73 34
[ 6626.174019] 0020: 63 68 61 c7 70 72 6f 74 6f 2d 30 cc 45 44 41 2d
[ 6626.180975] 0030: 30 32 32 36 37 2d 56 33 da 32 30 31 32 2d 31 31
[...]
[ 6626.371366] 0200: 66 64 65 6c 61 79 0a 00 00 00 00 00 00 00 00 00
[ 6626.378359] 0210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 6626.385361] [...]
[ 6626.387308] 1800: 70 6c 61 63 65 68 6f 6c 64 65 72 ff ff ff ff ff
[ 6626.394259] 1810: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 6626.401250] [...]
@end smallexample
The dump of @sc{sdb} looks like the following; the example
shows the simple @i{golden} gateware for the @sc{spec} card, removing
the leading timestamps to fit the page:
@smallexample
spec 0000:02:00.0: SDB: 00000651:e6a542c9 WB4-Crossbar-GSI
spec 0000:02:00.0: SDB: 0000ce42:ff07fc47 WR-Periph-Syscon (00000000-000000ff)
FMC: mezzanine 0: 0000:02:00.0 on SPEC
FMC: poor dump of sdb first level:
0000: 53 44 42 2d 00 02 01 00 00 00 00 00 00 00 00 00
0010: 00 00 00 00 00 00 01 ff 00 00 00 00 00 00 06 51
0020: e6 a5 42 c9 00 00 00 02 20 12 05 11 57 42 34 2d
0030: 43 72 6f 73 73 62 61 72 2d 47 53 49 20 20 20 00
0040: 00 00 01 01 00 00 00 07 00 00 00 00 00 00 00 00
0050: 00 00 00 00 00 00 00 ff 00 00 00 00 00 00 ce 42
0060: ff 07 fc 47 00 00 00 01 20 12 03 05 57 52 2d 50
0070: 65 72 69 70 68 2d 53 79 73 63 6f 6e 20 20 20 01
@end smallexample
@c ##########################################################################
@node FMC Device
@chapter FMC Device
......@@ -370,6 +449,9 @@ The individual methods perform the following tasks:
way) the file loaded will match the parameters. Per-device gateware
names can be specified using the @code{gateware=} parameter, see
@ref{Module Parameters}.
@b{Note}: Clients should call rhe new helper,
@i{fmc_reprogram}, which both calls this method and
parse the @sc{sdb} tree of the @sc{fpga}.
@item irq_request
@itemx irq_ack
......@@ -704,7 +786,9 @@ to see how they are actually used, please look at @i{spec-trivial.c}.
show the @sc{sdb} internal structure by means of kernel messages. It is
disabled by default because those lines tend to hide more
important messages, if you look at the system console while
loading the drivers.
loading the drivers. @b{Note}: the parameter is being obsoleted,
because @t{fmc.ko} itself now supports @t{dump_sdb=} that
applies to every client driver.
@end table
......
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