devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Guo <shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCHv3] ARM:boot:device tree: Allow the device tree binary to be appended to zImage
Date: Wed, 20 Apr 2011 13:47:47 +0800	[thread overview]
Message-ID: <20110420054746.GA31127@S2100-06.ap.freescale.net> (raw)
In-Reply-To: <20110413140030.GE12665-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>

Hi Tony,

On Wed, Apr 13, 2011 at 05:00:30PM +0300, Tony Lindgren wrote:
> * Shawn Guo <shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org> [110328 12:10]:
> > On Thu, Mar 24, 2011 at 04:18:41PM -0700, John Bonesio wrote:
> > > This patch provides the ability to boot using a device tree that is appended
> > > to the raw binary zImage (e.g. cat zImage <filename>.dtb > zImage_w_dtb).
> > > 
> > > Signed-off-by: John Bonesio <bones-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> > > ---
> > > 
> > Tested on mx51 babbage.  The non-dt kernel works fine, but dt kernel
> > does not.
> > 
> > I tracked it down a little bit and found, before calling kernel from
> > arch/arm/boot/compressed/head.S, the dtb magic number (at address
> > pointed by r8) was interpolated to 0x73fbc000 which happens to be the
> > value of 'uart_base' assigned in plat-mxc/include/mach/uncompress.h.
> 
I got it working by remove the 'static' from uart_base definition.

> Gave this a try on an omap3 based board, looks like decompress_kernel
> will trash the first 16 bytes of the device tree data somehow.
> 
16 bytes corruption is a little beyond my guess.  I expect only 8
bytes corruption on omap3.  Can you please remove the 'static' in
uncompress.h to see if it helps?

--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -27,8 +27,8 @@

 #define MDR1_MODE_MASK                 0x07

-static volatile u8 *uart_base;
-static int uart_shift;
+volatile u8 *uart_base;
+int uart_shift;
---

Here is how I tracked it down with help from Dave Martin and Nicolas
Pitre.

http://lists.linaro.org/pipermail/linaro-kernel/2011-April/000259.html

With the comments given by Nicolas below, this seems a global issue in
platform uncompress.h.

--- quote begins ---
You must not use static variable in the decompressor.  For one thing, 
that breaks the ability to XIP the decompressor code and move writable 
data elsewhere.

So the fix is indeed to _not_ declare any global variable as static in 
this case.
--- quote ends ---

I would like to confirm it fixes your setup before I send fixing
patch to remove 'static' from global variables in all platform
uncompress.h.

-- 
Regards,
Shawn

  parent reply	other threads:[~2011-04-20  5:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 23:18 [PATCHv3] ARM:boot:device tree: Allow the device tree binary to be appended to zImage John Bonesio
2011-03-24 23:37 ` Nicolas Pitre
2011-03-28  9:13 ` Shawn Guo
2011-04-13 14:00   ` Tony Lindgren
     [not found]     ` <20110413140030.GE12665-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-04-20  5:47       ` Shawn Guo [this message]
     [not found]         ` <20110420054746.GA31127-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-04-20  7:34           ` Shawn Guo
     [not found]             ` <20110420073445.GB31127-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-04-21  8:02               ` Tony Lindgren
     [not found]                 ` <20110421080238.GE13688-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-04-21 12:46                   ` Tony Lindgren
2011-04-27 14:23                     ` Tony Lindgren
     [not found]                       ` <20110427142306.GI3755-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-04-27 14:38                         ` Tony Lindgren
2011-04-27 14:40                         ` Nicolas Pitre
     [not found]                           ` <alpine.LFD.2.00.1104271036520.24613-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-04-27 14:43                             ` Tony Lindgren
     [not found]                               ` <20110427144335.GK3755-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-04-29 10:26                                 ` Tony Lindgren
     [not found]                                   ` <20110429102623.GX3755-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-04-29 13:02                                     ` Grant Likely
     [not found]                                       ` <BANLkTi=jcb8Piki6RrijGOQG=wJ=ULv5Gw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-29 13:08                                         ` Grant Likely
2011-04-29 13:09                                         ` Tony Lindgren
     [not found]                                           ` <20110429130939.GB3755-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-04-29 13:21                                             ` Nicolas Pitre
2011-04-29 13:16                                     ` Nicolas Pitre
2011-04-29 13:53                                       ` Russell King - ARM Linux
     [not found]                                         ` <20110429135334.GR5126-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2011-04-29 19:14                                           ` Nicolas Pitre
     [not found]                                             ` <alpine.LFD.2.00.1104291509540.24613-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-05-04  7:23                                               ` Tony Lindgren
     [not found]                                                 ` <20110504072317.GU2092-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-05-04 13:12                                                   ` Tony Lindgren
2011-05-04 13:38                                                   ` Nicolas Pitre
     [not found]                                                     ` <alpine.LFD.2.00.1105040936040.24613-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-05-09 11:19                                                       ` [PATCH] ARM: Make sure appended device tree data won't overlap kernel BSS Tony Lindgren
     [not found]                                                         ` <20110509111929.GA11410-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-05-09 14:49                                                           ` Tony Lindgren
     [not found]                                                             ` <20110509144949.GE30958-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-05-12 12:59                                                               ` Tony Lindgren
     [not found]                                                                 ` <20110512125952.GN31483-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-05-13  7:39                                                                   ` Nicolas Pitre
     [not found]                                                                     ` <alpine.LFD.2.00.1105130930330.2762-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-05-13 11:21                                                                       ` Tony Lindgren
     [not found]                                                                         ` <20110513112120.GO31483-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-05-13 13:09                                                                           ` Nicolas Pitre
     [not found]                                                                             ` <alpine.LFD.2.00.1105131507150.5787-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-05-13 13:28                                                                               ` Tony Lindgren
     [not found]                                                                                 ` <20110513132802.GU31483-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-06-07 12:43                                                                                   ` Tony Lindgren
     [not found]                                                                                     ` <20110607124311.GE8696-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-06-07 13:14                                                                                       ` Nicolas Pitre
     [not found]                                                                                         ` <alpine.LFD.2.00.1106070914050.2142-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-06-07 13:22                                                                                           ` Tony Lindgren
2011-06-12  6:14                                                                           ` Nicolas Pitre
     [not found]                                                                             ` <alpine.LFD.2.00.1106120209450.2142-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-06-13 10:49                                                                               ` Tony Lindgren
2011-05-09 11:23 ` [PATCHv3] ARM:boot:device tree: Allow the device tree binary to be appended to zImage Tony Lindgren

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=20110420054746.GA31127@S2100-06.ap.freescale.net \
    --to=shawn.guo-kzfg59tc24xl57midrcfdg@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).