Skip to content

Commit

Permalink
Merge branch 'main' into performance_data_zephyr_pr
Browse files Browse the repository at this point in the history
Signed-off-by: Tobiasz Dryjański <31992221+tobonex@users.noreply.github.com>
  • Loading branch information
tobonex authored Apr 2, 2024
2 parents 82d22c2 + 78831db commit b821d75
Show file tree
Hide file tree
Showing 75 changed files with 1,665 additions and 658 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ipc_fuzzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
sof/scripts/fuzz.sh -o fuzz-stdout.txt -t "$duration" -j"$(nproc)" -- "$cmake_arg"
- name: Upload stdout
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.IPC }} logs
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/llext.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---

name: Zephyr LLEXT

# 'workflow_dispatch' allows running this workflow manually from the
# 'Actions' tab
# yamllint disable-line rule:truthy
on: [pull_request, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
platform: [mtl, lnl]

steps:
- name: git clone sof
uses: actions/checkout@v4
with:
path: ./workspace/sof
fetch-depth: 0 # fix git describe
filter: 'tree:0'

- name: west clones
run: pip3 install west && cd workspace/sof/ && west init -l &&
west update --narrow --fetch-opt=--depth=5

- name: Download docker image && ls /opt/toolchains/
run: cd workspace && ./sof/zephyr/docker-run.sh ls -l /opt/toolchains/

- name: llext build
run: |
cd workspace && ./sof/zephyr/docker-run.sh /bin/sh -c \
'ln -s /opt/toolchains/zephyr-sdk-* ~/;
west build --board intel_adsp_ace15_mtpm sof/app \
-- -DEXTRA_CFLAGS=-Werror -DEXTRA_CXXFLAGS=-Werror \
-DEXTRA_AFLAGS=-Werror \
-DOVERLAY_CONFIG=overlays/mtl/module_overlay.conf'
3 changes: 1 addition & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ jobs:
# Use groups to avoid spamming the web interface. Pay attention
# to COMMAS. Don't use a single big group so a single failure
# does not block all other builds.
platform: [imx8ulp,
rn rmb,
platform: [rn rmb,
mt8186 mt8195,
]

Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/zephyr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,11 @@ jobs:
${{ matrix.build_opts }} ${{ matrix.IPC_platforms }}

- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ matrix.zephyr_revision == 'mnfst' }}
with:
name: linux-build ${{ matrix.build_opts }} ${{ matrix.IPC_platforms }}
if-no-files-found: error
path: |
${{ github.workspace }}/workspace/build-sof-staging
${{ github.workspace }}/workspace/**/compile_commands.json
Expand Down Expand Up @@ -239,14 +240,14 @@ jobs:
# or delete cache manually in Github Actions tab
- name: Cache unzip
id: cache-unzip
uses: actions/cache@v3.0.11
uses: actions/cache@v4
with:
path: unzip-5.51-1-bin.zip
key: ${{ runner.os }}-cache-unzip-5-51-1

- name: Cache wget
id: cache-wget
uses: actions/cache@v3.0.11
uses: actions/cache@v4
with:
path: wget-1.11.4-1-bin.zip
key: ${{ runner.os }}-cache-wget-1-11-4-1
Expand All @@ -255,7 +256,7 @@ jobs:
# sof/zephyr/docker-run.sh
- name: Cache Zephyr SDK 0.16.4
id: cache-zephyr-sdk
uses: actions/cache@v3.0.11
uses: actions/cache@v4
with:
path: zephyr-sdk-0.16.4_windows-x86_64.7z
key: ${{ runner.os }}-cache-zephyr-sdk-0-16-4
Expand Down Expand Up @@ -363,9 +364,10 @@ jobs:
${{ matrix.build_opts }} ${{ matrix.platforms }}

- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: windows-build ${{ matrix.build_opts }} ${{ matrix.platforms }}
if-no-files-found: error
path: |
${{ github.workspace }}/workspace/build-sof-staging
${{ github.workspace }}/workspace/**/compile_commands.json
Expand All @@ -391,7 +393,7 @@ jobs:
filter: 'tree:0'

- name: Download Windows and Linux builds
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- name: apt-get dos2unix
run: sudo apt-get update; sudo apt-get -y install dos2unix
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions app/boards/imx93_evk_mimx9352_a55.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright 2023 NXP
#
# SPDX-License-Identifier: Apache-2.0

# Enable dynamic interrupts
CONFIG_DYNAMIC_INTERRUPTS=y

CONFIG_ARM64_VA_BITS_40=y
CONFIG_ARM64_PA_BITS_40=y

