summaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-04-24 02:02:07 (GMT)
committerSimon Glass <sjg@chromium.org>2017-06-01 13:03:05 (GMT)
commite48eeb9ea3aed67e4bda94c65a7f13e8672a3501 (patch)
tree13a6fb91509ee655c8536577e8ec5101c67ac5dd /arch/sandbox
parente8abbb531f506dc0cac973b86fb5fa01f0bf88c4 (diff)
downloadu-boot-fsl-qoriq-e48eeb9ea3aed67e4bda94c65a7f13e8672a3501.tar.xz
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>
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/dts/test.dts12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 9077a82..7dde95d 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -12,6 +12,8 @@
eth3 = &eth_3;
eth5 = &eth_5;
i2c0 = "/i2c@0";
+ mmc0 = "/mmc0";
+ mmc1 = "/mmc1";
pci0 = &pci;
remoteproc1 = &rproc_1;
remoteproc2 = &rproc_2;
@@ -259,7 +261,15 @@
mbox-names = "other", "test";
};
- mmc {
+ mmc2 {
+ compatible = "sandbox,mmc";
+ };
+
+ mmc1 {
+ compatible = "sandbox,mmc";
+ };
+
+ mmc0 {
compatible = "sandbox,mmc";
};