1d5b0e70fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2d5b0e70fSEmmanuel Vadot%YAML 1.2 3d5b0e70fSEmmanuel Vadot--- 4d5b0e70fSEmmanuel Vadot$id: http://devicetree.org/schemas/mmc/marvell,xenon-sdhci.yaml# 5d5b0e70fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6d5b0e70fSEmmanuel Vadot 7d5b0e70fSEmmanuel Vadottitle: Marvell Xenon SDHCI Controller 8d5b0e70fSEmmanuel Vadot 9d5b0e70fSEmmanuel Vadotdescription: | 10d5b0e70fSEmmanuel Vadot This file documents differences between the core MMC properties described by 11d5b0e70fSEmmanuel Vadot mmc-controller.yaml and the properties used by the Xenon implementation. 12d5b0e70fSEmmanuel Vadot 13d5b0e70fSEmmanuel Vadot Multiple SDHCs might be put into a single Xenon IP, to save size and cost. 14d5b0e70fSEmmanuel Vadot Each SDHC is independent and owns independent resources, such as register 15d5b0e70fSEmmanuel Vadot sets, clock and PHY. 16d5b0e70fSEmmanuel Vadot 17d5b0e70fSEmmanuel Vadot Each SDHC should have an independent device tree node. 18d5b0e70fSEmmanuel Vadot 19d5b0e70fSEmmanuel Vadotmaintainers: 20d5b0e70fSEmmanuel Vadot - Ulf Hansson <ulf.hansson@linaro.org> 21d5b0e70fSEmmanuel Vadot 22d5b0e70fSEmmanuel Vadotproperties: 23d5b0e70fSEmmanuel Vadot compatible: 24d5b0e70fSEmmanuel Vadot oneOf: 25d5b0e70fSEmmanuel Vadot - enum: 26d5b0e70fSEmmanuel Vadot - marvell,armada-cp110-sdhci 27d5b0e70fSEmmanuel Vadot - marvell,armada-ap806-sdhci 28d5b0e70fSEmmanuel Vadot 29d5b0e70fSEmmanuel Vadot - items: 30*8d13bc63SEmmanuel Vadot - enum: 31*8d13bc63SEmmanuel Vadot - marvell,armada-ap807-sdhci 32*8d13bc63SEmmanuel Vadot - marvell,ac5-sdhci 33d5b0e70fSEmmanuel Vadot - const: marvell,armada-ap806-sdhci 34d5b0e70fSEmmanuel Vadot 35d5b0e70fSEmmanuel Vadot - items: 36d5b0e70fSEmmanuel Vadot - const: marvell,armada-3700-sdhci 37d5b0e70fSEmmanuel Vadot - const: marvell,sdhci-xenon 38d5b0e70fSEmmanuel Vadot 39d5b0e70fSEmmanuel Vadot reg: 40d5b0e70fSEmmanuel Vadot minItems: 1 41d5b0e70fSEmmanuel Vadot maxItems: 2 42d5b0e70fSEmmanuel Vadot description: | 43d5b0e70fSEmmanuel Vadot For "marvell,armada-3700-sdhci", two register areas. The first one 44d5b0e70fSEmmanuel Vadot for Xenon IP register. The second one for the Armada 3700 SoC PHY PAD 45d5b0e70fSEmmanuel Vadot Voltage Control register. Please follow the examples with compatible 46d5b0e70fSEmmanuel Vadot "marvell,armada-3700-sdhci" in below. 47d5b0e70fSEmmanuel Vadot Please also check property marvell,pad-type in below. 48d5b0e70fSEmmanuel Vadot 49d5b0e70fSEmmanuel Vadot For other compatible strings, one register area for Xenon IP. 50d5b0e70fSEmmanuel Vadot 51d5b0e70fSEmmanuel Vadot clocks: 52d5b0e70fSEmmanuel Vadot minItems: 1 53d5b0e70fSEmmanuel Vadot maxItems: 2 54d5b0e70fSEmmanuel Vadot 55d5b0e70fSEmmanuel Vadot clock-names: 56d5b0e70fSEmmanuel Vadot minItems: 1 57d5b0e70fSEmmanuel Vadot items: 58d5b0e70fSEmmanuel Vadot - const: core 59d5b0e70fSEmmanuel Vadot - const: axi 60d5b0e70fSEmmanuel Vadot 61d5b0e70fSEmmanuel Vadot interrupts: 62d5b0e70fSEmmanuel Vadot maxItems: 1 63d5b0e70fSEmmanuel Vadot 64d5b0e70fSEmmanuel Vadot marvell,xenon-sdhc-id: 65d5b0e70fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 66d5b0e70fSEmmanuel Vadot minimum: 0 67d5b0e70fSEmmanuel Vadot maximum: 7 68d5b0e70fSEmmanuel Vadot description: | 69d5b0e70fSEmmanuel Vadot Indicate the corresponding bit index of current SDHC in SDHC System 70d5b0e70fSEmmanuel Vadot Operation Control Register Bit[7:0]. Set/clear the corresponding bit to 71d5b0e70fSEmmanuel Vadot enable/disable current SDHC. 72d5b0e70fSEmmanuel Vadot 73d5b0e70fSEmmanuel Vadot marvell,xenon-phy-type: 74d5b0e70fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/string 75d5b0e70fSEmmanuel Vadot enum: 76aa1a8ff2SEmmanuel Vadot - emmc 5.1 phy 77aa1a8ff2SEmmanuel Vadot - emmc 5.0 phy 78d5b0e70fSEmmanuel Vadot description: | 79d5b0e70fSEmmanuel Vadot Xenon support multiple types of PHYs. To select eMMC 5.1 PHY, set: 80d5b0e70fSEmmanuel Vadot marvell,xenon-phy-type = "emmc 5.1 phy" eMMC 5.1 PHY is the default 81d5b0e70fSEmmanuel Vadot choice if this property is not provided. To select eMMC 5.0 PHY, set: 82d5b0e70fSEmmanuel Vadot marvell,xenon-phy-type = "emmc 5.0 phy" 83d5b0e70fSEmmanuel Vadot 84d5b0e70fSEmmanuel Vadot All those types of PHYs can support eMMC, SD and SDIO. Please note that 85d5b0e70fSEmmanuel Vadot this property only presents the type of PHY. It doesn't stand for the 86d5b0e70fSEmmanuel Vadot entire SDHC type or property. For example, "emmc 5.1 phy" doesn't mean 87d5b0e70fSEmmanuel Vadot that this Xenon SDHC only supports eMMC 5.1. 88d5b0e70fSEmmanuel Vadot 89d5b0e70fSEmmanuel Vadot marvell,xenon-phy-znr: 90d5b0e70fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 91d5b0e70fSEmmanuel Vadot minimum: 0 92d5b0e70fSEmmanuel Vadot maximum: 0x1f 93d5b0e70fSEmmanuel Vadot default: 0xf 94d5b0e70fSEmmanuel Vadot description: | 95d5b0e70fSEmmanuel Vadot Set PHY ZNR value. 96d5b0e70fSEmmanuel Vadot Only available for eMMC PHY. 97d5b0e70fSEmmanuel Vadot 98d5b0e70fSEmmanuel Vadot marvell,xenon-phy-zpr: 99d5b0e70fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 100d5b0e70fSEmmanuel Vadot minimum: 0 101d5b0e70fSEmmanuel Vadot maximum: 0x1f 102d5b0e70fSEmmanuel Vadot default: 0xf 103d5b0e70fSEmmanuel Vadot description: | 104d5b0e70fSEmmanuel Vadot Set PHY ZPR value. 105d5b0e70fSEmmanuel Vadot Only available for eMMC PHY. 106d5b0e70fSEmmanuel Vadot 107d5b0e70fSEmmanuel Vadot marvell,xenon-phy-nr-success-tun: 108d5b0e70fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 109d5b0e70fSEmmanuel Vadot minimum: 1 110d5b0e70fSEmmanuel Vadot maximum: 7 111d5b0e70fSEmmanuel Vadot default: 0x4 112d5b0e70fSEmmanuel Vadot description: | 113d5b0e70fSEmmanuel Vadot Set the number of required consecutive successful sampling points 114d5b0e70fSEmmanuel Vadot used to identify a valid sampling window, in tuning process. 115d5b0e70fSEmmanuel Vadot 116d5b0e70fSEmmanuel Vadot marvell,xenon-phy-tun-step-divider: 117d5b0e70fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 118d5b0e70fSEmmanuel Vadot default: 64 119d5b0e70fSEmmanuel Vadot description: | 120d5b0e70fSEmmanuel Vadot Set the divider for calculating TUN_STEP. 121d5b0e70fSEmmanuel Vadot 122d5b0e70fSEmmanuel Vadot marvell,xenon-phy-slow-mode: 123d5b0e70fSEmmanuel Vadot type: boolean 124d5b0e70fSEmmanuel Vadot description: | 125d5b0e70fSEmmanuel Vadot If this property is selected, transfers will bypass PHY. 126d5b0e70fSEmmanuel Vadot Only available when bus frequency lower than 55MHz in SDR mode. 127d5b0e70fSEmmanuel Vadot Disabled by default. Please only try this property if timing issues 128d5b0e70fSEmmanuel Vadot always occur with PHY enabled in eMMC HS SDR, SD SDR12, SD SDR25, 129d5b0e70fSEmmanuel Vadot SD Default Speed and HS mode and eMMC legacy speed mode. 130d5b0e70fSEmmanuel Vadot 131d5b0e70fSEmmanuel Vadot marvell,xenon-tun-count: 132d5b0e70fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 133d5b0e70fSEmmanuel Vadot default: 0x9 134d5b0e70fSEmmanuel Vadot description: | 135d5b0e70fSEmmanuel Vadot Xenon SDHC SoC usually doesn't provide re-tuning counter in 136d5b0e70fSEmmanuel Vadot Capabilities Register 3 Bit[11:8]. 137d5b0e70fSEmmanuel Vadot This property provides the re-tuning counter. 138d5b0e70fSEmmanuel Vadot 139d5b0e70fSEmmanuel VadotallOf: 140d5b0e70fSEmmanuel Vadot - $ref: mmc-controller.yaml# 141d5b0e70fSEmmanuel Vadot - if: 142d5b0e70fSEmmanuel Vadot properties: 143d5b0e70fSEmmanuel Vadot compatible: 144d5b0e70fSEmmanuel Vadot contains: 145d5b0e70fSEmmanuel Vadot const: marvell,armada-3700-sdhci 146d5b0e70fSEmmanuel Vadot 147d5b0e70fSEmmanuel Vadot then: 148d5b0e70fSEmmanuel Vadot properties: 149d5b0e70fSEmmanuel Vadot reg: 150d5b0e70fSEmmanuel Vadot items: 151d5b0e70fSEmmanuel Vadot - description: Xenon IP registers 152d5b0e70fSEmmanuel Vadot - description: Armada 3700 SoC PHY PAD Voltage Control register 153d5b0e70fSEmmanuel Vadot 154d5b0e70fSEmmanuel Vadot marvell,pad-type: 155d5b0e70fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/string 156d5b0e70fSEmmanuel Vadot enum: 157d5b0e70fSEmmanuel Vadot - sd 158d5b0e70fSEmmanuel Vadot - fixed-1-8v 159d5b0e70fSEmmanuel Vadot description: | 160d5b0e70fSEmmanuel Vadot Type of Armada 3700 SoC PHY PAD Voltage Controller register. 161d5b0e70fSEmmanuel Vadot If "sd" is selected, SoC PHY PAD is set as 3.3V at the beginning 162d5b0e70fSEmmanuel Vadot and is switched to 1.8V when later in higher speed mode. 163d5b0e70fSEmmanuel Vadot If "fixed-1-8v" is selected, SoC PHY PAD is fixed 1.8V, such as for 164d5b0e70fSEmmanuel Vadot eMMC. 165d5b0e70fSEmmanuel Vadot Please follow the examples with compatible 166d5b0e70fSEmmanuel Vadot "marvell,armada-3700-sdhci" in below. 167d5b0e70fSEmmanuel Vadot 168d5b0e70fSEmmanuel Vadot required: 169d5b0e70fSEmmanuel Vadot - marvell,pad-type 170d5b0e70fSEmmanuel Vadot 171d5b0e70fSEmmanuel Vadot - if: 172d5b0e70fSEmmanuel Vadot properties: 173d5b0e70fSEmmanuel Vadot compatible: 174d5b0e70fSEmmanuel Vadot contains: 175d5b0e70fSEmmanuel Vadot enum: 176d5b0e70fSEmmanuel Vadot - marvell,armada-cp110-sdhci 177d5b0e70fSEmmanuel Vadot - marvell,armada-ap807-sdhci 178d5b0e70fSEmmanuel Vadot - marvell,armada-ap806-sdhci 179d5b0e70fSEmmanuel Vadot 180d5b0e70fSEmmanuel Vadot then: 181d5b0e70fSEmmanuel Vadot properties: 182d5b0e70fSEmmanuel Vadot clocks: 183d5b0e70fSEmmanuel Vadot minItems: 2 184d5b0e70fSEmmanuel Vadot 185d5b0e70fSEmmanuel Vadot clock-names: 186d5b0e70fSEmmanuel Vadot items: 187d5b0e70fSEmmanuel Vadot - const: core 188d5b0e70fSEmmanuel Vadot - const: axi 189d5b0e70fSEmmanuel Vadot 190d5b0e70fSEmmanuel Vadot 191d5b0e70fSEmmanuel Vadotrequired: 192d5b0e70fSEmmanuel Vadot - compatible 193d5b0e70fSEmmanuel Vadot - reg 194d5b0e70fSEmmanuel Vadot - clocks 195d5b0e70fSEmmanuel Vadot - clock-names 196d5b0e70fSEmmanuel Vadot 197d5b0e70fSEmmanuel VadotunevaluatedProperties: false 198d5b0e70fSEmmanuel Vadot 199d5b0e70fSEmmanuel Vadotexamples: 200d5b0e70fSEmmanuel Vadot - | 201d5b0e70fSEmmanuel Vadot // For eMMC 202d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 203d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 204d5b0e70fSEmmanuel Vadot 205d5b0e70fSEmmanuel Vadot mmc@aa0000 { 206d5b0e70fSEmmanuel Vadot compatible = "marvell,armada-ap807-sdhci", "marvell,armada-ap806-sdhci"; 207d5b0e70fSEmmanuel Vadot reg = <0xaa0000 0x1000>; 208d5b0e70fSEmmanuel Vadot interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; 209d5b0e70fSEmmanuel Vadot clocks = <&emmc_clk 0>, <&axi_clk 0>; 210d5b0e70fSEmmanuel Vadot clock-names = "core", "axi"; 211d5b0e70fSEmmanuel Vadot bus-width = <4>; 212d5b0e70fSEmmanuel Vadot marvell,xenon-phy-slow-mode; 213d5b0e70fSEmmanuel Vadot marvell,xenon-tun-count = <11>; 214d5b0e70fSEmmanuel Vadot non-removable; 215d5b0e70fSEmmanuel Vadot no-sd; 216d5b0e70fSEmmanuel Vadot no-sdio; 217d5b0e70fSEmmanuel Vadot 218d5b0e70fSEmmanuel Vadot /* Vmmc and Vqmmc are both fixed */ 219d5b0e70fSEmmanuel Vadot }; 220d5b0e70fSEmmanuel Vadot 221d5b0e70fSEmmanuel Vadot - | 222d5b0e70fSEmmanuel Vadot // For SD/SDIO 223d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 224d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 225d5b0e70fSEmmanuel Vadot 226d5b0e70fSEmmanuel Vadot mmc@ab0000 { 227d5b0e70fSEmmanuel Vadot compatible = "marvell,armada-cp110-sdhci"; 228d5b0e70fSEmmanuel Vadot reg = <0xab0000 0x1000>; 229d5b0e70fSEmmanuel Vadot interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; 230d5b0e70fSEmmanuel Vadot vqmmc-supply = <&sd_vqmmc_regulator>; 231d5b0e70fSEmmanuel Vadot vmmc-supply = <&sd_vmmc_regulator>; 232d5b0e70fSEmmanuel Vadot clocks = <&sdclk 0>, <&axi_clk 0>; 233d5b0e70fSEmmanuel Vadot clock-names = "core", "axi"; 234d5b0e70fSEmmanuel Vadot bus-width = <4>; 235d5b0e70fSEmmanuel Vadot marvell,xenon-tun-count = <9>; 236d5b0e70fSEmmanuel Vadot }; 237d5b0e70fSEmmanuel Vadot 238d5b0e70fSEmmanuel Vadot - | 239d5b0e70fSEmmanuel Vadot // For eMMC with compatible "marvell,armada-3700-sdhci": 240d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 241d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 242d5b0e70fSEmmanuel Vadot 243d5b0e70fSEmmanuel Vadot mmc@aa0000 { 244d5b0e70fSEmmanuel Vadot compatible = "marvell,armada-3700-sdhci", "marvell,sdhci-xenon"; 245d5b0e70fSEmmanuel Vadot reg = <0xaa0000 0x1000>, 246d5b0e70fSEmmanuel Vadot <0x17808 0x4>; 247d5b0e70fSEmmanuel Vadot interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; 248d5b0e70fSEmmanuel Vadot clocks = <&emmcclk 0>; 249d5b0e70fSEmmanuel Vadot clock-names = "core"; 250d5b0e70fSEmmanuel Vadot bus-width = <8>; 251d5b0e70fSEmmanuel Vadot mmc-ddr-1_8v; 252d5b0e70fSEmmanuel Vadot mmc-hs400-1_8v; 253d5b0e70fSEmmanuel Vadot non-removable; 254d5b0e70fSEmmanuel Vadot no-sd; 255d5b0e70fSEmmanuel Vadot no-sdio; 256d5b0e70fSEmmanuel Vadot 257d5b0e70fSEmmanuel Vadot /* Vmmc and Vqmmc are both fixed */ 258d5b0e70fSEmmanuel Vadot 259d5b0e70fSEmmanuel Vadot marvell,pad-type = "fixed-1-8v"; 260d5b0e70fSEmmanuel Vadot }; 261d5b0e70fSEmmanuel Vadot 262d5b0e70fSEmmanuel Vadot - | 263d5b0e70fSEmmanuel Vadot // For SD/SDIO with compatible "marvell,armada-3700-sdhci": 264d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 265d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 266d5b0e70fSEmmanuel Vadot 267d5b0e70fSEmmanuel Vadot mmc@ab0000 { 268d5b0e70fSEmmanuel Vadot compatible = "marvell,armada-3700-sdhci", "marvell,sdhci-xenon"; 269d5b0e70fSEmmanuel Vadot reg = <0xab0000 0x1000>, 270d5b0e70fSEmmanuel Vadot <0x17808 0x4>; 271d5b0e70fSEmmanuel Vadot interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; 272d5b0e70fSEmmanuel Vadot vqmmc-supply = <&sd_regulator>; 273d5b0e70fSEmmanuel Vadot /* Vmmc is fixed */ 274d5b0e70fSEmmanuel Vadot clocks = <&sdclk 0>; 275d5b0e70fSEmmanuel Vadot clock-names = "core"; 276d5b0e70fSEmmanuel Vadot bus-width = <4>; 277d5b0e70fSEmmanuel Vadot 278d5b0e70fSEmmanuel Vadot marvell,pad-type = "sd"; 279d5b0e70fSEmmanuel Vadot }; 280