[U-Boot] [PATCH] disk: part_dos: Use the original allocation scheme for the SPL case

Jonathan Gray jsg at jsg.id.au
Sat Oct 7 13:20:11 UTC 2017


On Sat, Oct 07, 2017 at 08:23:31AM -0400, Rob Clark wrote:
> On Fri, Oct 6, 2017 at 10:08 PM, Jonathan Gray <jsg at jsg.id.au> wrote:
> > On Fri, Oct 06, 2017 at 08:21:26AM -0400, Rob Clark wrote:
> >> On Fri, Oct 6, 2017 at 12:35 AM, Jonathan Gray <jsg at jsg.id.au> wrote:
> >> > On Thu, Oct 05, 2017 at 05:05:49AM -0400, Rob Clark wrote:
> >> >> On Thu, Oct 5, 2017 at 12:36 AM, Jonathan Gray <jsg at jsg.id.au> wrote:
> >> >> > On Wed, Oct 04, 2017 at 01:12:48PM -0400, Rob Clark wrote:
> >> >> >> On Wed, Oct 4, 2017 at 12:29 PM, Fabio Estevam <fabio.estevam at nxp.com> wrote:
> >> >> >> > Since commit ff98cb90514d ("part: extract MBR signature from partitions")
> >> >> >> > SPL boot on i.MX6 starts to fail:
> >> >> >> >
> >> >> >> > U-Boot SPL 2017.09-00221-g0d6ab32 (Oct 02 2017 - 15:13:19)
> >> >> >> > Trying to boot from MMC1
> >> >> >> > (keep in loop)
> >> >> >> >
> >> >> >> > Use the original allocation scheme for the SPL case, so that MX6 boards
> >> >> >> > can boot again.
> >> >> >> >
> >> >> >> > This is a temporary solution to avoid the boot regression.
> >> >> >> >
> >> >> >> > Signed-off-by: Fabio Estevam <fabio.estevam at nxp.com>
> >> >> >> > ---
> >> >> >> > Hi Tom,
> >> >> >> >
> >> >> >> > I do not have time this week to further investigate and narrow down
> >> >> >> > this problem.
> >> >> >> >
> >> >> >> > Using the old allocation scheme fixes the mx6 SPL boot problem.
> >> >> >> >
> >> >> >>
> >> >> >> Hi Tom, if you are ok with this as a temporary fix, then this is:
> >> >> >>
> >> >> >> Acked-by: Rob Clark <robdclark at gmail.com>
> >> >> >>
> >> >> >> I'm getting some help from some of the fedora-arm folks so hopefully I
> >> >> >> can get some idea what is going wrong, but I'd like to unblock folks
> >> >> >> w/ mx6 boards..
> >> >> >>
> >> >> >> BR,
> >> >> >> -R
> >> >> >
> >> >> > This does not seem to be a complete fix, cubox is still broken when
> >> >> > U-Boot proper loads, unless the efi loader commits are to blame
> >> >> > for introducing unaligned accesses.
> >> >> >
> >> >> > Works with 2017.09.
> >> >> >
> >> >> > U-Boot SPL 2017.11-rc1-00026-g14b55fc833 (Oct 05 2017 - 15:17:47)
> >> >> > Trying to boot from MMC1
> >> >> >
> >> >> >
> >> >> > U-Boot 2017.11-rc1-00026-g14b55fc833 (Oct 05 2017 - 15:17:47 +1100)
> >> >> >
> >> >> > CPU:   Freescale i.MX6Q rev1.5 996 MHz (running at 792 MHz)
> >> >> > CPU:   Extended Commercial temperature grade (-20C to 105C) at 34C
> >> >> > Reset cause: WDOG
> >> >> > Board: MX6 Cubox-i
> >> >> > DRAM:  2 GiB
> >> >> > MMC:   FSL_SDHC: 0
> >> >> > *** Warning - bad CRC, using default environment
> >> >> >
> >> >> > No panel detected: default to HDMI
> >> >> > Display: HDMI (1024x768)
> >> >> > In:    serial
> >> >> > Out:   serial
> >> >> > Err:   serial
> >> >> > Net:   FEC
> >> >> > Hit any key to stop autoboot:  0
> >> >> > switch to partitions #0, OK
> >> >> > mmc0 is current device
> >> >> > Scanning mmc 0:1...
> >> >>
> >> >> I don't think any efi_loader code is running here, you would see a message like:
> >> >>
> >> >>   ## Starting EFI application at XYZ
> >> >>
> >> >> But to be sure you can disable CONFIG_EFI_LOADER in menuconfig to confirm.
> >> >>
> >> >> I guess this is some unrelated change.  I suspect Tom's change to
> >> >> malloc the fat_itr's which would make the buffers used for
> >> >> fs_exists()/etc not cache aligned.  I thought there was a patch
> >> >> floating around to change that to memalign().
> >> >
> >> > The imx6 problems still occur with CONFIG_EFI_LOADER disabled indeed.
> >> >
> >> > I can no longer load a kernel via efi on bbb though:
> >> >
> >> > U-Boot SPL 2017.11-rc1-00066-g4ac7de9239 (Oct 06 2017 - 14:21:51)
> >> > Trying to boot from MMC1
> >> > reading u-boot.img
> >> > reading u-boot.img
> >> >
> >> >
> >> > U-Boot 2017.11-rc1-00066-g4ac7de9239 (Oct 06 2017 - 14:21:51 +1100)
> >> >
> >> > CPU  : AM335X-GP rev 2.1
> >> > I2C:   ready
> >> > DRAM:  512 MiB
> >> > No match for driver 'omap_hsmmc'
> >> > No match for driver 'omap_hsmmc'
> >> > Some drivers were not found
> >> > MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
> >> > <ethaddr> not set. Validating first E-fuse MAC
> >> > Net:   cpsw, usb_ether
> >> > Press SPACE to abort autoboot in 2 seconds
> >> > switch to partitions #0, OK
> >> > mmc0 is current device
> >> > SD/MMC found on device 0
> >> > ** Unable to read file boot.scr **
> >> > ** Unable to read file uEnv.txt **
> >> > switch to partitions #0, OK
> >> > mmc0 is current device
> >> > Scanning mmc 0:1...
> >> > reading /am335x-boneblack.dtb
> >> > 35712 bytes read in 10 ms (3.4 MiB/s)
> >> > Found EFI removable media binary efi/boot/bootarm.efi
> >> > reading efi/boot/bootarm.efi
> >> > 65448 bytes read in 16 ms (3.9 MiB/s)
> >> > ## Starting EFI application at 82000000 ...
> >> > Scanning disks on usb...
> >> > Scanning disks on mmc...
> >> > MMC Device 2 not found
> >> > MMC Device 3 not found
> >> > Found 6 disks
> >> >>> OpenBSD/armv7 BOOTARM 0.9
> >> > 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>
> >> > cannot open sd0a:/etc/random.seed: Device not configured
> >> > booting sd0a:/bsd: open sd0a:/bsd: Device not configured
> >> >  failed(6). will try /bsd
> >> > Turning timeout off.
> >> > boot> ls sd1a:/
> >> > stat(sd1a:/): Device not configured
> >> >
> >> > To reproduce replace the existing MLO/u-boot.img in the FAT fs in
> >> > https://ftp.openbsd.org/pub/OpenBSD/snapshots/armv7/miniroot-am335x-62.fs
> >>
> >> Can you reproduce this on any aarch64 device?  I don't have anything
> >> armv7 to try.  (I guess the kernel won't actually boot on my db410c
> >> but at least it should get as far as trying if I could reproduce this
> >> on aarch64)
> >
> > Dale Rahn was working on DragonBoard support and had a driver for the
> > MSM UART but those changes are not currently in the tree/snapshots.
> 
> cool.. but I guess not really necessary to debug, as long as
> bootloader gets as far as trying to boot the kernel
> 
> >>
> >> I guess the openbsd bootloader is recognizing the "disks" differently
> >> now with more accurate devicepaths.  Or maybe some hack that was used
> >> to make things work before with the non-standard dp's is causing
> >> problems now?
> >
> > Same problem with the aarch64 rpi_3 target.  The same efiboot binary
> > works fine on U-Boot 2017.09 and the EDK2 based firmware on the
> > OverDrive 1000.
> 
> *maybe* it could be a legacy vs DM thing.. there are differences in
> construction devicepaths for the two cases, and I don't really have a
> good way to test legacy.  (And hopefully folks will hurry up and port
> legacy devices so we can simplify the efi_loader code.)
> 
> I'm not quite sure which category rpi3 falls into.  But iirc Peter
> Robinson tested that with the efi_loader patches + grub2 + fedora and
> it all worked.
> 
> Maybe there is a way I can reproduce this in qemu?
> 
> BR,
> -R

