diff --git a/tsi_core/CMakeLists.txt b/tsi_core/CMakeLists.txt new file mode 100644 index 000000000000..e3a4fe1c954f --- /dev/null +++ b/tsi_core/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(m85) + +target_sources(app PRIVATE src/main.c) diff --git a/tsi_core/README.rst b/tsi_core/README.rst new file mode 100644 index 000000000000..bf065c3cbdcd --- /dev/null +++ b/tsi_core/README.rst @@ -0,0 +1,29 @@ +.. _m85: + +TSI Banner +########### + +Overview +******** + +This is the core M85 Zephyr platform and initial startup code. It prints TSI Banner to the console by invocation of Zephyr main. This module also enables the logging functionality to log messages to console at different levels of severity such as Info, Warning, Error & Debug. + +Building and Running +******************** + +This application can be built as follows: + +.. zephyr-app-commands:: + :zephyr-app: + :host-os: unix + :board: ek_tsi_skyp/m85 + :goals: run + :compact: + + +Sample Output +============= + +.. code-block:: console + + !! Welcome to TSI Platform !! diff --git a/tsi_core/overlay_deferred.conf b/tsi_core/overlay_deferred.conf new file mode 100644 index 000000000000..5dbd4edd31a5 --- /dev/null +++ b/tsi_core/overlay_deferred.conf @@ -0,0 +1,11 @@ +CONFIG_LOG_MODE_IMMEDIATE=n +CONFIG_LOG_MODE_DEFERRED=y +CONFIG_LOG_BUFFER_SIZE=1024 +CONFIG_LOG_PROCESS_THREAD=y +CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100 +CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=2 +CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=4096 +CONFIG_LOG_BLOCK_IN_THREAD=y +CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_MIPI_SYST_ENABLE=y +CONFIG_LOG_BACKEND_UART_OUTPUT_SYST=y diff --git a/tsi_core/overlay_immediate.conf b/tsi_core/overlay_immediate.conf new file mode 100644 index 000000000000..82b28234abd0 --- /dev/null +++ b/tsi_core/overlay_immediate.conf @@ -0,0 +1,3 @@ +CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_MIPI_SYST_ENABLE=y +CONFIG_LOG_BACKEND_UART_OUTPUT_SYST=y diff --git a/tsi_core/prj.conf b/tsi_core/prj.conf new file mode 100644 index 000000000000..d34c7f64365e --- /dev/null +++ b/tsi_core/prj.conf @@ -0,0 +1,19 @@ +CONFIG_LOG=y +CONFIG_CONSOLE=y +CONFIG_LOG_PRINTK=y +CONFIG_UART_CONSOLE=y +CONFIG_SHELL=n +CONFIG_BOOT_BANNER=y +CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN=n +CONFIG_SHELL_BACKEND_SERIAL_RX_POLL_PERIOD=1 + +CONFIG_LOG_BACKEND_UART=y + +# Use immediate mode so all messages are being +# printed. Under deferred mode, there may be +# dropped messages as there are quite a number of +# messages to be printed. +CONFIG_LOG_MODE_IMMEDIATE=y + +# Need bigger stack for immediate mode +CONFIG_MAIN_STACK_SIZE=4096 diff --git a/tsi_core/prj_poll.conf b/tsi_core/prj_poll.conf new file mode 100644 index 000000000000..e36289a67f83 --- /dev/null +++ b/tsi_core/prj_poll.conf @@ -0,0 +1,4 @@ +CONFIG_SHELL=y +CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN=n +CONFIG_SHELL_BACKEND_SERIAL_RX_POLL_PERIOD=1 +CONFIG_BOOT_BANNER=n diff --git a/tsi_core/sample.yaml b/tsi_core/sample.yaml new file mode 100644 index 000000000000..5bebdd0046e7 --- /dev/null +++ b/tsi_core/sample.yaml @@ -0,0 +1,15 @@ +sample: + description: TSI Core platform - M85 + name: m85 +common: + tags: introduction + integration_platforms: + - ek_tsi_skyp + harness: console + harness_config: + type: one_line + regex: + - "Welcome to TSI!" +tests: + sample.m85: + tags: introduction diff --git a/tsi_core/src/main.c b/tsi_core/src/main.c new file mode 100644 index 000000000000..1b3f62e4c316 --- /dev/null +++ b/tsi_core/src/main.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024-2025 TSI + * + */ + + +#include +#include +#include +#include +#include +#include +#include + +#define DATA_MAX_DLEN 8 +#define LOG_MODULE_NAME m85 +LOG_MODULE_REGISTER(LOG_MODULE_NAME); +#define PRINT_TSI_BOOT_BANNER() printk(" Tsavorite Scalable Intelligence \n") + +int main(void) +{ + + /* TSI banner */ + PRINT_TSI_BOOT_BANNER(); + printf("\n"); + printf(" |||||||||||||||||||||||||||||||||||||\n");; + printf(" ||||||||||||||||||||||||||||||||||||| \n"); + printf(" |||||| |||||\n"); + printf(" |||||| ||||| \n"); + printf(" ||||||||||||||||| ||||| ||||| \n"); + printf(" ||||||||||||||||| ||||| |||||\n"); + printf(" |||||| |||||\n"); + printf(" |||||| |||||| ||||| ||||||\n"); + printf(" |||||||| |||||| ||||| ||||||||\n"); + printf(" |||||||||||||| ||||||||||||||\n"); + printf(" ||||||||||| ||||||||||||\n"); + printf(" ||||||||| ||||||||||\n"); + printf(" ||||||| ||||||||\n"); + printf(" ||||| |||||\n"); + printf(" ||| |||\n"); + printf(" |\n"); + + LOG_INF("Test Platform: %s",CONFIG_BOARD_TARGET); + LOG_WRN("Testing on FPGA"); + printk("TSI Logging enabled and printk is functional\n"); + + return 0; +}