From owner-freebsd-arm@freebsd.org Tue Dec 6 09:17:29 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 C9CCEC69F95 for ; Tue, 6 Dec 2016 09:17:29 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id B8FC7114 for ; Tue, 6 Dec 2016 09:17:29 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: by mailman.ysv.freebsd.org (Postfix) id B8522C69F93; Tue, 6 Dec 2016 09:17:29 +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 B7F60C69F92 for ; Tue, 6 Dec 2016 09:17:29 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.116.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77FD3113; Tue, 6 Dec 2016 09:17:29 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from bach.cs.huji.ac.il ([132.65.81.13]) by kabab.cs.huji.ac.il with esmtp id 1cEBsG-000D6M-O3; Tue, 06 Dec 2016 11:17:20 +0200 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: ubldr, was Re: dtb printout From: Daniel Braniss In-Reply-To: <1480950103.1889.251.camel@freebsd.org> Date: Tue, 6 Dec 2016 11:17:20 +0200 Cc: arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <93729768-D887-4568-8686-FE691A881BC6@cs.huji.ac.il> References: <7FD12DD6-B390-4EF3-811B-391798410BC0@cs.huji.ac.il> <1480950103.1889.251.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3251) 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: Tue, 06 Dec 2016 09:17:29 -0000 > On 5 Dec 2016, at 17:01, Ian Lepore wrote: >=20 > 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? >>=20 >> the longer version: >> I am developing on several different arm boards, rpi, rpi2, orangepi- >> one, orange-pc, to mention=20 >> 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. >>=20 >> cheers, >> danny >=20 > 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.) >=20 > To see the contents of the dtb, use ofwdump. The output is not > especially pretty. There is a manpage for it. >=20 > To just get a quick reminder of which file was loaded, create a > /boot/loader.rc.local (<-- .rc not .conf) that contains > =20 > ubenv import fdtfile fdt_file >=20 > Then in the running system you can use kenv and you'll see >=20 > uboot.fdtfile=3D"bcm2835-rpi-b-rev2.dtb" >=20 > Unfortunately, some u-boots use fdtfile, some use fdt_file. Grrr. >=20 > 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). >=20 > =E2=80=94 Ian >=20 as usual, I get more than I bargained for :-) on rpi adding ubenv import worked, but on orange/allwinner I got a = =E2=80=98syntax error=E2=80=99, I tried to upgrade the ubldr, but so far i get: U-Boot SPL 2016.09 (Dec 05 2016 - 15:02:38) DRAM: 1024 MiB Trying to boot from MMC1 U-Boot 2016.09 (Dec 05 2016 - 15:02:38 +0200) Allwinner Technology CPU: Allwinner H3 (SUN8I 1680) Model: Xunlong Orange Pi PC I2C: ready DRAM: 1 GiB WARNING: Caches not enabled MMC: SUNXI SD/MMC: 0 reading u-boot.env ** Unable to read "u-boot.env" from mmc0:1 ** Using default environment In: serial Out: serial Err: serial Net: phy interface0 eth0: ethernet@1c30000 starting USB... USB0: USB EHCI 1.00 USB1: USB OHCI 1.0 USB2: USB EHCI 1.00 USB3: USB OHCI 1.0 USB4: USB EHCI 1.00 USB5: USB OHCI 1.0 scanning bus 0 for devices... 1 USB Device(s) found scanning bus 2 for devices... 1 USB Device(s) found scanning bus 4 for devices... 1 USB Device(s) found Hit any key to stop autoboot: 0=20 Booting from: mmc 0 ubldr.bin reading ubldr.bin 223912 bytes read in 53 ms (4 MiB/s) ## No elf image at address 0x42000000 ## Starting application at 0x42000000 ...