mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/4] ARM: highbank: select OFTREE
Date: Thu, 26 Mar 2015 07:59:56 +0100	[thread overview]
Message-ID: <20150326065956.GI9742@pengutronix.de> (raw)
In-Reply-To: <91E9E3EA-7E8E-40FF-B6B5-F5AF9B7DF859@jcrosoft.com>

On Thu, Mar 26, 2015 at 11:58:12AM +0800, Jean-Christophe PLAGNIOL-VILLARD wrote:
> 
> > On Mar 26, 2015, at 4:57 AM, Lucas Stach <l.stach@pengutronix.de> wrote:
> > 
> > The board code uses quite a few OF functions and it doesn't seem
> > reasonable to run this board without DT support.
> > 
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > ---
> > arch/arm/mach-highbank/Kconfig | 1 +
> > 1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
> > index 950810b57517..8af480861c3f 100644
> > --- a/arch/arm/mach-highbank/Kconfig
> > +++ b/arch/arm/mach-highbank/Kconfig
> > @@ -9,6 +9,7 @@ choice
> > 
> > config MACH_HIGHBANK
> > 	bool "Calxeda Highbank"
> > +	select OFTREE
> > 	select HAVE_DEFAULT_ENVIRONMENT_NEW
> 
> you can run wihtout it as the oftree code is only used if you decide to use the dtb provided by the
> firmware

With CONFIG_OFTREE disabled the board fails to link:

arch/arm/boards/built-in.o: In function `highbank_mem_init':
:(.text.highbank_mem_init+0x10): undefined reference to `of_unflatten_dtb'
arch/arm/boards/built-in.o: In function `highbank_devices_init':
:(.text.highbank_devices_init+0x54): undefined reference to `of_get_fixed_tree'

Even if we had a static inline no-op wrapper for of_get_fixed_tree, the
board doesn't check the return value of of_get_fixed_tree and does this:

	fdt = of_get_fixed_tree(NULL);
	add_mem_device("dtb", (unsigned long)fdt, be32_to_cpu(fdt->totalsize),
	       IORESOURCE_MEM_WRITEABLE);

Here the code would crash with a NULL pointer derefence. So unless we
get a couple of other patches I believe Lucas' patch is correct.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-03-26  7:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 20:57 [PATCH 1/4] ARM: highbank: fix build with recent binutils Lucas Stach
2015-03-25 20:57 ` [PATCH 2/4] clk: fractional-divider: fix build with CONFIG_MODULES Lucas Stach
2015-03-25 20:57 ` [PATCH 3/4] ARM: highbank: select OFTREE Lucas Stach
2015-03-26  3:58   ` Jean-Christophe PLAGNIOL-VILLARD
2015-03-26  6:59     ` Sascha Hauer [this message]
2015-04-20  8:51       ` Lucas Stach
2015-04-20 11:20         ` Sascha Hauer
2015-03-25 20:57 ` [PATCH 4/4] usb: host: xhci: depend on HAS_DMA Lucas Stach
2015-03-26  7:01 ` [PATCH 1/4] ARM: highbank: fix build with recent binutils Sascha Hauer

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=20150326065956.GI9742@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /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