Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions Documentation/devicetree/bindings/soc/apple/apple,t6041-aop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/soc/apple/apple,t6041-aop.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple T604x Always-On Processor
title: Apple T604x and T8132 Always-On Processor

maintainers:
- Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
Expand All @@ -16,9 +16,15 @@ description:
reaches its services through the RTKit endpoints. The firmware's external
code and log segments live in DRAM, and the bootloader reserves them.

On T8132 the bootloader also programs the AOP DART's address filter (DAPF)
and reserves its windows, which the firmware reaches through its DART at
their physical addresses.

properties:
compatible:
const: apple,t6041-aop
enum:
- apple,t6041-aop
- apple,t8132-aop

reg:
minItems: 2
Expand Down Expand Up @@ -47,11 +53,12 @@ properties:

memory-region:
minItems: 1
maxItems: 4
maxItems: 18
description:
The firmware segments in DRAM (its external code and its log), filled in
by the bootloader from the ADT. The iommu-addresses property of each
region gives the address the firmware uses for it.
The firmware segments in DRAM (its external code and its log) and, on
T8132, the DAPF windows, filled in by the bootloader from the ADT. The
iommu-addresses property of each region gives the address the firmware
uses for it.

audio:
type: object
Expand Down Expand Up @@ -93,6 +100,16 @@ required:
- mbox-names
- iommus

allOf:
- if:
properties:
compatible:
const: apple,t6041-aop
then:
properties:
memory-region:
maxItems: 4

additionalProperties: false

examples:
Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/sound/apple,macaudio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ properties:
- apple,j616-macaudio
- apple,j616-macaudio-jack
- apple,j700-macaudio
- apple,j713-macaudio
- apple,j713-macaudio-jack
- const: apple,macaudio

"#address-cells":
Expand Down
61 changes: 40 additions & 21 deletions Documentation/devicetree/bindings/sound/apple,t6041-aop-audio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
$id: http://devicetree.org/schemas/sound/apple,t6041-aop-audio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple T6041 AOP audio
title: Apple T6041 and T8132 AOP audio

maintainers:
- Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>

description: |
The Always-On Processor on Apple T6041 SoCs runs the machine's audio
The Always-On Processor on Apple T6041 and T8132 SoCs runs the machine's audio
streams in its firmware: the microphone array, the internal speakers with
their voltage and current sense, and the 3.5 mm headset jack in both
directions. This node is a child of the AOP node and names the ADMAC
channels the host moves each stream's data over while the firmware runs
its serializer. The parent AOP binding describes the firmware transport.

The headset jack's channels are optional: a node without them has no jack
streams.
The speaker and headset jack channels are optional: a node without them has
no speaker or jack streams.

# Only select T6041 nodes: other AOP audio nodes carry the
# apple,t6030-aop-audio fallback too and have a different set of streams.
Expand All @@ -35,27 +35,46 @@ allOf:

properties:
compatible:
items:
- const: apple,t6041-aop-audio
- const: apple,t6030-aop-audio
oneOf:
- items:
- const: apple,t6041-aop-audio
- const: apple,t6030-aop-audio
- items:
- const: apple,t8132-aop-audio
- const: apple,t6041-aop-audio
- const: apple,t6030-aop-audio

dmas:
minItems: 3
items:
- description: Microphone array input
- description: Internal speaker output
- description: Speaker voltage and current sense input
- description: Headset jack output
- description: Headset microphone input
description:
The ADMAC channels named in dma-names, in that order. "dma" is the
microphone array input, "spkr" the internal speaker output, "sense" the
speakers' voltage and current sense input, "cout" the headset jack output
and "cin" the headset microphone input.
minItems: 1
maxItems: 5

dma-names:
minItems: 3
items:
- const: dma
- const: spkr
- const: sense
- const: cout
- const: cin
oneOf:
- description: The microphones only
items:
- const: dma
- description: The microphones and the headset jack
items:
- const: dma
- const: cout
- const: cin
- description: The microphones and the speakers
items:
- const: dma
- const: spkr
- const: sense
- description: The microphones, the speakers and the headset jack
items:
- const: dma
- const: spkr
- const: sense
- const: cout
- const: cin

"#sound-dai-cells":
const: 1
Expand Down
6 changes: 4 additions & 2 deletions arch/arm64/boot/dts/apple/t8132-j713-pmgr.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,18 @@
status = "disabled";
};

/* The CS42L84 headphone codec. */
&ps_i2c1 {
status = "disabled";
status = "okay";
};

&ps_i2c2 {
status = "disabled";
};

/* The SN012776 speaker amps. */
&ps_i2c3 {
status = "disabled";
status = "okay";
};

&ps_i2c4 {
Expand Down
186 changes: 186 additions & 0 deletions arch/arm64/boot/dts/apple/t8132-j713.dts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,76 @@
wifi0 = &wifi0;
};

