# Spi 1

**URL:** https://forums.sifive.com/t/spi-1/7278
**Category:** HiFive Premier P550
**Created:** [May 18, 2025, 2:38pm UTC](https://forums.sifive.com/t/spi-1/7278 "2025-05-18T14:38:07Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![fetch150zy](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/fetch150zy/32/1762_2.png) [@fetch150zy](https://forums.sifive.com/u/fetch150zy)
#### Post date: [May 18, 2025, 2:38pm UTC](https://forums.sifive.com/t/spi-1/7278/1 "2025-05-18T14:38:07Z")

</div>

Hi, I have some problems when trying to use the SPI of HiFive Premier P550 (EIC7700X), I didn’t find any device related to spidev in the system, then I recompiled the kernel (the kernel version used is [GitHub - sifiveinc/riscv-linux at rel/kernel/hifive-premier-p550](https://github.com/sifiveinc/riscv-linux/tree/rel/kernel/hifive-premier-p550)) and turned on CONFIG\_SPI\_SPIDEV, and then also enabled ssi1 in the device tree.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sifive/original/2X/0/062dd3897e60382c19084984b6a41f6f7b05d1f9.png)

```txt
ssi1: spi@50814000 {
	compatible = "snps,eic7700-spi";
	#address-cells = <1>;
	#size-cells = <0>;
	reg = <0x0 0x50814000 0x0 0x4000>;
	spi-max-frequency = <4800000>;
	clocks = <&d0_clock EIC7700_CLK_LSP_SSI1_PCLK>;
	clock-names = "clk";
	interrupt-parent = <&plic0>;
	interrupts = <92>;
	resets = <&d0_reset SSI_RST_CTRL SW_SSI_RST_N_1>;
	reset-names = "spi";
	eswin,spi_dma = <&d0_aon_dmac>;
	dmas = <&d0_aon_dmac 36 4>, <&d0_aon_dmac 37 4>;
	dma-names = "rx", "tx";
	status = "disabled";
};

pinctrl_spi1_default: spi1-default{
	mux{
		groups = "spi1_group";
		function = "spi1_func";
	};
};

&ssi1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1_default>;
	num-cs = <1>;
	cs-gpios = <&porta 35 GPIO_ACTIVE_LOW>;
	
	spidev1: spidev@0 {
		compatible = "spidev";
		reg = <0>;
		spi-max-frequency = <4800000>;
	};
};

```

But after completing the above work, there is still no way to use spidev, then I found `compatible = "snps,eic7700-spi";`. I want to know which driver is responsible for the SPI controller snps,eic7700-spi, and I can’t find any information related to this keyword in the kernel source code.

I am not familiar with device-tree, and I would like to know if there is anything wrong with the steps above? How can I connect peripherals using the SPI interface on the P550?

---

<div class="post-metadata">

### Author: ![hiten](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@hiten](https://forums.sifive.com/u/hiten)
#### Post date: [May 28, 2025, 5:35am UTC](https://forums.sifive.com/t/spi-1/7278/3 "2025-05-28T05:35:31Z")

</div>

hi user,  
can we know on which pins you have connected SPI peripherals ?

thanks.

---

<div class="post-metadata">

### Author: ![ganboing](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@ganboing](https://forums.sifive.com/u/ganboing)
#### Post date: [May 28, 2025, 6:00am UTC](https://forums.sifive.com/t/spi-1/7278/4 "2025-05-28T06:00:48Z")

</div>

It seems that SiFive’s linux kernel didn’t port the ESWIN’s patch over. In ESWIN’s linux tree, there’s the support for SPI:

> <https://github.com/eswincomputing/linux-stable/commit/5afc0c1b42090db5655cb4dd999f7a9857b20505#diff-aff3120343dbff15f76324c4dcfd1465560303251a6a9331b4dfcb863eae88c1>
>
> Changelogs:
> 1. support pwm, fan control
> 2. support dw-spi
> 3. support rtc, dw-wdt

And later ESWIN disabled DMA capability for the SPI controller:

> <https://github.com/eswincomputing/linux-stable/commit/a45092207dad559fab177beabbaaca8d283484be>
>
> Changelogs:
> 1. spi delete dma

So looks like it’s essentially a dw-spi device, and no ESWIN quirks (which is good). Without recompiling the kernel, you can try to hack the device-tree by changing the compatible string to `snps,dw-apb-ssi`. However this does enable the DMA capability. I suspect the reason behind ESWIN’s second patch is because all the DMA of the SoC are not cache-coherent, so perhaps they found some issues enabling it? Not sure. Anyway, good luck.

---

<div class="post-metadata">

### Author: ![fetch150zy](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/fetch150zy/32/1762_2.png) [@fetch150zy](https://forums.sifive.com/u/fetch150zy)
#### Post date: [May 29, 2025, 2:28am UTC](https://forums.sifive.com/t/spi-1/7278/5 "2025-05-29T02:28:43Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/sifive/original/2X/7/77ee96096c558af02288bb5551cab6651e6f15de.png)

I used these pins.

---

<div class="post-metadata">

### Author: ![fetch150zy](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/fetch150zy/32/1762_2.png) [@fetch150zy](https://forums.sifive.com/u/fetch150zy)
#### Post date: [May 29, 2025, 3:23am UTC](https://forums.sifive.com/t/spi-1/7278/6 "2025-05-29T03:23:07Z")

</div>

Thank you very much, this is very helpful. 😀

---

<div class="post-metadata">

### Author: ![hiten](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@hiten](https://forums.sifive.com/u/hiten)
#### Post date: [June 2, 2025, 7:52am UTC](https://forums.sifive.com/t/spi-1/7278/7 "2025-06-02T07:52:58Z")

</div>

Hi @fetch150zy ,  
These pins are configured as GPIO in current release. For the compatible string @ganboing has already shown some guide which is correct. We are validating it by pinmux changes to use those pins as SPI and validate with one SPI slave device. Once we validate we can share confirm changes. It seems that you have some progress based on @ganboing suggestions. So, once we have some results of SPI slave testing, we can share changes to validate SPI.

Thanks.

---

<div class="post-metadata">

### Author: ![ESWIN\_Support](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@ESWIN\_Support](https://forums.sifive.com/u/ESWIN_Support)
#### Post date: [June 25, 2025, 1:25am UTC](https://forums.sifive.com/t/spi-1/7278/8 "2025-06-25T01:25:44Z")

</div>

Hi, you can refer to the following modifications for the SPI configuration and conduct tests on the SPI flash.

```auto
diff --git a/arch/riscv/boot/dts/eswin/eic7700-hifive-premier-p550.dts b/arch/riscv/boot/dts/eswin/eic7700-hifive-premier-p550.dts
index e4fc03166..0aabbd7f3 100644
--- a/arch/riscv/boot/dts/eswin/eic7700-hifive-premier-p550.dts
+++ b/arch/riscv/boot/dts/eswin/eic7700-hifive-premier-p550.dts
@@ -565,8 +565,21 @@
 };
 
 &ssi0 {
-	/* pin header mux with GPIO 35,36,37,38,39,40 */
-	status = "disabled";
+	/* pin header mux with GPIO 35,36,37,38,39,40 41*/
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_spi1_default>;
+	/* spi flash */
+	num-cs = <1>;
+	spi-flash@0 {
+ compatible = "winbond,w25q128fw",
+ "jedec,spi-nor";
+ reg = <0>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ spi-max-frequency = <4800000>;
+ rx-sample-delay-ns = <10>;
+	};
 };
 
 &ssi1 {
@@ -821,16 +834,14 @@
 	status = "okay";
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_gpio6_default &pinctrl_gpio7_default &pinctrl_gpio8_default &pinctrl_gpio9_default
- &pinctrl_gpio10_default &pinctrl_gpio17_default &pinctrl_gpio35_default &pinctrl_gpio36_default
- &pinctrl_gpio37_default &pinctrl_gpio38_default &pinctrl_gpio39_default &pinctrl_gpio40_default
- &pinctrl_gpio41_default &pinctrl_gpio46_default &pinctrl_gpio52_default
- &pinctrl_gpio53_default &pinctrl_gpio64_default &pinctrl_gpio65_default &pinctrl_gpio66_default
- &pinctrl_gpio67_default &pinctrl_gpio70_default &pinctrl_gpio73_default &pinctrl_gpio83_default
- &pinctrl_gpio86_default &pinctrl_gpio87_default &pinctrl_gpio92_default &pinctrl_gpio93_default
+ &pinctrl_gpio10_default &pinctrl_gpio17_default &pinctrl_gpio46_default	&pinctrl_gpio52_default
+ &pinctrl_gpio53_default	&pinctrl_gpio64_default &pinctrl_gpio65_default &pinctrl_gpio66_default
+ &pinctrl_gpio67_default	&pinctrl_gpio70_default &pinctrl_gpio73_default &pinctrl_gpio83_default
+ &pinctrl_gpio86_default	&pinctrl_gpio87_default &pinctrl_gpio92_default &pinctrl_gpio93_default
 			&pinctrl_gpio94_default>;
 
     /* pin header default function for GPIO
- SPI1 (CS0,SCLK,MOSI,MISO,D2,D3): GPIO 35,36,37,38,39,40
+ SSI0 (CS0,SCLK,MOSI,MISO,D2,D3,CS1): GPIO 35,36,37,38,39,40,41
        I2C1 (SCL,SDA): GPIO 46,47
        UART3(TX,RX): GPIO 92,93
     */

```
