public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: matthias.fuchs at esd-electronics.com <matthias.fuchs@esd-electronics.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4] ppc4xx: Fix USB 2.0 phy reset sequence
Date: Tue,  7 Oct 2008 13:13:10 +0200	[thread overview]
Message-ID: <12233779903208-git-send-email-matthias.fuchs@esd-electronics.com> (raw)
In-Reply-To: <12233779903997-git-send-email-matthias.fuchs@esd-electronics.com>

From: Matthias Fuchs <matthias.fuchs@esd-electronics.com>

This patch fixes USB 2.0 communication issues on some DU440 boards.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
---
 board/esd/du440/du440.c |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/board/esd/du440/du440.c b/board/esd/du440/du440.c
index 7df2adb..6dca35d 100644
--- a/board/esd/du440/du440.c
+++ b/board/esd/du440/du440.c
@@ -169,6 +169,7 @@ int misc_init_r(void)
 	unsigned long usb2d0cr = 0;
 	unsigned long usb2phy0cr, usb2h0cr = 0;
 	unsigned long sdr0_pfc1;
+	unsigned long sdr0_srst0, sdr0_srst1;
 	int i, j;
 
 	/* adjust flash start and offset */
@@ -223,10 +224,38 @@ int misc_init_r(void)
 	mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
 	mtsdr(SDR0_USB2H0CR, usb2h0cr);
 
-	/* clear resets */
-	udelay (1000);
+	/*
+	 * Take USB out of reset:
+	 * -Initial status = all cores are in reset
+	 * -deassert reset to OPB1, P4OPB0, OPB2, PLB42OPB1 OPB2PLB40 cores
+	 * -wait 1 ms
+	 * -deassert reset to PHY
+	 * -wait 1 ms
+	 * -deassert  reset to HOST
+	 * -wait 4 ms
+	 * -deassert all other resets
+	 */
+	mfsdr(SDR0_SRST1, sdr0_srst1);
+	sdr0_srst1 &= ~(SDR0_SRST1_OPBA1 |		\
+			SDR0_SRST1_P4OPB0 |		\
+			SDR0_SRST1_OPBA2 |		\
+			SDR0_SRST1_PLB42OPB1 |		\
+			SDR0_SRST1_OPB2PLB40);
+	mtsdr(SDR0_SRST1, sdr0_srst1);
+	udelay(1000);
+
+	mfsdr(SDR0_SRST1, sdr0_srst1);
+	sdr0_srst1 &= ~SDR0_SRST1_USB20PHY;
+	mtsdr(SDR0_SRST1, sdr0_srst1);
+	udelay(1000);
+
+	mfsdr(SDR0_SRST0, sdr0_srst0);
+	sdr0_srst0 &= ~SDR0_SRST0_USB2H;
+	mtsdr(SDR0_SRST0, sdr0_srst0);
+	udelay(4000);
+
+	/* finally all the other resets */
 	mtsdr(SDR0_SRST1, 0x00000000);
-	udelay (1000);
 	mtsdr(SDR0_SRST0, 0x00000000);
 
 	printf("USB:   Host(int phy)\n");
-- 
1.5.3

  reply	other threads:[~2008-10-07 11:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-07 11:13 [U-Boot] [PATCH 1/4] ppc4xx: Update DU440 config matthias.fuchs at esd-electronics.com
2008-10-07 11:13 ` [U-Boot] [PATCH 2/4] ppc4xx: Fix DU440 GPIO configuration matthias.fuchs at esd-electronics.com
2008-10-07 11:13   ` [U-Boot] [PATCH 3/4] ppc4xx: Add strapping mode for 667MHz CPU frequency on DU440 board matthias.fuchs at esd-electronics.com
2008-10-07 11:13     ` matthias.fuchs at esd-electronics.com [this message]
2008-10-08  9:51       ` [U-Boot] [PATCH 4/4] ppc4xx: Fix USB 2.0 phy reset sequence Stefan Roese
2008-10-08 10:34         ` Matthias Fuchs
2008-10-08 11:14           ` Stefan Roese
2008-10-10  7:44       ` Stefan Roese
2008-10-10  7:44     ` [U-Boot] [PATCH 3/4] ppc4xx: Add strapping mode for 667MHz CPU frequency on DU440 board Stefan Roese
2008-10-08  9:50   ` [U-Boot] [PATCH 2/4] ppc4xx: Fix DU440 GPIO configuration Stefan Roese
2008-10-08 10:31     ` Matthias Fuchs
2008-10-08 11:14       ` Stefan Roese
2008-10-10  7:44   ` Stefan Roese
2008-10-10  7:44 ` [U-Boot] [PATCH 1/4] ppc4xx: Update DU440 config Stefan Roese

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=12233779903208-git-send-email-matthias.fuchs@esd-electronics.com \
    --to=matthias.fuchs@esd-electronics.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox