]> Git Repo - J-u-boot.git/blame - doc/SPI/README.sandbox-spi
version: Remove global macro U_BOOT_VERSION_STRING from version.h
[J-u-boot.git] / doc / SPI / README.sandbox-spi
CommitLineData
ffdb20be
MF
1Sandbox SPI/SPI Flash Implementation
2====================================
3
1cc0a9f4 4U-Boot supports SPI and SPI flash emulation in sandbox. This must be enabled
5e61c4e8 5via a device tree.
ffdb20be
MF
6
7For example:
8
5e61c4e8
AT
9 spi@0 {
10 #address-cells = <1>;
11 #size-cells = <0>;
12 reg = <0 1>;
13 compatible = "sandbox,spi";
14 cs-gpios = <0>, <&gpio_a 0>;
15 spi.bin@0 {
16 reg = <0>;
17 compatible = "spansion,m25p16", "jedec,spi-nor";
18 spi-max-frequency = <40000000>;
19 sandbox,filename = "spi.bin";
20 };
21 };
ffdb20be
MF
22
23Supported chips are W25Q16 (2MB), W25Q32 (4MB) and W25Q128 (16MB). Once
24U-Boot it started you can use 'sf' commands as normal. For example:
25
5e61c4e8
AT
26$ dd if=/dev/zero of=spi.bin bs=1M count=2
27$ u-boot -T
ffdb20be
MF
28
29Since the SPI bus is fully implemented as well as the SPI flash connected to
30it, you can also use low-level SPI commands to access the flash. For example
31this reads the device ID from the emulated chip:
32
33=> sspi 0 32 9f
5e61c4e8
AT
34SF: Detected m25p16 with page size 256 Bytes, erase size 64 KiB, total 2 MiB
35FF202015
ffdb20be
MF
36
37
38Simon Glass
39[email protected]
407/11/2013
41Note that the sandbox SPI implementation was written by Mike Frysinger
42<[email protected]>.
This page took 0.301218 seconds and 4 git commands to generate.