On Tue, Jun 14, 2016 at 08:29:09AM +0200, Matthieu Herrb wrote:
> On Mon, Jun 13, 2016 at 12:43:59PM +0200, Mark Kettenis wrote:
> > > Date: Sun, 12 Jun 2016 19:48:24 +0200
> > > From: Matthieu Herrb <[email protected]>
> > > 
> > > Hi,
> > > 
> > > I'm trying to convert my SabreLite board to boot via efiboot, but
> > > without success so far.
> > > 
> > > I'm using the nitrogen6q u-boot from ports
> > > 
> > > the boot loader is loaded and runs but it
> > > fails to find the sata disk to load the kernel:
> > > 
> > > => fatload sata 0:1 0x10800000 efi/boot/bootarm.efi
> > > reading efi/boot/bootarm.efi
> > > 65556 bytes read in 9 ms (6.9 MiB/s)
> > > => fatload sata 0:1 0x13000000 imx6q-sabrelite.dtb
> > > reading imx6q-sabrelite.dtb
> > > 36834 bytes read in 8 ms (4.4 MiB/s)
> > > =>  bootefi 0x10800000 0x13000000
> > > ## Starting EFI application at 0x10800000 ...
> > > Scanning disks on sata...
> > > Scanning disks on usb...
> > > Scanning disks on mmc...
> > > MMC: no card present
> > > MMC Device 2 not found
> > > MMC Device 3 not found
> > > Found 2 disks
> > 
> > The firmware found 2 disks.  Perhaps there is something wrong with
> > efiboot boot device selection code.  And unfortunately efiboot doesn't
> > currently support selecting alternative boot devices.
> > 
> > > >> OpenBSD/armv7 BOOTARM 0.1
> > > boot> 
> > > cannot open sd0a:/etc/random.seed: Device not configured
> > > booting sd0a:/bsd: open sd0a:/bsd: Device not configured
> > >  failed(6). will try /bsd
> > > boot>
> > 
> > This suggests that we actually didn't find the boot device.  So the
> > problem might be that the boot device selection code in efiboot
> > doesn't work for SATA devices.
> 
> I played a bit with the u-boot sources, and rebuilt it with the patch
> below to print the devname of the disks it found. I get:
> 
> => bootefi 0x10800000 0x13000000
> ## Starting EFI application at 0x10800000 ...
> Scanning disks on sata...
> Found 'sata0'
> Scanning disks on usb...
> Scanning disks on mmc...
> Found 'mmc0'
> MMC: no card present
> MMC Device 2 not found
> MMC Device 3 not found
> Found 2 disks
> ยป OpenBSD/armv7 BOOTARM 0.1
> boot>
> booting sd0a:/bsd: open sd0a:/bsd: Device not configured
>  failed(6). will try /bsd
> 
> so the sata0 disk is found. now I lost track of how this is passed to
> the bootloader. Any hint ?

I'd look at efi_diskprobe() in sys/arch/armv7/stand/efiboot/efiboot.c
with http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf

There is likely some way to skip the mmc disk (that isn't actually
present?)

> 
> --- lib/efi_loader/efi_disk.c~        Mon May 16 16:40:32 2016
> +++ lib/efi_loader/efi_disk.c Sun Jun 12 17:22:22 2016
> @@ -242,6 +242,7 @@
>                       snprintf(devname, sizeof(devname), "%s%d",
>                                cur_drvr->name, i);
>                       efi_disk_add_dev(devname, cur_drvr, desc, i, 0);
> +                     printf("Found '%s'\n", devname);
>                       disks++;
>  
>                       /*
> 
> -- 
> Matthieu Herrb


Reply via email to