1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

sandbox: update documents regarding spi_sf

Since the commit 1289e96797 ("sandbox: spi: Drop command-line SPI
option"), "--spi_sf" command line option is no longer supported.

So update the following documents to sync them up with the change.
	doc/arch/sandbox.rst
	doc/SPI/README.sandbox-spi

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
AKASHI Takahiro
2020-04-27 15:46:45 +09:00
committed by Simon Glass
parent 02c770b4e4
commit 5e61c4e89d
2 changed files with 37 additions and 65 deletions

View File

@@ -316,19 +316,29 @@ SPI Emulation
Sandbox supports SPI and SPI flash emulation.
This is controlled by the spi_sf argument, the format of which is::
The device can be enabled via a device tree, for example::
bus:cs:device:file
spi@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0 1>;
compatible = "sandbox,spi";
cs-gpios = <0>, <&gpio_a 0>;
spi.bin@0 {
reg = <0>;
compatible = "spansion,m25p16", "jedec,spi-nor";
spi-max-frequency = <40000000>;
sandbox,filename = "spi.bin";
};
};
bus - SPI bus number
cs - SPI chip select number
device - SPI device emulation name
file - File on disk containing the data
The file must be created in advance::
For example::
$ dd if=/dev/zero of=spi.bin bs=1M count=2
$ u-boot -T
dd if=/dev/zero of=spi.bin bs=1M count=4
./u-boot --spi_sf 0:0:M25P16:spi.bin
Here, you can use "-T" or "-D" option to specify test.dtb or u-boot.dtb,
respectively, or "-d <file>" for your own dtb.
With this setup you can issue SPI flash commands as normal::
@@ -346,22 +356,6 @@ also use low-level SPI commands::
This is issuing a READ_ID command and getting back 20 (ST Micro) part
0x2015 (the M25P16).
Drivers are connected to a particular bus/cs using sandbox's state
structure (see the 'spi' member). A set of operations must be provided
for each driver.
Configuration settings for the curious are:
CONFIG_SANDBOX_SPI_MAX_BUS:
The maximum number of SPI buses supported by the driver (default 1).
CONFIG_SANDBOX_SPI_MAX_CS:
The maximum number of chip selects supported by the driver (default 10).
CONFIG_SPI_IDLE_VAL:
The idle value on the SPI bus
Block Device Emulation
----------------------