Device Tree Configuration

The device tree of SPI is stored in the following path:
freelight-u-sdk/linux/arch/riscv/boot/dts/starfive/jh7110.dtsi
The following code block provides an example of how to set SPI0.
spi0: spi@10060000 {
        compatible = "arm,pl022", "arm,primecell";
        reg = <0x0 0x10060000 0x0 0xl0000>;
        clocks = <&clkgen JH7110_SPI0_CLK_APB>; 
        clock-names = "apb_pclk";
        resets = <&rstgen RSTN_U0_SSP_SPI_APB>; 
        reset-names = "rst_apb";
        interrupts = <38>;
        /* shortage of dma channel that not be used */ 
        /* dmas = <&dma 14 1>, <&dma 15 1>;*/ 
        /* dma-names = "rx","tx";*/ 
        arm,primecell-periphid = <0x00041022>;
        num-cs = <1>;
        #address-cells = <1>;
        #size-cells = <0>;
        status = "disabled";
The following list provides explanations for the parameters included in the above code block.
  • compatible: Compatibility information, used to associate the driver and its target device.
  • reg: Register base address "0x10060000" and range "0x10000".
  • clocks: The clocks used by the SPI module.
  • clock-names: The names of the above clocks.
  • resets: The reset signals used by the SPI module.
  • reset-names: The names of the above reset signals.
  • interrupts: Hardware interrupt ID.
  • primecell-periphid: The peripheral ID of the SPI device.
  • num-cs: The total count of the chip select signals.
  • status: The work status of the SPI module. To enable the module, set this bit as "okay" or to disable the module, set this bit as "disabled".