@@ -872,12 +872,6 @@ static int imx_ahci_probe(struct platform_device *pdev)
872872 return PTR_ERR (imxpriv -> sata_ref_clk );
873873 }
874874
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-
881875 if (imxpriv -> type == AHCI_IMX6Q || imxpriv -> type == AHCI_IMX6QP ) {
882876 u32 reg_value ;
883877
@@ -937,11 +931,8 @@ static int imx_ahci_probe(struct platform_device *pdev)
937931 goto disable_clk ;
938932
939933 /*
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.
945936 */
946937 reg_val = readl (hpriv -> mmio + HOST_CAP );
947938 if (!(reg_val & HOST_CAP_SSS )) {
@@ -954,8 +945,19 @@ static int imx_ahci_probe(struct platform_device *pdev)
954945 writel (reg_val , hpriv -> mmio + HOST_PORTS_IMPL );
955946 }
956947
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+ }
959961
960962 ret = ahci_platform_init_host (pdev , hpriv , & ahci_imx_port_info ,
961963 & ahci_platform_sht );
0 commit comments