From 52728c257e25112f99ea92a75a3b488113a212e9 Mon Sep 17 00:00:00 2001 From: Christian Vejlbo Date: Thu, 12 Dec 2024 09:56:29 +0100 Subject: [PATCH] Update to SDK v112.3.7. Enable DSP-based start/stop of barge-in/AEC --- os/drivers/ai-soc/Make.defs | 2 +- .../ndp120_dsp_algo_interface.h | 3 +- .../ndp120_dsp_audio_sync.h | 3 +- .../syntiant-dsp-firmware/ndp120_dsp_dnn.h | 3 +- .../syntiant-dsp-firmware/ndp120_dsp_fifo.h | 3 +- .../syntiant-dsp-firmware/ndp120_dsp_flow.h | 4 +- .../ndp120_dsp_fw_state.h | 3 +- .../ndp120_dsp_mailbox.h | 40 ++- .../syntiant-dsp-firmware/ndp120_dsp_memory.h | 3 +- .../syntiant-dsp-firmware/ndp120_dsp_sample.h | 3 +- .../syntiant-dsp-firmware/ndp120_serial.h | 3 +- .../ndp200_dsp_image_sensor.h | 14 +- .../syntiant-dsp-firmware/ndp_serial.h | 3 +- .../syntiant-firmware/ndp120_firmware.h | 9 +- .../include/syntiant-firmware/ndp120_mb.h | 2 +- .../include/syntiant-firmware/ndp120_mem.h | 3 +- .../syntiant-firmware/ndp120_orchestrator.h | 3 +- .../include/syntiant-firmware/ndp120_ph.h | 3 +- .../include/syntiant-firmware/ndp120_regs.h | 3 +- .../include/syntiant-firmware/ndp120_result.h | 3 +- .../syntiant-firmware/ndp120_spi_regs.h | 3 +- .../include/syntiant-firmware/ndp_regs.h | 4 +- .../include/syntiant-firmware/ndp_serial.h | 3 +- .../include/syntiant-firmware/ph/mcp_ph.h | 3 +- .../include/syntiant-firmware/ph/scp_ph.h | 3 +- .../ndp120/include/syntiant-firmware/uart.h | 36 ++ .../ai-soc/ndp120/include/syntiant_evb_io.h | 2 +- .../include/syntiant_ilib/ndp120_regs.h | 2 +- .../include/syntiant_ilib/ndp120_spi_regs.h | 2 +- .../include/syntiant_ilib/syntiant_ndp.h | 2 +- .../include/syntiant_ilib/syntiant_ndp115.h | 2 +- .../syntiant_ilib/syntiant_ndp115_driver.h | 2 +- .../include/syntiant_ilib/syntiant_ndp120.h | 15 +- .../syntiant_ilib/syntiant_ndp120_driver.h | 2 +- .../syntiant_ilib/syntiant_ndp120_flash.h | 2 +- .../syntiant_ilib/syntiant_ndp120_flashboot.h | 2 +- .../syntiant_ilib/syntiant_ndp120_mailbox.h | 2 +- .../syntiant_ilib/syntiant_ndp120_ph.h | 2 +- .../include/syntiant_ilib/syntiant_ndp200.h | 2 +- .../syntiant_ilib/syntiant_ndp_driver.h | 2 +- .../syntiant_ilib/syntiant_ndp_error.h | 2 +- .../syntiant_ilib/syntiant_ndp_ilib_version.h | 4 +- .../syntiant_ilib/syntiant_ndp_pbi_version.h | 2 +- .../syntiant_ilib/syntiant_portability.h | 2 +- .../syntiant_ilib/syntiant_spictl_regs.h | 2 +- .../ndp120/include/syntiant_ndp120_config.h | 2 +- .../ndp120/include/syntiant_ndp_config.h | 2 +- .../syntiant_packager/syntiant_package.h | 2 +- .../syntiant_package_consts.h | 2 +- .../syntiant_packager/syntiant_package_tags.h | 2 +- os/drivers/ai-soc/ndp120/src/checksum.c | 2 +- os/drivers/ai-soc/ndp120/src/ndp120_api.c | 324 +++++++++++++++--- os/drivers/ai-soc/ndp120/src/syntiant_ndp.c | 2 +- .../ai-soc/ndp120/src/syntiant_ndp115.c | 2 +- .../ai-soc/ndp120/src/syntiant_ndp120.c | 16 +- .../ndp120/src/syntiant_ndp120_config.c | 14 +- .../ndp120/src/syntiant_ndp120_config_misc.c | 2 +- .../ndp120/src/syntiant_ndp120_mailbox.c | 2 +- .../ai-soc/ndp120/src/syntiant_ndp120_ph.c | 2 +- .../ai-soc/ndp120/src/syntiant_ndp_error.c | 2 +- .../ai-soc/ndp120/src/syntiant_package.c | 2 +- .../ai-soc/ndp120/src/syntiant_portability.c | 2 +- os/drivers/audio/ndp120_voice.h | 1 + 63 files changed, 413 insertions(+), 188 deletions(-) create mode 100644 os/drivers/ai-soc/ndp120/include/syntiant-firmware/uart.h diff --git a/os/drivers/ai-soc/Make.defs b/os/drivers/ai-soc/Make.defs index 930b1c9b93..2082e72a4a 100644 --- a/os/drivers/ai-soc/Make.defs +++ b/os/drivers/ai-soc/Make.defs @@ -32,7 +32,7 @@ CSRCS += syntiant_portability.c # This should be set to the host processor clock frequency value CPU_FREQ ?= 1200000000 -EXTRACT_WINDOW_UTILIZATION ?= 50 +EXTRACT_WINDOW_UTILIZATION ?= 40 CFLAGS += -DCPU_FREQUENCY=$(CPU_FREQ) CFLAGS += -DEXTRACT_WINDOW_UTILIZATION=$(EXTRACT_WINDOW_UTILIZATION) diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_algo_interface.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_algo_interface.h index 1899430f3c..bfcc10f5af 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_algo_interface.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_algo_interface.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_DSP_ALGO_INTERFACE_H_ #define NDP120_DSP_ALGO_INTERFACE_H_ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_audio_sync.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_audio_sync.h index 4a7eccb796..e0d11a53d4 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_audio_sync.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_audio_sync.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_DSP_AUDIO_SYNC_H_ #define NDP120_DSP_AUDIO_SYNC_H_ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_dnn.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_dnn.h index 834ea1e4a8..88969f4cf0 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_dnn.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_dnn.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_DSP_DNN_H_ #define NDP120_DSP_DNN_H_ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_fifo.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_fifo.h index 9af813a5b4..872dd97371 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_fifo.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_fifo.h @@ -28,11 +28,10 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_DSP_FIFO_H_ #define NDP120_DSP_FIFO_H_ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_flow.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_flow.h index 40da9083d0..e5ec0ae7cf 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_flow.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_flow.h @@ -28,9 +28,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_DSP_FLOW_H_ #define NDP120_DSP_FLOW_H_ @@ -93,6 +92,7 @@ typedef enum { #define NDP120_NN_DATA_FLOW_RULE_MAX 32 #define NDP120_MCU_DATA_FLOW_RULE_MAX 8 #define NDP120_SENSOR_DATA_FLOW_RULE_MAX 4 +#define NDP120_FLOW_SET_IDS_MAX 4 /* dst_type enums for flow tuples */ typedef enum { diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_fw_state.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_fw_state.h index 6ef1478b89..4b5fa336c7 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_fw_state.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_fw_state.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_DSP_FW_STATE_H_ #define NDP120_DSP_FW_STATE_H_ #include diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_mailbox.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_mailbox.h index 1bf2b03722..ba2f4cff24 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_mailbox.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_mailbox.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_DSP_MAILBOX_H_ #define NDP120_DSP_MAILBOX_H_ @@ -55,23 +54,23 @@ typedef uint32_t ndp120_dsp_mailbox_msg_t; #define NDP120_M2D_MB_SET_EXT_PARAMS(x1, x2) ((x1) |\ (((x2) & NDP120_M2D_MB_EXT_PARAMS_MASK) << NDP120_M2D_MB_EXT_PARAMS_SHIFT)) -#define NDP120_DSP_MB_GET_PAYLOAD(x) ((x >> NDP120_DSP_MB_PAYLOAD_SHIFT) & NDP120_DSP_MB_PAYLOAD_MASK) -#define NDP120_DSP_MB_SET_PAYLOAD(x, y) ((x & ~(NDP120_DSP_MB_PAYLOAD_MASK << NDP120_DSP_MB_PAYLOAD_SHIFT)) | (((y) & NDP120_DSP_MB_PAYLOAD_MASK) << NDP120_DSP_MB_PAYLOAD_SHIFT)) +#define NDP120_DSP_MB_GET_PAYLOAD(x) (((x) >> NDP120_DSP_MB_PAYLOAD_SHIFT) & NDP120_DSP_MB_PAYLOAD_MASK) +#define NDP120_DSP_MB_SET_PAYLOAD(x, y) (((x) & ~(NDP120_DSP_MB_PAYLOAD_MASK << NDP120_DSP_MB_PAYLOAD_SHIFT)) | (((y) & NDP120_DSP_MB_PAYLOAD_MASK) << NDP120_DSP_MB_PAYLOAD_SHIFT)) -#define NDP120_DSP_MB_GET_MESSAGE(x) ((x >> NDP120_DSP_MB_MESSAGE_SHIFT) & NDP120_DSP_MB_MESSAGE_MASK) -#define NDP120_DSP_MB_SET_MESSAGE(x, y) ((x & ~(NDP120_DSP_MB_MESSAGE_MASK << NDP120_DSP_MB_MESSAGE_SHIFT)) | (((y) & NDP120_DSP_MB_MESSAGE_MASK) << NDP120_DSP_MB_MESSAGE_SHIFT)) +#define NDP120_DSP_MB_GET_MESSAGE(x) (((x) >> NDP120_DSP_MB_MESSAGE_SHIFT) & NDP120_DSP_MB_MESSAGE_MASK) +#define NDP120_DSP_MB_SET_MESSAGE(x, y) (((x) & ~(NDP120_DSP_MB_MESSAGE_MASK << NDP120_DSP_MB_MESSAGE_SHIFT)) | (((y) & NDP120_DSP_MB_MESSAGE_MASK) << NDP120_DSP_MB_MESSAGE_SHIFT)) -#define NDP120_DSP_MB_GET_SEQ(x) ((x >> NDP120_DSP_MB_SEQ_SHIFT) & NDP120_DSP_MB_SEQ_MASK) -#define NDP120_DSP_MB_SET_SEQ(x, y) ((x & ~(NDP120_DSP_MB_SEQ_MASK << NDP120_DSP_MB_SEQ_SHIFT)) | (((y) & NDP120_DSP_MB_SEQ_MASK) << NDP120_DSP_MB_SEQ_SHIFT)) +#define NDP120_DSP_MB_GET_SEQ(x) (((x) >> NDP120_DSP_MB_SEQ_SHIFT) & NDP120_DSP_MB_SEQ_MASK) +#define NDP120_DSP_MB_SET_SEQ(x, y) (((x) & ~(NDP120_DSP_MB_SEQ_MASK << NDP120_DSP_MB_SEQ_SHIFT)) | (((y) & NDP120_DSP_MB_SEQ_MASK) << NDP120_DSP_MB_SEQ_SHIFT)) -#define NDP120_DSP_MB_GET_TYPE(x) ((x >> NDP120_DSP_MB_TYPE_SHIFT) & NDP120_DSP_MB_TYPE_MASK) -#define NDP120_DSP_MB_SET_TYPE(x, y) ((x & ~(NDP120_DSP_MB_TYPE_MASK << NDP120_DSP_MB_TYPE_SHIFT)) | (((y) & NDP120_DSP_MB_TYPE_MASK) << NDP120_DSP_MB_TYPE_SHIFT)) +#define NDP120_DSP_MB_GET_TYPE(x) (((x) >> NDP120_DSP_MB_TYPE_SHIFT) & NDP120_DSP_MB_TYPE_MASK) +#define NDP120_DSP_MB_SET_TYPE(x, y) (((x) & ~(NDP120_DSP_MB_TYPE_MASK << NDP120_DSP_MB_TYPE_SHIFT)) | (((y) & NDP120_DSP_MB_TYPE_MASK) << NDP120_DSP_MB_TYPE_SHIFT)) -#define NDP120_DSP_MB_GET_TOGGLE(x) ((x >> NDP120_DSP_MB_TOGGLE_SHIFT) & NDP120_DSP_MB_TOGGLE_MASK) -#define NDP120_DSP_MB_SET_TOGGLE(x, y) ((x & ~(NDP120_DSP_MB_TOGGLE_MASK << NDP120_DSP_MB_TOGGLE_SHIFT)) | (((y) & NDP120_DSP_MB_TOGGLE_MASK) << NDP120_DSP_MB_TOGGLE_SHIFT)) +#define NDP120_DSP_MB_GET_TOGGLE(x) (((x) >> NDP120_DSP_MB_TOGGLE_SHIFT) & NDP120_DSP_MB_TOGGLE_MASK) +#define NDP120_DSP_MB_SET_TOGGLE(x, y) (((x) & ~(NDP120_DSP_MB_TOGGLE_MASK << NDP120_DSP_MB_TOGGLE_SHIFT)) | (((y) & NDP120_DSP_MB_TOGGLE_MASK) << NDP120_DSP_MB_TOGGLE_SHIFT)) -#define NDP120_H2D_MB_GET_PAYLOAD(x) ((x >> NDP120_H2D_MB_PAYLOAD_SHIFT) & NDP120_H2D_MB_PAYLOAD_MASK) -#define NDP120_H2D_MB_SET_PAYLOAD(x, y) ((x & ~(NDP120_H2D_MB_PAYLOAD_MASK << NDP120_H2D_MB_PAYLOAD_SHIFT)) | (((y) & NDP120_H2D_MB_PAYLOAD_MASK) << NDP120_H2D_MB_PAYLOAD_SHIFT)) +#define NDP120_H2D_MB_GET_PAYLOAD(x) (((x) >> NDP120_H2D_MB_PAYLOAD_SHIFT) & NDP120_H2D_MB_PAYLOAD_MASK) +#define NDP120_H2D_MB_SET_PAYLOAD(x, y) (((x) & ~(NDP120_H2D_MB_PAYLOAD_MASK << NDP120_H2D_MB_PAYLOAD_SHIFT)) | (((y) & NDP120_H2D_MB_PAYLOAD_MASK) << NDP120_H2D_MB_PAYLOAD_SHIFT)) #define NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_SHIFT 0 #define NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_MASK 0x1F @@ -79,17 +78,17 @@ typedef uint32_t ndp120_dsp_mailbox_msg_t; #define NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_MASK 0x1 #define NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GET_GPIO(x) \ - ((x >> NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_SHIFT) & NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_MASK) + (((x) >> NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_SHIFT) & NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_MASK) #define NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_SET_GPIO(x,y) \ - ((x & ~(NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_MASK << NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_SHIFT)) | \ + (((x) & ~(NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_MASK << NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_SHIFT)) | \ (((y) & NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_MASK) << NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GPIO_SHIFT)) #define NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_GET_STATE(x) \ - ((x >> NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_SHIFT) & NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_MASK) + (((x) >> NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_SHIFT) & NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_MASK) #define NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_SET_STATE(x,y) \ - ((x & ~(NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_MASK << NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_SHIFT)) | \ + (((x) & ~(NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_MASK << NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_SHIFT)) | \ (((y) & NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_MASK) << NDP120_DSP_MB_NOTIFY_PAYLOAD_GPIO_CHANGE_STATE_SHIFT)) #define NDP120_MCU_OPEN_RAM_START (0x20007400U) @@ -245,6 +244,11 @@ enum { NDP120_DSP_MB_H2D_UNKNOWN_MIC_STATE = NDP120_DSP_MB_D2H_UNKNOWN_MIC_STATE }; +/* Barge in */ +enum { + BARGE_IN_STATUS = 0, + BARGE_IN_INIT = 1 +}; enum { MB_REQ = 0, diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_memory.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_memory.h index a696a42d4e..f84c62aafc 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_memory.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_memory.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_DSP_MEMORY_H_ #define NDP120_DSP_MEMORY_H_ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_sample.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_sample.h index a656fc4462..99dace5a6b 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_sample.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_dsp_sample.h @@ -28,9 +28,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_DSP_SAMPLE_H_ #define NDP120_DSP_SAMPLE_H_ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_serial.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_serial.h index ab1f903e5e..2814427b0b 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_serial.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp120_serial.h @@ -28,11 +28,10 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-= */ /* */ /* IMPORTANT */ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp200_dsp_image_sensor.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp200_dsp_image_sensor.h index c78e27ec7c..c078ad0470 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp200_dsp_image_sensor.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp200_dsp_image_sensor.h @@ -28,21 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - - - - - - - - - - - - #ifndef NDP200_DSP_IMAGE_SENSOR_H_ #define NDP200_DSP_IMAGE_SENSOR_H_ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp_serial.h b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp_serial.h index a8903e5812..fdbfca1ddd 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp_serial.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-dsp-firmware/ndp_serial.h @@ -28,11 +28,10 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-= */ /* */ /* IMPORTANT */ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_firmware.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_firmware.h index 5136df3da0..72134e6d4a 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_firmware.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_firmware.h @@ -28,16 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ -/* - * NOTE: - * 1. this header file is used in the syntiant-ilib repo as an interface file - * 2. Some compilers do not pack the structs which means they are always 32 bit - * aligned so they are explicitly made 32 bit aligned so please follow that. - */ - #ifndef NDP120_FIRMWARE_H #define NDP120_FIRMWARE_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_mb.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_mb.h index 08e8b16d9d..b44a916af2 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_mb.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_mb.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef NDP120_MB_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_mem.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_mem.h index ae7135a27b..7147eb3c6d 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_mem.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_mem.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_MEM_H #define NDP120_MEM_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_orchestrator.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_orchestrator.h index 0fa2f5f1bc..498cfb3418 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_orchestrator.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_orchestrator.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef _NDP120_ORCHESTRATOR_H #define _NDP120_ORCHESTRATOR_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_ph.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_ph.h index 68230a51fb..09f3fd02b4 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_ph.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_ph.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_PH_H #define NDP120_PH_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_regs.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_regs.h index db39c30917..06cdf0be64 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_regs.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_regs.h @@ -28,9 +28,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - /* * ******* Automatically generated for ndp120 v2.00 DO NOT MODIFY!!!!! * Generated Wed Sep 30 21:53:23 2020 UTC diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_result.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_result.h index 01a9dcd84d..ca5a1b15f2 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_result.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_result.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef NDP120_RESULTS_H #define NDP120_RESULTS_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_spi_regs.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_spi_regs.h index 93d85d8620..5357469af0 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_spi_regs.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp120_spi_regs.h @@ -28,9 +28,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - /* * ******* Automatically generated for ndp120_spi v2.00 DO NOT MODIFY!!!!! * Generated Wed Sep 16 00:42:33 2020 UTC diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp_regs.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp_regs.h index 9daaec74a2..bc9f25d1a3 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp_regs.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp_regs.h @@ -28,9 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - + #ifndef NDP_REGS_H #define NDP_REGS_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp_serial.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp_serial.h index a8903e5812..fdbfca1ddd 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp_serial.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ndp_serial.h @@ -28,11 +28,10 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-= */ /* */ /* IMPORTANT */ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ph/mcp_ph.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ph/mcp_ph.h index 38e490085f..ee378d598a 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ph/mcp_ph.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ph/mcp_ph.h @@ -28,10 +28,9 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef _MCP_PH_H_ #define _MCP_PH_H_ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ph/scp_ph.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ph/scp_ph.h index aa0b18d50a..d70f9c0c28 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ph/scp_ph.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/ph/scp_ph.h @@ -28,9 +28,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ - #ifndef _SCP_PH_H_ #define _SCP_PH_H_ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant-firmware/uart.h b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/uart.h new file mode 100644 index 0000000000..a31e818f3d --- /dev/null +++ b/os/drivers/ai-soc/ndp120/include/syntiant-firmware/uart.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Syntiant Corp. All rights reserved. + * Contact at http://www.syntiant.com + * + * This software is available to you under a choice of one of two licenses. + * You may choose to be licensed under the terms of the GNU General Public + * License (GPL) Version 2, available from the file LICENSE in the main + * directory of this source tree, or the OpenIB.org BSD license below. Any + * code involving Linux software will require selection of the GNU General + * Public License (GPL) Version 2. + * + * OPENIB.ORG BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ** SDK: v112.3.7-Samsung ** +*/ +#pragma once + +void uart_write_str(char *str); +void uart_write_hex(uint32_t hex); diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_evb_io.h b/os/drivers/ai-soc/ndp120/include/syntiant_evb_io.h index 7d8c447c36..8078ce0cda 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_evb_io.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_evb_io.h @@ -13,7 +13,7 @@ * Dissemination of this information or reproduction of this material is * strictly forbidden unless prior written permission is obtained from * Syntiant Corporation. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_EVB_IO_H #define SYNTIANT_EVB_IO_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/ndp120_regs.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/ndp120_regs.h index 87e14ae158..13762df5f8 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/ndp120_regs.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/ndp120_regs.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef NDP120_REGS_H #define NDP120_REGS_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/ndp120_spi_regs.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/ndp120_spi_regs.h index 9883617d73..03ea7a6f83 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/ndp120_spi_regs.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/ndp120_spi_regs.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef NDP120_SPI_REGS_H #define NDP120_SPI_REGS_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp.h index e8a8b4f8d7..72660e5339 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP_H #define SYNTIANT_NDP_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp115.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp115.h index 028d3efa60..659a8f045d 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp115.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp115.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP115_H #define SYNTIANT_NDP115_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp115_driver.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp115_driver.h index 90fd5b68b5..3f0a7d1c1a 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp115_driver.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp115_driver.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ /* * ILib-internal NDP115 driver-specific definitions diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120.h index e382a85a26..a535552531 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP120_H #define SYNTIANT_NDP120_H @@ -324,7 +324,8 @@ enum { /* PDM clock mode */ SYNTIANT_NDP120_CONFIG_VALUE_PDM_CLK_MODE_EXTERNAL, SYNTIANT_NDP120_CONFIG_VALUE_PDM_CLK_MODE_INTERNAL, - SYNTIANT_NDP120_CONFIG_VALUE_PDM_CLK_MODE_DUAL_INTERNAL + SYNTIANT_NDP120_CONFIG_VALUE_PDM_CLK_MODE_DUAL_INTERNAL, + SYNTIANT_NDP120_CONFIG_VALUE_PDM_CLK_MODE_THROUGH }; enum { @@ -2629,16 +2630,16 @@ int syntiant_ndp120_set_get_dnn_run_delay(struct syntiant_ndp_device_s *ndp, src_type, uint32_t *delay, uint32_t set); /** - * @brief NDP120 enable/disable barge-in. + * @brief NDP120 config barge-in. * - * Enables/disables the barge-in by sending MB cmd to DSP. + * Configure the barge-in state by sending MB cmd to DSP. * * @param ndp NDP state object - * @param enable indicates enable/disable. + * @param config indicates init/status. * @return a @c SYNTIANT_NDP_ERROR_* code */ -int syntiant_ndp120_enable_disable_barge_in(struct syntiant_ndp_device_s *ndp, - int enable); +int syntiant_ndp120_config_barge_in(struct syntiant_ndp_device_s *ndp, + int config); /** @brief Get Core2 device type * @param ndp NDP state obkect diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_driver.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_driver.h index 0154589fd3..14b132540a 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_driver.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_driver.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ /* * ILib-internal NDP120 driver-specific definitions diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_flash.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_flash.h index b635cb733e..08ef982ded 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_flash.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_flash.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef _SYNTIANT_NDP120_FLASH_H_ #define _SYNTIANT_NDP120_FLASH_H_ diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_flashboot.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_flashboot.h index 2b8e9b2c53..c33676f757 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_flashboot.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_flashboot.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP120_DEBUG_H #define SYNTIANT_NDP120_DEBUG_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_mailbox.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_mailbox.h index 5a0f3bdddb..a17b22d156 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_mailbox.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_mailbox.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ /* * Syntiant NDP120 SPI mailbox protocol definitions diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_ph.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_ph.h index ba29a4f66c..310e43a759 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_ph.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp120_ph.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP120_PH_H #define SYNTIANT_NDP120_PH_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp200.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp200.h index eaace75016..55571f9781 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp200.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp200.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP200_H #define SYNTIANT_NDP200_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_driver.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_driver.h index 50bf940a16..02d024130f 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_driver.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_driver.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ /* * ILib-internal driver interface definitions diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_error.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_error.h index e68154ae9e..c66a997e73 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_error.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_error.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP_ERROR_H #define SYNTIANT_NDP_ERROR_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_ilib_version.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_ilib_version.h index 59e69c8f78..c58b25ac68 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_ilib_version.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_ilib_version.h @@ -29,7 +29,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ /* @@ -43,7 +43,7 @@ #define SYNTIANT_NDP_ILIB_VERSION_H #define SYNTIANT_NDP_ILIB_RELEASE_HASH \ - "50f312b01d0fa3433dccf1d5198aa93a8d1503ac" + "6369bb292a8256b669653be6cfd09f80cd1cdf6f" #define SYNTIANT_NDP_ILIB_SYNTIANT_CORE_1_MAJOR_VERSION 1 #define SYNTIANT_NDP_ILIB_SYNTIANT_CORE_1_MINOR_VERSION 138 diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_pbi_version.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_pbi_version.h index 795208680e..c3e9c03ac8 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_pbi_version.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_ndp_pbi_version.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP_PBI_VERSION_H #define SYNTIANT_NDP_PBI_VERSION_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_portability.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_portability.h index cc769b6ca1..47292237d9 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_portability.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_portability.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP_PORTABILITY_H #define SYNTIANT_NDP_PORTABILITY_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_spictl_regs.h b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_spictl_regs.h index a08200801a..4aa345c080 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_spictl_regs.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ilib/syntiant_spictl_regs.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #define NDP120_CHIP_CONFIG_SPICTL 0x4000903cU #define NDP120_CHIP_CONFIG_SPICTL_MSPI_MODE_SHIFT 0 diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ndp120_config.h b/os/drivers/ai-soc/ndp120/include/syntiant_ndp120_config.h index b38267d6e7..97a262edd6 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ndp120_config.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ndp120_config.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP120_CONFIG_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_ndp_config.h b/os/drivers/ai-soc/ndp120/include/syntiant_ndp_config.h index 9dfb3bbc7d..b0d6cf7357 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_ndp_config.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_ndp_config.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_NDP_CONFIG_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package.h b/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package.h index 356c4511b3..d77bd473ab 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_PACKAGE_H #define SYNTIANT_PACKAGE_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package_consts.h b/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package_consts.h index 16ebe71edf..3f44159eca 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package_consts.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package_consts.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_PACKAGE_CONSTS_H #define SYNTIANT_PACKAGE_CONSTS_H diff --git a/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package_tags.h b/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package_tags.h index f1cfb60baa..a737b025d8 100644 --- a/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package_tags.h +++ b/os/drivers/ai-soc/ndp120/include/syntiant_packager/syntiant_package_tags.h @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef SYNTIANT_PACKAGE_TAGS_H diff --git a/os/drivers/ai-soc/ndp120/src/checksum.c b/os/drivers/ai-soc/ndp120/src/checksum.c index bd561ae185..fdef98832d 100644 --- a/os/drivers/ai-soc/ndp120/src/checksum.c +++ b/os/drivers/ai-soc/ndp120/src/checksum.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #include diff --git a/os/drivers/ai-soc/ndp120/src/ndp120_api.c b/os/drivers/ai-soc/ndp120/src/ndp120_api.c index f6515fd668..71fbcea787 100644 --- a/os/drivers/ai-soc/ndp120/src/ndp120_api.c +++ b/os/drivers/ai-soc/ndp120/src/ndp120_api.c @@ -29,7 +29,6 @@ * process, and are protected by trade secret or copyright law. Dissemination * of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from Syntiant Corporation. - ** SDK: v104 ** */ /**************************************************************************** @@ -75,14 +74,13 @@ #define round_down(x, y) ((x) - ((x) % (y))) #define STRING_LEN 256 -/* currently the max size of tank is limited to ~580ms */ #define AUDIO_BEFORE_MATCH_MS (1500) #define PDM_CLOCK_PDM_RATE 1536000 /* this is the higher bound of the keyword length, it will be rounded down to multiple of frame size */ #define KEYWORD_BUFFER_LEN (SYNTIANT_NDP120_AUDIO_SAMPLE_RATE * SYNTIANT_NDP120_AUDIO_SAMPLES_PER_WORD * AUDIO_BEFORE_MATCH_MS / 1000) -#define NDP120_SPI_FREQ_HIGH 12000000 +#define NDP120_SPI_FREQ_HIGH 20000000 #define NDP120_SPI_FREQ_INIT 1000000 #define FF_ID NDP120_DSP_DATA_FLOW_FUNCTION_FULL_FF_49 #define KEYWORD_NETWORK_ID 0 @@ -90,6 +88,11 @@ /* Periodicity of NDP alivness check thread */ #define NDP_ALIVENESS_CHECK_PERIOD (3000) +#define COMBINED_FLOW_SET_ID 0 + +// can be enabled to print the flow rules during init +//#define CONFIG_DEBUG_AUDIO_INFO + /**************************************************************************** * Private Data ****************************************************************************/ @@ -123,6 +126,12 @@ static struct ndp120_dev_s *_ndp_debug_handle = NULL; * Function Prototypes ****************************************************************************/ int ndp120_init(struct ndp120_dev_s *dev, bool reinit); +void ndp120_aec_enable(struct ndp120_dev_s *dev); +void ndp120_aec_disable(struct ndp120_dev_s *dev); +void ndp120_test_internal_passthrough_switch(struct ndp120_dev_s *dev, int internal); + +static void do_ndp120_i2s_setup(struct syntiant_ndp_device_s *ndp); + static int check_status(char *message, int s) { @@ -388,7 +397,6 @@ static int initialize_ndp(struct ndp120_dev_s *dev) dev->ndp_interrupts_enabled = false; - int full_speed_freq = dev->lower->spi_config.freq; dev->lower->spi_config.freq = NDP120_SPI_FREQ_INIT; /* @@ -683,6 +691,28 @@ static int configure_audio(struct ndp120_dev_s *dev, unsigned int pdm_in_shift) */ + /* Configure mic sensitivity */ + syntiant_ndp120_config_mic_t mic_config; + memset(&mic_config, 0, sizeof(mic_config)); + mic_config.mic = 0; + mic_config.sensitivity = -37; + mic_config.delay = 0; + mic_config.pad = 0; + mic_config.get = 0; + mic_config.set = SYNTIANT_NDP120_CONFIG_MIC_SETTINGS; + s = syntiant_ndp120_config_mic(dev->ndp, &mic_config); + if (check_status("config mic0 sensitivity", s)) { + goto errout_configure_audio; + } + + mic_config.mic = 1; + s = syntiant_ndp120_config_mic(dev->ndp, &mic_config); + if (check_status("config mic1 sensitivity", s)) { + goto errout_configure_audio; + } + + do_ndp120_i2s_setup(dev->ndp); + /* enable the PDM clock (for the default, pdm0 aka 'left' mic) */ memset(&pdm_config, 0, sizeof(pdm_config)); pdm_config.interface = 0; @@ -766,7 +796,7 @@ void print_flow_rule(ndp120_dsp_data_flow_rule_t *flow, int type, size_t len) void dsp_flow_show(struct syntiant_ndp_device_s *ndp) { - for(uint32_t v = 0; v < 3; v++) { + for(uint32_t v = 0; v < 1; v++) { ndp120_dsp_data_flow_setup_t filtered_flow_setup = {0}; syntiant_ndp120_dsp_flow_setup_get_rules(ndp, v, &filtered_flow_setup); auddbg("\n flowset ID: %d \n", v); @@ -792,54 +822,114 @@ void dsp_flow_show(struct syntiant_ndp_device_s *ndp) #endif /* CONFIG_DEBUG_AUDIO_INFO */ static -void add_dsp_flow_rules(struct syntiant_ndp_device_s *ndp, int include_pcm_audio_extract) +void do_ndp120_i2s_setup(struct syntiant_ndp_device_s *ndp) +{ + int s = 0; + syntiant_ndp120_config_i2s_t ndp120_config_i2s, *config; + + config = &ndp120_config_i2s; + + auddbg("Configure I2S\n"); + memset(config, 0, sizeof(*config)); + + config->set = SYNTIANT_NDP120_CONFIG_SET_I2S_MODE | + SYNTIANT_NDP120_CONFIG_SET_I2S_FRAMESIZE | + SYNTIANT_NDP120_CONFIG_SET_I2S_SAMPLESIZE | + SYNTIANT_NDP120_CONFIG_SET_I2S_MSB_INDEX | + SYNTIANT_NDP120_CONFIG_SET_I2S_PACKED | + SYNTIANT_NDP120_CONFIG_SET_I2S_DELAYED_FLOP_SENSITIVITY | + SYNTIANT_NDP120_CONFIG_SET_I2S_LEFTCHENABLE | + SYNTIANT_NDP120_CONFIG_SET_I2S_RIGHTCHENABLE; + + config->freq = 48000; + config->mode = SYNTIANT_NDP120_CONFIG_VALUE_I2S_MODE_STANDARD; + config->framesize = 32; + config->samplesize = 16; + config->msb_index = 14; + config->delayed_flop_sensitivity = SYNTIANT_NDP120_CONFIG_VALUE_I2S_DELAYED_FLOP_SENSITIVITY_DELAYED; + config->packed = 0; + config->rightchenable = 0; + config->leftchenable = 1; + config->interface = NDP120_DSP_AUDIO_CHAN_AUD1; + + s = syntiant_ndp120_config_i2s(ndp, config); + check_status("syntiant_ndp120_config_i2s", s); +}; + +static int +do_audio_sync(struct syntiant_ndp_device_s *ndp, int ref_chan, int adj_chan, int chan_delay_ticks) +{ + int s = 0; + ndp120_dsp_audio_sync_config_t cfg; + + memset(&cfg, 0, sizeof(cfg)); + + cfg.mode = NDP120_DSP_AUDIO_SYNC_MODE_ALIGN; + cfg.ref_chan = (ndp120_dsp_audio_chan_t) ref_chan; + cfg.adj_chan = (ndp120_dsp_audio_chan_t) adj_chan; + cfg.chan_delay_ticks = chan_delay_ticks; + + s = syntiant_ndp120_write_audio_sync_config(ndp, &cfg); + if (s) { + auddbg("error in config for sync: %d\n", s); + } + return s; +} + +static +void add_dsp_flow_rules(struct syntiant_ndp_device_s *ndp) { int s = 0; - ndp120_dsp_data_flow_setup_t setup = {0}; - - /* PCM3->FUNCx */ - setup.src_pcm_audio[0].src_param = NDP120_DSP_DATA_FLOW_SRC_PARAM_AUD0_STEREO; - setup.src_pcm_audio[0].dst_param = FF_ID; - setup.src_pcm_audio[0].dst_type = NDP120_DSP_DATA_FLOW_DST_TYPE_FUNCTION; - setup.src_pcm_audio[0].algo_config_index = 0; - setup.src_pcm_audio[0].set_id = 0; - setup.src_pcm_audio[0].algo_exec_property = 0; - - if (include_pcm_audio_extract) { - /* PCM3->HOST_EXT_AUDIO */ - setup.src_pcm_audio[1].src_param = NDP120_DSP_DATA_FLOW_SRC_PARAM_AUD0_STEREO; - setup.src_pcm_audio[1].dst_param = NDP120_DSP_DATA_FLOW_DST_SUBTYPE_AUDIO; - setup.src_pcm_audio[1].dst_type = NDP120_DSP_DATA_FLOW_DST_TYPE_HOST_EXTRACT; - setup.src_pcm_audio[1].algo_config_index = 0; - setup.src_pcm_audio[1].set_id = 0; - setup.src_pcm_audio[1].algo_exec_property = 0; - } + ndp120_dsp_data_flow_setup_t setup; + + int src_pcm = 0; + int src_func = 0; + int src_nn = 0; + + memset(&setup, 0, sizeof(setup)); + + // ---------- + // COMBINED NORMAL + AEC FLOW + /* PCM7->FUNCx */ + setup.src_pcm_audio[src_pcm].src_param = NDP120_DSP_DATA_FLOW_SRC_PARAM_AUD0_STEREO; +#ifdef CONFIG_NDP120_AEC_SUPPORT + setup.src_pcm_audio[src_pcm].src_param |= NDP120_DSP_DATA_FLOW_SRC_PARAM_AUD1_LEFT; +#endif + setup.src_pcm_audio[src_pcm].dst_param = FF_ID; + setup.src_pcm_audio[src_pcm].dst_type = NDP120_DSP_DATA_FLOW_DST_TYPE_FUNCTION; + setup.src_pcm_audio[src_pcm].algo_config_index = 0; + setup.src_pcm_audio[src_pcm].set_id = COMBINED_FLOW_SET_ID; + setup.src_pcm_audio[src_pcm].algo_exec_property = 0; + src_pcm++; /* FUNCx->NN0 */ - setup.src_function[0].src_param = FF_ID; - setup.src_function[0].dst_param = KEYWORD_NETWORK_ID; - setup.src_function[0].dst_type = NDP120_DSP_DATA_FLOW_DST_TYPE_NN; - setup.src_function[0].algo_config_index = -1; - setup.src_function[0].set_id = 0; - setup.src_function[0].algo_exec_property = 0; + setup.src_function[src_func].src_param = FF_ID; + setup.src_function[src_func].dst_param = KEYWORD_NETWORK_ID; + setup.src_function[src_func].dst_type = NDP120_DSP_DATA_FLOW_DST_TYPE_NN; + setup.src_function[src_func].algo_config_index = -1; + setup.src_function[src_func].set_id = COMBINED_FLOW_SET_ID; + setup.src_function[src_func].algo_exec_property = 0; + src_func++; /* FUNCx->HOST_EXT_AUDIO */ - setup.src_function[1].src_param = FF_ID; - setup.src_function[1].dst_param = NDP120_DSP_DATA_FLOW_DST_SUBTYPE_AUDIO; - setup.src_function[1].dst_type = NDP120_DSP_DATA_FLOW_DST_TYPE_HOST_EXTRACT; - setup.src_function[1].algo_config_index = 0; - setup.src_function[1].set_id = 0; - setup.src_function[1].algo_exec_property = 0; + setup.src_function[src_func].src_param = FF_ID; + setup.src_function[src_func].dst_param = NDP120_DSP_DATA_FLOW_DST_SUBTYPE_AUDIO; + setup.src_function[src_func].dst_type = NDP120_DSP_DATA_FLOW_DST_TYPE_HOST_EXTRACT; + setup.src_function[src_func].algo_config_index = 0; + setup.src_function[src_func].set_id = COMBINED_FLOW_SET_ID; + setup.src_function[src_func].algo_exec_property = 0; + src_func++; /* NN0->MCU */ - setup.src_nn[0].src_param = 0; - setup.src_nn[0].dst_param = 0; - setup.src_nn[0].dst_type = NDP120_DSP_DATA_FLOW_DST_TYPE_MCU; - setup.src_nn[0].algo_config_index = -1; - setup.src_nn[0].set_id = 0; - setup.src_nn[0].algo_exec_property = 0; - - printf("applied flow rules\n"); + setup.src_nn[src_nn].src_param = 0; + setup.src_nn[src_nn].dst_param = 0; + setup.src_nn[src_nn].dst_type = NDP120_DSP_DATA_FLOW_DST_TYPE_MCU; + setup.src_nn[src_nn].algo_config_index = -1; + setup.src_nn[src_nn].set_id = COMBINED_FLOW_SET_ID; + setup.src_nn[src_nn].algo_exec_property = 0; + src_nn++; + + auddbg("Applied flow rules\n"); s = syntiant_ndp120_dsp_flow_setup_apply(ndp, &setup); check_status("syntiant_ndp120_dsp_flow_setup_apply", s); @@ -889,10 +979,24 @@ struct ndp120_dev_s * ndp120_get_debug_handle(void) return _ndp_debug_handle; } +void check_mb(struct ndp120_dev_s *dev) +{ + uint32_t resp = 0; + + int s; + s = syntiant_ndp120_do_mailbox_req(dev->ndp, NDP120_DSP_MB_H2D_REQUEST_NOP, &resp); + auddbg("NDP120_DSP_MB_H2D_REQUEST_NOP => %d / 0x%x\n", s, resp); + + resp = 0; + s = syntiant_ndp120_do_mailbox_req(dev->ndp, NDP_MBIN_REQUEST_NOP, &resp); + auddbg("NDP_MBIN_REQUEST_NOP => %d / 0x%x\n", s, resp); +} + /* debug function, useful for doing debugging via shell */ -void ndp120_show_debug(int include_spi) +void ndp120_show_debug(int include_spi, int do_check_mb) { uint8_t tmp; + uint32_t val; int i, s; ndp120_dsp_counters_t dsp_cnts; int flowset_id; @@ -919,6 +1023,15 @@ void ndp120_show_debug(int include_spi) printf("frame_cnt: %d\n", dsp_cnts.frame_cnt); printf("dnn_int_cnt: %d\n", dsp_cnts.dnn_int_cnt); printf("dnn_err_cnt: %d\n", dsp_cnts.dnn_err_cnt); + printf("h2d_mb_cnt: %d\n", dsp_cnts.h2d_mb_cnt); + printf("d2m_mb_cnt: %d\n", dsp_cnts.d2m_mb_cnt); + printf("m2d_mb_cnt: %d\n", dsp_cnts.m2d_mb_cnt); + printf("watermark_cnt: %d\n", dsp_cnts.watermark_cnt); + printf("fifo_overflow_cnt: %d\n", dsp_cnts.fifo_overflow_cnt); + printf("mem_alloc_err_cnt: %d\n", dsp_cnts.mem_alloc_err_cnt); + printf("func_debug_cnt: %d\n", dsp_cnts.func_debug_cnt); + printf("pcm_debug_cnt: %d\n", dsp_cnts.pcm_debug_cnt); + printf("dnn_run_err_cnt: %d\n", dsp_cnts.dnn_run_err_cnt); syntiant_ndp120_config_tank_t tank_config; memset(&tank_config, 0, sizeof(tank_config)); @@ -935,6 +1048,7 @@ void ndp120_show_debug(int include_spi) printf("KD Enabled: %d\n",_ndp_debug_handle->kd_enabled); printf("NDP interrupts enabled : %d\n", _ndp_debug_handle->ndp_interrupts_enabled); + printf("sample ready count %d\n", _ndp_debug_handle->sample_ready_cnt); uint32_t buffill[NDP120_DSP_CONFIG_BUFFILLLEVEL_COUNT]; for (i = 0; i < NDP120_DSP_CONFIG_BUFFILLLEVEL_COUNT; i++) { @@ -943,6 +1057,60 @@ void ndp120_show_debug(int include_spi) for (i = 0; i < NDP120_DSP_CONFIG_BUFFILLLEVEL_COUNT; i++) { printf("BUFFILLLEVEL[%d]: 0x%X\n", i, buffill[i]); } + + uint32_t bufctrl[NDP120_DSP_CONFIG_BUFCTRL_COUNT]; + for (i = 0; i < NDP120_DSP_CONFIG_BUFCTRL_COUNT; i++) { + ndp_mcu_read(NDP120_DSP_CONFIG_BUFCTRL(i), &bufctrl[i]); + } + for (i = 0; i < NDP120_DSP_CONFIG_BUFCTRL_COUNT; i++) { + printf("BUFCTRL[%d]: 0x%X\n", i, bufctrl[i]); + } + + uint32_t startaddr[NDP120_DSP_CONFIG_BUFSTARTADDR_COUNT]; + for (i = 0; i < NDP120_DSP_CONFIG_BUFSTARTADDR_COUNT; i++) { + ndp_mcu_read(NDP120_DSP_CONFIG_BUFSTARTADDR(i), &startaddr[i]); + } + for (i = 0; i < NDP120_DSP_CONFIG_BUFSTARTADDR_COUNT; i++) { + printf("BUFSTARTADDR[%d]: 0x%X\n", i, startaddr[i]); + } + + uint32_t endaddr[NDP120_DSP_CONFIG_BUFENDADDR_COUNT]; + for (i = 0; i < NDP120_DSP_CONFIG_BUFENDADDR_COUNT; i++) { + ndp_mcu_read(NDP120_DSP_CONFIG_BUFENDADDR(i), &endaddr[i]); + } + for (i = 0; i < NDP120_DSP_CONFIG_BUFENDADDR_COUNT; i++) { + printf("BUFENDADDR[%d]: 0x%X\n", i, endaddr[i]); + } + + uint32_t bufwrptr[NDP120_DSP_CONFIG_BUFCURWRPTR_COUNT]; + for (i = 0; i < NDP120_DSP_CONFIG_BUFCURWRPTR_COUNT; i++) { + ndp_mcu_read(NDP120_DSP_CONFIG_BUFCURWRPTR(i), &bufwrptr[i]); + } + for (i = 0; i < NDP120_DSP_CONFIG_BUFCURWRPTR_COUNT; i++) { + printf("BUFCURWRPTR[%d]: 0x%X\n", i, bufwrptr[i]); + } + + uint32_t fifosamplethreshold[NDP120_DSP_CONFIG_FIFOSAMPLETHRESHOLD_COUNT]; + for (i = 0; i < NDP120_DSP_CONFIG_FIFOSAMPLETHRESHOLD_COUNT; i++) { + ndp_mcu_read(NDP120_DSP_CONFIG_FIFOSAMPLETHRESHOLD(i), &fifosamplethreshold[i]); + } + for (i = 0; i < NDP120_DSP_CONFIG_FIFOSAMPLETHRESHOLD_COUNT; i++) { + printf("FIFOSAMPLETHRESHOLD[%d]: 0x%X\n", i, fifosamplethreshold[i]); + } + + for (i = 0; i < 2; i++) { + ndp_mcu_read(NDP120_DSP_CONFIG_PDMCTL(i), &val); + printf("PDMCTL[%d]: 0x%X\n", i, val); + } + + for (i = 0; i < NDP120_DSP_CONFIG_I2SCTL_COUNT; i++) { + ndp_mcu_read(NDP120_DSP_CONFIG_I2SCTL(i), &val); + printf("I2SCTL[%d]: 0x%X\n", i, val); + } + + if (do_check_mb) { + check_mb(_ndp_debug_handle); + } } #ifdef CONFIG_NDP120_ALIVE_CHECK @@ -976,7 +1144,7 @@ check_firmware_aliveness(struct ndp120_dev_s *dev, uint32_t wait_period_ms) * interrupts from NDP after this*/ dev->lower->irq_enable(false); - s = syntiant_ndp_uninit(&dev->ndp, false, SYNTIANT_NDP_INIT_MODE_RESET); + s = syntiant_ndp_uninit(dev->ndp, false, SYNTIANT_NDP_INIT_MODE_RESET); audvdbg("uninit : %d\n", s); dev->lower->reset(); @@ -1101,8 +1269,12 @@ int ndp120_init(struct ndp120_dev_s *dev, bool reinit) goto errout_ndp120_init; } - attach_algo_config_area(dev->ndp, 49, 0); - add_dsp_flow_rules(dev->ndp, 0); + attach_algo_config_area(dev->ndp, FF_ID, 0); + +#ifdef CONFIG_NDP120_AEC_SUPPORT + do_audio_sync(dev->ndp, NDP120_DSP_AUDIO_CHAN_AUD1, NDP120_DSP_AUDIO_CHAN_AUD0, 0); +#endif + add_dsp_flow_rules(dev->ndp); struct syntiant_ndp120_config_tank_s tank_config; memset(&tank_config, 0, sizeof(tank_config)); @@ -1110,6 +1282,13 @@ int ndp120_init(struct ndp120_dev_s *dev, bool reinit) tank_config.sampletank_msec = AUDIO_TANK_MS; s = syntiant_ndp120_config_dsp_tank_memory(dev->ndp, &tank_config); + int flowset_id = COMBINED_FLOW_SET_ID; + s = syntiant_ndp120_dsp_flow_get_put_set_id(dev->ndp, &flowset_id); + if (s) { + auddbg("Error enabling flow id %d: %d\n", flowset_id, s); + goto errout_ndp120_init; + } + s = configure_audio(dev, DMIC_1536KHZ_PDM_IN_SHIFT_FF); if (s) { auddbg("audio configure failed\n"); @@ -1128,6 +1307,14 @@ int ndp120_init(struct ndp120_dev_s *dev, bool reinit) return s; } +#ifdef CONFIG_NDP120_AEC_SUPPORT + s = syntiant_ndp120_config_barge_in(dev->ndp, BARGE_IN_INIT); + if (s) { + auddbg("error enabling barge-in: %s\n", s); + goto errout_ndp120_init; + } +#endif + s_num_labels = 16; s = get_versions_and_labels(dev->ndp, s_label_data, sizeof(s_label_data), s_labels, &s_num_labels); #ifdef CONFIG_DEBUG_AUDIO_INFO @@ -1151,6 +1338,7 @@ int ndp120_init(struct ndp120_dev_s *dev, bool reinit) } #endif dev->alive = true; + dev->sample_ready_cnt = 0; errout_ndp120_init: return s; @@ -1274,12 +1462,33 @@ int ndp120_irq_handler_work(struct ndp120_dev_s *dev) goto errout_with_irq; } - if (notifications & NDP_NOTIFICATION_ERRORS) { - ret = SYNTIANT_NDP_ERROR_FAIL; - goto errout_with_irq; + /* SPI Read Failure */ + if (notifications & SYNTIANT_NDP_NOTIFICATION_SPI_READ_FAILURE) { + auddbg("spi read failed\n"); + ndp120_signal_mb(dev); + } + + if (notifications & SYNTIANT_NDP_NOTIFICATION_ERROR) { + auddbg("SYNTIANT_NDP_NOTIFICATION_ERROR\n"); + if (notifications & SYNTIANT_NDP_NOTIFICATION_DSP_MEM_ERROR) { + auddbg("(NO DSP MEM ERROR)\n"); + } + + if (notifications & SYNTIANT_NDP_NOTIFICATION_DNN_MEM_ERROR) { + auddbg("(NO DNN MEM ERROR)\n"); + } + + if (notifications & SYNTIANT_NDP_NOTIFICATION_INVALID_ARGS) { + auddbg("(INVALID ARGS)\n"); + } + + if (notifications & SYNTIANT_NDP_NOTIFICATION_DELAY_ERROR) { + auddbg("(DELAY ERROR)\n"); + } } if (notifications & SYNTIANT_NDP_NOTIFICATION_EXTRACT_READY) { + dev->sample_ready_cnt++; /* signal that we have data to extract */ ndp120_signal_sample(dev); } @@ -1296,8 +1505,7 @@ int ndp120_irq_handler_work(struct ndp120_dev_s *dev) } if (!(summary & NDP120_SPI_MATCH_MATCH_MASK)) { - /* no actual match, so this is a match-per-frame interrupt, also commonly used as sample ready indication */ - ndp120_signal_sample(dev); + auddbg("NDP120_SPI_MATCH_MATCH_MASK - summary=0x%x\n", summary); goto errout_with_irq; } network_id = ndp->d.ndp120.last_network_id; @@ -1357,6 +1565,9 @@ int ndp120_irq_handler_work(struct ndp120_dev_s *dev) mq_send(dev->dev.process_mq, (FAR const char *)&msg, sizeof(msg), 100); } } + } else if (dev->dev.process_mq == NULL) { + /* consume the summary */ + (void)syntiant_ndp_get_match_summary(ndp, &summary); } errout_with_irq: @@ -1416,7 +1627,7 @@ int ndp120_extract_audio(struct ndp120_dev_s *dev, struct ap_buffer_s *apb) auddbg("NDP sample mutex lock err: %d\n", err); return SYNTIANT_NDP_ERROR_FAIL; } - + struct timespec abstime; clock_gettime(CLOCK_REALTIME, &abstime); /* Set timeout value to three sample sizes (2 should be enough). Generally the time values are in milli seconds */ @@ -1581,6 +1792,8 @@ void ndp120_test_internal_passthrough_switch(struct ndp120_dev_s *dev, int inter } syntiant_ndp120_write(dev->ndp, 1, NDP120_CHIP_CONFIG_AUDCTRL(intf), audctrl); + + audvdbg("Set to %s\n", internal ? "internal" : "pdm-thru"); } void ndp120_aec_enable(struct ndp120_dev_s *dev) @@ -1597,4 +1810,3 @@ void ndp120_aec_disable(struct ndp120_dev_s *dev) dev->extclk_inuse = false; } #endif - diff --git a/os/drivers/ai-soc/ndp120/src/syntiant_ndp.c b/os/drivers/ai-soc/ndp120/src/syntiant_ndp.c index b32b6b9bf9..eb269fa041 100644 --- a/os/drivers/ai-soc/ndp120/src/syntiant_ndp.c +++ b/os/drivers/ai-soc/ndp120/src/syntiant_ndp.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #include diff --git a/os/drivers/ai-soc/ndp120/src/syntiant_ndp115.c b/os/drivers/ai-soc/ndp120/src/syntiant_ndp115.c index 2dc0c3ba25..11649ece9e 100644 --- a/os/drivers/ai-soc/ndp120/src/syntiant_ndp115.c +++ b/os/drivers/ai-soc/ndp120/src/syntiant_ndp115.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #include diff --git a/os/drivers/ai-soc/ndp120/src/syntiant_ndp120.c b/os/drivers/ai-soc/ndp120/src/syntiant_ndp120.c index 1c05946cce..82afe4c75e 100644 --- a/os/drivers/ai-soc/ndp120/src/syntiant_ndp120.c +++ b/os/drivers/ai-soc/ndp120/src/syntiant_ndp120.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #include @@ -6932,7 +6932,7 @@ int syntiant_ndp120_init( if (s) goto error; if (spi_data != 0xff) break; } - int n = 100; + int n = 100; while (n--) { s = ndp_spi_read(NDP120_SPI_INTSTS, &spi_data); if (s) goto error; @@ -9971,8 +9971,8 @@ int syntiant_ndp120_set_get_dnn_run_delay(struct syntiant_ndp_device_s *ndp, return s; } -static int syntiant_ndp120_enable_disable_barge_in_no_sync(struct syntiant_ndp_device_s *ndp, - int enable) +static int syntiant_ndp120_config_barge_in_no_sync(struct syntiant_ndp_device_s + *ndp, int config) { int s = SYNTIANT_NDP_ERROR_NONE; uint32_t adx; @@ -9980,7 +9980,7 @@ static int syntiant_ndp120_enable_disable_barge_in_no_sync(struct syntiant_ndp_d adx = NDP120_DSP_MB_H2D_ADDR; payload_in_MSB[0] = NDP120_H2D_MB_SET_PAYLOAD(payload_in_MSB[0], - (uint32_t)enable); + (uint32_t) (config ? BARGE_IN_INIT : BARGE_IN_STATUS)); s = syntiant_ndp120_write_block(ndp, SYNTIANT_NDP120_MCU, adx, payload_in_MSB, sizeof(payload_in_MSB)); if (s) { @@ -9996,8 +9996,8 @@ static int syntiant_ndp120_enable_disable_barge_in_no_sync(struct syntiant_ndp_d return s; } -int syntiant_ndp120_enable_disable_barge_in(struct syntiant_ndp_device_s *ndp, - int enable) +int syntiant_ndp120_config_barge_in(struct syntiant_ndp_device_s *ndp, + int config) { int s0, s; s = (ndp->iif.sync)(ndp->iif.d); @@ -10005,7 +10005,7 @@ int syntiant_ndp120_enable_disable_barge_in(struct syntiant_ndp_device_s *ndp, DEBUG_PRINTF("Error in syntiant_ndp120_enable_disable_barge_in \n"); goto out; } - s = syntiant_ndp120_enable_disable_barge_in_no_sync(ndp, enable); + s = syntiant_ndp120_config_barge_in_no_sync(ndp, config); s0 = (ndp->iif.unsync)(ndp->iif.d); s = s ? s : s0; out: diff --git a/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_config.c b/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_config.c index 684120f21d..12bdec69be 100644 --- a/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_config.c +++ b/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_config.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #include @@ -2492,6 +2492,7 @@ syntiant_ndp120_config_pdm_no_sync( uint32_t decimation; uint32_t main_clk = 0; uint32_t main_clk_at_last_config = 0; + unsigned int pdm_mode; if (!config->set && !config->get) { DEBUG_PRINTF("not get or set, returning\n"); @@ -2741,15 +2742,22 @@ syntiant_ndp120_config_pdm_no_sync( } break; case SYNTIANT_NDP120_CONFIG_VALUE_PDM_CLK_MODE_INTERNAL: + case SYNTIANT_NDP120_CONFIG_VALUE_PDM_CLK_MODE_THROUGH: + if (config->clk_mode == + SYNTIANT_NDP120_CONFIG_VALUE_PDM_CLK_MODE_INTERNAL) { + pdm_mode = NDP120_CHIP_CONFIG_AUDCTRL_MODE_PDM_OUT; + } else { + pdm_mode = NDP120_CHIP_CONFIG_AUDCTRL_MODE_PDM_THRU; + } /* audctrl */ audctrl = NDP120_CHIP_CONFIG_AUDCTRL_PDMCLKOUTNEEDED_INSERT(audctrl, 1); - audctrl = NDP120_CHIP_CONFIG_AUDCTRL_MODE_MASK_INSERT(audctrl, NDP120_CHIP_CONFIG_AUDCTRL_MODE_PDM_OUT); + audctrl = NDP120_CHIP_CONFIG_AUDCTRL_MODE_MASK_INSERT(audctrl, pdm_mode); audctrl = NDP120_CHIP_CONFIG_AUDCTRL_PDMCLKOUTDIV_MASK_INSERT(audctrl, main_clk / 2 / config->pdm_rate); audctrl = NDP120_CHIP_CONFIG_AUDCTRL_PCLK0_EN_INSERT(audctrl, 1); audctrl = NDP120_CHIP_CONFIG_AUDCTRL_PCLK1_EN_MASK_INSERT(audctrl, 0); audctrl = NDP120_CHIP_CONFIG_AUDCTRL_OE_MASK_INSERT(audctrl, 1); - audctrl = NDP120_CHIP_CONFIG_AUDCTRL_IE_MASK_INSERT(audctrl, 0x5); + audctrl = NDP120_CHIP_CONFIG_AUDCTRL_IE_MASK_INSERT(audctrl, 0x7); switch (config->mode) { case SYNTIANT_NDP120_CONFIG_VALUE_PDM_MODE_LEFT: diff --git a/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_config_misc.c b/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_config_misc.c index 6ad5bc0098..a8d95f1b54 100644 --- a/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_config_misc.c +++ b/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_config_misc.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #include #include diff --git a/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_mailbox.c b/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_mailbox.c index b477706421..04a044d6a7 100644 --- a/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_mailbox.c +++ b/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_mailbox.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #include diff --git a/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_ph.c b/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_ph.c index 78ccb9c3ac..0f4a150529 100644 --- a/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_ph.c +++ b/os/drivers/ai-soc/ndp120/src/syntiant_ndp120_ph.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #ifndef __LINUX_KERNEL__ #include diff --git a/os/drivers/ai-soc/ndp120/src/syntiant_ndp_error.c b/os/drivers/ai-soc/ndp120/src/syntiant_ndp_error.c index 3c5eb2591c..a1b25ed3cb 100644 --- a/os/drivers/ai-soc/ndp120/src/syntiant_ndp_error.c +++ b/os/drivers/ai-soc/ndp120/src/syntiant_ndp_error.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #include diff --git a/os/drivers/ai-soc/ndp120/src/syntiant_package.c b/os/drivers/ai-soc/ndp120/src/syntiant_package.c index ec21ced528..758e4f5489 100644 --- a/os/drivers/ai-soc/ndp120/src/syntiant_package.c +++ b/os/drivers/ai-soc/ndp120/src/syntiant_package.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #include diff --git a/os/drivers/ai-soc/ndp120/src/syntiant_portability.c b/os/drivers/ai-soc/ndp120/src/syntiant_portability.c index 1b6014ba9b..fc9bdb645e 100644 --- a/os/drivers/ai-soc/ndp120/src/syntiant_portability.c +++ b/os/drivers/ai-soc/ndp120/src/syntiant_portability.c @@ -28,7 +28,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - ** SDK: v112.3.5-Samsung ** + ** SDK: v112.3.7-Samsung ** */ #include diff --git a/os/drivers/audio/ndp120_voice.h b/os/drivers/audio/ndp120_voice.h index 3056fbad6c..e1787b6402 100644 --- a/os/drivers/audio/ndp120_voice.h +++ b/os/drivers/audio/ndp120_voice.h @@ -78,6 +78,7 @@ struct ndp120_dev_s { uint32_t extract_size; bool extclk_inuse; volatile bool alive; + uint32_t sample_ready_cnt; /* moved to using pthread cond variable for parity with reference implementation in ilib examples */ pthread_mutex_t ndp_mutex_mbsync;