]>
git.ipfire.org Git - people/ms/u-boot.git/blob - arch/arm/mach-uniphier/clk/clk-ld11.c
2 * Copyright (C) 2016 Socionext Inc.
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <linux/bitops.h>
13 #include "../sc64-regs.h"
14 #include "../sg-regs.h"
16 #define SDCTRL_EMMC_HW_RESET 0x59810280
18 void uniphier_ld11_clk_init(void)
20 /* if booted from a device other than USB, without stand-by MPU */
21 if ((readl(SG_PINMON0
) & BIT(27)) &&
22 uniphier_boot_device_raw() != BOOT_DEVICE_USB
) {
23 writel(1, SG_ETPHYPSHUT
);
24 writel(1, SG_ETPHYCNT
);
26 udelay(1); /* wait for regulator level 1.1V -> 2.5V */
28 writel(3, SG_ETPHYCNT
);
29 writel(3, SG_ETPHYPSHUT
);
30 writel(7, SG_ETPHYCNT
);
33 /* TODO: use "mmc-pwrseq-emmc" */
34 writel(1, SDCTRL_EMMC_HW_RESET
);
36 #ifdef CONFIG_USB_EHCI_HCD
38 /* FIXME: the current clk driver can not handle parents */
42 tmp
= readl(SC_CLKCTRL4
);
43 tmp
|= SC_CLKCTRL4_MIO
| SC_CLKCTRL4_STDMAC
;
44 writel(tmp
, SC_CLKCTRL4
);
46 for (ch
= 0; ch
< 3; ch
++) {
47 void __iomem
*phyctrl
= (void __iomem
*)SG_USBPHYCTRL
;
49 writel(0x82280600, phyctrl
+ 8 * ch
);
50 writel(0x00000106, phyctrl
+ 8 * ch
+ 4);