Commit 3403e680 authored by Alessandro Rubini's avatar Alessandro Rubini

doc: documented sdb-read

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 21765e56
......@@ -1417,6 +1417,9 @@ The most important tools in @file{userspace/tools} are the following:
for each port and for the RTU daemon. The @t{--help} option
lists all configuration items of the tool.
@item sdb-read
The tool, copied from the @t{fpga-config-space} project,
is documented in the next section,
@c FIXME: document lm32-vuart rtu_stat spll_dbg_proxy wr_management
@c FIXME: document wrs_pstats
@end table
......@@ -1426,6 +1429,80 @@ scripts you need to specify both the kernel
directory (@code{LINUX=}) and the cross-compiler to use
(@code{CROSS_COMPILE=}).
@c ==========================================================================
@node sdb-read
@section sdb-read
[Note: this documentation section comes from the @t{ohwr} project
called @t{fpga-config-space}.]
The @i{sdb-read} program can be used to access an @i{sdbfs} image
stored in a disk file or an FPGA area in physical memory.
It works both as @i{ls} (to list the files
included in the image) and as @i{cat} (to print to its own @i{stdout}
one of the files that live in the binary image).
The program can be used in three ways:
@table @code
@item sdb-read [options] <image-file>
This invocation lists the contents of the image. With @code{-l}
the listing is @i{long}, including more information than the
file name.
@item sdb-read [options] <image-file> <filename>
When called with two arguments, the program prints to @i{stdout}
the content of the named file, extracted from the image. Please
note that if the file has been over-sized at creation time,
the whole allocated data area is printed to standard output.
@item sdb-read [options] <image-file> <hex-vendor>:<hex-device>
If the second argument is built as two hex numbers separated
by a colon, then the program uses them as vendor-id and device-id
to find the file. If more than one file have the same identifiers,
the @i{first} of them is printed.
@end table
The following option flags are supported:
@table @code
@item -l
For listing, use @i{long} format. A @i{verbose} format will
be added later.
@item -e <entrypoint>
Specify the offset of the magic number in the image file.
@item -m <size>@@<addr>
@itemx -m <addr>+<size>
Either form is used to specify a memory range. This is the
preferred way to read from a memory-mapped area, like an FPGA
memory space. Please note that in general you should not
read a ``file'' in FPGA space, because this would mean read
all device registers. The form ``@t{<image-file> <filename>}''
is thus discouraged for in-memory SDB trees (i.e. where
@t{<image-file>} is @t{/dev/mem}).
@item -r
Register the device with a @i{read} method instead of the @i{data}
pointer. In this way the
tool can be used to test the library with either access method.
If @i{mmap} fails on the file (e.g., it is a non-mappable device),
@i{read} is used automatically, irrespective of @t{-r}.
@end table
@c ==========================================================================
@node VHDL Binaries
@section VHDL and LM32 Binaries
......
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