mbox series

[v4,0/2] ARM: dts: add mmc aliases for Exynos devices

Message ID 20230315212644.15764-1-henrik@grimler.se
Headers show
Series ARM: dts: add mmc aliases for Exynos devices | expand

Message

Henrik Grimler March 15, 2023, 9:26 p.m. UTC
It is convenient to have fixed mmcblk numbering of the eMMC and sdcard
so that assigned numbers will not change from boot-to-boot or
depending on if storage devices are actually attached or not.

Anton Bambura has done the work for the chromebooks while I have
looked at the other devices.  On the chromebooks, mmc0 is used for
eMMC and mmc1 for sdcard, while mmc0 is used for eMMC and mmc2 for
sdcard on the other boards, simply because Anton and I had different
preferences.

Also drop mshc aliases while we are at it and instead add mmc
capabilities to the individual device trees (right now they are added
depending on alias index).  I have tested the changes on
exynos4412-odroid-u2 and exynos5422-odroid-xu4: the MMC_CAP_1_8V_DDR
and MMC_CAP_8_BIT_DATA caps are set correctly (meaning they are set
for mshc_0/mmc_0 but not mshc_2/mmc_2) both before and after this
patchset.

---

Changes since v3:
* Skip sorting of nodes, to not make reviewing impossible (and I need
  to read up on preferred style)
* Move two mmc alias additions from patch 1 to patch 2

Changes since v2:
* Set mmc-ddr-1_8v in device trees so that MMC_CAP_1_8V_DDR is set
  also after removal of mshc0 alias.  Issue was pointed out by Krzysztof
  and David.
* Fix whitespace issue in patch 2 which was pointed out by Krzysztof
* Reword commit message of patch 2 after Rob's comment

Changes since v1:
* Move mshc alias cleanup to a separate commit
* Use mmc0 and mmc1 (instead of mmc0 and mmc2) for eMMC and sdcard on
  chromebooks
* Address Krzysztof's review comments:
 - Make changes per device rather than in soc dtsi


Henrik Grimler (2):
  ARM: dts: exynos: replace mshc0 alias with mmc-ddr-1_8v property
  ARM: dts: exynos: add mmc aliases

 arch/arm/boot/dts/exynos3250-artik5-eval.dts        | 5 +++++
 arch/arm/boot/dts/exynos3250-artik5.dtsi            | 6 ++++++
 arch/arm/boot/dts/exynos3250-monk.dts               | 2 ++
 arch/arm/boot/dts/exynos3250-rinato.dts             | 3 +++
 arch/arm/boot/dts/exynos4210-i9100.dts              | 7 +++++++
 arch/arm/boot/dts/exynos4210-origen.dts             | 6 ++++++
 arch/arm/boot/dts/exynos4210-smdkv310.dts           | 4 ++++
 arch/arm/boot/dts/exynos4210-trats.dts              | 7 +++++++
 arch/arm/boot/dts/exynos4210-universal_c210.dts     | 7 +++++++
 arch/arm/boot/dts/exynos4412-itop-elite.dts         | 4 ++++
 arch/arm/boot/dts/exynos4412-itop-scp-core.dtsi     | 5 +++++
 arch/arm/boot/dts/exynos4412-midas.dtsi             | 4 ++++
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi     | 6 ++++++
 arch/arm/boot/dts/exynos4412-origen.dts             | 6 ++++++
 arch/arm/boot/dts/exynos4412-p4note.dtsi            | 7 +++++++
 arch/arm/boot/dts/exynos4412-smdk4412.dts           | 4 ++++
 arch/arm/boot/dts/exynos4412-tiny4412.dts           | 4 ++++
 arch/arm/boot/dts/exynos4412.dtsi                   | 1 -
 arch/arm/boot/dts/exynos5250-arndale.dts            | 6 ++++++
 arch/arm/boot/dts/exynos5250-smdk5250.dts           | 3 +++
 arch/arm/boot/dts/exynos5250-snow-common.dtsi       | 4 ++++
 arch/arm/boot/dts/exynos5250-spring.dts             | 6 ++++++
 arch/arm/boot/dts/exynos5250.dtsi                   | 4 ----
 arch/arm/boot/dts/exynos5260-xyref5260.dts          | 6 ++++++
 arch/arm/boot/dts/exynos5410-odroidxu.dts           | 3 +++
 arch/arm/boot/dts/exynos5410-smdk5410.dts           | 6 ++++++
 arch/arm/boot/dts/exynos5420-arndale-octa.dts       | 6 ++++++
 arch/arm/boot/dts/exynos5420-galaxy-tab-common.dtsi | 6 ++++++
 arch/arm/boot/dts/exynos5420-peach-pit.dts          | 4 ++++
 arch/arm/boot/dts/exynos5420-smdk5420.dts           | 6 ++++++
 arch/arm/boot/dts/exynos5420.dtsi                   | 3 ---
 arch/arm/boot/dts/exynos5422-odroid-core.dtsi       | 4 ++++
 arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi  | 5 +++++
 arch/arm/boot/dts/exynos5422-samsung-k3g.dts        | 1 +
 arch/arm/boot/dts/exynos5800-peach-pi.dts           | 4 ++++
 35 files changed, 157 insertions(+), 8 deletions(-)


