Commit 0b304a2494eed170562a9fdd64e31332ad5ae73a

Authored by Simon Glass
1 parent 73e256c2ac

sandbox: dts: Add a SPI device and cros_ec device

Add a SPI device which can be used for testing SPI flash features in
sandbox.

Also add a cros_ec device since with driver model the Chrome OS EC
emulation will not otherwise be available.

Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 51 additions and 0 deletions Side-by-side Diff

arch/sandbox/dts/sandbox.dts
1 1 /dts-v1/;
2 2  
3 3 / {
  4 + #address-cells = <1>;
  5 + #size-cells = <0>;
  6 +
4 7 chosen {
5 8 stdout-path = "/serial";
6 9 };
... ... @@ -129,6 +132,29 @@
129 132 #gpio-cells = <1>;
130 133 gpio-bank-name = "a";
131 134 num-gpios = <20>;
  135 + };
  136 +
  137 + spi@0 {
  138 + #address-cells = <1>;
  139 + #size-cells = <0>;
  140 + reg = <0>;
  141 + compatible = "sandbox,spi";
  142 + cs-gpios = <0>, <&gpio_a 0>;
  143 + flash@0 {
  144 + reg = <0>;
  145 + compatible = "spansion,m25p16", "sandbox,spi-flash";
  146 + spi-max-frequency = <40000000>;
  147 + sandbox,filename = "spi.bin";
  148 + };
  149 + };
  150 +
  151 + cros-ec@0 {
  152 + compatible = "google,cros-ec";
  153 + #address-cells = <1>;
  154 + #size-cells = <1>;
  155 + firmware_storage_spi: flash@0 {
  156 + reg = <0 0x400000>;
  157 + };
132 158 };
133 159  
134 160 };
doc/device-tree-bindings/mtd/spi/spi-flash.txt
  1 +* MTD SPI driver for serial flash chips
  2 +
  3 +Required properties:
  4 +- #address-cells, #size-cells : Must be present if the device has sub-nodes
  5 + representing partitions.
  6 +- compatible : Should be the manufacturer and the name of the chip. Bear in
  7 + mind that the DT binding is not U-Boot-only, but in case of
  8 + U-Boot, see spi_flash_params_table table in
  9 + drivers/mtd/spi/sf_params.c for the list of supported chips.
  10 +- reg : Chip-Select number
  11 +- spi-max-frequency : Maximum frequency of the SPI bus the chip can operate at
  12 +
  13 +Optional properties:
  14 + - memory-map : Address and size of the flash, if memory mapped. This may
  15 + apply to Intel chipsets, which tend to memory-map flash.
  16 +
  17 +Example:
  18 +
  19 + flash: m25p80@0 {
  20 + #address-cells = <1>;
  21 + #size-cells = <1>;
  22 + compatible = "spansion,m25p80";
  23 + reg = <0>;
  24 + spi-max-frequency = <40000000>;
  25 + };