From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 24 Nov 2014 21:21:24 -0700 Subject: [U-Boot] Raspberry Pi with driver model In-Reply-To: References: Message-ID: <547403C4.3030707@nvidia.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/24/2014 08:58 AM, Simon Glass wrote: > Hi Stephen, > > There was another thread where you reported a hang when booting > Raspberry Pi with driver model. It can be repeated by applying this > patch and trying to boot with syslinux. > > http://patchwork.ozlabs.org/patch/392180/ > > When it hangs, the HDMI display displays lots of spaces, then lots of > dots, scrolling forever. The serial console displays nothing further. > > I narrowed the problem down to writing to address 0. So it is easy to > repeat with something like 'mw 0 0'. > > However I'm really not sure what is going on. Something with driver > model seems to make address 0 sensitive to writes. I can't see what > that might be, but I don't understand the platform very well. Do you > have any ideas? The problem seems to be that inside pl01x_serial_probe() (well, I assume all serial functions), dev_get_priv() returns 0, which ends up using address 0 as the UART address since that's the first field in struct pl01x_priv. I found this by amending pl01x_serial_probe() as follows, and dumping the data after boot: uint32_t *log = (uint32_t *)(128*1024*1024); uint32_t log_i = 1; static int pl01x_serial_probe(struct udevice *dev) { struct pl01x_serial_platdata *plat = dev_get_platdata(dev); struct pl01x_priv *priv = dev_get_priv(dev); log[log_i++] = (uint32_t)dev; log[log_i++] = (uint32_t)plat; log[log_i++] = (uint32_t)priv; log[0] = log_i; priv->regs = (struct pl01x_regs *)plat->base; priv->type = plat->type; return pl01x_generic_serial_init(priv->regs, priv->type); } U-Boot> md.l 0x08000000 08000000: 00000007 07fffaf8 0003972c 00000000 ........,....... 08000010: 1db4e108 1df8372c 00000000 00000000 ....,7.......... It seems a bit odd that pl01x_serial_probe() is called twice, but perhaps that's expected?