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

Add the new platform ACP_7_0 #9351

Merged
merged 9 commits into from
Sep 11, 2024
Merged
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
10 changes: 6 additions & 4 deletions scripts/set_xtensa_params.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,25 @@ case "$platform" in
;;
rmb)
PLATFORM="rembrandt"
ARCH="xtensa"
XTENSA_CORE="LX7_HiFi5_PROD"
HOST="xtensa-rmb-elf"
TOOLCHAIN_VER="RI-2019.1-linux"
;;
vangogh)
ARCH="xtensa"
XTENSA_CORE="ACP_5_0_001_PROD"
HOST="xtensa-vangogh-elf"
TOOLCHAIN_VER="RI-2019.1-linux"
;;
acp_6_3)
ARCH="xtensa"
XTENSA_CORE="ACP_6_3_HiFi5_PROD_Linux"
HOST="xtensa-acp_6_3-elf"
TOOLCHAIN_VER="RI-2021.6-linux"
;;
acp_7_0)
XTENSA_CORE="ACP_7_0_HiFi5_NNE_PROD"
HOST="xtensa-acp_7_0-elf"
TOOLCHAIN_VER="RI-2023.11-linux"
;;

# Mediatek
mt8186)
Expand All @@ -142,7 +144,7 @@ esac

# Pre-zephyr "XTOS" build, testbench,...
case "$platform" in
mtl|lnl|ptl)
mtl|lnl|ptl|acp_7_0)
SOF_CC_BASE='clang';;
*)
SOF_CC_BASE='xcc';;
Expand Down
2 changes: 1 addition & 1 deletion scripts/xtensa-build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DEFAULT_PLATFORMS=(
SUPPORTED_PLATFORMS=( "${DEFAULT_PLATFORMS[@]}" )

# Container work is in progress
SUPPORTED_PLATFORMS+=( acp_6_3 )
SUPPORTED_PLATFORMS+=( acp_6_3 acp_7_0 )

BUILD_ROM=no
BUILD_DEBUG=no
Expand Down
4 changes: 3 additions & 1 deletion src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ elseif(CONFIG_VANGOGH)
set(platform_folder amd/vangogh)
elseif(CONFIG_ACP_6_3)
set(platform_folder amd/acp_6_3)
elseif(CONFIG_ACP_7_0)
set(platform_folder amd/acp_7_0)
elseif(CONFIG_MT8186)
set(platform_folder mt8186)
elseif(CONFIG_MT8188)
Expand Down Expand Up @@ -473,7 +475,7 @@ add_custom_target(
# NXP
set(UNSIGNED_RI imx8 imx8x imx8m imx8ulp)
# AMD
list(APPEND UNSIGNED_RI rn rmb vangogh acp_6_3)
list(APPEND UNSIGNED_RI rn rmb vangogh acp_6_3 acp_7_0)
# MediaTek
list(APPEND UNSIGNED_RI mt8186 mt8188 mt8195)

Expand Down
35 changes: 35 additions & 0 deletions src/arch/xtensa/configs/acp_7_0_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
CONFIG_ACP_7_0=y
CONFIG_RIMAGE_SIGNING_SCHEMA="acp_7_0"
CONFIG_TRACE_CHANNEL=7
CONFIG_WRAP_ACTUAL_POSITION=y
CONFIG_AMD_BT=n
CONFIG_AMD_SP=n
CONFIG_CORE_COUNT=1
CONFIG_LP_MEMORY_BANKS=20
CONFIG_HP_MEMORY_BANKS=10
CONFIG_FORMAT_CONVERT_HIFI3=n
CONFIG_LP_SRAM=n
CONFIG_HAVE_AGENT=n
CONFIG_COMP_VOLUME=n
CONFIG_COMP_SRC=n
CONFIG_COMP_FIR=n
CONFIG_COMP_IIR=n
CONFIG_COMP_DCBLOCK=n
CONFIG_COMP_CROSSOVER=n
CONFIG_COMP_DRC=n
CONFIG_COMP_MULTIBAND_DRC=n
CONFIG_COMP_TONE=n
CONFIG_COMP_SWITCH=n
CONFIG_COMP_KPB=n
CONFIG_MAXIM_DSM=n
CONFIG_COMP_ASRC=n
CONFIG_COMP_IGO_NR=n
CONFIG_COMP_COPIER=n
CONFIG_COMP_RTNR=n
CONFIG_COMP_ARIA=n
CONFIG_COMP_BASEFW_IPC4=n
CONFIG_COMP_UP_DOWN_MIXER=n
CONFIG_COMP_TDFB=n
#CONFIG_COMP_MUX=n
CONFIG_COMP_SEL=n
CONFIG_COMP_MIXER=n
3 changes: 0 additions & 3 deletions src/arch/xtensa/include/arch/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ static inline void arch_spin_unlock(struct k_spinlock *lock)
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proper git summary prefix please

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saisurya-ch Can you update the git commit message to have proper prefix on the first line?

static inline void arch_spin_unlock(struct k_spinlock *lock)
{
uint32_t result;

lock->lock = 0;
result = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change looks good but the commit message does not:

Remove the unused variable 'result' that is causing the GCC build error.

Which error? Which gcc? This has been successfully compiled by gcc since forever.

Copy link
Member Author

@saisurya-ch saisurya-ch Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[  5%] Building ASM object src/arch/xtensa/xtos/CMakeFiles/xlevel4.dir/int-vector.S.o
[  7%] Building ASM object src/arch/xtensa/xtos/CMakeFiles/xlevel4.dir/int-initlevel.S.o
[  7%] Building ASM object src/arch/xtensa/xtos/CMakeFiles/xlevel3.dir/int-handler.S.o
[  8%] Building ASM object src/arch/xtensa/hal/CMakeFiles/hal.dir/int_asm.S.o
[  8%] Building ASM object src/arch/xtensa/hal/CMakeFiles/hal.dir/clock.S.o
[  8%] Building C object src/arch/xtensa/hal/CMakeFiles/hal.dir/interrupts.c.o
[ 10%] Building ASM object src/arch/xtensa/xtos/CMakeFiles/xlevel5.dir/int-handler.S.o
[ 10%] Building ASM object src/arch/xtensa/xtos/CMakeFiles/xlevel3.dir/int-vector.S.o
[ 11%] No download step for 'smex_ep'
In file included from /home/sof/xtos/include/rtos/spinlock.h:16,
                 from /home/sof/xtos/include/rtos/sof.h:14,
                 from /home/sof/src/include/sof/debug/debug.h:16,
                 from /home/sof/src/init/ext_manifest.c:11:
/home/sof/src/arch/xtensa/include/arch/spinlock.h: In function 'arch_spin_unlock':
/home/sof/src/arch/xtensa/include/arch/spinlock.h:121:11: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
  121 |  uint32_t result;
      |           ^~~~~~
[ 11%] No download step for 'rimage_ep'
cc1: all warnings being treated as errors
gmake[3]: *** [src/init/CMakeFiles/ext_manifest.dir/build.make:77: src/init/CMakeFiles/ext_manifest.dir/ext_manifest.c.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:2118: src/init/CMakeFiles/ext_manifest.dir/all] Error 2
gmake[2]: *** Waiting for unfinished jobs....
[ 12%] Building ASM object src/arch/xtensa/hal/CMakeFiles/hal.dir/memcopy.S.o
[ 13%] Building ASM object src/arch/xtensa/xtos/CMakeFiles/xtos.dir/core-restore.S.o
[ 14%] No update step for 'smex_ep'
[ 14%] Building ASM object src/arch/xtensa/xtos/CMakeFiles/xtos.dir/core-save.S.o

facing this error when building with GCC, not sure why this is not raised previously. Could that be due to GCC version?

Copy link
Collaborator

@marc-hb marc-hb Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before getting into what you don't know, simply start by adding to the commit message what you know already: just the error message and the gcc version that prints it. That could be enough.

}

#endif /* XCHAL_HAVE_EXCLUSIVE || XCHAL_HAVE_S32C1I */
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
add_subdirectory(common)
if(CONFIG_RENOIR)
add_subdirectory(renoir)
elseif(CONFIG_REMBRANDT OR CONFIG_ACP_6_3)
elseif(CONFIG_REMBRANDT OR CONFIG_ACP_6_3 OR CONFIG_ACP_7_0)
add_subdirectory(rembrandt)
elseif(CONFIG_VANGOGH)
add_subdirectory(vangogh)
Expand Down
1 change: 0 additions & 1 deletion src/drivers/amd/common/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com>

#include <rtos/panic.h>
#include <xtensa/core-macros.h>
#include <platform/chip_offset_byte.h>
#include <platform/chip_registers.h>
#include <rtos/interrupt.h>
Expand Down
1 change: 0 additions & 1 deletion src/drivers/amd/rembrandt/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <xtensa/hal.h>
#include <xtensa/config/core.h>
#include <xtensa/config/specreg.h>
#include <xtensa/core-macros.h>
#include "xtos-internal.h"
#include <errno.h>
#include <inttypes.h>
Expand Down
1 change: 0 additions & 1 deletion src/drivers/amd/rembrandt/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Bala Kishore <balakishore.pati@amd.com>

#include <rtos/panic.h>
#include <xtensa/core-macros.h>
#include <platform/chip_offset_byte.h>
#include <platform/chip_registers.h>
#include <rtos/interrupt.h>
Expand Down
21 changes: 0 additions & 21 deletions src/lib/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,6 @@ static void validate_memory(void *ptr, size_t size)
}
#endif

/* total size of block */
static inline uint32_t block_get_size(struct block_map *map)
{
uint32_t size = sizeof(*map) + map->count *
(map->block_size + sizeof(struct block_hdr));

return size;
}

/* total size of heap */
static inline uint32_t heap_get_size(struct mm_heap *heap)
{
uint32_t size = sizeof(struct mm_heap);
int i;

for (i = 0; i < heap->blocks; i++)
size += block_get_size(&heap->map[i]);

return size;
}

#if CONFIG_DEBUG_BLOCK_FREE
static void write_pattern(struct mm_heap *heap_map, int heap_depth,
uint8_t pattern)
Expand Down
14 changes: 14 additions & 0 deletions src/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,19 @@ config ACP_6_3
help
Select if your target platform is acp_6_3-compatible

config ACP_7_0
bool "Build for ACP_7_0"
select XT_INTERRUPT_LEVEL_5
select XT_INTERRUPT_LEVEL_3
select XT_INTERRUPT_LEVEL_1
select XT_INTERRUPT_LEVEL_4
select XT_WAITI_DELAY
select XTENSA_EXCLUSIVE
select AMD
select SCHEDULE_DMA_MULTI_CHANNEL
help
Select if your target platform is acp_7_0-compatible

config MT8186
bool "Build for MTK MT8186"
select XT_INTERRUPT_LEVEL_1
Expand Down Expand Up @@ -454,6 +467,7 @@ config RIMAGE_SIGNING_SCHEMA
default "rmb" if REMBRANDT
default "vangogh" if VANGOGH
default "acp_6_3" if ACP_6_3
default "acp_7_0" if ACP_7_0
default "mt8186" if MT8186
default "mt8188" if MT8188
default "mt8195" if MT8195
Expand Down
2 changes: 2 additions & 0 deletions src/platform/amd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ elseif(CONFIG_VANGOGH)
add_subdirectory(vangogh)
elseif(CONFIG_ACP_6_3)
add_subdirectory(acp_6_3)
elseif(CONFIG_ACP_7_0)
add_subdirectory(acp_7_0)
endif()
5 changes: 5 additions & 0 deletions src/platform/amd/acp_7_0/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause

add_subdirectory(lib)

add_local_sources(sof platform.c)
Loading
Loading