imx7_clock.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <imx_regs.h>
  7. #include <imx_clock.h>
  8. static void imx7_clock_uart_init(void)
  9. {
  10. unsigned int i;
  11. for (i = 0; i < MXC_MAX_UART_NUM; i++)
  12. imx_clock_disable_uart(i);
  13. }
  14. static void imx7_clock_wdog_init(void)
  15. {
  16. unsigned int i;
  17. for (i = 0; i < MXC_MAX_WDOG_NUM; i++)
  18. imx_clock_disable_wdog(i);
  19. }
  20. static void imx7_clock_usb_init(void)
  21. {
  22. /* Disable the clock root */
  23. imx_clock_target_clr(CCM_TRT_ID_USB_HSIC_CLK_ROOT, 0xFFFFFFFF);
  24. }
  25. void imx_clock_init(void)
  26. {
  27. /*
  28. * The BootROM hands off to the next stage with the internal 24 MHz XTAL
  29. * crystal already clocking the main PLL, which is very handy.
  30. * Here we should enable whichever peripherals are required for ATF and
  31. * OPTEE.
  32. *
  33. * Subsequent stages in the boot process such as u-boot and Linux
  34. * already have a significant and mature code-base around clocks, so our
  35. * objective should be to enable what we need for ATF/OPTEE without
  36. * breaking any existing upstream code in Linux and u-boot.
  37. */
  38. /* Initialize UART clocks */
  39. imx7_clock_uart_init();
  40. /* Watchdog clocks */
  41. imx7_clock_wdog_init();
  42. /* USB clocks */
  43. imx7_clock_usb_init();
  44. }