@@ -872,12 +872,6 @@ static int imx_ahci_probe(struct platform_device *pdev)
872
872
return PTR_ERR (imxpriv -> sata_ref_clk );
873
873
}
874
874
875
- imxpriv -> ahb_clk = devm_clk_get (dev , "ahb" );
876
- if (IS_ERR (imxpriv -> ahb_clk )) {
877
- dev_err (dev , "can't get ahb clock.\n" );
878
- return PTR_ERR (imxpriv -> ahb_clk );
879
- }
880
-
881
875
if (imxpriv -> type == AHCI_IMX6Q || imxpriv -> type == AHCI_IMX6QP ) {
882
876
u32 reg_value ;
883
877
@@ -937,11 +931,8 @@ static int imx_ahci_probe(struct platform_device *pdev)
937
931
goto disable_clk ;
938
932
939
933
/*
940
- * Configure the HWINIT bits of the HOST_CAP and HOST_PORTS_IMPL,
941
- * and IP vendor specific register IMX_TIMER1MS.
942
- * Configure CAP_SSS (support stagered spin up).
943
- * Implement the port0.
944
- * Get the ahb clock rate, and configure the TIMER1MS register.
934
+ * Configure the HWINIT bits of the HOST_CAP and HOST_PORTS_IMPL.
935
+ * Set CAP_SSS (support stagered spin up) and Implement the port0.
945
936
*/
946
937
reg_val = readl (hpriv -> mmio + HOST_CAP );
947
938
if (!(reg_val & HOST_CAP_SSS )) {
@@ -954,8 +945,19 @@ static int imx_ahci_probe(struct platform_device *pdev)
954
945
writel (reg_val , hpriv -> mmio + HOST_PORTS_IMPL );
955
946
}
956
947
957
- reg_val = clk_get_rate (imxpriv -> ahb_clk ) / 1000 ;
958
- writel (reg_val , hpriv -> mmio + IMX_TIMER1MS );
948
+ if (imxpriv -> type != AHCI_IMX8QM ) {
949
+ /*
950
+ * Get AHB clock rate and configure the vendor specified
951
+ * TIMER1MS register on i.MX53, i.MX6Q and i.MX6QP only.
952
+ */
953
+ imxpriv -> ahb_clk = devm_clk_get (dev , "ahb" );
954
+ if (IS_ERR (imxpriv -> ahb_clk )) {
955
+ dev_err (dev , "Failed to get ahb clock\n" );
956
+ goto disable_sata ;
957
+ }
958
+ reg_val = clk_get_rate (imxpriv -> ahb_clk ) / 1000 ;
959
+ writel (reg_val , hpriv -> mmio + IMX_TIMER1MS );
960
+ }
959
961
960
962
ret = ahci_platform_init_host (pdev , hpriv , & ahci_imx_port_info ,
961
963
& ahci_platform_sht );
0 commit comments