u-boot-brain/arch/sandbox
Simon Glass e48eeb9ea3 dm: blk: Improve block device claiming
The intention with block devices is that the device number (devnum field
in its descriptor) matches the alias of its parent device. For example,
with:

	aliases {
		mmc0 = "/sdhci@700b0600";
		mmc1 = "/sdhci@700b0400";
	}

we expect that the block devices for mmc0 and mmc1 would have device
numbers of 0 and 1 respectively.

Unfortunately this does not currently always happen. If there is another
MMC device earlier in the driver model data structures its block device
will be created first. It will therefore get device number 0 and mmc0
will therefore miss out. In this case the MMC device will have sequence
number 0 but its block device will not.

To avoid this, allow a device to request a device number and bump any
existing device number that is using it. This all happens during the
binding phase so it is safe to change these numbers around. This allows
device numbers to match the aliases in all circumstances.

Add a test to verify the behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:05 -06:00
..
cpu dm: Use dm.h header when driver mode is used 2017-06-01 06:57:52 -06:00
dts dm: blk: Improve block device claiming 2017-06-01 07:03:05 -06:00
include/asm dm: Simple Watchdog uclass 2017-05-08 11:57:30 -04:00
lib libfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY 2016-12-02 20:54:34 -07:00
config.mk sandbox: Support building an SPL image 2016-07-14 20:40:24 -06:00
Kconfig drivers/pci/Kconfig: Add PCI 2016-10-27 20:33:56 -04:00
Makefile Kbuild: introduce Makefile in arch/$ARCH/ 2014-12-08 09:35:45 -05:00