Skip to content
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
8 changes: 8 additions & 0 deletions scripts/xtensa-build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ DEFAULT_PLATFORMS=( byt cht bdw hsw tgl tgl-h apl skl kbl cnl sue icl jsl \
# Work in progress can be added to this "staging area" without breaking
# the -a option for everyone.
SUPPORTED_PLATFORMS=( "${DEFAULT_PLATFORMS[@]}" )
SUPPORTED_PLATFORMS=( "${DEFAULT_PLATFORMS[@]}" rmb)

BUILD_ROM=no
BUILD_DEBUG=no
Expand Down Expand Up @@ -335,6 +336,13 @@ do
HOST="xtensa-rn-elf"
XTENSA_TOOLS_VERSION="RI-2019.1-linux"
;;
rmb)
PLATFORM="rembrandt"
ARCH="xtensa"
XTENSA_CORE="LX7_HiFi5_PROD"
HOST="xtensa-rmb-elf"
XTENSA_TOOLS_VERSION="RI-2019.1-linux"
;;
mt8186)
PLATFORM="mt8186"
XTENSA_CORE="hifi5_7stg_I64D128"
Expand Down
7 changes: 6 additions & 1 deletion src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ if(CONFIG_RENOIR)
set(platform_folder amd/renoir)
set(platform_ld_script renoir.x)
endif()

if(CONFIG_REMBRANDT)
set(platform_folder amd/rembrandt)
set(platform_ld_script rembrandt.x)
endif()
# includes

target_include_directories(sof_options INTERFACE
Expand Down Expand Up @@ -542,7 +547,7 @@ set(UNSIGNED_RI byt cht hsw bdw sue)
# NXP
list(APPEND UNSIGNED_RI imx8 imx8x imx8m imx8ulp)
# AMD
list(APPEND UNSIGNED_RI rn)
list(APPEND UNSIGNED_RI rn rmb)
# Mediatek
list(APPEND UNSIGNED_RI mt8186 mt8195)

Expand Down
24 changes: 24 additions & 0 deletions src/arch/xtensa/configs/rembrandt_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CONFIG_REMBRANDT=y
CONFIG_RIMAGE_SIGNING_SCHEMA="rmb"
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=0
CONFIG_HP_MEMORY_BANKS=10
CONFIG_FORMAT_CONVERT_HIFI3=n
CONFIG_LP_SRAM=n
CONFIG_HAVE_AGENT=n
CONFIG_COMP_SRC=n
CONFIG_COMP_FIR=n
CONFIG_COMP_IIR=n
CONFIG_COMP_DCBLOCK=n
CONFIG_COMP_TDFB=n
CONFIG_COMP_TONE=n
CONFIG_COMP_MIXER=n
CONFIG_COMP_MUX=n
CONFIG_COMP_SWITCH=n
CONFIG_COMP_KPB=n
CONFIG_COMP_SEL=n
CONFIG_COMP_ASRC=n
2 changes: 1 addition & 1 deletion src/drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(CONFIG_INTEL)
add_subdirectory(intel)
endif()

if(CONFIG_RENOIR)
if(CONFIG_RENOIR OR CONFIG_REMBRANDT)
add_subdirectory(amd)
endif()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

a general question to this PR: how different are these drivers from renoir? Could any be reused?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR uses different set of registers than Renoir. Currently we are not planning for restructure. We will plan for those activities once platforms are stabilized


Expand Down
2 changes: 2 additions & 0 deletions src/drivers/amd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

if(CONFIG_RENOIR)
add_subdirectory(renoir)
elseif(CONFIG_REMBRANDT)
add_subdirectory(rembrandt)
endif()
16 changes: 16 additions & 0 deletions src/drivers/amd/rembrandt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-License-Identifier: BSD-3-Clause

add_local_sources(sof
acp_dma.c
acp_bt_dai.c
acp_sp_dai.c
acp_dmic_dai.c
acp_hs_dai.c
interrupt.c
ipc.c
timer.c
acp_bt_dma.c
acp_sp_dma.c
acp_hs_dma.c
acp_dmic_dma.c
)
95 changes: 95 additions & 0 deletions src/drivers/amd/rembrandt/acp_bt_dai.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// SPDX-License-Identifier: BSD-3-Clause
//
//Copyright(c) 2022 AMD. All rights reserved.
//
//Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
// Bala Kishore <balakishore.pati@amd.com>

#include <sof/audio/component.h>
#include <sof/drivers/acp_dai_dma.h>
#include <sof/drivers/interrupt.h>
#include <sof/lib/alloc.h>
#include <sof/lib/dai.h>
#include <sof/lib/dma.h>
#include <sof/lib/uuid.h>
#include <ipc/dai.h>
#include <ipc/topology.h>
#include <platform/fw_scratch_mem.h>
#include <sof/lib/io.h>
#include <platform/chip_offset_byte.h>

/* 4abd71ba-8619-458a-b33f-160fc0cf809b */
DECLARE_SOF_UUID("btdai", btdai_uuid, 0x4abd71ba, 0x8619, 0x458a,
0xb3, 0x3f, 0x16, 0x0f, 0xc0, 0xcf, 0x80, 0x9b);

DECLARE_TR_CTX(btdai_tr, SOF_UUID(btdai_uuid), LOG_LEVEL_INFO);

static inline int btdai_set_config(struct dai *dai, struct ipc_config_dai *common_config,
void *spec_config)
{
/* nothing to do on rembrandt */
return 0;
}

static int btdai_trigger(struct dai *dai, int cmd, int direction)
{
/* nothing to do on rembrandt */
return 0;
}

static int btdai_probe(struct dai *dai)
{
/* TODO */
return 0;
}

static int btdai_remove(struct dai *dai)
{
/* TODO */
return 0;
}

static int btdai_get_fifo(struct dai *dai, int direction, int stream_id)
{
switch (direction) {
case DAI_DIR_PLAYBACK:
case DAI_DIR_CAPTURE:
return dai_fifo(dai, direction);
default:
dai_err(dai, "Not a valid direction");
return -EINVAL;
}
}

static int btdai_get_handshake(struct dai *dai, int direction, int stream_id)
{
return dai->plat_data.fifo[direction].handshake;
}

static int btdai_get_hw_params(struct dai *dai,
struct sof_ipc_stream_params *params, int dir)
{
/* supported parameters */
params->rate = ACP_DEFAULT_SAMPLE_RATE;
params->channels = ACP_DEFAULT_NUM_CHANNELS;
params->buffer_fmt = SOF_IPC_BUFFER_INTERLEAVED;
params->frame_fmt = SOF_IPC_FRAME_S16_LE;
return 0;
}

const struct dai_driver acp_btdai_driver = {
.type = SOF_DAI_AMD_BT,
.uid = SOF_UUID(btdai_uuid),
.tctx = &btdai_tr,
.dma_dev = DMA_DEV_BT,
.dma_caps = DMA_CAP_BT,
.ops = {
.trigger = btdai_trigger,
.set_config = btdai_set_config,
.probe = btdai_probe,
.remove = btdai_remove,
.get_fifo = btdai_get_fifo,
.get_handshake = btdai_get_handshake,
.get_hw_params = btdai_get_hw_params,
},
};
Loading