u-boot/arch
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
..
arc board_f: Rename initdram() to dram_init() 2017-04-13 09:40:57 -04:00
arm dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
avr32 Remove various unused interrupt related code 2017-04-06 20:42:18 -04:00
m68k spi: Zap cf_qspi driver and related code 2017-01-15 18:29:04 +01:00
microblaze spl: make image arg or fdt blob address reconfigurable 2017-05-08 11:38:40 -04:00
mips mips: bmips: fix BCM3380 periph clock frequency 2017-05-31 15:45:29 +02:00
nds32 nds32: eth: Support ftmac100 DM. 2017-05-23 13:48:27 +08:00
nios2 fdt: Move fdt_fixup_ethernet to a common place 2017-05-01 09:11:59 -04:00
powerpc Convert CONFIG_CMD_IRQ to Kconfig 2017-05-22 12:45:31 -04:00
sandbox dm: blk: Improve block device claiming 2017-06-01 07:03:05 -06:00
sh sh: generate position independent code for all platforms 2016-12-02 21:32:54 -05:00
x86 x86: minnowmax: Remove incorrect pad-offset of several pins 2017-05-17 17:13:06 +08:00
xtensa board_f: Rename initdram() to dram_init() 2017-04-13 09:40:57 -04:00
.gitignore
Kconfig Kconfig: Finish migration of hashing commands 2017-05-31 19:38:14 -04:00