base-commit: 0e84f3493a37d50f2f629dbea670135b8a8ee391

Comments

Marek Szyprowski March 16, 2023, 10:32 a.m. UTC | #1
Hi Henrik

On 15.03.2023 22:26, Henrik Grimler wrote:
> Previously, the mshc0 alias has been necessary so that
> MMC_CAP_1_8V_DDR | MMC_CAP_8_BIT_DATA are set for mshc_0/mmc_0.
> However, these capabilities should be described in the device tree so
> that we do not have to rely on the alias.
>
> The property mmc-ddr-1_8v replaces MMC_CAP_1_8V_DDR, while bus_width =
> <8>, which is already set for all the mshc0/mmc0 nodes, replaces
> MMC_CAP_8_BIT_DATA.
>
> Also drop other mshc aliases as they are not needed.
>
> Signed-off-by: Henrik Grimler <henrik@grimler.se>
> ---
>
> Changes since v3:
> * Drop attempt at node sorting/cleaning
> * Move two mmc alias additions to the other patch
> * Update commit message
>
> Changes since v2:
> * Set mmc-ddr-1_8v in device trees for mshc_0/mmc_0
>
>   arch/arm/boot/dts/exynos3250-artik5.dtsi            | 1 +
>   arch/arm/boot/dts/exynos3250-monk.dts               | 1 +
>   arch/arm/boot/dts/exynos3250-rinato.dts             | 1 +
>   arch/arm/boot/dts/exynos4210-i9100.dts              | 1 +
>   arch/arm/boot/dts/exynos4210-origen.dts             | 1 +
>   arch/arm/boot/dts/exynos4210-trats.dts              | 1 +
>   arch/arm/boot/dts/exynos4210-universal_c210.dts     | 1 +
>   arch/arm/boot/dts/exynos4412-itop-scp-core.dtsi     | 1 +
>   arch/arm/boot/dts/exynos4412-midas.dtsi             | 1 +
>   arch/arm/boot/dts/exynos4412-odroid-common.dtsi     | 1 +
>   arch/arm/boot/dts/exynos4412-origen.dts             | 1 +
>   arch/arm/boot/dts/exynos4412-p4note.dtsi            | 1 +
>   arch/arm/boot/dts/exynos4412.dtsi                   | 1 -
>   arch/arm/boot/dts/exynos5250-arndale.dts            | 1 +
>   arch/arm/boot/dts/exynos5250-smdk5250.dts           | 1 +
>   arch/arm/boot/dts/exynos5250-snow-common.dtsi       | 1 +
>   arch/arm/boot/dts/exynos5250-spring.dts             | 1 +
>   arch/arm/boot/dts/exynos5250.dtsi                   | 4 ----
>   arch/arm/boot/dts/exynos5260-xyref5260.dts          | 1 +
>   arch/arm/boot/dts/exynos5410-odroidxu.dts           | 1 +
>   arch/arm/boot/dts/exynos5410-smdk5410.dts           | 1 +
>   arch/arm/boot/dts/exynos5420-arndale-octa.dts       | 1 +
>   arch/arm/boot/dts/exynos5420-galaxy-tab-common.dtsi | 1 +
>   arch/arm/boot/dts/exynos5420-peach-pit.dts          | 1 +
>   arch/arm/boot/dts/exynos5420-smdk5420.dts           | 1 +
>   arch/arm/boot/dts/exynos5420.dtsi                   | 3 ---
>   arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi  | 1 +
>   arch/arm/boot/dts/exynos5422-samsung-k3g.dts        | 1 +
>   arch/arm/boot/dts/exynos5800-peach-pi.dts           | 1 +
>   29 files changed, 26 insertions(+), 8 deletions(-)
>

