Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Dec 2016 08:01:43 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Daniel Braniss <danny@cs.huji.ac.il>, arm@freebsd.org
Subject:   Re: dtb printout
Message-ID:  <1480950103.1889.251.camel@freebsd.org>
In-Reply-To: <7FD12DD6-B390-4EF3-811B-391798410BC0@cs.huji.ac.il>
References:  <7FD12DD6-B390-4EF3-811B-391798410BC0@cs.huji.ac.il>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2016-12-05 at 15:48 +0200, Daniel Braniss wrote:
> Hi,
> the short version:
> 	is there a way to obtain the dtb from the kernel?
> 
> the longer version:
> I am developing on several different arm boards, rpi, rpi2, orangepi-
> one, orange-pc, to mention 
> a few, and each one has a different u-boot, ubldr, dtb, and I keep
> loosing track :-(
> I find myself too often wondering which ddb file got loaded.
> 
> cheers,
> 	danny

First:  each one does NOT have a different ubldr.  All ubldr.bin files
are the same, they're not board-specific anymore.  (The elf versions,
ubldr without the .bin, may have a different load address in the elf
header, but other than that, they're identical too and can actually be
loaded at any address.)

To see the contents of the dtb, use ofwdump.  The output is not
especially pretty.  There is a manpage for it.

To just get a quick reminder of which file was loaded, create a
/boot/loader.rc.local (<-- .rc not .conf) that contains
  
  ubenv import fdtfile fdt_file

Then in the running system you can use kenv and you'll see

  uboot.fdtfile="bcm2835-rpi-b-rev2.dtb"

Unfortunately, some u-boots use fdtfile, some use fdt_file.  Grrr.

You can, of course, use that ubenv import thing to pull any variable
from the uboot environment into the kernel environment.  If you just
say ubenv import without naming a variable, you get all the vars
(including vars that contain scripts, which is kind of messy).

-- Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1480950103.1889.251.camel>