Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

SPI AIO-3128C

24

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
24

SPI AIO-3128C

Posted at 6/8/2018 16:21:09      View:6613 | Replies:4        Print      Only Author   [Copy Link] 1#
Dear colleagues, I'm building a kernel driver to a device. This device has SPI interface.  I sent data by SPI with the last fireprime model but in this moment I can't send anything by SPI with  AIO board. DTS file are diferent and I don't have schematics to check conections. I have some questions.

1 Which dts file do I have to change? aio-3128c.dts or rk3128-fireprime-aio.dts
2. What do i have to do in this code to use SPI interface?

&spi0 {
    status = "okay";
    max-freq = <48000000>;

    dac0: dh2228@00 {
              status = "disabled";
              compatible = "rohm,dh2228fv";
              reg = <00>;
              spi-max-frequency = <100000>;
          };

    spi_wk2xxx: spi_wk2xxx@00{
                status = "okay";
                compatible = "firefly,spi-wk2xxx";
                reg = <0x00>;
                spi-max-frequency = <10000000>;
                reset-gpio = <&gpio3 GPIO_D3 GPIO_ACTIVE_HIGH>;
                irq-gpio = <&gpio1 GPIO_B4 IRQ_TYPE_EDGE_FALLING>;
                cs-gpio = <&gpio1 GPIO_B3 GPIO_ACTIVE_HIGH>;
                pwr-en-gpio = <&gpio0 GPIO_B4 GPIO_ACTIVE_HIGH>;
            };
};


Any suggestion? Thank you very much.
Reply

Use props Report

792

Credits

10

Prestige

10

Contribution

advanced

Rank: 4

Credits
792
Posted at 6/11/2018 14:22:14        Only Author  2#
need to disabled spi_wk2xxx
Reply

Use props Report

24

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
24
Posted at 6/18/2018 15:57:49        Only Author  3#
The problem was solved. I changed in 312x.dtsi pinctrl-0 = <&spi0_txd_mux0 &spi0_rxd_mux0 &spi0_clk_mux0 &spi0_cs0_mux0 &spi0_cs1_mux0>; to pinctrl-0 = <&spi0_txd_mux2 &spi0_rxd_mux2 &spi0_clk_mux2 &spi0_cs0_mux2>; and it's working.

        spi0: spi@20074000 {
                compatible = "rockchip,rockchip-spi";
                reg = <0x20074000 0x1000>;
                interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
                #address-cells = <1>;
                #size-cells = <0>;
                pinctrl-names = "default";
                //pinctrl-0 = <&spi0_txd_mux0 &spi0_rxd_mux0 &spi0_clk_mux0 &spi0_cs0_mux0 &spi0_cs1_mux0>;
                //pinctrl-0 = <&spi0_txd_mux1 &spi0_rxd_mux1 &spi0_clk_mux1 &spi0_cs0_mux1 &spi0_cs1_mux1>;
                pinctrl-0 = <&spi0_txd_mux2 &spi0_rxd_mux2 &spi0_clk_mux2 &spi0_cs0_mux2>;
                rockchip,spi-src-clk = <0>;
                num-cs = <2>;
                clocks =<&clk_spi0>, <&clk_gates7 12>;
                clock-names = "spi","pclk_spi0";
                dmas = <&pdma 8>, <&pdma 9>;
                #dma-cells = <2>;
                dma-names = "tx", "rx";
                status = "disabled";
        };

Thanks a lot.
Reply

Use props Report

127

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
127
Posted at 7 day before        Only Author  4#
JPTestKingにIT業界のエリートのグループがあって、彼達は自分の経験と専門知識を使ってCompTIA 220-1102J認証試験に参加する方に対して問題集を研究続けています。君が後悔しないようにもっと少ないお金を使って大きな良い成果を取得するためにJPTestKingを選択してください。JPTestKingはまた一年間に無料なサービスを更新いたします。
Reply

Use props Report

128

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
128
Posted at before yesterday 00:39        Only Author  5#
What a motivating article, thanks for sharing it with us! The New AICP learning materials content is of high value, and it’s free to access.
Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list