1cb7aa33aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2cb7aa33aSEmmanuel Vadot%YAML 1.2 3cb7aa33aSEmmanuel Vadot--- 4cb7aa33aSEmmanuel Vadot$id: http://devicetree.org/schemas/soc/mediatek/mediatek,pwrap.yaml# 5cb7aa33aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6cb7aa33aSEmmanuel Vadot 7cb7aa33aSEmmanuel Vadottitle: Mediatek PMIC Wrapper 8cb7aa33aSEmmanuel Vadot 9cb7aa33aSEmmanuel Vadotmaintainers: 10cb7aa33aSEmmanuel Vadot - Flora Fu <flora.fu@mediatek.com> 11cb7aa33aSEmmanuel Vadot - Alexandre Mergnat <amergnat@baylibre.com> 12cb7aa33aSEmmanuel Vadot 13cb7aa33aSEmmanuel Vadotdescription: 14cb7aa33aSEmmanuel Vadot On MediaTek SoCs the PMIC is connected via SPI. The SPI master interface 15cb7aa33aSEmmanuel Vadot is not directly visible to the CPU, but only through the PMIC wrapper 16cb7aa33aSEmmanuel Vadot inside the SoC. The communication between the SoC and the PMIC can 17cb7aa33aSEmmanuel Vadot optionally be encrypted. Also a non standard Dual IO SPI mode can be 18cb7aa33aSEmmanuel Vadot used to increase speed. 19cb7aa33aSEmmanuel Vadot 20cb7aa33aSEmmanuel Vadot IP Pairing 21cb7aa33aSEmmanuel Vadot 22cb7aa33aSEmmanuel Vadot On MT8135 the pins of some SoC internal peripherals can be on the PMIC. 23cb7aa33aSEmmanuel Vadot The signals of these pins are routed over the SPI bus using the pwrap 24cb7aa33aSEmmanuel Vadot bridge. In the binding description below the properties needed for bridging 25cb7aa33aSEmmanuel Vadot are marked with "IP Pairing". These are optional on SoCs which do not support 26cb7aa33aSEmmanuel Vadot IP Pairing 27cb7aa33aSEmmanuel Vadot 28cb7aa33aSEmmanuel Vadotproperties: 29cb7aa33aSEmmanuel Vadot compatible: 30cb7aa33aSEmmanuel Vadot oneOf: 31cb7aa33aSEmmanuel Vadot - items: 32cb7aa33aSEmmanuel Vadot - enum: 33cb7aa33aSEmmanuel Vadot - mediatek,mt2701-pwrap 34cb7aa33aSEmmanuel Vadot - mediatek,mt6765-pwrap 35cb7aa33aSEmmanuel Vadot - mediatek,mt6779-pwrap 36f126890aSEmmanuel Vadot - mediatek,mt6795-pwrap 37cb7aa33aSEmmanuel Vadot - mediatek,mt6797-pwrap 38cb7aa33aSEmmanuel Vadot - mediatek,mt6873-pwrap 39cb7aa33aSEmmanuel Vadot - mediatek,mt7622-pwrap 40cb7aa33aSEmmanuel Vadot - mediatek,mt8135-pwrap 41cb7aa33aSEmmanuel Vadot - mediatek,mt8173-pwrap 42cb7aa33aSEmmanuel Vadot - mediatek,mt8183-pwrap 43cb7aa33aSEmmanuel Vadot - mediatek,mt8186-pwrap 44cb7aa33aSEmmanuel Vadot - mediatek,mt8195-pwrap 45cb7aa33aSEmmanuel Vadot - mediatek,mt8365-pwrap 46cb7aa33aSEmmanuel Vadot - mediatek,mt8516-pwrap 47cb7aa33aSEmmanuel Vadot - items: 48cb7aa33aSEmmanuel Vadot - enum: 49cb7aa33aSEmmanuel Vadot - mediatek,mt8186-pwrap 50cb7aa33aSEmmanuel Vadot - mediatek,mt8195-pwrap 51cb7aa33aSEmmanuel Vadot - const: syscon 52*8d13bc63SEmmanuel Vadot - items: 53*8d13bc63SEmmanuel Vadot - enum: 54*8d13bc63SEmmanuel Vadot - mediatek,mt8188-pwrap 55*8d13bc63SEmmanuel Vadot - const: mediatek,mt8195-pwrap 56*8d13bc63SEmmanuel Vadot - const: syscon 57cb7aa33aSEmmanuel Vadot 58cb7aa33aSEmmanuel Vadot reg: 59cb7aa33aSEmmanuel Vadot minItems: 1 60cb7aa33aSEmmanuel Vadot items: 61cb7aa33aSEmmanuel Vadot - description: PMIC wrapper registers 62cb7aa33aSEmmanuel Vadot - description: IP pairing registers 63cb7aa33aSEmmanuel Vadot 64cb7aa33aSEmmanuel Vadot reg-names: 65cb7aa33aSEmmanuel Vadot minItems: 1 66cb7aa33aSEmmanuel Vadot items: 67cb7aa33aSEmmanuel Vadot - const: pwrap 68cb7aa33aSEmmanuel Vadot - const: pwrap-bridge 69cb7aa33aSEmmanuel Vadot 70cb7aa33aSEmmanuel Vadot interrupts: 71cb7aa33aSEmmanuel Vadot maxItems: 1 72cb7aa33aSEmmanuel Vadot 73cb7aa33aSEmmanuel Vadot clocks: 74cb7aa33aSEmmanuel Vadot minItems: 2 75cb7aa33aSEmmanuel Vadot items: 76cb7aa33aSEmmanuel Vadot - description: SPI bus clock 77cb7aa33aSEmmanuel Vadot - description: Main module clock 78cb7aa33aSEmmanuel Vadot - description: System module clock 79cb7aa33aSEmmanuel Vadot - description: Timer module clock 80cb7aa33aSEmmanuel Vadot 81cb7aa33aSEmmanuel Vadot clock-names: 82cb7aa33aSEmmanuel Vadot minItems: 2 83cb7aa33aSEmmanuel Vadot items: 84cb7aa33aSEmmanuel Vadot - const: spi 85cb7aa33aSEmmanuel Vadot - const: wrap 86cb7aa33aSEmmanuel Vadot - const: sys 87cb7aa33aSEmmanuel Vadot - const: tmr 88cb7aa33aSEmmanuel Vadot 89cb7aa33aSEmmanuel Vadot resets: 90cb7aa33aSEmmanuel Vadot minItems: 1 91cb7aa33aSEmmanuel Vadot items: 92cb7aa33aSEmmanuel Vadot - description: PMIC wrapper reset 93cb7aa33aSEmmanuel Vadot - description: IP pairing reset 94cb7aa33aSEmmanuel Vadot 95cb7aa33aSEmmanuel Vadot reset-names: 96cb7aa33aSEmmanuel Vadot minItems: 1 97cb7aa33aSEmmanuel Vadot items: 98cb7aa33aSEmmanuel Vadot - const: pwrap 99cb7aa33aSEmmanuel Vadot - const: pwrap-bridge 100cb7aa33aSEmmanuel Vadot 101cb7aa33aSEmmanuel Vadot pmic: 102cb7aa33aSEmmanuel Vadot type: object 103cb7aa33aSEmmanuel Vadot 104cb7aa33aSEmmanuel Vadotrequired: 105cb7aa33aSEmmanuel Vadot - compatible 106cb7aa33aSEmmanuel Vadot - reg 107cb7aa33aSEmmanuel Vadot - reg-names 108cb7aa33aSEmmanuel Vadot - interrupts 109cb7aa33aSEmmanuel Vadot - clocks 110cb7aa33aSEmmanuel Vadot - clock-names 111cb7aa33aSEmmanuel Vadot 112cb7aa33aSEmmanuel VadotdependentRequired: 113cb7aa33aSEmmanuel Vadot resets: [reset-names] 114cb7aa33aSEmmanuel Vadot 115cb7aa33aSEmmanuel VadotallOf: 116cb7aa33aSEmmanuel Vadot - if: 117cb7aa33aSEmmanuel Vadot properties: 118cb7aa33aSEmmanuel Vadot compatible: 119cb7aa33aSEmmanuel Vadot contains: 120cb7aa33aSEmmanuel Vadot const: mediatek,mt8365-pwrap 121cb7aa33aSEmmanuel Vadot then: 122cb7aa33aSEmmanuel Vadot properties: 123cb7aa33aSEmmanuel Vadot clocks: 124cb7aa33aSEmmanuel Vadot minItems: 4 125cb7aa33aSEmmanuel Vadot 126cb7aa33aSEmmanuel Vadot clock-names: 127cb7aa33aSEmmanuel Vadot minItems: 4 128cb7aa33aSEmmanuel Vadot 129cb7aa33aSEmmanuel VadotadditionalProperties: false 130cb7aa33aSEmmanuel Vadot 131cb7aa33aSEmmanuel Vadotexamples: 132cb7aa33aSEmmanuel Vadot - | 133cb7aa33aSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 134cb7aa33aSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 135cb7aa33aSEmmanuel Vadot #include <dt-bindings/reset/mt8135-resets.h> 136cb7aa33aSEmmanuel Vadot 137cb7aa33aSEmmanuel Vadot soc { 138cb7aa33aSEmmanuel Vadot #address-cells = <2>; 139cb7aa33aSEmmanuel Vadot #size-cells = <2>; 140cb7aa33aSEmmanuel Vadot pwrap@1000f000 { 141cb7aa33aSEmmanuel Vadot compatible = "mediatek,mt8135-pwrap"; 142cb7aa33aSEmmanuel Vadot reg = <0 0x1000f000 0 0x1000>, 143cb7aa33aSEmmanuel Vadot <0 0x11017000 0 0x1000>; 144cb7aa33aSEmmanuel Vadot reg-names = "pwrap", "pwrap-bridge"; 145cb7aa33aSEmmanuel Vadot interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>; 146cb7aa33aSEmmanuel Vadot clocks = <&clk26m>, <&clk26m>; 147cb7aa33aSEmmanuel Vadot clock-names = "spi", "wrap"; 148cb7aa33aSEmmanuel Vadot resets = <&infracfg MT8135_INFRA_PMIC_WRAP_RST>, 149cb7aa33aSEmmanuel Vadot <&pericfg MT8135_PERI_PWRAP_BRIDGE_SW_RST>; 150cb7aa33aSEmmanuel Vadot reset-names = "pwrap", "pwrap-bridge"; 151cb7aa33aSEmmanuel Vadot }; 152cb7aa33aSEmmanuel Vadot }; 153