dts: T312: config spicc amlogic driver to support dirspi_xxx [1/1]
authorSunny Luo <sunny.luo@amlogic.com>
Wed, 19 Jun 2019 08:41:54 +0000 (16:41 +0800)
committerSunny Luo <sunny.luo@amlogic.com>
Fri, 5 Jul 2019 06:50:55 +0000 (14:50 +0800)
PD#SWPL-9815

Problem:
One T312-T962X3 project need use the dirspi_xxx interfaces to
communicate with a extern mcu(spi device).

Solution:
config dts to use spicc amlogic-driver to support dirspi_xxx

Verify:
T312

Change-Id: Icad0e516b5d694b86350fec1e9322170e84d9c8f
Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
arch/arm/boot/dts/amlogic/mesontm2.dtsi
arch/arm/boot/dts/amlogic/tm2_t962x3_t312.dts
arch/arm64/boot/dts/amlogic/mesontm2.dtsi
arch/arm64/boot/dts/amlogic/tm2_t962x3_t312.dts
drivers/amlogic/spicc/spicc.c

index efa7829..3691ac8 100644 (file)
                };
        };
 
+       /* to use "dirspi" of amlogic-driver for T312 */
+       spicc_b:spicc_b {
+               compatible = "amlogic, spicc";
+               status = "disabled";
+               device_id = <1>;
+               reg = <0xffd15000 0x3c>;
+               clocks = <&clkc CLKID_SPICC1>,
+                       <&clkc CLKID_SPICC1_COMP>;
+               clock-names = "cts_spicc_hclk", "spicc_clk";
+               clk_rate = <166666666>;
+               //interrupts = <0 90 1>;
+               enhance = <1>;
+               dma_tx_threshold = <3>;
+               dma_rx_threshold = <3>;
+               dma_num_per_read_burst = <3>;
+               dma_num_per_write_burst = <3>;
+               ssctl = <0>;
+               dma_en = <0>;
+               delay_control = <0x15>;
+               cs_delay = <10>;
+               enhance_dlyctl = <0>;
+       };
 
        spifc: spifc@ffd14000 {
                compatible = "amlogic,aml-spi-nor";
                };
        };
 
+       spicc1_pins_h: spicc1_pins_h {
+               mux {
+                       groups = "spi1_mosi_h",
+                                "spi1_miso_h",
+                                "spi1_clk_h";
+                       function = "spi1";
+                       drive-strength = <1>;
+               };
+       };
+
        internal_eth_pins: internal_eth_pins {
                mux {
                        groups = "eth_link_led",
index 2c35a0b..7a4ec50 100644 (file)
        cs-gpios = <&gpio GPIOH_20 0>;
 };
 
+&spicc_b {
+       status = "disabled";
+       pinctrl-names= "default";
+       pinctrl-0=<&spicc1_pins_h>;
+       num_chipselect = <1>;
+       cs-gpios = <&gpio GPIOH_0 GPIO_ACTIVE_HIGH>;
+};
+
 &meson_fb {
        status = "okay";
        display_size_default = <1920 1080 1920 2160 32>;
index 41f3f9a..559570c 100644 (file)
                };
        };
 
+       /* to use "dirspi" of amlogic-driver for T312 */
+       spicc_b:spicc_b {
+               compatible = "amlogic, spicc";
+               status = "disabled";
+               device_id = <1>;
+               reg = <0x0 0xffd15000 0x0 0x3c>;
+               clocks = <&clkc CLKID_SPICC1>,
+                       <&clkc CLKID_SPICC1_COMP>;
+               clock-names = "cts_spicc_hclk", "spicc_clk";
+               clk_rate = <166666666>;
+               //interrupts = <0 90 1>;
+               enhance = <1>;
+               dma_tx_threshold = <3>;
+               dma_rx_threshold = <3>;
+               dma_num_per_read_burst = <3>;
+               dma_num_per_write_burst = <3>;
+               ssctl = <0>;
+               dma_en = <0>;
+               delay_control = <0x15>;
+               cs_delay = <10>;
+               enhance_dlyctl = <0>;
+       };
 
        spifc: spifc@ffd14000 {
                compatible = "amlogic,aml-spi-nor";
                };
        };
 
+       spicc1_pins_h: spicc1_pins_h {
+               mux {
+                       groups = "spi1_mosi_h",
+                                "spi1_miso_h",
+                                "spi1_clk_h";
+                       function = "spi1";
+                       drive-strength = <1>;
+               };
+       };
+
        internal_eth_pins: internal_eth_pins {
                mux {
                        groups = "eth_link_led",
index ec591fd..127231a 100644 (file)
        cs-gpios = <&gpio GPIOH_20 0>;
 };
 
+&spicc_b {
+       status = "disabled";
+       pinctrl-names= "default";
+       pinctrl-0=<&spicc1_pins_h>;
+       num_chipselect = <1>;
+       cs-gpios = <&gpio GPIOH_0 GPIO_ACTIVE_HIGH>;
+};
+
 &meson_fb {
        status = "okay";
        display_size_default = <1920 1080 1920 2160 32>;
index e72023a..80d4a7e 100644 (file)
@@ -1084,6 +1084,7 @@ static int of_spicc_get_data(
        if (spicc->clk_rate) {
                clk_set_rate(spicc->clk, spicc->clk_rate);
                clk_prepare_enable(spicc->clk);
+               clk_prepare_enable(spicc->hclk);
        }
 
        if (spicc_get_flag(spicc, FLAG_ENHANCE)) {