All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] ARM: rmobile: Move HSUSB configuration to board on Salvator-X
Date: Tue, 12 Sep 2017 19:07:21 +0200	[thread overview]
Message-ID: <20170912170725.29733-2-marek.vasut+renesas@gmail.com> (raw)
In-Reply-To: <20170912170725.29733-1-marek.vasut+renesas@gmail.com>

In order to use ehci-generic driver, move the configuration of HSUSB
block into the board file. This configuration should not have been in
the Gen3 EHCI USB driver in the first place, so move it to the board
file until there is a proper infrastructure and driver for the HSUSB
block.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 board/renesas/salvator-x/salvator-x.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/board/renesas/salvator-x/salvator-x.c b/board/renesas/salvator-x/salvator-x.c
index e260117802..37fcbbd448 100644
--- a/board/renesas/salvator-x/salvator-x.c
+++ b/board/renesas/salvator-x/salvator-x.c
@@ -55,6 +55,7 @@ void s_init(void)
 #define SD1_MSTP313		BIT(13)
 #define SD2_MSTP312		BIT(12)	/* either MMC0 */
 #define SD3_MSTP311		BIT(11)	/* either MMC1 */
+#define HSUSB_MSTP704		BIT(4)	/* HSUSB */
 
 #define SD0CKCR			0xE6150074
 #define SD1CKCR			0xE6150078
@@ -92,6 +93,13 @@ int board_early_init_f(void)
 /* -/W 32 Power resume control register 2 (3DG) */
 #define	SYSC_PWRONCR2	0xE618010C
 
+/* HSUSB block registers */
+#define HSUSB_REG_LPSTS			0xE6590102
+#define HSUSB_REG_LPSTS_SUSPM_NORMAL	BIT(14)
+#define HSUSB_REG_UGCTRL2		0xE6590184
+#define HSUSB_REG_UGCTRL2_USB0SEL	0x30
+#define HSUSB_REG_UGCTRL2_USB0SEL_EHCI	0x10
+
 int board_init(void)
 {
 	/* adress of boot parameters */
@@ -116,6 +124,14 @@ int board_init(void)
 	/* USB1 pull-up */
 	setbits_le32(PFC_PUEN6, PUEN_USB1_OVC | PUEN_USB1_PWEN);
 
+	/* Configure the HSUSB block */
+	mstp_clrbits_le32(MSTPSR7, SMSTPCR7, HSUSB_MSTP704);
+	/* Choice USB0SEL */
+	clrsetbits_le32(HSUSB_REG_UGCTRL2, HSUSB_REG_UGCTRL2_USB0SEL,
+			HSUSB_REG_UGCTRL2_USB0SEL_EHCI);
+	/* low power status */
+	setbits_le16(HSUSB_REG_LPSTS, HSUSB_REG_LPSTS_SUSPM_NORMAL);
+
 #ifdef CONFIG_RENESAS_RAVB
 	/* EtherAVB Enable */
 	/* GPSR2 */
-- 
2.11.0

  reply	other threads:[~2017-09-12 17:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12 17:07 [U-Boot] [PATCH 1/6] ARM: rmobile: dts: Add EHCI USB nodes to r8a7796 Marek Vasut
2017-09-12 17:07 ` Marek Vasut [this message]
2017-09-22 22:14   ` [U-Boot] [PATCH 2/6] ARM: rmobile: Move HSUSB configuration to board on Salvator-X Nobuhiro Iwamatsu
2017-09-12 17:07 ` [U-Boot] [PATCH 3/6] ARM: rmobile: Move HSUSB configuration to board on ULCB Marek Vasut
2017-09-22 22:15   ` Nobuhiro Iwamatsu
2017-09-12 17:07 ` [U-Boot] [PATCH 4/6] ARM: rmobile: Enable EHCI generic on Salvator-X Marek Vasut
2017-09-22 22:16   ` Nobuhiro Iwamatsu
2017-09-12 17:07 ` [U-Boot] [PATCH 5/6] ARM: rmobile: Enable EHCI generic on ULCB Marek Vasut
2017-09-22 22:16   ` Nobuhiro Iwamatsu
2017-09-12 17:07 ` [U-Boot] [PATCH 6/6] usb: Drop the EHCI RCar Gen3 Marek Vasut
2017-09-24  5:46   ` Nobuhiro Iwamatsu
2017-09-22 22:15 ` [U-Boot] [PATCH 1/6] ARM: rmobile: dts: Add EHCI USB nodes to r8a7796 Nobuhiro Iwamatsu
2017-09-26 18:06 Marek Vasut
2017-09-26 18:06 ` [U-Boot] [PATCH 2/6] ARM: rmobile: Move HSUSB configuration to board on Salvator-X Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170912170725.29733-2-marek.vasut+renesas@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.