From owner-freebsd-arm@freebsd.org Mon Dec 5 15:01:58 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29152C68A5F for ; Mon, 5 Dec 2016 15:01:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 141C01436 for ; Mon, 5 Dec 2016 15:01:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 13404C68A5E; Mon, 5 Dec 2016 15:01:58 +0000 (UTC) Delivered-To: arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12B4AC68A5D for ; Mon, 5 Dec 2016 15:01:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FB121433 for ; Mon, 5 Dec 2016 15:01:57 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: bf3de023-bafb-11e6-9673-39b5816e8152 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id bf3de023-bafb-11e6-9673-39b5816e8152; Mon, 05 Dec 2016 15:01:50 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uB5F1h7V013797; Mon, 5 Dec 2016 08:01:43 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1480950103.1889.251.camel@freebsd.org> Subject: Re: dtb printout From: Ian Lepore To: Daniel Braniss , arm@freebsd.org Date: Mon, 05 Dec 2016 08:01:43 -0700 In-Reply-To: <7FD12DD6-B390-4EF3-811B-391798410BC0@cs.huji.ac.il> References: <7FD12DD6-B390-4EF3-811B-391798410BC0@cs.huji.ac.il> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 15:01:58 -0000 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