rpi: Set the default mmc max device to 2
PATCH 1/1 rpi: Set the default mmc max device to 2
When running with special configuration (OF_BOARD and mmc overlay) RPI have the SD card as id 1.
This make device enumeration fails when using the API.
--- include/configs/rpi.h | 2 ++ 1 file changed, 2 insertions(+)
include/configs/rpi.h +2 -0
@@ -69,6 +69,8 @@#define CONFIG_MISC_INIT_R #endif +#define CONFIG_SYS_MMC_MAX_DEVICE 2 +/* Console configuration */ #define CONFIG_SYS_CBSIZE 1024
Signature · 1 line
2.17.0
PATCH 1/1 rpi: Set the default mmc max device to 2
Quoted 5 lines · Emmanuel Vadot
When running with special configuration (
OF_BOARDand mmc overlay) RPI have the SD card as id 1.
This make device enumeration fails when using the API.Signed-off-by Emmanuel Vadot <[email protected]>
Could you please elaborate a bit? From the commit message I don't fully understand which problem you're trying to solve.
Thanks,
Alex
Quoted 17 lines
--- include/configs/rpi.h | 2 ++ 1 file changed, 2 insertions(+)include/configs/rpi.h +2
-0@@ -69,6 +69,8 @@#define CONFIG_MISC_INIT_R #endif +#define CONFIG_SYS_MMC_MAX_DEVICE 2 +/* Console configuration */ #define CONFIG_SYS_CBSIZE 1024
PATCH 1/1 rpi: Set the default mmc max device to 2
Quoted 7 lines · On Wed, 4 Jul 2018 09:25:16 +0200 Alexander Graf <[email protected]> wrote:
Quoted 5 lines · Emmanuel Vadot
When running with special configuration (
OF_BOARDand mmc overlay) RPI have the SD card as id 1.
This make device enumeration fails when using the API.Signed-off-by Emmanuel Vadot <[email protected]>
Quoted 7 lines
Could you please elaborate a bit? From the commit message I don't fully understand which problem you're trying to solve.
Thanks,
Alex
Sure,
When using the dtb from the rpi fundation and the mmc overlay (which
switch back the sd card to use the SDHCI controller and not the SDHOST one) and using OF_BOARD so u-boot uses it/pass it to the OS the device id for the sd is 1 :
U-Boot> mmc list
mmc at 7e300000: 1
This cause the API (see api/api_storage.c) code to never expose this
device to the consumer as the default value for CONFIG_SYS_MMC_MAX_DEVICE is 1.
If it's more clear I'll send a v2 with those words.
Cheers,
Quoted 17 lines
Quoted 17 lines
--- include/configs/rpi.h | 2 ++ 1 file changed, 2 insertions(+)include/configs/rpi.h +2
-0@@ -69,6 +69,8 @@#define CONFIG_MISC_INIT_R #endif +#define CONFIG_SYS_MMC_MAX_DEVICE 2 +/* Console configuration */ #define CONFIG_SYS_CBSIZE 1024
Signature · 1 line
Emmanuel Vadot <[email protected]> <[email protected]>
PATCH 1/1 rpi: Set the default mmc max device to 2
Quoted 25 lines · Emmanuel Vadot
Quoted 5 lines · On Wed, 4 Jul 2018 09:25:16 +0200 Alexander Graf <[email protected]> wrote:
Quoted 4 lines · Emmanuel Vadot
When running with special configuration (
OF_BOARDand mmc overlay) RPI have the SD card as id 1.
This make device enumeration fails when using the API.Quoted 8 lines
Quoted 1 line
Signed-off-by Emmanuel Vadot <[email protected]>Could you please elaborate a bit? From the commit message I don't fully understand which problem you're trying to solve.
Thanks,
Alex
Sure,
When using the dtb from the rpi fundation and the mmc overlay (which
switch back the sd card to use the SDHCI controller and not the SDHOST one) and usingOF_BOARDso u-boot uses it/pass it to the OS the device id for the sd is 1 :
U-Boot> mmc list
mmc at7e300000: 1
Quoted 3 lines
This cause the API (see
api/api_storage.c) code to never expose this
device to the consumer as the default value forCONFIG_SYS_MMC_MAX_DEVICEis 1.
Ouch, that whole file assumes that you know the number of devices present in your system. That's terrible.
I think the real fix would be to convert api_storage.c to instead use dm native routines to loop through all available devices and not explicitly depend on any maximum number of possible devices.
Simon, do you potentially have a patch lying around for that in a branch already?
Alex
PATCH 1/1 rpi: Set the default mmc max device to 2
Hi Alex,
Quoted 38 lines · Alexander Graf
Quoted 29 lines · Emmanuel Vadot
Quoted 8 lines · On Wed, 4 Jul 2018 09:25:16 +0200 Alexander Graf <[email protected]> wrote:
Quoted 6 lines · Emmanuel Vadot
When running with special configuration (
OF_BOARDand mmc overlay) RPI have the SD card as id 1.
This make device enumeration fails when using the API.Signed-off-by Emmanuel Vadot <[email protected]>Quoted 7 lines
Could you please elaborate a bit? From the commit message I don't fully understand which problem you're trying to solve.
Thanks,
Alex
Sure,
When using the dtb from the rpi fundation and the mmc overlay (which
switch back the sd card to use the SDHCI controller and not the SDHOST one) and usingOF_BOARDso u-boot uses it/pass it to the OS the device id for the sd is 1 :
U-Boot> mmc list
mmc at7e300000: 1Quoted 3 lines
This cause the API (see
api/api_storage.c) code to never expose this
device to the consumer as the default value forCONFIG_SYS_MMC_MAX_DEVICEis 1.Ouch, that whole file assumes that you know the number of devices present in your system. That's terrible.
Quoted 6 lines
I think the real fix would be to convert
api_storage.cto instead use dm native routines to loop through all available devices and not explicitly depend on any maximum number of possible devices.Simon, do you potentially have a patch lying around for that in a branch already?
No sorry I don't.
The API could use another look for DM.
Regards,
Simon
PATCH 1/1 rpi: Set the default mmc max device to 2
In reply to Emmanuel VadotQuoted 27 lines · Emmanuel Vadot
Quoted 7 lines · On Wed, 4 Jul 2018 09:25:16 +0200 Alexander Graf <[email protected]> wrote:
Quoted 5 lines · Emmanuel Vadot
When running with special configuration (
OF_BOARDand mmc overlay) RPI have the SD card as id 1.
This make device enumeration fails when using the API.Signed-off-by Emmanuel Vadot <[email protected]>Quoted 7 lines
Could you please elaborate a bit? From the commit message I don't fully understand which problem you're trying to solve.
Thanks,
Alex
Sure,
When using the dtb from the rpi fundation and the mmc overlay (which
switch back the sd card to use the SDHCI controller and not the SDHOST one) and usingOF_BOARDso u-boot uses it/pass it to the OS the device id for the sd is 1 :
U-Boot> mmc list
mmc at7e300000: 1
Quoted 5 lines
This cause the API (see
api/api_storage.c) code to never expose this
device to the consumer as the default value forCONFIG_SYS_MMC_MAX_DEVICEis 1.If it's more clear I'll send a v2 with those words.
Please send a v2 with reworked wording or - if you have the time - rework the storage api to no require this change at all with DM :).
Alex