ARM: dts: Add mmc0 and mmc1 aliases for rk3288
Subsystems (2)
PATCH 1/1 ARM: dts: Add mmc0 and mmc1 aliases for rk3288
It's convenient (and less confusing to people reading logs) if the eMMC port on rk3288 is consistenly marked with mmc0 and the sdmmc port on rk3288 is consistently marked with mmc1. Add the appropriate aliases.
These aliases only actually do something if a patch like
(https://patchwork.kernel.org/patch/3925551/) lands, but they don't hurt even before that patch.
--- arch/arm/boot/dts/rk3288.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/rk3288.dtsi +2 -0
@@ -29,6 +29,8 @@ i2c3 = &i2c3; i2c4 = &i2c4; i2c5 = &i2c5; + mmc0 = &emmc; + mmc1 = &sdmmc; serial0 = &uart0; serial1 = &uart1; serial2 = &uart2;
Signature · 1 line
2.1.0.rc2.206.gedb03e5
Quoted 21 lines
It's convenient (and less confusing to people reading logs) if the eMMC port on rk3288 is consistenly marked with mmc0 and the sdmmc port on rk3288 is consistently marked with mmc1. Add the appropriate aliases.
These aliases only actually do something if a patch like
(https://patchwork.kernel.org/patch/3925551/) lands, but they don't hurt even before that patch.Signed-off-by Doug Anderson <[email protected]>Reviewed-by Sonny Rao <[email protected]>--- arch/arm/boot/dts/rk3288.dtsi | 2 ++ 1 file changed, 2 insertions(+)arch/arm/boot/dts/rk3288.dtsi +0
-0
arch/arm/boot/dts/rk3288.dtsi line 33
Quoted 5 lines
arch/arm/boot/dts/rk3288.dtsi +2
-0@@ -29,6 +29,8 @@ i2c3 = &i2c3; i2c4 = &i2c4; i2c5 = &i2c5; + mmc0 = &emmc; + mmc1 = &sdmmc;
There are 8 registers can be configured for clock tunning(see chapter 3, page 133):
sdmmc: CRU_SDMMC_CON0(offset: 0x200)CRU_SDMMC_CON1(offset: 0x204)
sdio0: CRU_SDMMC_CON2(offset: 0x208)CRU_SDMMC_CON3(offset: 0x20c)
sdio1: CRU_SDMMC_CON4(offset: 0x210)CRU_SDMMC_CON5(offset: 0x214)
emmc: CRU_SDMMC_CON6(offset: 0x218)CRU_SDMMC_CON7(offset: 0x21c)
I think maybe it is suitable as follows:
mmc0 = &sdmmc
mmc1 = &sdio0
mmc2 = &sdio1
mmc3 = &emmc
So we can get ctrl_id:ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
and can get offset of registers:
offset = 0x200 + ctrl_id * 8 + 4 * drive_or_sample
Quoted 3 lines
arch/arm/boot/dts/rk3288.dtsi +0
-0serial0 = &uart0; serial1 = &uart1; serial2 = &uart2;
Addy,
Quoted 5 lines · Addy
I think maybe it is suitable as follows:
mmc0 = &sdmmc
mmc1 = &sdio0
mmc2 = &sdio1
mmc3 = &emmc
Right, except the only ones that have landed in Heiko's tree are sdmmc and emmc, so we can't do sdio0 and sdio1 yet. You could post support for sdio0 and adio1?
Also: it's really handy if emmc is 0. See below: I don't think it's great to use the ID to find the sysconfig registers.
Quoted 2 lines
So we can get
ctrl_id:ctrl_id=of_alias_get_id(host->dev->of_node, "mshc");
Somehow I hadn't realized that was there. I guess we could use that too. I'd vote to remove that and use the standard "mmc" numbering (and get some momentum to land those patches). If you want I'll repost using the mshc stuff, though.
Quoted 2 lines
and can get offset of registers:
offset =0x200+ctrl_id* 8 + 4 *drive_or_sample
I thought the plan was to actually implement the phase stuff as a clock driver.
...even if we didn't, I'd rather not rely on ID like this to find the right address. It's really non-obvious.
Quoted 10 lines
Addy,
Quoted 5 lines · Addy
I think maybe it is suitable as follows:
mmc0 = &sdmmc
mmc1 = &sdio0
mmc2 = &sdio1
mmc3 = &emmc
Quoted 3 lines
Right, except the only ones that have landed in Heiko's tree are sdmmc and emmc, so we can't do sdio0 and sdio1 yet. You could post support for sdio0 and adio1?
yes, I will post it today.
Quoted 24 lines
Also: it's really handy if emmc is 0. See below: I don't think it's great to use the ID to find the sysconfig registers.
Quoted 2 lines
So we can get
ctrl_id:ctrl_id=of_alias_get_id(host->dev->of_node, "mshc");Somehow I hadn't realized that was there. I guess we could use that too. I'd vote to remove that and use the standard "mmc" numbering (and get some momentum to land those patches). If you want I'll repost using the mshc stuff, though.
Quoted 2 lines
and can get offset of registers:
offset =0x200+ctrl_id* 8 + 4 *drive_or_sampleI thought the plan was to actually implement the phase stuff as a clock driver.
...even if we didn't, I'd rather not rely on ID like this to find the right address. It's really non-obvious.