How to implement sspi command in uboot in Arria10 SoC Devkit
I am running Linux on Arria10 SoC Devkit.
I refer to the link here to create uboot. And it is working fine.
With Arria10 SoC Devkit, you can give instructions to the System Controller (MAX V) from the FPGA via SPI.
Then, after Linux booted, the LED connected to the System Controller was turned on / off correctly using the SPI driver.
However, after starting uboot, the "sspi" command does not work properly. If the sspi command is sent, no response is returned and the device will restart after a while.
What's wrong?
[Configure uboot]
Difference from socfpga_arria10_defconfig
- CONFIG_CMD_SF=y
- CONFIG_CMD_SPI=y
- CONFIG_DEFAULT_SPI_BUS=0
- CONFIG_DEFAULT_SPI_MODE=0
- CONFIG_DM_DEBUG=y
- CONFIG_DESIGNWARE_SPI=y
[Device Tree]
[ socfpga_arria10.dtsi ]
spi1: spi@ffda5000 {
compatible = "snps,dw-apb-ssi";
#address-cells = <1>;
#size-cells = <0>;
reg = <0xffda5000 0x100>;
interrupts = <0 102 4>;
num-chipselect = <4>;
bus-num = <0>;
/*32bit_access;*/
tx-dma-channel = <&pdma 16>;
rx-dma-channel = <&pdma 17>;
clocks = <&spi_m_clk>;
status = "okay";
spidev@0 {
compatible = "spidev";
reg = <0x0>;
spi-max-frequency = <100000>;
};
};
[ socfpga_arria10_socdk.dtsi ]
<< Add spi0 in aliases >>
aliases {
ethernet0 = &gmac0;
serial0 = &uart1;
i2c0 = &i2c1;
spi0 = "/soc/spi@ffda5000";
};
<< Delete >>
a10leds {
compatible = "gpio-leds";
a10sr_led0 {
label = "a10sr-led0";
gpios = <&a10sr_gpio 0 1>;
};
a10sr_led1 {
label = "a10sr-led1";
gpios = <&a10sr_gpio 1 1>;
};
a10sr_led2 {
label = "a10sr-led2";
gpios = <&a10sr_gpio 2 1>;
};
a10sr_led3 {
label = "a10sr-led3";
gpios = <&a10sr_gpio 3 1>;
};
};
<< Modify >>
&spi1 {
status = "okay";
resource-manager@0 {
compatible = "altr,a10sr";
reg = <0>;
spi-max-frequency = <100000>;
/* low-level active IRQ at GPIO1_5 */
interrupt-parent = <&portb>;
interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
#interrupt-cells = <2>;
a10sr_gpio: gpio-controller {
compatible = "altr,a10sr-gpio";
gpio-controller;
#gpio-cells = <2>;
};
a10sr_rst: reset-controller {
compatible = "altr,a10sr-reset";
#reset-cells = <1>;
};
};
};
If you know how to make sspi command work with uboot, please help me !