Commit 2f0dc4c503d8ac831fb809ec124e79712defae77

Authored by Ye Li
1 parent 70514bd095

MLK-17821-2 imx8: clock: Add cdns3 clock enable and disable

Implemented the clock enable and disable interfaces for CDNS3 USB
driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peter Chen <peter.chen@nxp.com>

Showing 1 changed file with 31 additions and 1 deletions Side-by-side Diff

arch/arm/cpu/armv8/imx8/clock.c
1 1 /*
2   - * Copyright 2017 NXP
  2 + * Copyright 2017-2018 NXP
3 3 *
4 4 * SPDX-License-Identifier: GPL-2.0+
5 5 */
... ... @@ -241,6 +241,36 @@
241 241 return;
242 242 }
243 243  
  244 +int cdns3_enable_clks(int index)
  245 +{
  246 + init_clk_usb3(index);
  247 + return 0;
  248 +}
  249 +
  250 +int cdns3_disable_clks(int index)
  251 +{
  252 + sc_err_t err;
  253 + sc_ipc_t ipc;
  254 +
  255 + ipc = gd->arch.ipc_channel_handle;
  256 +
  257 + err = sc_pm_clock_enable(ipc, SC_R_USB_2, SC_PM_CLK_MISC, false, false);
  258 + if (err != SC_ERR_NONE)
  259 + printf("USB3 disable clock failed!, line=%d (error = %d)\n",
  260 + __LINE__, err);
  261 +
  262 + err = sc_pm_clock_enable(ipc, SC_R_USB_2, SC_PM_CLK_MST_BUS, false, false);
  263 + if (err != SC_ERR_NONE)
  264 + printf("USB3 disable clock failed!, line=%d (error = %d)\n",
  265 + __LINE__, err);
  266 +
  267 + err = sc_pm_clock_enable(ipc, SC_R_USB_2, SC_PM_CLK_PER, false, false);
  268 + if (err != SC_ERR_NONE)
  269 + printf("USB3 disable clock failed!, line=%d (error = %d)\n",
  270 + __LINE__, err);
  271 +
  272 + return 0;
  273 +}
244 274  
245 275 void init_clk_usdhc(u32 index)
246 276 {