From owner-freebsd-arm@freebsd.org Mon Oct 10 14:33:38 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 85DAAC0B4BC for ; Mon, 10 Oct 2016 14:33:38 +0000 (UTC) (envelope-from freebsd-arm@herveybayaustralia.com.au) Received: from mail.unitedinsong.com.au (mail.unitedinsong.com.au [150.101.178.33]) (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 AA7FF812 for ; Mon, 10 Oct 2016 14:33:37 +0000 (UTC) (envelope-from freebsd-arm@herveybayaustralia.com.au) Received: from [192.168.0.177] (laptop3.herveybayaustralia.com.au [192.168.0.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.unitedinsong.com.au (Postfix) with ESMTPSA id 5A7C962053; Tue, 11 Oct 2016 00:33:23 +1000 (EST) Subject: Re: u-boot efi option To: Warner Losh , Emmanuel Vadot References: <36160c78-9095-f716-8041-3eb7656642af@herveybayaustralia.com.au> <20161002123700.662f2868688b4b32465395aa@bidouilliste.com> <20161003103247.78ff7596607755ce0f204648@bidouilliste.com> <20161003122309.6ab5f4b3c94c33355b682ade@bidouilliste.com> <20161006181000.b52d8a27d32dd25c31853948@bidouilliste.com> Cc: "freebsd-arm@freebsd.org" From: Da Rock Message-ID: <49e08194-d029-1156-dc5c-dee1471f9463@herveybayaustralia.com.au> Date: Tue, 11 Oct 2016 00:33:21 +1000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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, 10 Oct 2016 14:33:38 -0000 Ok, so I'm so close to getting this I can smell it! However, it seems to hang up on the boot1.efi - maybe can't find the loader/partition? No messages at all. So I've tried copying loader.efi (works for cd's apparently, so hey why not give it a shot?) and it comes up with "FreeBSD..." (yay!) then application fails with "r=-22"; no beastie or boot query. Given that loader expects itself to be in the partition booted thats fair enough - but that narrows it squarely down to boot1. I've gone back over my knowledge (using google and handbook) to check if I missed something, but I don't think so. My partitions are mbr based so all good for uboot to _not_ hang up on. The only thing I can think of is using a GPT hybrid but I'm not 100% sure of the necessity at this stage given the info available. GPT itself fails (tried) as the uboot/rpi system can't read it. So damn frustrating - I know this could work... On 07/10/2016 03:53, Warner Losh wrote: > I'd really like to merge the release and nanobsd (and crochet if they > want to use it) building methods if at all possible. > > Warner > > On Thu, Oct 6, 2016 at 10:10 AM, Emmanuel Vadot wrote: >> Good news, everyone! >> >> I've just tested without alignment and it works. >> What doesn't work is taking the snapshot or release image and doing >> EFI with it. >> I did nothing special when creating the sd card : >> >> gpart create -s mbr da0 >> gpart add -t fat16 -s 50m -a 1m da0 >> gpart show da0 >> gpart add -t freebsd da0 >> gpart create -s bsd da0s2 >> gpart add -t freebsd-ufs da0s2 >> newfs /dev/da0s2a >> newfs_msdos -F16 /dev/da0s1 >> >> Now that I know everything works I'll look at the release scripts to >> see how to adapt them for EFI. >> >> On Mon, 3 Oct 2016 07:55:37 -0600 >> Warner Losh wrote: >> >>> Sounds like we should target 12 to be EFI only then, or at least EFI >>> preferred with our infrastructure setup to cope. >>> >>> Why is there a 512k alignment requirement? Or is that just the typical >>> 512k at the start of the disk is needed for uboot issue? >>> >>> Warner >>> >>> On Mon, Oct 3, 2016 at 4:23 AM, Emmanuel Vadot wrote: >>>> On Mon, 3 Oct 2016 19:01:30 +1000 >>>> Da Rock wrote: >>>> >>>>> A few points that I'd like clarification on: >>>>> >>>>> 1. I'm not having much success on rpi3 with any images, but I'm working >>>>> on my own 64bit anyway. I'm also trying to get a handle on what the >>>>> process of running the system on the rpi3 actually is as well. Fun... :) >>>>> So the 512kb alignment, why is that an issue? Perhaps I'm a little >>>>> foggy, but isn't that simply a case of partitioning correctly? >>>> I don't know exactly to be honest, I have to read a lot of code. >>>> >>>>> 2. I should have mentioned this initially (which is why I was checking >>>>> efi status to see if I was banging on for no reason), but I'm having >>>>> trouble (still) compiling u-boot version that has the efi capability >>>>> (2016.09) - can't find . I've tried with clang (x18 error) >>>>> and gcc to no avail. I tried leveraging ports, but it is not exactly >>>>> cooperating either (I'll have to try some more diags on that). Anyone >>>>> have a clue on how to get past this? -I doesn't work, or linking to >>>>> /usr/local/include. >>>> - Install {arm,aarch64}-none-{eabi,elf}-{gcc,binutils} >>>> - cd uboot-src >>>> - gmake ARCH={arm,arm64} CROSS_COMPILE={arm,aarch64}-none-{eabi,elf}- >>>> XXX_defconfig >>>> - gmake ARCH={arm,arm64} CROSS_COMPILE={arm,aarch64}-none-{eabi,elf}- >>>> >>>> I've never tried with clang. >>>> >>>>> 3. My other query was on the EFI boot process on arm. As I understood, >>>>> the u-boot is equivalent to boot0? So that means boot1 should then be in >>>>> the fat partition? Is that what you mean by /efi/boot/bootarm.efi? Or >>>>> doesn't it need to be? >>>> U-Boot can be seen as BIOS/boot0 combined. >>>> Yes boot1.efi MUST be on the fat partition and by default an EFI >>>> firmware will load /efi/boot/boot${ARCH}.efi >>>> >>>>> Apologies if I sound like a complete goose, but I'm still new to all >>>>> things arm yet - but learning fast :) >>>> Don't worry, this motivate me more to do a page on the wiki about UEFI >>>> on arm :) >>>> >>>>> On 03/10/2016 18:32, Emmanuel Vadot wrote: >>>>>> I've never had any problem with it (I know it doesn't really answer to >>>>>> your question). >>>>>> SuSe have switch to EFI (the main developer for U-Boot >>>>>> EFI is from SuSe), OpenBSD too. >>>>>> >>>>>> The main problem right now for people to test is that the partition >>>>>> on the arm images that we provide aren't aligned for it to work. >>>>>> >>>>>> I either need to fix the bug for non 512kb-aligned partition or >>>>>> aligned them in the release scripts. >>>>>> >>>>>> Also I don't know which ports-tree re@ is using for snapshots. I think >>>>>> that they use the latest quarterly for release and stable. >>>>>> So we have to be carefull when we will switch the ports to UEFI. >>>>>> >>>>>> In the meantime don't hesitate to test with my patch. >>>>>> >>>>>> If you have the correct dtb in /dtb/ on the msdos part U-Boot will load >>>>>> it. >>>>>> For booting automatically just put boot1.efi as /efi/boot/bootarm.efi >>>>>> >>>>>> On Sun, 2 Oct 2016 16:06:37 -0600 >>>>>> Warner Losh wrote: >>>>>> >>>>>>> How long do you think until this is mature enough we can cut over to it? >>>>>>> There's issues with ubldr on newer u-boot version on some of the platforms >>>>>>> we support. If we could cut over to this, that would be great. >>>>>>> >>>>>>> Warner >>>>>>> >>>>>>> On Sun, Oct 2, 2016 at 4:37 AM, Emmanuel Vadot wrote: >>>>>>>> Hello, >>>>>>>> >>>>>>>> I've commited every needed change on our side, for uboot side you will >>>>>>>> need this patch : >>>>>>>> https://people.freebsd.org/~manu/u-boot_201609_efi.diff >>>>>>>> >>>>>>>> The only drawback is that you will need to have your partition aligned >>>>>>>> on 512kb boundaries on the mmc. >>>>>>>> >>>>>>>> I've successfully booted my beaglebone black and most of my Allwinner >>>>>>>> boards with UEFI. >>>>>>>> >>>>>>>> Some part of the uboot patch have started to be upstreamed, for >>>>>>>> the others I need to rework on some part before I upstream them. >>>>>>>> >>>>>>>> Cheers, >>>>>>>> >>>>>>>> On Sun, 2 Oct 2016 19:56:54 +1000 >>>>>>>> Da Rock wrote: >>>>>>>> >>>>>>>>> Has anyone tried this option yet? I've heard someone got it going for >>>>>>>>> slack, but I thought it sounded like it might make it easier for running >>>>>>>>> freebsd. >>>>>>>>> >>>>>>>>> I'm currently trying to build a more current u-boot to test it. >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> freebsd-arm@freebsd.org mailing list >>>>>>>>> https://lists.freebsd.org/mailman/listinfo/freebsd-arm >>>>>>>>> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" >>>>>>>> -- >>>>>>>> Emmanuel Vadot >>>>>>>> _______________________________________________ >>>>>>>> freebsd-arm@freebsd.org mailing list >>>>>>>> https://lists.freebsd.org/mailman/listinfo/freebsd-arm >>>>>>>> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" >>>> >>>> -- >>>> Emmanuel Vadot >> >> -- >> Emmanuel Vadot