CONFIG_DCACHE_LINE_SIZE_DETECT=n
CONFIG_DCACHE_LINE_SIZE=64

CONFIG_IMX93_A55=y
CONFIG_TRACE=n

# DAI-related configurations
CONFIG_SAI_HAS_MCLK_CONFIG_OPTION=y
CONFIG_SAI_IMX93_ERRATA_051421=y

# DMA-related configurations
CONFIG_DMA=y
CONFIG_DMA_NXP_EDMA_ENABLE_HALFMAJOR_IRQ=y

# needed because EDMA uses same interrupt for multiple
# channels.
CONFIG_SHARED_INTERRUPTS=y

CONFIG_ZEPHYR_NATIVE_DRIVERS=y
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@
reg = <0x42430000 DT_SIZE_K(64)>;
};

sai3: memory@42660000 {
reg = <0x42660000 DT_SIZE_K(64)>;
};

edma2_ch0: memory@42010000 {
reg = <0x42010000 DT_SIZE_K(32)>;
};

edma2_ch1: memory@42018000 {
reg = <0x42018000 DT_SIZE_K(32)>;
};

outbox: memory@ce100000 {
reg = <0xce100000 DT_SIZE_K(4)>;
};
Expand All @@ -58,4 +46,22 @@
host_ram: memory@80000000 {
reg = <0x80000000 DT_SIZE_M(1024)>;
};

host_dma: dma {
compatible = "nxp,sof-host-dma";
dma-channels = <32>;
#dma-cells = <0>;
};
};

&sai3 {
tx-fifo-watermark = <2>;
rx-fifo-watermark = <96>;
fifo-depth = <96>;
rx-sync-mode = <1>;
status = "okay";
};

&edma4 {
status = "okay";
};
2 changes: 2 additions & 0 deletions app/boards/intel_adsp_ace15_mtpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ CONFIG_LOG_BACKEND_SOF_PROBE=n
CONFIG_SOF_LOG_LEVEL_INF=y
CONFIG_ZEPHYR_LOG=y
CONFIG_LOG_OUTPUT_FORMAT_LINUX_TIMESTAMP=y
CONFIG_LOG_BACKEND_ADSP=n
CONFIG_WINSTREAM_CONSOLE=n

CONFIG_INTEL_ADSP_IPC=y
CONFIG_WATCHDOG=y
Expand Down
8 changes: 7 additions & 1 deletion app/boards/intel_adsp_ace20_lnl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ CONFIG_LUNARLAKE=y
CONFIG_IPC_MAJOR_4=y

CONFIG_COMP_SRC=y

CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
CONFIG_COMP_DRC=y

# power settings
CONFIG_PM=y
Expand Down Expand Up @@ -66,11 +66,17 @@ CONFIG_LOG_BACKEND_ADSP_MTRACE=y
CONFIG_SOF_LOG_LEVEL_INF=y
CONFIG_ZEPHYR_LOG=y
CONFIG_LOG_OUTPUT_FORMAT_LINUX_TIMESTAMP=y
CONFIG_LOG_BACKEND_ADSP=n
CONFIG_WINSTREAM_CONSOLE=n

CONFIG_INTEL_ADSP_IPC=y

CONFIG_PROBE=y
CONFIG_PROBE_DMA_MAX=2

CONFIG_MEMORY_WIN_2_SIZE=12288


# Temporary disabled options
CONFIG_TRACE=n
CONFIG_COMP_KPB=y
Expand Down
2 changes: 2 additions & 0 deletions app/boards/intel_adsp_cavs25.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ CONFIG_ZEPHYR_LOG=y
CONFIG_LOG_BACKEND_ADSP_MTRACE=y
CONFIG_LOG_BACKEND_ADSP=n
CONFIG_LOG_OUTPUT_FORMAT_LINUX_TIMESTAMP=y
CONFIG_WINSTREAM_CONSOLE=n

CONFIG_LOG_FUNC_NAME_PREFIX_ERR=y
CONFIG_LOG_FUNC_NAME_PREFIX_WRN=y
CONFIG_LOG_FUNC_NAME_PREFIX_INF=y
Expand Down
2 changes: 2 additions & 0 deletions app/boards/intel_adsp_cavs25_tgph.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ CONFIG_ZEPHYR_LOG=y
CONFIG_LOG_BACKEND_ADSP_MTRACE=y
CONFIG_LOG_BACKEND_ADSP=n
CONFIG_LOG_OUTPUT_FORMAT_LINUX_TIMESTAMP=y
CONFIG_WINSTREAM_CONSOLE=n

