u-boot/arch/sandbox/dts
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
..
include Makefile: Support include files for .dts files 2014-06-20 11:55:03 -06:00
.gitignore sandbox: ignore sandbox.dtb 2014-05-09 14:51:20 -06:00
cros-ec-keyboard.dtsi cros_ec: exynos: Match up device tree with kernel version 2015-04-18 11:11:16 -06:00
Makefile Various Makefiles: Add SPDX-License-Identifier tags 2015-11-10 09:19:52 -05:00
sandbox.dts sandbox: Add some test LEDs 2017-04-14 19:38:57 -06:00
sandbox_pmic.dtsi sandbox: add ADC driver 2015-11-02 10:38:00 +09:00
test.dts dm: blk: Improve block device claiming 2017-06-01 07:03:05 -06:00