1# Copyright (c) 2020 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5    This is an abstract device responsible for forwarding pins between cores.
6
7    In nRF53 family of SoCs, GPIO pins must be explicitly forwarded by
8    the application core to the network core if the latter should drive them.
9    The purpose of this abstract device is to represent all GPIO pins that the
10    nRF53 application core should forward to the nRF53 network core.
11
12    Once the control over selected GPIO pins is forwarded to it, the network
13    core is responsible for configuring the pins and driving them as needed.
14
15    Here is an example of how a nrf-gpio-forwarder can be used with a nRF5340
16    combined with a nRF21540 Front-End module. Consider the following node
17    present in DTS file targeted for the nRF5340 network core, which defines
18    the details of the nRF21540 Front-End module's interface:
19
20    nrf_radio_fem: nrf21540 {
21      compatible = "nordic,nrf21540-fem";
22      tx-en-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
23      rx-en-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
24      pdn-gpios   = <&gpio1 10 GPIO_ACTIVE_HIGH>;
25      mode-gpios  = <&gpio1 12 GPIO_ACTIVE_HIGH>;
26    };
27
28    Since the nRF21540 Front-End module should be controlled by the nRF5340
29    network core, all the GPIO pins used to control it must be forwarded by
30    the nRF5340 application core to the network core. Consider the following
31    nrf-gpio-forwarder node defined in DTS file targeted for the nRF5340
32    application core:
33
34    gpio_fwd: nrf-gpio-forwarder {
35      compatible = "nordic,nrf-gpio-forwarder";
36      nrf21540-gpio-if {
37        gpios = <&gpio0 30 0>, <&gpio1 11 0>, <&gpio1 10 0>, <&gpio1 12 0>;
38      };
39    };
40
41    In the above example, the nrf-gpio-forwarder node is configured to forward
42    control over the following GPIO pins to the network core:
43
44      - P0.30 (matching `tx-en-gpios`)
45      - P1.11 (matching `rx-en-gpios`)
46      - P1.10 (matching `pdn-gpios`)
47      - P1.12 (matching `mode-gpios`)
48
49    Please note that the GPIO flags provided for child nodes of the forwarder
50    are ignored. In order to configure the GPIOs passed to the forwarder, their
51    GPIO flags must be set in the matching node that these GPIOs are forwarded
52    to. In the above example, the GPIO flags must be set in the nrf21540 node.
53    They are set to 0 in the nrf-gpio-forwarder node as they are ignored anyway.
54
55    Child nodes for the forwarder can be defined independently by multiple DTS
56    files. They are merged into a single node with multiple child nodes when
57    processing devicetree for an application build. However, in order for that
58    to happen, names of the child nodes must be unique in the scope of a single
59    nrf-gpio-forwarder instance.
60
61compatible: "nordic,nrf-gpio-forwarder"
62
63include: "base.yaml"
64
65child-binding:
66  description: Arrays of GPIOs to be forwarded.
67
68  properties:
69    gpios:
70      type: phandle-array
71      required: true
72      description: |
73          Array of GPIOs to be forwarded. Note that GPIO flags provided for
74          elements of this array are ignored. In order to configure the GPIOs
75          from this array, their GPIO flags must be set in the matching
76          node that these GPIOs are forwarded to.
77