Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microphones via AOP (+ a few SEP bits). #342

Draft
wants to merge 19 commits into
base: asahi-wip
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bc43bac
dmaengine: apple-admac: Avoid accessing registers in probe
WhatAmISupposedToPutHere Nov 9, 2024
e05b6cb
soc: apple: rtkit: Add apple_rtkit_has_endpoint()
WhatAmISupposedToPutHere Nov 9, 2024
5f064ae
soc: apple: rtkit: Add tracekit endpoint.
WhatAmISupposedToPutHere Nov 9, 2024
16a9fea
fixup! rust: soc: apple: rtkit: Add Apple RTKit abstraction
WhatAmISupposedToPutHere Nov 9, 2024
c4576f5
rust: Add helper for memcpy_toio
WhatAmISupposedToPutHere Nov 9, 2024
4e26ab7
rust: alloc: Add .resize() to Vec
WhatAmISupposedToPutHere Nov 9, 2024
ec61e9f
rust: device: Add Device::parent()
WhatAmISupposedToPutHere Nov 17, 2024
95b18e6
rust: add dma pool and coherent allocator
metaspace Nov 9, 2024
27d6864
rust: WIP(?): Various bits of rust glue for AOP series
WhatAmISupposedToPutHere Nov 9, 2024
8353aff
rust: Only export module id tables if building as module
WhatAmISupposedToPutHere Nov 17, 2024
f0c8754
soc: apple: Add support for the AOP co-processor.
WhatAmISupposedToPutHere Nov 9, 2024
a9aafa1
rust: alloc: kbox: Add AsRef implementation to Box
WhatAmISupposedToPutHere Nov 9, 2024
c511451
ASoC: apple: Add aop_audio driver.
WhatAmISupposedToPutHere Nov 17, 2024
0b3d9bf
iio: common: Add AOP sensor drivers.
WhatAmISupposedToPutHere Nov 9, 2024
a474498
rust: soc: apple: Add Apple mailbox abstractions
WhatAmISupposedToPutHere Nov 10, 2024
9e26016
rust: WIP(?): Various bits of rust glue for sep
WhatAmISupposedToPutHere Nov 10, 2024
0b84c6d
soc: apple: Add SEP driver.
WhatAmISupposedToPutHere Nov 10, 2024
cee4325
arm64: dts: apple: Add AOP and subdevices.
WhatAmISupposedToPutHere Nov 9, 2024
34a5c14
arm64: dts: apple: Add SEP device tree nodes.
WhatAmISupposedToPutHere Nov 10, 2024
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
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/apple/t6000-j314s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@
compatible = "apple,j314-macaudio", "apple,macaudio";
model = "MacBook Pro J314";
};

&aop {
status = "okay";
};

&aop_audio {
apple,chassis-name = "j314";
};
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/apple/t6000-j316s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@
compatible = "apple,j316-macaudio", "apple,macaudio";
model = "MacBook Pro J316";
};

&aop {
status = "okay";
};

&aop_audio {
apple,chassis-name = "J316";
};
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/apple/t6001-j314c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@
compatible = "apple,j314-macaudio", "apple,macaudio";
model = "MacBook Pro J314";
};

&aop {
status = "okay";
};

&aop_audio {
apple,chassis-name = "J314";
};
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/apple/t6001-j316c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@
compatible = "apple,j316-macaudio", "apple,macaudio";
model = "MacBook Pro J316";
};

&aop {
status = "okay";
};

&aop_audio {
apple,chassis-name = "J316";
};
117 changes: 116 additions & 1 deletion arch/arm64/boot/dts/apple/t600x-die0.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,91 @@
};
};

aop_mbox: mbox@293400000 {
compatible = "apple,t6000-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x2 0x93408000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 582 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 583 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 584 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 585 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "send-not-empty",
"recv-empty", "recv-not-empty";
#mbox-cells = <0>;
};

aop_dart: iommu@293808000 {
compatible = "apple,t6000-dart";
reg = <0x2 0x93808000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 597 IRQ_TYPE_LEVEL_HIGH>;
};

