I have used SPI2 as its wired out on LS connector and i found the following issues.
1.There is some issue with clock configuration “clock-names”
with the below config it is not booting.
spi2: spi@ffd68000 {
compatible = “arm,pl022”, “arm,primecell”;
reg = <0x0 0xffd68000 0x0 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <0 116 4>;
clocks = <&crg_ctrl HI3660_CLK_GATE_SPI2>;
clock-names =“apb_pclk”;
pinctrl-names = “default”;
pinctrl-0 = <&spi2_pmx_func &spi2_cfg_func>;
num-cs = <1>;
cs-gpios = <&gpio27 2 0>;
status = “ok”;
}
and i have modified clock-names as below
clock-names =“xyz”,“apb_pclk”;
with this config Booting is fine but amba_device_add_failled with -2 error.
Please find my kernel logs below(Debugging logs added).
0m Creating amba device /soc/spi@ffd68000
^[[32m[ 0.387402] ^[[0m Test1
^[[32m[ 0.387415] ^[[0m Test2
^[[32m[ 0.387427] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387430] ^[[0m Test3
^[[32m[ 0.387435] ^[[0m Test4
^[[32m[ 0.387440] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387466] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387479] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387493] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387506] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387519] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387532] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387545] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387558] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387570] ^[[0m Test5
^[[32m[ 0.387582] ^[[0m Test7 []
^[[32m[ 0.387586] ^[[0m amba_device_add Test1
^[[32m[ 0.387590] ^[[0m amba_device_add Test4
^[[32m[ 0.387597] ^[[0m amba_device_add Test6
^[[32m[ 0.387601] ^[[0m amba_get_enable_pclk Test1
^[[32m[ 0.387604] ^[[0m __of_clk_get_by_name Test1
^[[32m[ 0.387608] ^[[0m __of_clk_get_by_name Test2 name [apb_pclk] dev_id:[ffd68000.spi]
^[[32m[ 0.387613] ^[[0m (p + l > end return success
^[[32m[ 0.387617] ^[[0m (p + l > end return success
^[[32m[ 0.387621] ^[[0m __of_clk_get_by_name Test3 index [1]
^[[32m[ 0.387625] ^[[0m of_clk_get Test1 index[1] dev_id:[ffd68000.spi] con_id:[apb_pclk]
^[[32m[ 0.387629] ^[[0m of_clk_get Test2
^[[32m[ 0.387635] ^[[0m^[[33m of_clk_get Test3 rc^[[0m: [-2]
^[[32m[ 0.387640] ^[[0m^[[33m of_clk_get Test4 rc^[[0m: [-2]
^[[32m[ 0.387644] ^[[0m^[[33mERROR^[[0m^[[31m: could not get clock /soc/spi@ffd68000:apb_pclk(1)^[[0m
^[[32m[ 0.387649] ^[[0m amba_get_enable_pclk Test2
^[[32m[ 0.387655] ^[[0m amba_device_add Test10 ret value [-2]
^[[32m[ 0.387659] ^[[0m amba_device_add Test11
^[[32m[ 0.387663] ^[[0m Test8
^[[32m[ 0.387669] ^[[0m^[[33mof_amba_device_create()^[[0m^[[31m: amba_device_add() failed (-2) for /soc/spi@ffd68000^[[0m