summaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3-adas/recipes-bsp/u-boot/u-boot/0012-board-ulcb-Fix-reset-command-clock-setting.patch
blob: 3ddd592933527d1e6d4806c2843f0036aa84ad38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 238ab2a2f90819ef4a050b8d2a8f1b1359e2a28a Mon Sep 17 00:00:00 2001
From: Yusuke Goda <yusuke.goda.sx@renesas.com>
Date: Thu, 11 May 2017 19:46:18 +0900
Subject: [PATCH] board: ulcb: Fix reset command clock setting

Reset command uses the power control of the PMIC via CPLD.
CPLD is connected by GPIO2 and GPIO6, so GPIO2 and GPIO6
clock need to be supplied.

Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
---
 board/renesas/ulcb/cpld.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/board/renesas/ulcb/cpld.c b/board/renesas/ulcb/cpld.c
index abc7c84..66922d7 100644
--- a/board/renesas/ulcb/cpld.c
+++ b/board/renesas/ulcb/cpld.c
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <asm/arch/prr_depend.h>
+#include <asm/arch/rcar-mstp.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 
@@ -24,6 +25,9 @@
 #define MISO	GPIO_GP_6_10
 #endif
 
+#define GP2_MSTP910   (1 << 10)
+#define GP6_MSTP906   (1 << 6)
+
 #define CPLD_ADDR_MODE		0x00 /* RW */
 #define CPLD_ADDR_MUX		0x02 /* RW */
 #define CPLD_ADDR_DIPSW6	0x08 /* R */
@@ -103,6 +107,9 @@ static void cpld_init(void)
 	val |= PUEN_SSI_SDATA4;
 	writel(val, PFC_PUEN5);
 
+	/* GPIO2, GPIO6 for reset */
+	mstp_clrbits_le32(MSTPSR9, SMSTPCR9, GP6_MSTP906 | GP2_MSTP910);
+
 	gpio_request(SCLK, NULL);
 	gpio_request(SSTBZ, NULL);
 	gpio_request(MOSI, NULL);
-- 
1.9.1