aop_admac: dma-controller@293980000 {
compatible = "apple,t6000-admac2", "apple,admac2";
reg = <0x2 0x93980000 0x0 0x34000>;
#dma-cells = <1>;
dma-channels = <16>;
interrupts-extended = <0>,
<0>,
<&aic AIC_IRQ 0 600 IRQ_TYPE_LEVEL_HIGH>,
<0>;
iommus = <&aop_dart 7>;
};

aop: aop@293c00000 {
compatible = "apple,aop";
reg = <0x2 0x93c00000 0x0 0x250000>,
<0x2 0x93400000 0x0 0x6C000>;
mboxes = <&aop_mbox>;
mbox-names = "mbox";
iommus = <&aop_dart 0>;

apple,aop-target = <0>;
apple,aop-alignment = <64>;
status = "disabled";

aop_audio: audio {
dmas = <&aop_admac 1>;
dma-names = "dma";
apple,bytes-per-sample = <2>;
apple,clock-source = <0x706c6c20>; // 'pll '
apple,pdm-frequency = <2400000>;
apple,pdmc-frequency = <24000000>;
apple,slow-clock-speed = <24000000>;
apple,fast-clock-speed = <24000000>;
apple,channel-polarity-select = <256>;
apple,channel-phase-select = <0>;
apple,mic-turn-on-time-ms = <20>;
apple,mic-settle-time-ms = <50>;

apple,filter-lengths = <0x542c47>;
apple,decm-ratios = [0f 05 02];
apple,decm-latency = <15>;
apple,coefficients = <
0x88030000 0x82080000 0x51120000 0xa230000 0xce3d0000 0x97660000
0x43a20000 0x9cf60000 0x536a0100 0xe6040200 0x7ece0200 0xaecf0300
0x2e110500 0x7d9b0600 0x75760800 0xd8a80a00 0xd2370d00 0x82261000
0x86751300 0x97221700 0x39281b00 0x897d1f00 0x2e162400 0x69e22800
0x56cf2d00 0x51c73200 0x80b23700 0x87773c00 0x4cfc4000 0xd9264500
0x47de4800 0xa00b4c00 0xc19a4e00 0x1f7b5000 0x68a05100 0x6035200
0x4a250000 0x4caf0000 0xc0070200 0x45990400 0x9a840800 0x7d380d00
0x5f1a1100 0xd9811100 0x80440b00 0x8ee5fbff 0xca32e3ff 0x52c7c4ff
0xa6bca8ff 0x83e69aff 0xb85ba8ff 0x6baedbff 0xe7d83800 0x2442ba00
0x33205001 0x6edce201 0x42235802 0x2c509902 0xcffaffff 0x530affff
0x6623fbff 0xa03ef4ff 0xe668f0ff 0xb835f7ff 0x56ec0400 0x37a30900
0xd4feff 0x78a3f5ff 0x3bffeff 0x84d50b00 0xbe0b0400 0x5254f2ff
0x6d3ff8ff 0xc57f0f00 0xe69e0c00 0x7903efff 0xd533edff 0xecd11100
0x7d691a00 0xd655eeff 0x8866dcff 0x57261000 0xc78d2e00 0x822ef3ff
0x6369c4ff 0xcd080700 0x35344b00 0xaf210200 0x83b6a1ff 0xe2d5efff
0x949b7600 0xf3d72500 0xfffc67ff 0xe3acb6ff 0x521bcc00 0x3c8a8b00
0x9f0ccdfe 0x5c68ccfe 0x4dc59802 0x82cffb06>;
};
aop_als: als {
};
};

disp0_dart: iommu@38b304000 {
compatible = "apple,t6000-dart";
reg = <0x3 0x8b304000 0x0 0x4000>;
Expand All @@ -203,6 +288,36 @@
apple,dma-range = <0x1f0 0x0 0x0 0xfc000000>;
};

sep_dart: iommu@3952c0000 {
compatible = "apple,t6000-dart";
reg = <0x3 0x952c0000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 551 IRQ_TYPE_LEVEL_HIGH>;
};