/*
* The speaker amps' shared shutdown line (SDZ, AP GPIO 15, the ADT
* function-reset; low = shutdown). One fixed regulator, the SDZ supply
* of all four, so one amp's fault takes the whole group down.
*/
speaker_sdz: regulator-sn012776-sdz {
compatible = "regulator-fixed";
regulator-name = "sn012776-sdz";
gpios = <&pinctrl_ap 15 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

/*
* The AOP firmware runs the stream (MCA cluster 0, one serializer for
* the four amps); macaudio's J713 variant links the AOP audio
* component's speaker back-end (DAI 3) to them. The codecs are listed in
* the ADT provider order, so each gets its native playback slot (LW 0,
* RW 1, LT 2, RT 3). The idle masks are the ADT amp-tx-zd-config rows 0
* and 1 over the 16 sense byte slots: the left woofer drives zeros in
* the right amps' sense slots, the right woofer in the left amps'.
*/
sound: sound {
compatible = "apple,j713-macaudio", "apple,macaudio";
model = "MacBook Air J713";
#address-cells = <1>;
#size-cells = <0>;

dai-link@0 {
reg = <0>;
link-name = "Speakers";
dai-tdm-idle-mode-0 = "zero";
dai-tdm-idle-mode-1 = "zero";
dai-tdm-slot-tx-idle-mask-0 = <0xf0f0>;
dai-tdm-slot-tx-idle-mask-1 = <0x0f0f>;

cpu {
sound-dai = <&aop_audio 3>;
};

codec {
sound-dai = <&speaker_left_woof>, <&speaker_right_woof>,
<&speaker_left_tweet>, <&speaker_right_tweet>;
};
};
};

/*
* The headphone jack: the AOP audio component's jack back-end (DAI 4)
* to the CS42L84, as a card of its own.
*/
sound_jack: sound-jack {
compatible = "apple,j713-macaudio-jack", "apple,macaudio";
model = "MacBook Air J713 Jack";
#address-cells = <1>;
#size-cells = <0>;

dai-link@0 {
reg = <0>;
link-name = "Headphone Jack";

cpu {
sound-dai = <&aop_audio 4>;
};

codec {
sound-dai = <&jack_codec>;
};
};
};

chosen {
linux-enablement-mac,disk-boot;
linux-enablement-mac,dapf-handoff = "/arm-io/aop", "/arm-io/mtp",
Expand All @@ -56,6 +126,122 @@
};
};

/*
* m1n1 programs the AOP DART's DAPF and reserves the firmware segments and
* the DAPF windows in memory-region when /chosen asks for the AOP's handoff,
* or disables the AOP.
*/
&aop {
status = "okay";
};

&aop_audio {
/*
* The microphones on LEAP; the speakers and their sense on base-ns TX0
* and RX0 (the J616s stream: six playback and twelve sense slots, of
* which the four amps take the first four and eight), the jack on TX2
* and RX2.
*/
dmas = <&admac0 1>, <&admac1 0>, <&admac1 1>, <&admac1 4>, <&admac1 5>;
dma-names = "dma", "spkr", "sense", "cout", "cin";
apple,chassis-name = "J713";
apple,machine-kind = "MacBook Air";
};

/*
* The four SN012776 speaker amps, held in hardware shutdown until the sound
* card enables them (ADT /arm-io/i2c3/audio-speaker at 0x38 and its
* speaker1..3): one interrupt line on AP GPIO 14, level low; sense slots from
* speaker-config (amp i at RX bytes 4i and 4i + 2, order LW RW LT RT). Names
* as speakersafetyd's j413/j613 profiles use them. Every amp joins the SDZ
* fail-closed group.
*/
&i2c3 {
status = "okay";

speaker_left_woof: codec@38 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x38>;
SDZ-supply = <&speaker_sdz>;
apple,sdz-group-fail-closed;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Woofer";
interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <0>;
ti,vmon-slot-no = <2>;
};

speaker_left_tweet: codec@39 {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x39>;
SDZ-supply = <&speaker_sdz>;
apple,sdz-group-fail-closed;
#sound-dai-cells = <0>;
sound-name-prefix = "Left Tweeter";
interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <8>;
ti,vmon-slot-no = <10>;
};

speaker_right_woof: codec@3b {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3b>;
SDZ-supply = <&speaker_sdz>;
apple,sdz-group-fail-closed;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Woofer";
interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <4>;
ti,vmon-slot-no = <6>;
};

speaker_right_tweet: codec@3c {
compatible = "ti,sn012776", "ti,tas2764";
reg = <0x3c>;
SDZ-supply = <&speaker_sdz>;
apple,sdz-group-fail-closed;
#sound-dai-cells = <0>;
sound-name-prefix = "Right Tweeter";
interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>;
ti,imon-slot-no = <12>;
ti,vmon-slot-no = <14>;
};
};

/*
* The CS42L84 headphone codec (ADT /arm-io/i2c1/audio-codec-output at 0x4b).
* Its reset line is nub GPIO 17, driven high to run the codec; its interrupt
* is AP GPIO 98, level low. The AOP firmware runs the jack's stream.
*/
&i2c1 {
status = "okay";

jack_codec: codec@4b {
compatible = "cirrus,cs42l84";
reg = <0x4b>;
reset-gpios = <&pinctrl_nub 17 GPIO_ACTIVE_HIGH>;
#sound-dai-cells = <0>;
interrupts-extended = <&pinctrl_ap 98 IRQ_TYPE_LEVEL_LOW>;
sound-name-prefix = "Jack";
};
};

&aop_dart {
status = "okay";
};

&aop_mbox {
status = "okay";
};

&admac0 {
status = "okay";
};

&admac1 {
status = "okay";
};

/* Enable DVFS only with the J713 board thermal owner. */
&cpufreq_e {
status = "okay";
Expand Down
Loading