public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Chin Liang See <clsee@altera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Newbie SPL question for socfpga_sockit
Date: Wed, 13 Apr 2016 17:25:36 +0800	[thread overview]
Message-ID: <1460539536.1801.15.camel@altera.com> (raw)
In-Reply-To: <570D1E29.1060905@denx.de>

On Tue, 2016-04-12 at 18:11 +0200, Marek Vasut wrote:
> On 04/12/2016 06:08 PM, Dinh Nguyen wrote:
> > 
> > 
> > On 04/12/2016 11:00 AM, Marek Vasut wrote:
> > > On 04/12/2016 05:53 PM, Dinh Nguyen wrote:
> > > > 
> > > > 
> > > > On 04/07/2016 06:31 PM, George Broz wrote:
> > > > > On 7 April 2016 at 13:39, Marek Vasut <marex@denx.de> wrote:
> > > > > > On 04/07/2016 03:14 PM, George Broz wrote:
> > > > > > > On 6 April 2016 at 19:05, Marek Vasut <marex@denx.de>
> > > > > > > wrote:
> > > > > > > > On 04/07/2016 03:42 AM, George Broz wrote:
> > > > > > > > 
> > > > > > > > Hi,
> > > > > > > > 
> > > > > > > > > > > U-Boot SPL 2016.03 (Apr 05 2016 - 17:57:23)
> > > > > > > > > > > drivers/ddr/altera/sequencer.c: Preparing to
> > > > > > > > > > > start memory calibration
> > > > > > > > > > > drivers/ddr/altera/sequencer.c: CALIBRATION
> > > > > > > > > > > PASSED
> > > > > > > > > > > drivers/ddr/altera/sequencer.c: Calibration
> > > > > > > > > > > complete
> > > > > > > > > > > Trying to boot from MMC1
> > > > > > > > > > > 
> > > > > > > > > > > First time that an SPL built from a recent
> > > > > > > > > > > version has run successfully
> > > > > > > > > > > on that board.
> > > > > > > > > > > 
> > > > > > > > > > > Will try it out on de0 tomorrow morning...
> > > > > > > > > > 
> > > > > > > > > > This is great news, thanks!
> > > > > > > > > 
> > > > > > > > > This patch also fixes the intermittent SDRAM
> > > > > > > > > calibration failures on my
> > > > > > > > > de0_nano_soc board. Thanks so much!
> > > > > > > > 
> > > > > > > > Great
> > > > > > > > 
> > > > > > > > > Now with up-to-date versions of SPL and image... I
> > > > > > > > > have some
> > > > > > > > > USB questions/news/observations:
> > > > > > > > > 
> > > > > > > > > When using an OTG cable between USB port and mass
> > > > > > > > > storage
> > > > > > > > > device, the de0_nano_soc board is able to detect and
> > > > > > > > > access some USB
> > > > > > > > > sticks. The detection with these is almost immediate
> > > > > > > > > from when 'usb start'
> > > > > > > > > is entered. If the same (working) USB stick is used
> > > > > > > > > with a non-OTG cable,
> > > > > > > > > I get the timeout messages from before:
> > > > > > > > > 
> > > > > > > > > dwc_otg_core_host_init: Timeout!
> > > > > > > > > dwc_otg_core_host_init: Timeout!
> > > > > > > > > 
> > > > > > > > > and this is true even if I add 'dr_mode = "host" '
> > > > > > > > 
> > > > > > > > I don't think the driver supports the dr_mode property
> > > > > > > > yet. Patch is
> > > > > > > > welcome.
> > > > > > > > 
> > > > > > > > > to the dts for usb1
> > > > > > > > > of the de0
> > > > > > > > > (and rebuild/reload). The older SPL/image that ships
> > > > > > > > > from the Terasic factory
> > > > > > > > > detects USB sticks with a non-OTG cable, (the cable
> > > > > > > > > that ships with the unit).
> > > > > > > > > What is the correct "expected" behavior here?? Is an
> > > > > > > > > OTG cable required or
> > > > > > > > > not?
> > > > > > > > 
> > > > > > > > The DWC2 driver tests the value of the OTG ID pin, so
> > > > > > > > if you don't use
> > > > > > > > OTG cable with correct ID pin setup, the host won't
> > > > > > > > work.
> > > > > > > > 
> > > > > > > > > Even with the OTG cable, some USB sticks "fail" in a
> > > > > > > > > not-so-great way.
> > > > > > > > > I have a Kingston stick and the sequence goes like
> > > > > > > > > this:
> > > > > > > > > 
> > > > > > > > > => usb reset
> > > > > > > > > resetting USB...
> > > > > > > > > USB0:   Core Release: 2.93a
> > > > > > > > > scanning bus 0 for devices...
> > > > > > > > > 
> > > > > > > > > <<< 1 minute, 41 seconds pass before >>>
> > > > > > > > > ... Device NOT ready
> > > > > > > > >    Request Sense returned 00 00 00
> > > > > > > > > 
> > > > > > > > >  <<< then another  24 seconds pass before >>>
> > > > > > > > > 
> > > > > > > > > 2 USB Device(s) found
> > > > > > > > > 
> > > > > > > > > It was able to read some information about the stick:
> > > > > > > > > 
> > > > > > > > > => usb info
> > > > > > > > > :
> > > > > > > > > 2: Mass Storage,  USB Revision 2.0
> > > > > > > > > - Kingston DataTraveler SE9 0014857749E5ECB0173000D3
> > > > > > > > > - Class: (from Interface) Mass Storage
> > > > > > > > > - PacketSize: 64  Configurations: 1
> > > > > > > > > - Vendor: 0x0930  Product 0x6545 Version 1.0
> > > > > > > > >    Configuration: 1
> > > > > > > > >    - Interfaces: 1 Bus Powered 200mA
> > > > > > > > >      Interface: 0
> > > > > > > > >      - Alternate Setting 0, Endpoints: 2
> > > > > > > > >      - Class Mass Storage, Transp. SCSI, Bulk only
> > > > > > > > >      - Endpoint 1 In Bulk MaxPacket 512
> > > > > > > > >      - Endpoint 2 Out Bulk MaxPacket 512
> > > > > > > > > 
> > > > > > > > > BUT, the stick cannot be accessed otherwise, for
> > > > > > > > > example:
> > > > > > > > > 
> > > > > > > > > => usb part 0
> > > > > > > > > ## Unknown partition table type 0
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > Is there any feature of the USB stick that would
> > > > > > > > > indicate
> > > > > > > > > whether or not it is "compatible" with u-boot?
> > > > > > > > 
> > > > > > > > Can you do "dcache off" before you do "usb reset" and
> > > > > > > > see if thusb at fixes
> > > > > > > > the problem ?
> > > > > > > 
> > > > > > > The behavior is unchanged if "dcache off" done before
> > > > > > > "usb reset".
> > > > > > 
> > > > > > Try with the attached patch (and probably with dcache off)
> > > > > 
> > > > > The patch applied cleanly. The behavior is unchanged with
> > > > > both
> > > > > dcache on and off. The "good" sticks still work, and "bad"
> > > > > sticks still don't.
> > > > > 
> > > > 
> > > > Not sure if this helps, but with this patch and dcache off, my
> > > > "bad"
> > > > stick (SanDisk Cruzer U 4C530200250418114310) is now working.
> > > 
> > > You mean the revert is needed on SoCFPGA, right ? I tried bashing
> > > Stefan
> > > about the patch a bit and I am tempted to just revert it for now,
> > > since
> > > there seems to be no time to repair it proper :(
> > > 
> > 
> > Yes, I applied your attached patch as is, not realizing it was a
> > revert
> > of 'c998da0d "usb: Change power-on / scanning timeout handling"'.
> > 
> > I also tested with a revert as well.
> 
> Grumble ... I will either look into the patch or revert it. I am not
> sure yet. Still, the dcache issue is not gone even with the DDR
> patches.
> 

Yup, same to my case. The DDR works as can boot to Linux at CV socdk
but still same issue with USB. I am still suspecting the issue between
the cache and DDR area. 

With that, I tried to patch both L1 and L2 cache auxiliary register but
doesn't help. Attaching the change here and hope can spark some
thoughts.



diff --git a/arch/arm/include/asm/pl310.h
b/arch/arm/include/asm/pl310.h
index d588f94..8c1d217 100644
--- a/arch/arm/include/asm/pl310.h
+++ b/arch/arm/include/asm/pl310.h
@@ -17,8 +17,11 @@
#define L2X0_CTRL_EN                           1
 
#define L310_SHARED_ATT_OVERRIDE_ENABLE                (1 << 22)
+#define L310_AUX_CTRL_FULL_LINE_ZERO_MASK      (1 << 0)
+#define L310_AUX_CTRL_NS_LOCKDOWN_MASK         (1 << 26)
#define L310_AUX_CTRL_DATA_PREFETCH_MASK       (1 << 28)
#define L310_AUX_CTRL_INST_PREFETCH_MASK       (1 << 29)
+#define L310_AUX_CTRL_EARLY_BRESP_MASK         (1 << 30)
 
struct pl310_regs {
        u32 pl310_cache_id;
diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach
-socfpga/misc.c
index dd05e14..f67ab0b 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -53,6 +53,13 @@ void enable_caches(void)
 
void v7_outer_cache_enable(void)
{
+       u32 acr;
+
+       /* Read ACR */
+       asm volatile ("mrc p15, 0, %0, c1, c0, 1" : "=r" (acr));
+       acr |= (0x7 << 1);
+       v7_arch_cp15_set_acr(acr, 0, 0, 0, 0);
+
        /* Disable the L2 cache */
        clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
 
@@ -60,6 +67,9 @@ void v7_outer_cache_enable(void)
        setbits_le32(&pl310->pl310_aux_ctrl,
                     L310_AUX_CTRL_DATA_PREFETCH_MASK |
                     L310_AUX_CTRL_INST_PREFETCH_MASK |
+                    L310_AUX_CTRL_EARLY_BRESP_MASK |
+                    L310_AUX_CTRL_NS_LOCKDOWN_MASK |
+                    L310_AUX_CTRL_FULL_LINE_ZERO_MASK |
                     L310_SHARED_ATT_OVERRIDE_ENABLE);
 
        /* Enable the L2 cache */

  reply	other threads:[~2016-04-13  9:25 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 21:54 [U-Boot] Newbie SPL question for socfpga_sockit George Broz
2016-02-18  2:45 ` Phil Reid
2016-03-02  2:40   ` George Broz
2016-03-02  3:49     ` Phil Reid
2016-03-03  6:49       ` George Broz
2016-03-03  7:11         ` Phil Reid
2016-03-03 14:57           ` George Broz
2016-03-09  1:42             ` Phil Reid
2016-03-09 10:55               ` Marek Vasut
2016-03-09 16:06                 ` George Broz
2016-03-16  1:29                   ` George Broz
2016-03-16 16:17                     ` George Broz
2016-03-17  1:35                       ` Marek Vasut
2016-03-18 18:59                         ` George Broz
2016-03-18 19:32                           ` Marek Vasut
2016-03-18 21:22                             ` George Broz
2016-03-19 11:10                               ` Phil Reid
2016-03-20 16:44                                 ` Marek Vasut
2016-03-20 16:49                               ` Marek Vasut
2016-03-29  1:56                                 ` George Broz
2016-03-29 17:46                                   ` Marek Vasut
2016-03-20 15:55                         ` Dinh Nguyen
2016-03-20 16:42                           ` Marek Vasut
2016-03-22 17:06                             ` Dinh Nguyen
2016-03-26 20:52                               ` Marek Vasut
2016-04-05  8:33                                 ` Phil Reid
2016-04-05 22:03                                   ` Marek Vasut
2016-04-06  0:31                                     ` George Broz
2016-04-06  0:45                                       ` Marek Vasut
2016-04-06  1:17                                         ` George Broz
2016-04-06 10:43                                           ` Marek Vasut
2016-04-07  1:42                                             ` George Broz
2016-04-07  2:05                                               ` Marek Vasut
2016-04-07 13:14                                                 ` George Broz
2016-04-07 20:39                                                   ` Marek Vasut
2016-04-07 23:31                                                     ` George Broz
2016-04-07 23:36                                                       ` Marek Vasut
2016-04-07 23:51                                                         ` George Broz
2016-04-08  5:16                                                           ` Stefan Roese
2016-04-08 12:36                                                             ` Marek Vasut
2016-04-08 22:40                                                               ` George Broz
2016-04-10 17:47                                                                 ` Marek Vasut
2016-04-11  2:03                                                                   ` George Broz
2016-04-11 14:02                                                                     ` Marek Vasut
2016-04-12 15:53                                                       ` Dinh Nguyen
2016-04-12 16:00                                                         ` Marek Vasut
2016-04-12 16:08                                                           ` Dinh Nguyen
2016-04-12 16:11                                                             ` Marek Vasut
2016-04-13  9:25                                                               ` Chin Liang See [this message]
2016-04-12 16:09                                                           ` Stefan Roese
2016-04-13 11:09                                                             ` Marek Vasut
2016-04-06  7:00                                     ` Phil Reid
2016-04-06 11:51                                       ` Marek Vasut
2016-04-06 15:04                                         ` Phil Reid
2016-04-06 20:38                                           ` Marek Vasut
2016-03-29  1:44                           ` George Broz
2016-03-29 17:45                             ` Marek Vasut
2016-03-03 21:16           ` George Broz
2016-03-02 22:54     ` Dinh Nguyen
2016-03-02 23:04       ` Marek Vasut
2016-03-02 23:08       ` Dinh Nguyen
2016-03-02 23:24         ` Marek Vasut
2016-03-03 14:48           ` Dinh Nguyen
2016-03-03 14:51             ` Marek Vasut
2016-03-03 22:00               ` George Broz
2016-03-03 22:09                 ` Marek Vasut
     [not found]                   ` <CAMcKmiG8OMmbZ262n8gL7eM=WAgaakaZ5rWzCC1vYu7yzGBYAA@mail.gmail.com>
     [not found]                     ` <56D8BDD7.8070604@denx.de>
     [not found]                       ` <CAMcKmiGrZ94sZKY85Y3aC1_fwgV8oJeAJ0O71bY=gMxUGBp=FQ@mail.gmail.com>
     [not found]                         ` <56D8C3A0.9020204@denx.de>
2016-03-03 23:46                           ` George Broz
2016-03-04 16:52                   ` Dinh Nguyen
2016-03-04 16:06           ` Dinh Nguyen
2016-03-04 19:03             ` Marek Vasut
2016-03-21 14:05               ` Chin Liang See
2016-03-21 15:45                 ` Chin Liang See
2016-03-23 15:00                   ` Chin Liang See
2016-03-23 15:37                     ` [U-Boot] SoCFPGA cache / S-bit problem - was " Stefan Roese
2016-04-06 16:35                       ` Dinh Nguyen
2016-04-06 16:46                         ` Marek Vasut
2016-04-06 16:51                           ` Dinh Nguyen
2016-03-03  6:55       ` [U-Boot] " George Broz
2016-03-03  9:48         ` 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=1460539536.1801.15.camel@altera.com \
    --to=clsee@altera.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