Browse Source

Enable Cadence DesignWare SPI driver #10

SPI now loads ok:

  # dmesg |grep spi
  [    3.923747] dw_spi_mmio 12410000.spi2: Detected FIFO size: 8 bytes
  [    3.930002] dw_spi_mmio 12410000.spi2: DMA init failed
  [    3.935487] dw_spi_mmio 12410000.spi2: registered master spi1
  [    3.941662] spi spi1.0: setup mode 0, 8 bits/w, 10000000 Hz max --> 0
  [    3.948847] dw_spi_mmio 12410000.spi2: registered child spi1.0

And spidev now exists:

  # ls -ltar /dev/spidev1.0
  crw-rw----    1 root     root      153,   0 Jan  1 00:00 /dev/spidev1.0

This also required adding spi2 node to the device tree like in beagle_uboot-opensbi:
https://github.com/starfive-tech/beagle_uboot-opensbi/blob/starfive/arch/riscv/dts/starfive_vic7100_evb.dts#L488

		spi2:spi2@12410000 {
			compatible = "snps,dw-apb-ssi";
			#address-cells = <1>;
			#size-cells = <0>;
			interrupt-parent = <&plic>;
			interrupts = <70>;
			reg = <0x0 0x12410000 0x0 0x10000>;
			clocks = <&ahb2clk>;
			/*num-cs = <1>;
			cs-gpios = <&gpio 0 0>;*/
			spi_dev0: spi@0 {
				compatible = "rohm,dh2228fv";
				spi-max-frequency = <10000000>;
				reg = <0>;
				status = "okay";
			};
		};
Drew Fustini 3 years ago
parent
commit
ca34469749
1 changed files with 6 additions and 0 deletions
  1. 6 0
      conf/sdk_210209_defconfig

+ 6 - 0
conf/sdk_210209_defconfig

@@ -147,7 +147,13 @@ CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
 CONFIG_SPI=y
+CONFIG_SPI_DEBUG=y
+# CONFIG_SPI_MEM is not set
+CONFIG_SPI_DESIGNWARE=y
+CONFIG_SPI_DW_DMA=y
+CONFIG_SPI_DW_MMIO=y
 CONFIG_SPI_SIFIVE=y
+CONFIG_SPI_SPIDEV=y
 # CONFIG_PTP_1588_CLOCK is not set
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y