@@ -99,3 +99,7 @@
usb0_id_det-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
status = "okay";
};
+
+&spi0 {
+ status = "okay";
+};
@@ -993,7 +993,7 @@ config SPL_STACK_R_ADDR
config SPL_SPI_SUNXI
bool "Support for SPI Flash on Allwinner SoCs in SPL"
- depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNXI_H3_H5 || MACH_SUN50I || MACH_SUN8I_R40 || MACH_SUN50I_H6
+ depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNXI_H3_H5 || MACH_SUN50I || MACH_SUN8I_R40 || MACH_SUN50I_H6 || MACH_SUN8I_V3S
help
Enable support for SPI Flash. This option allows SPL to read from
sunxi SPI Flash. It uses the same method as the boot ROM, so does
@@ -83,6 +83,20 @@ static ulong bytes_per_second(unsigned int len, ulong start_ms)
return 1024 * len / max(get_timer(start_ms), 1UL);
}
+static void spi_probe(void)
+{
+ struct uclass *uc;
+ struct udevice *dev;
+
+ int ret = uclass_get(UCLASS_SPI, &uc);
+ if (ret)
+ return;
+
+ uclass_foreach_dev(dev, uc) {
+ device_probe(dev);
+ }
+}
+
static int do_spi_flash_probe(int argc, char *const argv[])
{
unsigned int bus = CONFIG_SF_DEFAULT_BUS;
@@ -124,6 +138,8 @@ static int do_spi_flash_probe(int argc, char *const argv[])
return -1;
}
+ spi_probe();
+
#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
/* Remove the old device, otherwise probe will just be a nop */
ret = spi_find_bus_and_cs(bus, cs, &bus_dev, &new);
@@ -3,5 +3,9 @@ CONFIG_ARCH_SUNXI=y
CONFIG_SPL=y
CONFIG_MACH_SUN8I_V3S=y
CONFIG_DRAM_CLK=360
+CONFIG_SPL_SPI_SUNXI=y
CONFIG_DEFAULT_DEVICE_TREE="sun8i-v3s-licheepi-zero"
-# CONFIG_NETDEVICES is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y