Yes, the behaviour also occurs with the vexpress_ca15_tc2 target:

$ qemu-system-arm -m 1024 -M vexpress-a15 \
-kernel /usr/local/share/u-boot/vexpress_ca15_tc2/u-boot \
-sd miniroot-am335x-62.fs -serial stdio
WARNING: Image format was not specified for 'miniroot-am335x-62.fs' and probing guessed raw.
	 Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
	 Specify the 'raw' format explicitly to remove the restrictions.


U-Boot 2017.09 (Sep 12 2017 - 15:05:11 +1000)

DRAM:  1 GiB
WARNING: Caches not enabled
Flash: 128 MiB
MMC:   MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   smc911x-0
Hit any key to stop autoboot:  0
MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
env - environment handling commands

Usage:
env default [-f] -a - [forcibly] reset default environment
env default [-f] var [...] - [forcibly] reset variable(s) to their default values
env delete [-f] var [...] - [forcibly] delete variable(s)
env export [-t | -b | -c] [-s size] addr [var ...] - export environment
env import [-d] [-t [-r] | -b | -c] addr [size] - import environment
env print [-a | name ...] - print environment
env run var [...] - run commands in an environment variable
env save - save environment
env set [-f] name [arg ...]

Scanning mmc 0:1...
Found EFI removable media binary efi/boot/bootarm.efi
reading efi/boot/bootarm.efi
67372 bytes read in 113 ms (582 KiB/s)
## Starting EFI application at a0008000 ...
WARNING: Invalid device tree, expect boot to fail
Scanning disks on mmc...
MMC Device 1 not found
MMC Device 2 not found
MMC Device 3 not found
Found 1 disks
>> OpenBSD/armv7 BOOTARM 1.0
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 2305632+7989448+444512|[174378+90+319888+152368]=0xae1134
qemu-system-arm: terminating on signal 2

