From 62c67d65fd35de4b9d5da30ef6d821051d3264a5 Mon Sep 17 00:00:00 2001 From: Manish Pandey Date: Fri, 20 Sep 2024 14:33:05 +0530 Subject: [PATCH] ARM: dts: msm: Add SD card support for tuna Add SD card support for tuna target. Change-Id: Iff912a5b284cae6ef6026918e3124f483cfe9802 Signed-off-by: Manish Pandey --- qcom/tuna-pinctrl.dtsi | 58 ++++++++++++++++++++++++++++++++ qcom/tuna.dtsi | 75 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/qcom/tuna-pinctrl.dtsi b/qcom/tuna-pinctrl.dtsi index ad6406c2..cfd44251 100644 --- a/qcom/tuna-pinctrl.dtsi +++ b/qcom/tuna-pinctrl.dtsi @@ -1580,4 +1580,62 @@ }; }; }; + + sdc2_on: sdc2_on { + clk { + pins = "gpio62"; + function = "sdc2_clk"; + bias-disable; + drive-strength = <16>; + }; + + cmd { + pins = "gpio51"; + function = "sdc2_cmd"; + bias-pull-up; + drive-strength = <10>; + }; + + data { + pins = "gpio63", "gpio120", "gpio48", "gpio49"; + function = "sdc2_data"; + bias-pull-up; + drive-strength = <10>; + }; + + sd-cd { + pins = "gpio39"; + bias-pull-up; + drive-strength = <2>; + }; + }; + + sdc2_off: sdc2_off { + clk { + pins = "gpio62"; + function = "gpio"; + bias-disable; + drive-strength = <2>; + }; + + cmd { + pins = "gpio51"; + function = "gpio"; + bias-pull-up; + drive-strength = <2>; + }; + + data { + pins = "gpio63", "gpio120", "gpio48", "gpio49"; + function = "gpio"; + bias-pull-up; + drive-strength = <2>; + }; + + sd-cd { + pins = "gpio39"; + bias-pull-up; + drive-strength = <2>; + }; + }; }; diff --git a/qcom/tuna.dtsi b/qcom/tuna.dtsi index 07467382..7f067b3d 100644 --- a/qcom/tuna.dtsi +++ b/qcom/tuna.dtsi @@ -50,6 +50,7 @@ aliases { serial0 = &qupv3_se7_2uart; ufshc1 = &ufshc_mem; /* Embedded UFS Slot */ + mmc1 = &sdhc_2; /* SDC2 SD card slot */ hsuart0 = &qupv3_se14_4uart; i2c0 = &qupv3_se0_i2c; i2c1 = &qupv3_se1_i2c; @@ -1355,6 +1356,80 @@ qcom,client-id = <0x00000001>; }; + sdhc2_opp_table: sdhc2-opp-table { + compatible = "operating-points-v2"; + + opp-100000000 { + opp-hz = /bits/ 64 <100000000>; + opp-peak-kBps = <160000 100000>; + opp-avg-kBps = <50000 0>; + }; + + opp-202000000 { + opp-hz = /bits/ 64 <202000000>; + opp-peak-kBps = <200000 120000>; + opp-avg-kBps = <104000 0>; + }; + }; + + sdhc_2_dma_resv: sdhc_2_dma_resv_region { + /* + * Restrict IOVA mappings for SDHC2 buffers to the 256 MB region + * from 0x40000000 - 0x4fffffff. + */ + iommu-addresses = <&sdhc_2 0x0 0x40000000>, + <&sdhc_2 0x50000000 0xb0000000>; + }; + + sdhc_2: sdhci@8804000 { + status = "disabled"; + + compatible = "qcom,sdhci-msm-v5"; + reg = <0x08804000 0x1000>; + reg-names = "hc"; + + interrupts = , + ; + interrupt-names = "hc_irq", "pwr_irq"; + + bus-width = <4>; + no-sdio; + no-mmc; + qcom,restore-after-cx-collapse; + + clocks = <&gcc GCC_SDCC2_AHB_CLK>, + <&gcc GCC_SDCC2_APPS_CLK>; + clock-names = "iface", "core"; + + /* + * DLL HSR settings. Refer go/hsr - DLL settings. + * Note that the DLL_CONFIG_2 value is not passed from the + * device tree, but it is calculated in the driver. + */ + qcom,dll-hsr-list = <0x0007442C 0x0 0x10 + 0x090106C0 0x80040868>; + + iommus = <&apps_smmu 0x540 0x0>; + qcom,iommu-dma = "fastmap"; + dma-coherent; + memory-region = <&sdhc_2_dma_resv>; + + interconnects = <&aggre2_noc MASTER_SDCC_2 &mc_virt SLAVE_EBI1>, + <&gem_noc MASTER_APPSS_PROC &config_noc SLAVE_SDCC_2>; + interconnect-names = "sdhc-ddr","cpu-sdhc"; + operating-points-v2 = <&sdhc2_opp_table>; + + qos0 { + mask = <0xc0>; + vote = <44>; + }; + + qos1 { + mask = <0x3f>; + vote = <44>; + }; + }; + ufsphy_mem: ufsphy_mem@1d80000 { reg = <0x1d80000 0x2000>; reg-names = "phy_mem";