From owner-freebsd-arm@freebsd.org Tue Aug 4 13:56:13 2015 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 02CD19B21FB for ; Tue, 4 Aug 2015 13:56:13 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) by mx1.freebsd.org (Postfix) with SMTP id CCD051FD2 for ; Tue, 4 Aug 2015 13:56:12 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 4 Aug 2015 13:56:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t74Du5Rs018235; Tue, 4 Aug 2015 07:56:05 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1438696565.70393.72.camel@freebsd.org> Subject: Re: kernel entry point address [was: Hummingboard u-boot not loading?] From: Ian Lepore To: Svatopluk Kraus Cc: freebsd-arm Date: Tue, 04 Aug 2015 07:56:05 -0600 In-Reply-To: References: <20150728173831.229400355e485fa511ca388b@ulrich-grey.de> <20150801182519.4886608.58781.1809@gmail.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2015 13:56:13 -0000 On Tue, 2015-08-04 at 11:52 +0200, Svatopluk Kraus wrote: > On Tue, Aug 4, 2015 at 6:57 AM, Russell Haley wrote: > > Hello, > > > > Recap: I'm trying to get a Hummingboard with dual core pro SOM to boot > > using only HDMI output (I don't have a FTDI cable yet) . I am running a > > binary u-boot from Oleksandr. Successfullly built head yesterday. > > > > My SD Card looks like this: > > > > - 1Mb free space with uboot at 1k > > - 50Mb Fat32 partition with ubldr > > - 3.6Gb ufs partition > > > > I applied the patch for HDMI output: > > https://lists.freebsd.org/pipermail/freebsd-arm/2015-July/011912.html > > (Oleksandr via Mikael). I then ran buildkernel with the -DNOCLEAN option > > (thanks Ian!). I then mistakenly did a installkernel which takes hours on > > an SD card and overwrote everything so I couldn't tell if the files I > > wanted were actually installed (i.e. imx6_hdmi.o). I can't find any of the > > files I think I should have been added, but that could be my feeble > > understanding of file searching. > > > > Anyway, I ran it and nothing changed. I get a u-boot auto config counting > > down, I get the message *20647 bytes read in 26 ms (9.6MiB/s) *which is the > > size of ubldr, but nothing fires after that. It could the output is > > happening on a serial out, or it could be nothing is happening??? I have > > toyed with the idea of adding something to loarder.conf, but the defaults > > all seem sufficient, again, unless someone can suggest something? > > > > > Well, this just reminds me of something I dealt with recently. I'm > running FreeBSD kernel without ubldr, so u-boot loads kernel and then > jumps to kernel starting address. It turns out that kernel starting > address, which was always stable, was changed suddently and the result > was same like in your case. Thus, maybe it's worth a try to find out > how ubldr is run from u-boot and which is its starting address. > > Svata There has been some mention lately on irc of the entry point address jumping around from one kernel compile to the next (not just on arm). It may be alignment-related in the sense that a tiny change to the source requires it to split the text and data into different sections so that the data section is aligned properly. That results in an extra program header for the next section, and that makes the headers big enough to push the start of the text segment to its next alignment boundary (256 bytes iirc). It's not clear when/why this started happening, but there have been changes to the elf toolchain stuff lately. Maybe the old tools inserted some padding bytes but left text+data as one section, and now the new tool splits it into two sections (perhaps because of differences in the RWE bits that are now being honored correctly). U-boot launches ubldr using the 'bootelf' command which reads the elf headers, so it should work fine (unless maybe it fails to deal with multiple sections with the LOAD flag on). ubldr uses the elf headers in the kernel (but again I'm not sure about handling of multiple LOAD flags). -- Ian