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