1*d5b0e70fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*d5b0e70fSEmmanuel Vadot%YAML 1.2
3*d5b0e70fSEmmanuel Vadot---
4*d5b0e70fSEmmanuel Vadot$id: http://devicetree.org/schemas/soc/ti/wkup-m3-ipc.yaml#
5*d5b0e70fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*d5b0e70fSEmmanuel Vadot
7*d5b0e70fSEmmanuel Vadottitle: Wakeup M3 IPC device
8*d5b0e70fSEmmanuel Vadot
9*d5b0e70fSEmmanuel Vadotmaintainers:
10*d5b0e70fSEmmanuel Vadot  - Dave Gerlach <d-gerlach@ti.com>
11*d5b0e70fSEmmanuel Vadot  - Drew Fustini <dfustini@baylibre.com>
12*d5b0e70fSEmmanuel Vadot
13*d5b0e70fSEmmanuel Vadotdescription: |+
14*d5b0e70fSEmmanuel Vadot  The TI AM33xx and AM43xx family of devices use a small Cortex M3 co-processor
15*d5b0e70fSEmmanuel Vadot  (commonly referred to as Wakeup M3 or CM3) to help with various low power tasks
16*d5b0e70fSEmmanuel Vadot  that cannot be controlled from the MPU, like suspend/resume and certain deep
17*d5b0e70fSEmmanuel Vadot  C-states for CPU Idle. Once the wkup_m3_ipc driver uses the wkup_m3_rproc driver
18*d5b0e70fSEmmanuel Vadot  to boot the wkup_m3, it handles communication with the CM3 using IPC registers
19*d5b0e70fSEmmanuel Vadot  present in the SoC's control module and a mailbox. The wkup_m3_ipc exposes an
20*d5b0e70fSEmmanuel Vadot  API to allow the SoC PM code to execute specific PM tasks.
21*d5b0e70fSEmmanuel Vadot
22*d5b0e70fSEmmanuel Vadot  Wkup M3 Device Node
23*d5b0e70fSEmmanuel Vadot  ====================
24*d5b0e70fSEmmanuel Vadot  A wkup_m3_ipc device node is used to represent the IPC registers within an
25*d5b0e70fSEmmanuel Vadot  SoC.
26*d5b0e70fSEmmanuel Vadot
27*d5b0e70fSEmmanuel Vadot  Support for VTT Toggle with GPIO pin
28*d5b0e70fSEmmanuel Vadot  ====================================
29*d5b0e70fSEmmanuel Vadot  On some boards like the AM335x EVM-SK and the AM437x GP EVM, a GPIO pin is
30*d5b0e70fSEmmanuel Vadot  connected to the enable pin on the DDR VTT regulator. This allows the
31*d5b0e70fSEmmanuel Vadot  regulator to be disabled upon suspend and enabled upon resume. Please note
32*d5b0e70fSEmmanuel Vadot  that the GPIO pin must be part of the GPIO0 module as only this GPIO module
33*d5b0e70fSEmmanuel Vadot  is in the wakeup power domain.
34*d5b0e70fSEmmanuel Vadot
35*d5b0e70fSEmmanuel Vadot  Support for IO Isolation
36*d5b0e70fSEmmanuel Vadot  ========================
37*d5b0e70fSEmmanuel Vadot  On AM437x SoCs, certain pins can be forced into an alternate state when IO
38*d5b0e70fSEmmanuel Vadot  isolation is activated. Those pins have pad control registers prefixed by
39*d5b0e70fSEmmanuel Vadot  'CTRL_CONF_' that contain DS0 (e.g. deep sleep) configuration bits that can
40*d5b0e70fSEmmanuel Vadot  override the pin's existing bias (pull-up/pull-down) and value (high/low) when
41*d5b0e70fSEmmanuel Vadot  IO isolation is active.
42*d5b0e70fSEmmanuel Vadot
43*d5b0e70fSEmmanuel Vadot  Support for I2C PMIC Voltage Scaling
44*d5b0e70fSEmmanuel Vadot  ====================================
45*d5b0e70fSEmmanuel Vadot  It is possible to pass the name of a binary file to load into the CM3 memory.
46*d5b0e70fSEmmanuel Vadot  The binary data is the I2C sequences for the CM3 to send out to the PMIC
47*d5b0e70fSEmmanuel Vadot  during low power mode entry.
48*d5b0e70fSEmmanuel Vadot
49*d5b0e70fSEmmanuel Vadotproperties:
50*d5b0e70fSEmmanuel Vadot  compatible:
51*d5b0e70fSEmmanuel Vadot    enum:
52*d5b0e70fSEmmanuel Vadot      - ti,am3352-wkup-m3-ipc # for AM33xx SoCs
53*d5b0e70fSEmmanuel Vadot      - ti,am4372-wkup-m3-ipc # for AM43xx SoCs
54*d5b0e70fSEmmanuel Vadot
55*d5b0e70fSEmmanuel Vadot  reg:
56*d5b0e70fSEmmanuel Vadot    description:
57*d5b0e70fSEmmanuel Vadot      The IPC register address space to communicate with the Wakeup M3 processor
58*d5b0e70fSEmmanuel Vadot    maxItems: 1
59*d5b0e70fSEmmanuel Vadot
60*d5b0e70fSEmmanuel Vadot  interrupts:
61*d5b0e70fSEmmanuel Vadot    description: wkup_m3 interrupt that signals the MPU
62*d5b0e70fSEmmanuel Vadot    maxItems: 1
63*d5b0e70fSEmmanuel Vadot
64*d5b0e70fSEmmanuel Vadot  ti,rproc:
65*d5b0e70fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
66*d5b0e70fSEmmanuel Vadot    description:
67*d5b0e70fSEmmanuel Vadot      phandle to the wkup_m3 rproc node so the IPC driver can boot it
68*d5b0e70fSEmmanuel Vadot
69*d5b0e70fSEmmanuel Vadot  mboxes:
70*d5b0e70fSEmmanuel Vadot    description:
71*d5b0e70fSEmmanuel Vadot      phandles used by IPC framework to get correct mbox
72*d5b0e70fSEmmanuel Vadot      channel for communication. Must point to appropriate
73*d5b0e70fSEmmanuel Vadot      mbox_wkupm3 child node.
74*d5b0e70fSEmmanuel Vadot    maxItems: 1
75*d5b0e70fSEmmanuel Vadot
76*d5b0e70fSEmmanuel Vadot  firmware-name:
77*d5b0e70fSEmmanuel Vadot    description:
78*d5b0e70fSEmmanuel Vadot      Name of binary file with I2C sequences for PMIC voltage scaling
79*d5b0e70fSEmmanuel Vadot
80*d5b0e70fSEmmanuel Vadot  ti,vtt-gpio-pin:
81*d5b0e70fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
82*d5b0e70fSEmmanuel Vadot    description: GPIO pin connected to enable pin on VTT regulator
83*d5b0e70fSEmmanuel Vadot
84*d5b0e70fSEmmanuel Vadot  ti,set-io-isolation:
85*d5b0e70fSEmmanuel Vadot    type: boolean
86*d5b0e70fSEmmanuel Vadot    description:
87*d5b0e70fSEmmanuel Vadot      If this property is present, then the wkup_m3_ipc driver will instruct
88*d5b0e70fSEmmanuel Vadot      the CM3 firmware to activate IO isolation when suspending to deep sleep.
89*d5b0e70fSEmmanuel Vadot      This can be leveraged by a board design to put other devices on the board
90*d5b0e70fSEmmanuel Vadot      into a low power state.
91*d5b0e70fSEmmanuel Vadot
92*d5b0e70fSEmmanuel VadotallOf:
93*d5b0e70fSEmmanuel Vadot  - if:
94*d5b0e70fSEmmanuel Vadot      properties:
95*d5b0e70fSEmmanuel Vadot        compatible:
96*d5b0e70fSEmmanuel Vadot          not:
97*d5b0e70fSEmmanuel Vadot            contains:
98*d5b0e70fSEmmanuel Vadot              const: ti,am4372-wkup-m3-ipc
99*d5b0e70fSEmmanuel Vadot    then:
100*d5b0e70fSEmmanuel Vadot      properties:
101*d5b0e70fSEmmanuel Vadot        ti,set-io-isolation: false
102*d5b0e70fSEmmanuel Vadot
103*d5b0e70fSEmmanuel Vadotrequired:
104*d5b0e70fSEmmanuel Vadot  - compatible
105*d5b0e70fSEmmanuel Vadot  - reg
106*d5b0e70fSEmmanuel Vadot  - interrupts
107*d5b0e70fSEmmanuel Vadot  - ti,rproc
108*d5b0e70fSEmmanuel Vadot  - mboxes
109*d5b0e70fSEmmanuel Vadot
110*d5b0e70fSEmmanuel VadotadditionalProperties: false
111*d5b0e70fSEmmanuel Vadot
112*d5b0e70fSEmmanuel Vadotexamples:
113*d5b0e70fSEmmanuel Vadot  - |
114*d5b0e70fSEmmanuel Vadot    /* Example for AM335x SoC */
115*d5b0e70fSEmmanuel Vadot    soc {
116*d5b0e70fSEmmanuel Vadot        #address-cells = <1>;
117*d5b0e70fSEmmanuel Vadot        #size-cells = <1>;
118*d5b0e70fSEmmanuel Vadot
119*d5b0e70fSEmmanuel Vadot        am335x_mailbox: mailbox {
120*d5b0e70fSEmmanuel Vadot            #mbox-cells = <1>;
121*d5b0e70fSEmmanuel Vadot        };
122*d5b0e70fSEmmanuel Vadot
123*d5b0e70fSEmmanuel Vadot        wkup_m3_ipc@1324 {
124*d5b0e70fSEmmanuel Vadot           compatible = "ti,am3352-wkup-m3-ipc";
125*d5b0e70fSEmmanuel Vadot           reg = <0x1324 0x24>;
126*d5b0e70fSEmmanuel Vadot           interrupts = <78>;
127*d5b0e70fSEmmanuel Vadot           ti,rproc = <&wkup_m3>;
128*d5b0e70fSEmmanuel Vadot           mboxes = <&am335x_mailbox &mbox_wkupm3>;
129*d5b0e70fSEmmanuel Vadot           ti,vtt-gpio-pin = <7>;
130*d5b0e70fSEmmanuel Vadot           firmware-name = "am335x-evm-scale-data.bin";
131*d5b0e70fSEmmanuel Vadot        };
132*d5b0e70fSEmmanuel Vadot    };
133*d5b0e70fSEmmanuel Vadot
134*d5b0e70fSEmmanuel Vadot  - |
135*d5b0e70fSEmmanuel Vadot    /*
136*d5b0e70fSEmmanuel Vadot     * Example for AM473x SoC:
137*d5b0e70fSEmmanuel Vadot     * On the AM437x-GP-EVM board, gpio5_7 is wired to enable pin of the DDR VTT
138*d5b0e70fSEmmanuel Vadot     * regulator. The 'ddr_vtt_toggle_default' pinmux node configures gpio5_7
139*d5b0e70fSEmmanuel Vadot     * for pull-up during normal system operation. However, the DS0 (deep sleep)
140*d5b0e70fSEmmanuel Vadot     * state of the pin is configured for pull-down and thus the VTT regulator
141*d5b0e70fSEmmanuel Vadot     * will be disabled to save power when IO isolation is active. Note that
142*d5b0e70fSEmmanuel Vadot     * this method is an alternative to using the 'ti,vtt-gpio-pin' property.
143*d5b0e70fSEmmanuel Vadot     */
144*d5b0e70fSEmmanuel Vadot    #include <dt-bindings/pinctrl/am43xx.h>
145*d5b0e70fSEmmanuel Vadot    soc {
146*d5b0e70fSEmmanuel Vadot        #address-cells = <1>;
147*d5b0e70fSEmmanuel Vadot        #size-cells = <1>;
148*d5b0e70fSEmmanuel Vadot
149*d5b0e70fSEmmanuel Vadot        am437x_mailbox: mailbox {
150*d5b0e70fSEmmanuel Vadot            #mbox-cells = <1>;
151*d5b0e70fSEmmanuel Vadot        };
152*d5b0e70fSEmmanuel Vadot
153*d5b0e70fSEmmanuel Vadot        am43xx_pinmux {
154*d5b0e70fSEmmanuel Vadot            pinctrl-names = "default";
155*d5b0e70fSEmmanuel Vadot            pinctrl-0 = <&ddr3_vtt_toggle_default>;
156*d5b0e70fSEmmanuel Vadot
157*d5b0e70fSEmmanuel Vadot            ddr3_vtt_toggle_default: ddr_vtt_toggle_default {
158*d5b0e70fSEmmanuel Vadot                 pinctrl-single,pins = <
159*d5b0e70fSEmmanuel Vadot                    0x25C (DS0_PULL_UP_DOWN_EN | PIN_OUTPUT_PULLUP | DS0_FORCE_OFF_MODE | MUX_MODE7)
160*d5b0e70fSEmmanuel Vadot                 >;
161*d5b0e70fSEmmanuel Vadot            };
162*d5b0e70fSEmmanuel Vadot        };
163*d5b0e70fSEmmanuel Vadot
164*d5b0e70fSEmmanuel Vadot        wkup_m3_ipc@1324 {
165*d5b0e70fSEmmanuel Vadot           compatible = "ti,am4372-wkup-m3-ipc";
166*d5b0e70fSEmmanuel Vadot           reg = <0x1324 0x24>;
167*d5b0e70fSEmmanuel Vadot           interrupts = <78>;
168*d5b0e70fSEmmanuel Vadot           ti,rproc = <&wkup_m3>;
169*d5b0e70fSEmmanuel Vadot           mboxes = <&am437x_mailbox &mbox_wkupm3>;
170*d5b0e70fSEmmanuel Vadot           ti,set-io-isolation;
171*d5b0e70fSEmmanuel Vadot           firmware-name = "am43x-evm-scale-data.bin";
172*d5b0e70fSEmmanuel Vadot        };
173*d5b0e70fSEmmanuel Vadot    };
174*d5b0e70fSEmmanuel Vadot
175*d5b0e70fSEmmanuel Vadot...
176