QSPI1 on RZG2L DEVICE TREE

Hi everyone, 

On my rzg2l I would like to use SPI mapped to the QSPI1 dedicated pins shown below:

I'm interested in using the device as a normal SPI1, is it possible? And if so, how should I create the device in the device tree? I tried writing like this in the file rzg2l-smarc-som.dtsi

&spi1 {
   pinctrl-0 = <&qspi1_pins>;
   pinctrl-names = "default";
   status = "okay";

   adc@0 {
   compatible = "spidev";
   reg = <0>;
   spi-max-frequency = <10000000>;
   };

}

dove qspi1_pins è:

qspi1_pins: spi1 {
   qspi1-data {
   pins = "QSPI1_IO0", "QSPI1_IO1", "QSPI1_IO2", "QSPI1_IO3";
   power-source = <1800>;
   };

   qspi1-ctrl {
   pins = "QSPI1_SPCLK", "QSPI1_SSL", "QSPI_RESET#";
   power-source = <1800>;
   };
};

But when I launch the system and from the console I enter in the /dev folder, I don't find the spi1 device.

I would expect to find the SPI1 device and by echo "test" > spidev1 to see the characters come out of the SPI.

Parents
  • Hello, AndEdo

    I don't think it's possible.
    The QSPI1 dedicated pins are dedicated to the SPI multi I/O bus controller. And the SPI multi I/O bus controller functions as a bus bridge connected to the MPU bus in the system, not as an SPI communication controller.

    So even if you add a node for the SPI communication controller to the device tree, the driver for the SPI multi I/O bus controller won't refer to it.

    BR
  • Ok, thank you for your reply.

    When I add the SPI node to the device tree, can I set the SPI parameters such as polarity, speed etc.?

  • When I add the SPI node to the device tree, can I set the SPI parameters such as polarity, speed etc.?

    I will answer assuming you are asking about the RSPI of RZ/G2L.

    Basically, it's as described in the following documents:
    - "SPI Controller Generic Binding"
       (Documentation/devicetree/bindings/spi/spi-controller.yaml)
    - "Renesas (Quad) Serial Peripheral Interface (RSPI/QSPI)"
       (Documentation/devicetree/bindings/spi/renesas,rspi.yaml)

    Of course, it is limited to what the hardware can achieve.

    BR

Reply
  • When I add the SPI node to the device tree, can I set the SPI parameters such as polarity, speed etc.?

    I will answer assuming you are asking about the RSPI of RZ/G2L.

    Basically, it's as described in the following documents:
    - "SPI Controller Generic Binding"
       (Documentation/devicetree/bindings/spi/spi-controller.yaml)
    - "Renesas (Quad) Serial Peripheral Interface (RSPI/QSPI)"
       (Documentation/devicetree/bindings/spi/renesas,rspi.yaml)

    Of course, it is limited to what the hardware can achieve.

    BR

Children
No Data