|
| 1 | +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause |
| 2 | +%YAML 1.2 |
| 3 | +--- |
| 4 | +$id: http://devicetree.org/schemas/dma/apple,sio.yaml# |
| 5 | +$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | + |
| 7 | +title: Apple SIO Coprocessor |
| 8 | + |
| 9 | +description: |
| 10 | + SIO is a coprocessor on Apple M1 and later chips (and maybe also on earlier |
| 11 | + chips). Its role is to offload SPI, UART and DisplayPort audio transfers, |
| 12 | + being a pretend DMA controller. |
| 13 | + |
| 14 | +maintainers: |
| 15 | + - Martin Povišer <povik+lin@cutebit.org> |
| 16 | + |
| 17 | +allOf: |
| 18 | + - $ref: dma-controller.yaml# |
| 19 | + |
| 20 | +properties: |
| 21 | + compatible: |
| 22 | + items: |
| 23 | + - enum: |
| 24 | + - apple,t6000-sio |
| 25 | + - apple,t8103-sio |
| 26 | + - const: apple,sio |
| 27 | + |
| 28 | + reg: |
| 29 | + maxItems: 1 |
| 30 | + |
| 31 | + '#dma-cells': |
| 32 | + const: 1 |
| 33 | + description: |
| 34 | + DMA clients specify a single cell that corresponds to the RTKit endpoint |
| 35 | + number used for arranging the transfers in question |
| 36 | + |
| 37 | + dma-channels: |
| 38 | + maximum: 128 |
| 39 | + |
| 40 | + mboxes: |
| 41 | + maxItems: 1 |
| 42 | + |
| 43 | + iommus: |
| 44 | + maxItems: 1 |
| 45 | + |
| 46 | + power-domains: |
| 47 | + maxItems: 1 |
| 48 | + |
| 49 | + memory-region: |
| 50 | + minItems: 2 |
| 51 | + maxItems: 8 |
| 52 | + description: |
| 53 | + A number of references to reserved memory regions among which are the DATA/TEXT |
| 54 | + sections of coprocessor executable firmware and also auxiliary firmware data |
| 55 | + describing the available DMA-enabled peripherals |
| 56 | + |
| 57 | + apple,sio-firmware-params: |
| 58 | + $ref: /schemas/types.yaml#/definitions/uint32-array |
| 59 | + description: | |
| 60 | + Parameters in the form of opaque key/value pairs that are to be sent to the SIO |
| 61 | + coprocesssor once it boots. These parameters can point into the reserved memory |
| 62 | + regions (in device address space). |
| 63 | +
|
| 64 | + Note that unlike Apple's firmware, we treat the parameters, and the data they |
| 65 | + refer to, as opaque. Apple embed short data blobs into their SIO devicetree node |
| 66 | + that describe the DMA-enabled peripherals (presumably with defined semantics). |
| 67 | + Their driver processes those blobs and sets up data structure in mapped device |
| 68 | + memory, then references this memory in the parameters sent to the SIO. At the |
| 69 | + level of description we are opting for in this binding, we assume the job of |
| 70 | + constructing those data structures has been done in advance, leaving behind an |
| 71 | + opaque list of key/value parameter pairs to be sent by a prospective driver. |
| 72 | +
|
| 73 | + This approach is chosen for two reasons: |
| 74 | +
|
| 75 | + - It means we don't need to try to understand the semantics of Apple's blobs |
| 76 | + as long as we know the transformation we need to do from Apple's devicetree |
| 77 | + data to SIO data (which can be shoved away into a loader). It also means the |
| 78 | + semantics of Apple's blobs (or of something to replace them) need not be part |
| 79 | + of the binding and be kept up with Apple's firmware changes in the future. |
| 80 | +
|
| 81 | + - It leaves less work for the driver attaching on this binding. Instead the work |
| 82 | + is done upfront in the loader which can be better suited for keeping up with |
| 83 | + Apple's firmware changes. |
| 84 | +
|
| 85 | +required: |
| 86 | + - compatible |
| 87 | + - reg |
| 88 | + - '#dma-cells' |
| 89 | + - dma-channels |
| 90 | + - mboxes |
| 91 | + - iommus |
| 92 | + - power-domains |
| 93 | + |
| 94 | +additionalProperties: false |
| 95 | + |
| 96 | +examples: |
| 97 | + - | |
| 98 | + sio: dma-controller@36400000 { |
| 99 | + compatible = "apple,t8103-sio", "apple,sio"; |
| 100 | + reg = <0x36400000 0x8000>; |
| 101 | + dma-channels = <128>; |
| 102 | + #dma-cells = <1>; |
| 103 | + mboxes = <&sio_mbox>; |
| 104 | + iommus = <&sio_dart 0>; |
| 105 | + power-domains = <&ps_sio_cpu>; |
| 106 | + memory-region = <&sio_text>, <&sio_data>, |
| 107 | + <&sio_auxdata1>, <&sio_auxdata2>; /* Filled by loader */ |
| 108 | + apple,sio-firmware-params = <0xb 0x10>, <0xc 0x1b80>, <0xf 0x14>, |
| 109 | + <0x10 0x1e000>, <0x30d 0x34>, <0x30e 0x4000>, |
| 110 | + <0x1a 0x38>, <0x1b 0x50>; /* Filled by loader */ |
| 111 | + }; |
0 commit comments