-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
audio: base_fw: add platform layer to IPC4 hw_config data
Some of the IPC4 HW_CONFIG fields are platform specific and cannot be filled with generic code. Handle this functionality by separating platform specific parts of base_fw to a new base_fw_platform.h interface. Move out existing code for Intel cAVS and ACE platforms. Add a new stub implementation for posix platform. This posix stub can be also used as a starting point when adding IPC4 support to new platforms. This platform construct can be later used to move out other vendor and platform data out from base_fw.c. Signed-off-by: Kai Vehmanen <[email protected]>
- Loading branch information
Showing
5 changed files
with
80 additions
and
11 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
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,25 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright(c) 2024 Intel Corporation. | ||
* | ||
* Author: Kai Vehmanen <[email protected]> | ||
*/ | ||
|
||
/** | ||
* \file include/ipc4/base_fw_platform.h | ||
* \brief Platform specific IPC4 base firmware functionality. | ||
*/ | ||
|
||
#ifndef __SOF_IPC4_BASE_FW_PLATFORM_H__ | ||
#define __SOF_IPC4_BASE_FW_PLATFORM_H__ | ||
|
||
/** | ||
* \brief Platform specific routine to add data tuples to HW_CONFIG | ||
* structure sent to host via IPC. | ||
* \param[out] data_offset data offset after tuples added | ||
* \parma[in] data pointer where to add new entries | ||
* \return 0 if successful, error code otherwise. | ||
*/ | ||
int platform_basefw_hw_config(uint32_t *data_offset, char *data); | ||
|
||
#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,32 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// Copyright(c) 2024 Intel Corporation. | ||
// | ||
// Author: Kai Vehmanen <[email protected]> | ||
|
||
#include <rtos/string.h> | ||
#include <sof/tlv.h> | ||
#include <sof/lib/dai.h> | ||
#include <ipc4/base_fw.h> | ||
|
||
int platform_basefw_hw_config(uint32_t *data_offset, char *data) | ||
{ | ||
struct sof_tlv *tuple = (struct sof_tlv *)data; | ||
uint32_t value; | ||
|
||
tlv_value_uint32_set(tuple, IPC4_HP_EBB_COUNT_HW_CFG, PLATFORM_HPSRAM_EBB_COUNT); | ||
|
||
tuple = tlv_next(tuple); | ||
/* 2 DMIC dais */ | ||
value = DAI_NUM_SSP_BASE + DAI_NUM_HDA_IN + DAI_NUM_HDA_OUT + | ||
DAI_NUM_ALH_BI_DIR_LINKS + 2; | ||
tlv_value_uint32_set(tuple, IPC4_GATEWAY_COUNT_HW_CFG, value); | ||
|
||
tuple = tlv_next(tuple); | ||
tlv_value_uint32_set(tuple, IPC4_LP_EBB_COUNT_HW_CFG, PLATFORM_LPSRAM_EBB_COUNT); | ||
|
||
tuple = tlv_next(tuple); | ||
*data_offset = (int)((char *)tuple - data); | ||
|
||
return 0; | ||
} |
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,15 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// Copyright(c) 2024 Intel Corporation. | ||
// | ||
// Author: Kai Vehmanen <[email protected]> | ||
|
||
#include <stdint.h> | ||
#include <ipc4/base_fw_platform.h> | ||
|
||
int platform_basefw_hw_config(uint32_t *data_offset, char *data) | ||
{ | ||
*data_offset = 0; | ||
|
||
return 0; | ||
} |
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