Merge branch 'master' of git://git.denx.de/u-boot-uniphier
[oweals/u-boot.git] / arch / arm / mach-uniphier / clk / clk-ld11.c
1 /*
2  * Copyright (C) 2016 Socionext Inc.
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7 #include <common.h>
8 #include <linux/bitops.h>
9 #include <linux/io.h>
10
11 #include "../init.h"
12 #include "../sg-regs.h"
13
14 void uniphier_ld11_clk_init(void)
15 {
16         if (readl(SG_PINMON0) & BIT(27)) {
17                 /* if booted without stand-by MPU */
18
19                 writel(1, SG_ETPHYPSHUT);
20                 writel(1, SG_ETPHYCNT);
21
22                 udelay(1); /* wait for regulator level 1.1V -> 2.5V */
23
24                 writel(3, SG_ETPHYCNT);
25                 writel(3, SG_ETPHYPSHUT);
26                 writel(7, SG_ETPHYCNT);
27         }
28 }