11eece23dSJohan Jonker# SPDX-License-Identifier: GPL-2.0
21eece23dSJohan Jonker%YAML 1.2
31eece23dSJohan Jonker---
41eece23dSJohan Jonker$id: http://devicetree.org/schemas/mmc/rockchip-dw-mshc.yaml#
51eece23dSJohan Jonker$schema: http://devicetree.org/meta-schemas/core.yaml#
61eece23dSJohan Jonker
71eece23dSJohan Jonkertitle: Rockchip designware mobile storage host controller device tree bindings
81eece23dSJohan Jonker
91eece23dSJohan Jonkerdescription:
101eece23dSJohan Jonker  Rockchip uses the Synopsys designware mobile storage host controller
111eece23dSJohan Jonker  to interface a SoC with storage medium such as eMMC or SD/MMC cards.
121eece23dSJohan Jonker  This file documents the combined properties for the core Synopsys dw mshc
131eece23dSJohan Jonker  controller that are not already included in the synopsys-dw-mshc-common.yaml
141eece23dSJohan Jonker  file and the Rockchip specific extensions.
151eece23dSJohan Jonker
161eece23dSJohan JonkerallOf:
171eece23dSJohan Jonker  - $ref: "synopsys-dw-mshc-common.yaml#"
181eece23dSJohan Jonker
191eece23dSJohan Jonkermaintainers:
201eece23dSJohan Jonker  - Heiko Stuebner <heiko@sntech.de>
211eece23dSJohan Jonker
221eece23dSJohan Jonker# Everything else is described in the common file
231eece23dSJohan Jonkerproperties:
241eece23dSJohan Jonker  compatible:
251eece23dSJohan Jonker    oneOf:
261eece23dSJohan Jonker      # for Rockchip RK2928 and before RK3288
271eece23dSJohan Jonker      - const: rockchip,rk2928-dw-mshc
281eece23dSJohan Jonker      # for Rockchip RK3288
291eece23dSJohan Jonker      - const: rockchip,rk3288-dw-mshc
301eece23dSJohan Jonker      - items:
311eece23dSJohan Jonker          - enum:
321eece23dSJohan Jonker            # for Rockchip PX30
331eece23dSJohan Jonker            - rockchip,px30-dw-mshc
341eece23dSJohan Jonker            # for Rockchip RK3036
351eece23dSJohan Jonker            - rockchip,rk3036-dw-mshc
361eece23dSJohan Jonker            # for Rockchip RK322x
371eece23dSJohan Jonker            - rockchip,rk3228-dw-mshc
38c389b003SJohan Jonker            # for Rockchip RK3308
39c389b003SJohan Jonker            - rockchip,rk3308-dw-mshc
401eece23dSJohan Jonker            # for Rockchip RK3328
411eece23dSJohan Jonker            - rockchip,rk3328-dw-mshc
421eece23dSJohan Jonker            # for Rockchip RK3368
431eece23dSJohan Jonker            - rockchip,rk3368-dw-mshc
441eece23dSJohan Jonker            # for Rockchip RK3399
451eece23dSJohan Jonker            - rockchip,rk3399-dw-mshc
461eece23dSJohan Jonker            # for Rockchip RV1108
471eece23dSJohan Jonker            - rockchip,rv1108-dw-mshc
481eece23dSJohan Jonker          - const: rockchip,rk3288-dw-mshc
491eece23dSJohan Jonker
501eece23dSJohan Jonker  reg:
511eece23dSJohan Jonker    maxItems: 1
521eece23dSJohan Jonker
531eece23dSJohan Jonker  interrupts:
541eece23dSJohan Jonker    maxItems: 1
551eece23dSJohan Jonker
561eece23dSJohan Jonker  clocks:
571eece23dSJohan Jonker    minItems: 2
581eece23dSJohan Jonker    maxItems: 4
591eece23dSJohan Jonker    description:
601eece23dSJohan Jonker      Handle to "biu" and "ciu" clocks for the bus interface unit clock and
611eece23dSJohan Jonker      the card interface unit clock. If "ciu-drive" and "ciu-sample" are
621eece23dSJohan Jonker      specified in clock-names, it should also contain
631eece23dSJohan Jonker      handles to these clocks.
641eece23dSJohan Jonker
651eece23dSJohan Jonker  clock-names:
661eece23dSJohan Jonker    minItems: 2
671eece23dSJohan Jonker    items:
681eece23dSJohan Jonker      - const: biu
691eece23dSJohan Jonker      - const: ciu
701eece23dSJohan Jonker      - const: ciu-drive
711eece23dSJohan Jonker      - const: ciu-sample
721eece23dSJohan Jonker    description:
731eece23dSJohan Jonker      Apart from the clock-names "biu" and "ciu" two more clocks
741eece23dSJohan Jonker      "ciu-drive" and "ciu-sample" are supported. They are used
751eece23dSJohan Jonker      to control the clock phases, "ciu-sample" is required for tuning
761eece23dSJohan Jonker      high speed modes.
771eece23dSJohan Jonker
781eece23dSJohan Jonker  rockchip,default-sample-phase:
791eece23dSJohan Jonker    allOf:
801eece23dSJohan Jonker      - $ref: /schemas/types.yaml#/definitions/uint32
811eece23dSJohan Jonker    minimum: 0
821eece23dSJohan Jonker    maximum: 360
831eece23dSJohan Jonker    default: 0
841eece23dSJohan Jonker    description:
851eece23dSJohan Jonker      The default phase to set "ciu-sample" at probing,
861eece23dSJohan Jonker      low speeds or in case where all phases work at tuning time.
871eece23dSJohan Jonker      If not specified 0 deg will be used.
881eece23dSJohan Jonker
891eece23dSJohan Jonker  rockchip,desired-num-phases:
901eece23dSJohan Jonker    allOf:
911eece23dSJohan Jonker      - $ref: /schemas/types.yaml#/definitions/uint32
921eece23dSJohan Jonker    minimum: 0
931eece23dSJohan Jonker    maximum: 360
941eece23dSJohan Jonker    default: 360
951eece23dSJohan Jonker    description:
961eece23dSJohan Jonker      The desired number of times that the host execute tuning when needed.
971eece23dSJohan Jonker      If not specified, the host will do tuning for 360 times,
981eece23dSJohan Jonker      namely tuning for each degree.
991eece23dSJohan Jonker
1001eece23dSJohan Jonkerrequired:
1011eece23dSJohan Jonker  - compatible
1021eece23dSJohan Jonker  - reg
1031eece23dSJohan Jonker  - interrupts
1041eece23dSJohan Jonker  - clocks
1051eece23dSJohan Jonker  - clock-names
1061eece23dSJohan Jonker
1071eece23dSJohan Jonkerexamples:
1081eece23dSJohan Jonker  - |
1091eece23dSJohan Jonker    #include <dt-bindings/clock/rk3288-cru.h>
1101eece23dSJohan Jonker    #include <dt-bindings/interrupt-controller/arm-gic.h>
1111eece23dSJohan Jonker    #include <dt-bindings/interrupt-controller/irq.h>
1121eece23dSJohan Jonker    sdmmc: mmc@ff0c0000 {
1131eece23dSJohan Jonker      compatible = "rockchip,rk3288-dw-mshc";
1141eece23dSJohan Jonker      reg = <0x0 0xff0c0000 0x0 0x4000>;
1151eece23dSJohan Jonker      interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
1161eece23dSJohan Jonker      clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
1171eece23dSJohan Jonker               <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
1181eece23dSJohan Jonker      clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
1191eece23dSJohan Jonker      resets = <&cru SRST_MMC0>;
1201eece23dSJohan Jonker      reset-names = "reset";
1211eece23dSJohan Jonker      fifo-depth = <0x100>;
1221eece23dSJohan Jonker      max-frequency = <150000000>;
1231eece23dSJohan Jonker    };
1241eece23dSJohan Jonker
1251eece23dSJohan Jonker...
126