sep_mbox: mbox@396400000 {
compatible = "apple,t6000-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x3 0x96408000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 545 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 546 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 547 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 548 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "send-not-empty",
"recv-empty", "recv-not-empty";
#mbox-cells = <0>;
};

sep: sep@396400000 {
compatible = "apple,sep";
reg = <0x3 0x96400000 0x0 0x6C000>;
mboxes = <&sep_mbox>;
mbox-names = "mbox";
iommus = <&sep_dart 0>;
power-domains = <&ps_sep>;
};

dpaudio0: audio-controller@39b500000 {
compatible = "apple,t6000-dpaudio", "apple,dpaudio";
reg = <0x3 0x9b500000 0x0 0x4000>;
Expand Down Expand Up @@ -416,7 +531,7 @@
};

admac: dma-controller@39b400000 {
compatible = "apple,t6000-admac", "apple,admac";
compatible = "apple,t6000-admac2", "apple,t6000-admac", "apple,admac2", "apple,admac";
reg = <0x3 0x9b400000 0x0 0x34000>;
#dma-cells = <1>;
dma-channels = <16>;
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/apple/t600x-j314-j316.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
serial0 = &serial0;
sio = &sio;
wifi0 = &wifi0;
sep = &sep;
};

chosen {
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/apple/t600x-j375.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
serial0 = &serial0;
sio = &sio;
wifi0 = &wifi0;
sep = &sep;
};

chosen {
Expand Down
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/apple/t6020-j414s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@
&mtp_mt {
firmware-name = "apple/tpmtfw-j414s.bin";
};

&aop {
status = "okay";
};

&aop_audio {
apple,chassis-name = "J414";
};
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/apple/t6020-j416s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@
&mtp_mt {
firmware-name = "apple/tpmtfw-j416s.bin";
};

&aop {
status = "okay";
};

&aop_audio {
apple,chassis-name = "J416";
};
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/apple/t6021-j414c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@
&mtp_mt {
firmware-name = "apple/tpmtfw-j414c.bin";
};

&aop {
status = "okay";
};

&aop_audio {
apple,chassis-name = "J414";
};
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/apple/t6021-j416c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@
&mtp_mt {
firmware-name = "apple/tpmtfw-j416c.bin";
};

&aop {
status = "okay";
};

&aop_audio {
apple,chassis-name = "J416";
};
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/apple/t602x-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

aliases {
gpu = &gpu;
sep = &sep;
};

cpus {
Expand Down
117 changes: 116 additions & 1 deletion arch/arm64/boot/dts/apple/t602x-die0.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,91 @@
<AIC_IRQ 0 857 IRQ_TYPE_LEVEL_HIGH>;
};

aop_mbox: mbox@2a6400000 {
compatible = "apple,t6020-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x2 0xa6408000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 613 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 614 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 615 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 616 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "send-not-empty",
"recv-empty", "recv-not-empty";
#mbox-cells = <0>;
};

aop_dart: iommu@2a6808000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x2 0xa6808000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 628 IRQ_TYPE_LEVEL_HIGH>;
};

aop_admac: dma-controller@2a6980000 {
compatible = "apple,t6020-admac2", "apple,admac2";
reg = <0x2 0xa6980000 0x0 0x34000>;
#dma-cells = <1>;
dma-channels = <16>;
interrupts-extended = <0>,
<0>,
<&aic AIC_IRQ 0 631 IRQ_TYPE_LEVEL_HIGH>,
<0>;
iommus = <&aop_dart 10>;
};

