]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sandbox: Move CONFIG_SANDBOX_SPI to Kconfig
authorSimon Glass <sjg@chromium.org>
Fri, 6 Mar 2015 20:19:05 +0000 (13:19 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:28:59 +0000 (22:28 +0200)
Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
configs/sandbox_defconfig
drivers/spi/Kconfig
include/configs/sandbox.h

index a85084bfaa295edd14b5937dc8458d11b9ecfd7c..a5b9935627a88e4aebea6c4fd08a3aa1adf00653 100644 (file)
@@ -22,3 +22,4 @@ CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_SANDBOX_GPIO=y
 CONFIG_SYS_VSNPRINTF=y
 CONFIG_SYS_I2C_SANDBOX=y
+CONFIG_SANDBOX_SPI=y
index 3ce5a6b61638327f4b9ef51ab9eef1941edd79da..60e660a4ecfcf091c8f34bb6a571d66ff72e3db4 100644 (file)
@@ -13,3 +13,28 @@ config DM_SPI
          as 'parent data' to every slave on each bus. Slaves
          typically use driver-private data instead of extending the
          spi_slave structure.
+
+config SANDBOX_SPI
+       bool "Sandbox SPI driver"
+       depends on SANDBOX && DM
+       help
+         Enable SPI support for sandbox. This is an emulation of a real SPI
+         bus. Devices can be attached to the bus using the device tree
+         which specifies the driver to use. As an example, see this device
+         tree fragment from sandbox.dts. It shows that the SPI bus has a
+         single flash device on chip select 0 which is emulated by the driver
+         for "sandbox,spi-flash", which is in drivers/mtd/spi/sandbox.c.
+
+         spi@0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0>;
+               compatible = "sandbox,spi";
+               cs-gpios = <0>, <&gpio_a 0>;
+               flash@0 {
+                       reg = <0>;
+                       compatible = "spansion,m25p16", "sandbox,spi-flash";
+                       spi-max-frequency = <40000000>;
+                       sandbox,filename = "spi.bin";
+               };
+       };
index 30d41e5edb4fed7d42c034a2a201336f0b1e2f5b..b77a866fea14b913136967c76db6e8f00b4d1a33 100644 (file)
@@ -79,7 +79,6 @@
 #define CONFIG_ENV_IS_NOWHERE
 
 /* SPI - enable all SPI flash types for testing purposes */
-#define CONFIG_SANDBOX_SPI
 #define CONFIG_CMD_SF
 #define CONFIG_CMD_SF_TEST
 #define CONFIG_CMD_SPI