18c2ecf20Sopenharmony_ciMarvell Xenon SDHCI Controller device tree bindings 28c2ecf20Sopenharmony_ciThis file documents differences between the core mmc properties 38c2ecf20Sopenharmony_cidescribed by mmc.txt and the properties used by the Xenon implementation. 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ciMultiple SDHCs might be put into a single Xenon IP, to save size and cost. 68c2ecf20Sopenharmony_ciEach SDHC is independent and owns independent resources, such as register sets, 78c2ecf20Sopenharmony_ciclock and PHY. 88c2ecf20Sopenharmony_ciEach SDHC should have an independent device tree node. 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciRequired Properties: 118c2ecf20Sopenharmony_ci- compatible: should be one of the following 128c2ecf20Sopenharmony_ci - "marvell,armada-3700-sdhci": For controllers on Armada-3700 SoC. 138c2ecf20Sopenharmony_ci Must provide a second register area and marvell,pad-type. 148c2ecf20Sopenharmony_ci - "marvell,armada-ap806-sdhci": For controllers on Armada AP806. 158c2ecf20Sopenharmony_ci - "marvell,armada-cp110-sdhci": For controllers on Armada CP110. 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci- clocks: 188c2ecf20Sopenharmony_ci Array of clocks required for SDHC. 198c2ecf20Sopenharmony_ci Require at least input clock for Xenon IP core. For Armada AP806 and 208c2ecf20Sopenharmony_ci CP110, the AXI clock is also mandatory. 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci- clock-names: 238c2ecf20Sopenharmony_ci Array of names corresponding to clocks property. 248c2ecf20Sopenharmony_ci The input clock for Xenon IP core should be named as "core". 258c2ecf20Sopenharmony_ci The input clock for the AXI bus must be named as "axi". 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci- reg: 288c2ecf20Sopenharmony_ci * For "marvell,armada-3700-sdhci", two register areas. 298c2ecf20Sopenharmony_ci The first one for Xenon IP register. The second one for the Armada 3700 SoC 308c2ecf20Sopenharmony_ci PHY PAD Voltage Control register. 318c2ecf20Sopenharmony_ci Please follow the examples with compatible "marvell,armada-3700-sdhci" 328c2ecf20Sopenharmony_ci in below. 338c2ecf20Sopenharmony_ci Please also check property marvell,pad-type in below. 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci * For other compatible strings, one register area for Xenon IP. 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ciOptional Properties: 388c2ecf20Sopenharmony_ci- marvell,xenon-sdhc-id: 398c2ecf20Sopenharmony_ci Indicate the corresponding bit index of current SDHC in 408c2ecf20Sopenharmony_ci SDHC System Operation Control Register Bit[7:0]. 418c2ecf20Sopenharmony_ci Set/clear the corresponding bit to enable/disable current SDHC. 428c2ecf20Sopenharmony_ci If Xenon IP contains only one SDHC, this property is optional. 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci- marvell,xenon-phy-type: 458c2ecf20Sopenharmony_ci Xenon support multiple types of PHYs. 468c2ecf20Sopenharmony_ci To select eMMC 5.1 PHY, set: 478c2ecf20Sopenharmony_ci marvell,xenon-phy-type = "emmc 5.1 phy" 488c2ecf20Sopenharmony_ci eMMC 5.1 PHY is the default choice if this property is not provided. 498c2ecf20Sopenharmony_ci To select eMMC 5.0 PHY, set: 508c2ecf20Sopenharmony_ci marvell,xenon-phy-type = "emmc 5.0 phy" 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci All those types of PHYs can support eMMC, SD and SDIO. 538c2ecf20Sopenharmony_ci Please note that this property only presents the type of PHY. 548c2ecf20Sopenharmony_ci It doesn't stand for the entire SDHC type or property. 558c2ecf20Sopenharmony_ci For example, "emmc 5.1 phy" doesn't mean that this Xenon SDHC only 568c2ecf20Sopenharmony_ci supports eMMC 5.1. 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci- marvell,xenon-phy-znr: 598c2ecf20Sopenharmony_ci Set PHY ZNR value. 608c2ecf20Sopenharmony_ci Only available for eMMC PHY. 618c2ecf20Sopenharmony_ci Valid range = [0:0x1F]. 628c2ecf20Sopenharmony_ci ZNR is set as 0xF by default if this property is not provided. 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci- marvell,xenon-phy-zpr: 658c2ecf20Sopenharmony_ci Set PHY ZPR value. 668c2ecf20Sopenharmony_ci Only available for eMMC PHY. 678c2ecf20Sopenharmony_ci Valid range = [0:0x1F]. 688c2ecf20Sopenharmony_ci ZPR is set as 0xF by default if this property is not provided. 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci- marvell,xenon-phy-nr-success-tun: 718c2ecf20Sopenharmony_ci Set the number of required consecutive successful sampling points 728c2ecf20Sopenharmony_ci used to identify a valid sampling window, in tuning process. 738c2ecf20Sopenharmony_ci Valid range = [1:7]. 748c2ecf20Sopenharmony_ci Set as 0x4 by default if this property is not provided. 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci- marvell,xenon-phy-tun-step-divider: 778c2ecf20Sopenharmony_ci Set the divider for calculating TUN_STEP. 788c2ecf20Sopenharmony_ci Set as 64 by default if this property is not provided. 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci- marvell,xenon-phy-slow-mode: 818c2ecf20Sopenharmony_ci If this property is selected, transfers will bypass PHY. 828c2ecf20Sopenharmony_ci Only available when bus frequency lower than 55MHz in SDR mode. 838c2ecf20Sopenharmony_ci Disabled by default. Please only try this property if timing issues 848c2ecf20Sopenharmony_ci always occur with PHY enabled in eMMC HS SDR, SD SDR12, SD SDR25, 858c2ecf20Sopenharmony_ci SD Default Speed and HS mode and eMMC legacy speed mode. 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci- marvell,xenon-tun-count: 888c2ecf20Sopenharmony_ci Xenon SDHC SoC usually doesn't provide re-tuning counter in 898c2ecf20Sopenharmony_ci Capabilities Register 3 Bit[11:8]. 908c2ecf20Sopenharmony_ci This property provides the re-tuning counter. 918c2ecf20Sopenharmony_ci If this property is not set, default re-tuning counter will 928c2ecf20Sopenharmony_ci be set as 0x9 in driver. 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci- marvell,pad-type: 958c2ecf20Sopenharmony_ci Type of Armada 3700 SoC PHY PAD Voltage Controller register. 968c2ecf20Sopenharmony_ci Only valid when "marvell,armada-3700-sdhci" is selected. 978c2ecf20Sopenharmony_ci Two types: "sd" and "fixed-1-8v". 988c2ecf20Sopenharmony_ci If "sd" is selected, SoC PHY PAD is set as 3.3V at the beginning and is 998c2ecf20Sopenharmony_ci switched to 1.8V when later in higher speed mode. 1008c2ecf20Sopenharmony_ci If "fixed-1-8v" is selected, SoC PHY PAD is fixed 1.8V, such as for eMMC. 1018c2ecf20Sopenharmony_ci Please follow the examples with compatible "marvell,armada-3700-sdhci" 1028c2ecf20Sopenharmony_ci in below. 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ciExample: 1058c2ecf20Sopenharmony_ci- For eMMC: 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci sdhci@aa0000 { 1088c2ecf20Sopenharmony_ci compatible = "marvell,armada-ap806-sdhci"; 1098c2ecf20Sopenharmony_ci reg = <0xaa0000 0x1000>; 1108c2ecf20Sopenharmony_ci interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH> 1118c2ecf20Sopenharmony_ci clocks = <&emmc_clk>,<&axi_clk>; 1128c2ecf20Sopenharmony_ci clock-names = "core", "axi"; 1138c2ecf20Sopenharmony_ci bus-width = <4>; 1148c2ecf20Sopenharmony_ci marvell,xenon-phy-slow-mode; 1158c2ecf20Sopenharmony_ci marvell,xenon-tun-count = <11>; 1168c2ecf20Sopenharmony_ci non-removable; 1178c2ecf20Sopenharmony_ci no-sd; 1188c2ecf20Sopenharmony_ci no-sdio; 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci /* Vmmc and Vqmmc are both fixed */ 1218c2ecf20Sopenharmony_ci }; 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ci- For SD/SDIO: 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci sdhci@ab0000 { 1268c2ecf20Sopenharmony_ci compatible = "marvell,armada-cp110-sdhci"; 1278c2ecf20Sopenharmony_ci reg = <0xab0000 0x1000>; 1288c2ecf20Sopenharmony_ci interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH> 1298c2ecf20Sopenharmony_ci vqmmc-supply = <&sd_vqmmc_regulator>; 1308c2ecf20Sopenharmony_ci vmmc-supply = <&sd_vmmc_regulator>; 1318c2ecf20Sopenharmony_ci clocks = <&sdclk>, <&axi_clk>; 1328c2ecf20Sopenharmony_ci clock-names = "core", "axi"; 1338c2ecf20Sopenharmony_ci bus-width = <4>; 1348c2ecf20Sopenharmony_ci marvell,xenon-tun-count = <9>; 1358c2ecf20Sopenharmony_ci }; 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci- For eMMC with compatible "marvell,armada-3700-sdhci": 1388c2ecf20Sopenharmony_ci 1398c2ecf20Sopenharmony_ci sdhci@aa0000 { 1408c2ecf20Sopenharmony_ci compatible = "marvell,armada-3700-sdhci"; 1418c2ecf20Sopenharmony_ci reg = <0xaa0000 0x1000>, 1428c2ecf20Sopenharmony_ci <phy_addr 0x4>; 1438c2ecf20Sopenharmony_ci interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH> 1448c2ecf20Sopenharmony_ci clocks = <&emmcclk>; 1458c2ecf20Sopenharmony_ci clock-names = "core"; 1468c2ecf20Sopenharmony_ci bus-width = <8>; 1478c2ecf20Sopenharmony_ci mmc-ddr-1_8v; 1488c2ecf20Sopenharmony_ci mmc-hs400-1_8v; 1498c2ecf20Sopenharmony_ci non-removable; 1508c2ecf20Sopenharmony_ci no-sd; 1518c2ecf20Sopenharmony_ci no-sdio; 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ci /* Vmmc and Vqmmc are both fixed */ 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ci marvell,pad-type = "fixed-1-8v"; 1568c2ecf20Sopenharmony_ci }; 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_ci- For SD/SDIO with compatible "marvell,armada-3700-sdhci": 1598c2ecf20Sopenharmony_ci 1608c2ecf20Sopenharmony_ci sdhci@ab0000 { 1618c2ecf20Sopenharmony_ci compatible = "marvell,armada-3700-sdhci"; 1628c2ecf20Sopenharmony_ci reg = <0xab0000 0x1000>, 1638c2ecf20Sopenharmony_ci <phy_addr 0x4>; 1648c2ecf20Sopenharmony_ci interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH> 1658c2ecf20Sopenharmony_ci vqmmc-supply = <&sd_regulator>; 1668c2ecf20Sopenharmony_ci /* Vmmc is fixed */ 1678c2ecf20Sopenharmony_ci clocks = <&sdclk>; 1688c2ecf20Sopenharmony_ci clock-names = "core"; 1698c2ecf20Sopenharmony_ci bus-width = <4>; 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci marvell,pad-type = "sd"; 1728c2ecf20Sopenharmony_ci }; 173