$ qemu-system-arm -m 1024 -M vexpress-a15 \
-kernel vexpress_ca15_tc2/u-boot \
-sd miniroot-am335x-62.fs -serial stdio
WARNING: Image format was not specified for 'miniroot-am335x-62.fs' and probing guessed raw.
	 Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
	 Specify the 'raw' format explicitly to remove the restrictions.


U-Boot 2017.11-rc1-00066-g4ac7de9239 (Oct 08 2017 - 00:07:26 +1100)

DRAM:  1 GiB
WARNING: Caches not enabled
Flash: 128 MiB
MMC:   MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   smc911x-0
Hit any key to stop autoboot:  0
MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
env - environment handling commands

Usage:
env default [-f] -a - [forcibly] reset default environment
env default [-f] var [...] - [forcibly] reset variable(s) to their default values
env delete [-f] var [...] - [forcibly] delete variable(s)
env export [-t | -b | -c] [-s size] addr [var ...] - export environment
env import [-d] [-t [-r] | -b | -c] addr [size] - import environment
env print [-a | name ...] - print environment
env run var [...] - run commands in an environment variable
env save - save environment
env set [-f] name [arg ...]

Scanning mmc 0:1...
load - load binary file from a filesystem

Usage:
load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
    - Load binary file 'filename' from partition 'part' on device
       type 'interface' instance 'dev' to address 'addr' in memory.
      'bytes' gives the size to load in bytes.
      If 'bytes' is 0 or omitted, the file is read until the end.
      'pos' gives the file byte position to start reading from.
      If 'pos' is 0 or omitted, the file is read from the start.
Found EFI removable media binary efi/boot/bootarm.efi
Scanning disks on mmc...
MMC Device 1 not found
MMC Device 2 not found
MMC Device 3 not found
Found 1 disks
reading efi/boot/bootarm.efi
67372 bytes read in 55 ms (1.2 MiB/s)
## Starting EFI application at a0008000 ...
WARNING: Invalid device tree, expect boot to fail
>> OpenBSD/armv7 BOOTARM 1.0
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> ls sd0a:/
stat(sd0a:/): Device not configured
boot> ls sd1a:/
stat(sd1a:/): Device not configured
boot> qemu-system-arm: terminating on signal 2


More information about the U-Boot mailing list