aop: aop@2a6c00000 {
compatible = "apple,aop";
reg = <0x2 0xa6c00000 0x0 0x250000>,
<0x2 0xa6400000 0x0 0x6C000>;
mboxes = <&aop_mbox>;
mbox-names = "mbox";
iommus = <&aop_dart 0>;

apple,aop-target = <0>;
apple,aop-alignment = <64>;
status = "disabled";

aop_audio: audio {
dmas = <&aop_admac 1>;
dma-names = "dma";
apple,bytes-per-sample = <2>;
apple,clock-source = <0x706c6c20>; // 'pll '
apple,pdm-frequency = <2400000>;
apple,pdmc-frequency = <24000000>;
apple,slow-clock-speed = <24000000>;
apple,fast-clock-speed = <24000000>;
apple,channel-polarity-select = <256>;
apple,channel-phase-select = <0>;
apple,mic-turn-on-time-ms = <20>;
apple,mic-settle-time-ms = <50>;

apple,filter-lengths = <0x542c47>;
apple,decm-ratios = [0f 05 02];
apple,decm-latency = <15>;
apple,coefficients = <
0x88030000 0x82080000 0x51120000 0xa230000 0xce3d0000 0x97660000
0x43a20000 0x9cf60000 0x536a0100 0xe6040200 0x7ece0200 0xaecf0300
0x2e110500 0x7d9b0600 0x75760800 0xd8a80a00 0xd2370d00 0x82261000
0x86751300 0x97221700 0x39281b00 0x897d1f00 0x2e162400 0x69e22800
0x56cf2d00 0x51c73200 0x80b23700 0x87773c00 0x4cfc4000 0xd9264500
0x47de4800 0xa00b4c00 0xc19a4e00 0x1f7b5000 0x68a05100 0x6035200
0x4a250000 0x4caf0000 0xc0070200 0x45990400 0x9a840800 0x7d380d00
0x5f1a1100 0xd9811100 0x80440b00 0x8ee5fbff 0xca32e3ff 0x52c7c4ff
0xa6bca8ff 0x83e69aff 0xb85ba8ff 0x6baedbff 0xe7d83800 0x2442ba00
0x33205001 0x6edce201 0x42235802 0x2c509902 0xcffaffff 0x530affff
0x6623fbff 0xa03ef4ff 0xe668f0ff 0xb835f7ff 0x56ec0400 0x37a30900
0xd4feff 0x78a3f5ff 0x3bffeff 0x84d50b00 0xbe0b0400 0x5254f2ff
0x6d3ff8ff 0xc57f0f00 0xe69e0c00 0x7903efff 0xd533edff 0xecd11100
0x7d691a00 0xd655eeff 0x8866dcff 0x57261000 0xc78d2e00 0x822ef3ff
0x6369c4ff 0xcd080700 0x35344b00 0xaf210200 0x83b6a1ff 0xe2d5efff
0x949b7600 0xf3d72500 0xfffc67ff 0xe3acb6ff 0x521bcc00 0x3c8a8b00
0x9f0ccdfe 0x5c68ccfe 0x4dc59802 0x82cffb06>;
};
aop_als: als {
};
};

mtp: mtp@2a9400000 {
compatible = "apple,t6020-mtp", "apple,t6020-rtk-helper-asc4", "apple,mtp", "apple,rtk-helper-asc4";
reg = <0x2 0xa9400000 0x0 0x4000>,
Expand Down Expand Up @@ -392,6 +477,36 @@
phandle = <&display>;
};

sep_dart: iommu@388ac0000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x3 0x88ac0000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 579 IRQ_TYPE_LEVEL_HIGH>;
};

sep_mbox: mbox@38a400000 {
compatible = "apple,t6020-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x3 0x8a408000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 573 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 574 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 575 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 576 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "send-not-empty",
"recv-empty", "recv-not-empty";
#mbox-cells = <0>;
};

sep: sep@396400000 {
compatible = "apple,sep";
reg = <0x3 0x8a400000 0x0 0x6C000>;
mboxes = <&sep_mbox>;
mbox-names = "mbox";
iommus = <&sep_dart 0>;
power-domains = <&ps_sep>;
};

fpwm0: pwm@39b030000 {
compatible = "apple,t6020-fpwm", "apple,s5l-fpwm";
reg = <0x3 0x9b030000 0x0 0x4000>;
Expand Down Expand Up @@ -585,7 +700,7 @@
};

admac: dma-controller@39b400000 {
compatible = "apple,t6020-admac", "apple,admac";
compatible = "apple,t6020-admac2", "apple,t6020-admac", "apple,admac2", "apple,admac";
reg = <0x3 0x9b400000 0x0 0x34000>;
#dma-cells = <1>;
dma-channels = <16>;
Expand Down
Loading