CONFIG_LOG_FUNC_NAME_PREFIX_ERR=y
CONFIG_LOG_FUNC_NAME_PREFIX_WRN=y
CONFIG_LOG_FUNC_NAME_PREFIX_INF=y
Expand Down
16 changes: 0 additions & 16 deletions app/boards/mimx93_evk_a55.conf

This file was deleted.

1 change: 1 addition & 0 deletions app/overlays/mtl/module_overlay.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SAMPLE_SMART_AMP=m
4 changes: 4 additions & 0 deletions app/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ CONFIG_SCHED_CPU_MASK_PIN_ONLY=y
CONFIG_SYS_CLOCK_TICKS_PER_SEC=15000
CONFIG_DAI=y
CONFIG_HEAP_MEM_POOL_SIZE=2048

CONFIG_LLEXT=y
CONFIG_LLEXT_STORAGE_WRITABLE=y
CONFIG_MODULES=y
28 changes: 14 additions & 14 deletions app/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ tests:
tags: sof
build_only: true
platform_allow:
- intel_adsp_cavs25
- intel_adsp_ace15_mtpm
- intel_adsp_ace20_lnl
- nxp_adsp_imx8
- nxp_adsp_imx8x
- nxp_adsp_imx8m
- nxp_adsp_imx8ulp
- intel_adsp/cavs25
- intel_adsp/ace15_mtpm
- intel_adsp/ace20_lnl
- imx8qm_mek/mimx8qm6/adsp
- imx8qxp_mek/mimx8qx6/adsp
- imx8mp_evk/mimx8ml8/adsp
- imx8ulp_evk/mimx8ud7/adsp

integration_platforms:
- intel_adsp_cavs25 # TGL
- intel_adsp_ace15_mtpm # MTL
- intel_adsp_ace20_lnl
- nxp_adsp_imx8
- nxp_adsp_imx8x
- nxp_adsp_imx8m
- nxp_adsp_imx8ulp
- intel_adsp/cavs25 # TGL
- intel_adsp/ace15_mtpm # MTL
- intel_adsp/ace20_lnl
- imx8qm_mek/mimx8qm6/adsp
- imx8qxp_mek/mimx8qx6/adsp
- imx8mp_evk/mimx8ml8/adsp
- imx8ulp_evk/mimx8ud7/adsp
56 changes: 56 additions & 0 deletions scripts/llext_link_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause

# We need to calculate ELF section addresses of an LLEXT module and use them to
# run the linker. We could just use Python to calculate addresses and pass them
# back to cmake to have it call the linker. However, there doesn't seem to be a
# portable way to do that. Therefore we pass the linker path and all the command
# line parameters to this script and call the linker directly.

import argparse
import subprocess
from elftools.elf.elffile import ELFFile

args = None
def parse_args():
global args

parser = argparse.ArgumentParser(description='Helper utility to run a linker command '
'with calculated ELF section addresses')

parser.add_argument('command', type=str, help='Linker command to execute')
parser.add_argument('params', nargs='+', help='Additional linker parameters')
parser.add_argument("-f", "--file", required=True, type=str,
help='Object file name')
parser.add_argument("-t", "--text-addr", required=True, type=str,
help='.text section address')

args = parser.parse_args()

def main():
parse_args()

elf = ELFFile(open(args.file, 'rb'))

text_addr = int(args.text_addr, 0)

text_offset = elf.get_section_by_name('.text').header.sh_offset
rodata_offset = elf.get_section_by_name('.rodata').header.sh_offset
data_offset = elf.get_section_by_name('.data').header.sh_offset

upper = rodata_offset - text_offset + text_addr + 0xfff
rodata_addr = upper - (upper % 0x1000)

upper = data_offset - rodata_offset + rodata_addr + 0xf
data_addr = upper - (upper % 0x10)

command = [args.command,
f'-Wl,-Ttext=0x{text_addr:x}',
f'-Wl,--section-start=.rodata=0x{rodata_addr:x}',
f'-Wl,-Tdata=0x{data_addr:x}']
command.extend(args.params)

subprocess.run(command)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion scripts/xtensa-build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
# Platforms built and tested by default in CI using the `-a` option.
# They must have a toolchain available in the latest Docker image.
DEFAULT_PLATFORMS=(
imx8m imx8ulp
imx8m
rn rmb vangogh
mt8186 mt8195
)
Expand Down
Loading

0 comments on commit b821d75

Please sign in to comment.