> ...

> diff --git a/arch/arm/boot/dts/exynos4210-i9100.dts b/arch/arm/boot/dts/exynos4210-i9100.dts
> index bba85011ecc9..a370a5fa20d8 100644
> --- a/arch/arm/boot/dts/exynos4210-i9100.dts
> +++ b/arch/arm/boot/dts/exynos4210-i9100.dts
> @@ -776,6 +776,7 @@ &sdhci_0 {
>   	status = "okay";
>   
>   	bus-width = <8>;
> +	mmc-ddr-1_8v;
>   	non-removable;
>   	vmmc-supply = <&vemmc_reg>;
>   
> diff --git a/arch/arm/boot/dts/exynos4210-origen.dts b/arch/arm/boot/dts/exynos4210-origen.dts
> index 1103e7f92b57..d8dd13ce29e1 100644
> --- a/arch/arm/boot/dts/exynos4210-origen.dts
> +++ b/arch/arm/boot/dts/exynos4210-origen.dts
> @@ -326,6 +326,7 @@ max8997_irq: max8997-irq-pins {
>   
>   &sdhci_0 {
>   	bus-width = <4>;
> +	mmc-ddr-1_8v;
>   	pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus4 &sd0_cd>;
>   	pinctrl-names = "default";
>   	vmmc-supply = <&mmc_reg>;
> diff --git a/arch/arm/boot/dts/exynos4210-trats.dts b/arch/arm/boot/dts/exynos4210-trats.dts
> index b8e9dd23fc51..d757228a5676 100644
> --- a/arch/arm/boot/dts/exynos4210-trats.dts
> +++ b/arch/arm/boot/dts/exynos4210-trats.dts
> @@ -491,6 +491,7 @@ &rtc {
>   
>   &sdhci_0 {
>   	bus-width = <8>;
> +	mmc-ddr-1_8v;
>   	non-removable;
>   	pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus8>;
>   	pinctrl-names = "default";
> diff --git a/arch/arm/boot/dts/exynos4210-universal_c210.dts b/arch/arm/boot/dts/exynos4210-universal_c210.dts
> index 140abfb38e1d..57dbed908131 100644
> --- a/arch/arm/boot/dts/exynos4210-universal_c210.dts
> +++ b/arch/arm/boot/dts/exynos4210-universal_c210.dts
> @@ -584,6 +584,7 @@ &rtc {
>   
>   &sdhci_0 {
>   	bus-width = <8>;
> +	mmc-ddr-1_8v;
>   	non-removable;
>   	pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus8>;
>   	pinctrl-names = "default";

SDHCI is a different MMC controller than MSHC (DW-MMC), so please drop 
the above changes as they break SDHCI based MMC device operation (tested 
on Exynos4210 based Trats). With that fixed, feel free to add:

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>


Best regards