-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Zephyr support for the Audio DSP on the MT8196 SOC. This is a very similar device to previous designs. Most of this patch is just DTS. The biggest delta is the more complicated second level interrupt controller, though it is still able to be represented using some vaguely clever DTS config over the older intc_mtk_adsp driver. Also the memory layout is slightly different, requiring a little indirection to set the initial boot stack address and log output buffer. And the timer "irq_ack" register bits moved. Signed-off-by: Andy Ross <[email protected]>
- Loading branch information
Showing
11 changed files
with
196 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright 2024 The ChromiumOS Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config BOARD_MT8196_ADSP | ||
select SOC_MT8196_ADSP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
boards: | ||
- name: mt8196_adsp | ||
vendor: mediatek | ||
socs: | ||
- name: mt8196_adsp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/* Copyright 2024 The ChromiumOS Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#include <mem.h> | ||
|
||
/dts-v1/; | ||
/ { | ||
|
||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
sram0: memory@4e100000 { | ||
device_type = "memory"; | ||
compatible = "mmio-sram"; | ||
reg = <0x4e100000 DT_SIZE_K(512)>; | ||
}; | ||
|
||
dram0: memory@90000000 { | ||
device_type = "memory"; | ||
compatible = "mmio-sram"; | ||
reg = <0x90000000 DT_SIZE_M(6)>; | ||
}; | ||
|
||
dram1: memory@90700000 { | ||
device_type = "memory"; | ||
compatible = "mmio-sram"; | ||
reg = <0x90700000 DT_SIZE_M(1)>; | ||
}; | ||
|
||
soc { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
core_intc: core_intc@0 { | ||
compatible = "cdns,xtensa-core-intc"; | ||
reg = <0 4>; | ||
interrupt-controller; | ||
#interrupt-cells = <3>; | ||
}; | ||
|
||
/* The 8196 interrupt controller is actually more complicated | ||
* than the driver here supports. There are 64 total | ||
* interrupt inputs, each of which is a associated with one of | ||
* 16 "groups", each of which is wired to a separate Xtensa | ||
* architectural interrupt. (Whether the mapping of external | ||
* interrupts to groups is mutable is an open question, the | ||
* values here appear to be hardware defaults). We represent | ||
* each group (strictly each of the high and low 32 interrupts | ||
* of each group) as a separate adsp_intc controller, pointing | ||
* at the same status and enable registers, but with disjoint | ||
* masks. Note that this disallows configurations where a | ||
* single controller needs to manage interrupts in both the | ||
* high and low 32 bits of the set, but no current drivers | ||
* rely on such a configuration. | ||
*/ | ||
|
||
intc_g1: intc_g1@1a014010 { | ||
compatible = "mediatek,adsp_intc"; | ||
interrupt-controller; | ||
#interrupt-cells = <3>; | ||
reg = <0x1a014010 4>; | ||
status-reg = <0x1a014008>; | ||
mask = <0x00007f3f>; | ||
interrupts = <1 0 0>; | ||
interrupt-parent = <&core_intc>; | ||
}; | ||
|
||
intc_g2: intc_g2@1a014010 { | ||
compatible = "mediatek,adsp_intc"; | ||
interrupt-controller; | ||
#interrupt-cells = <3>; | ||
reg = <0x1a014010 4>; | ||
status-reg = <0x1a014008>; | ||
mask = <0x000000c0>; | ||
interrupts = <2 0 0>; | ||
interrupt-parent = <&core_intc>; | ||
}; | ||
|
||
ostimer64: ostimer64@1a00b080 { | ||
compatible = "mediatek,ostimer64"; | ||
reg = <0x1a00b080 28>; | ||
}; | ||
|
||
ostimer0: ostimer@1a00b000 { | ||
compatible = "mediatek,ostimer"; | ||
reg = <0x1a00b000 16>; | ||
interrupt-parent = <&intc_g1>; | ||
interrupts = <8 0 0>; | ||
}; | ||
|
||
mbox0: mbox@1a360100 { | ||
compatible = "mediatek,mbox"; | ||
reg = <0x1a360100 16>; | ||
interrupt-parent = <&intc_g2>; | ||
interrupts = <6 0 0>; | ||
}; | ||
|
||
mbox1: mbox@1a370100 { | ||
compatible = "mediatek,mbox"; | ||
reg = <0x1a370100 16>; | ||
interrupt-parent = <&intc_g2>; | ||
interrupts = <7 0 0>; | ||
}; | ||
}; /* soc */ | ||
|
||
chosen { }; | ||
aliases { }; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2024 The ChromiumOS Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SOC_MT8196_ADSP | ||
|
||
config LEGACY_MULTI_LEVEL_TABLE_GENERATION | ||
default n | ||
|
||
config NUM_2ND_LEVEL_AGGREGATORS | ||
default 2 | ||
|
||
config 2ND_LVL_INTR_00_OFFSET | ||
default 1 | ||
|
||
config 2ND_LVL_INTR_01_OFFSET | ||
default 2 | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* Copyright 2024 The ChromiumOS Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "../linker.ld" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* Copyright 2024 The ChromiumOS Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_SOC_MT8196_ADSP_SOC_H | ||
#define ZEPHYR_SOC_MT8196_ADSP_SOC_H | ||
|
||
#include "../soc.h" | ||
|
||
#endif /* ZEPHYR_SOC_MT8196_ADSP_SOC_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,6 @@ family: | |
socs: | ||
- name: mt8186_adsp | ||
- name: mt8188_adsp | ||
- name: mt8196_adsp | ||
socs: | ||
- name: mt8196_adsp |