clk-ld11.c 882 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (C) 2016 Socionext Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <spl.h>
  8. #include <linux/bitops.h>
  9. #include <linux/io.h>
  10. #include "../boot-mode/boot-device.h"
  11. #include "../init.h"
  12. #include "../sc64-regs.h"
  13. #include "../sg-regs.h"
  14. void uniphier_ld11_clk_init(void)
  15. {
  16. /* if booted from a device other than USB, without stand-by MPU */
  17. if ((readl(SG_PINMON0) & BIT(27)) &&
  18. spl_boot_device_raw() != BOOT_DEVICE_USB) {
  19. writel(1, SG_ETPHYPSHUT);
  20. writel(1, SG_ETPHYCNT);
  21. udelay(1); /* wait for regulator level 1.1V -> 2.5V */
  22. writel(3, SG_ETPHYCNT);
  23. writel(3, SG_ETPHYPSHUT);
  24. writel(7, SG_ETPHYCNT);
  25. }
  26. #ifdef CONFIG_USB_EHCI
  27. {
  28. /* FIXME: the current clk driver can not handle parents */
  29. u32 tmp;
  30. tmp = readl(SC_CLKCTRL4);
  31. tmp |= SC_CLKCTRL4_MIO | SC_CLKCTRL4_STDMAC;
  32. writel(tmp, SC_CLKCTRL4);
  33. }
  34. #endif
  35. }