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

M85 firstbanner & logging #83372

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ca38d4b
These are first set of changes to add support for MPS3 AN547 TSV targ…
atrivedi-tsavoritesi Jun 27, 2024
7fabda4
Merge branch 'zephyrproject-rtos:main' into main
atrivedi-tsavoritesi Jun 27, 2024
1639631
Adding changes to support the jtag UART support for FPGA using
atrivedi-tsavoritesi Jun 28, 2024
9b1c0e9
Changed the JTAG UART address to 0x3000 as specified by M850 spec.
atrivedi-tsavoritesi Jun 28, 2024
a2b53c8
Making the address change to make this relative address to iOne block…
atrivedi-tsavoritesi Jun 30, 2024
c2f0566
Added changes to make the Zephyr code start from 0x6000_0000 and keep…
atrivedi-tsavoritesi Jul 2, 2024
fb34094
Made chanegs to fix the zephyr,console and zephyr,shell-uart to use j…
atrivedi-tsavoritesi Jul 3, 2024
293720e
Made changes to ensure SOC peripherals are programmed for MPU bounds.
atrivedi-tsavoritesi Jul 5, 2024
85328fd
Making temporary change to use printk instead of printf in sample code.
atrivedi-tsavoritesi Jul 8, 2024
c95435b
The mps3_an547_tsv initially was based off of mps3_an547_ns i.e. the non
atrivedi-tsavoritesi Jul 8, 2024
0a1b36e
Made changes to ensure the printf works in DV environment and prints the
atrivedi-tsavoritesi Jul 9, 2024
c345c39
Now that everything is working in DV environment changed the memory
atrivedi-tsavoritesi Jul 10, 2024
1022669
Made following address layout change to be use space application ready
atrivedi-tsavoritesi Jul 10, 2024
d99edde
Made changes to generate zephyr.hex using bin2hex as used by DV team
atrivedi-tsavoritesi Jul 14, 2024
edc9686
Added a command to make sure all *.hex files are removed before
atrivedi-tsavoritesi Jul 14, 2024
50cd08a
Reduced the baudrate to support jtag_uart based shell
atrivedi-tsavoritesi Jul 15, 2024
153022f
Added bootloader hex in the repo so that it will generate one hex
atrivedi-tsavoritesi Jul 15, 2024
128884a
New tsi board and soc configurations added
gkethamallax Jul 16, 2024
7c56407
changes made for auto script hex file generation
gkethamallax Jul 17, 2024
9fc4622
code clean up
gkethamallax Jul 22, 2024
bfa180b
Added m85 to board.yml and soc.yml; renamed board name - ek_tsi & soc…
Jul 22, 2024
3728cd1
Tsi m85 (#1)
atrivedi-tsavoritesi Jul 22, 2024
0e8cc1f
Tsi m85 v1 (#2)
gkethamallax Jul 30, 2024
3c4d731
@FIR-65: tsvbootloader changes (#5)
atrivedi-tsavoritesi Aug 15, 2024
72c0ccb
@FIR-433: Updated Addresses
atrivedi-tsavoritesi Dec 23, 2024
582e2b7
@FIR-433: Made changes to remove peripheral accesses. (#6)
atrivedi-tsavoritesi Dec 23, 2024
558afee
@FIR-434: Clean up the MPS3 build to not customize for TSI (#7)
atrivedi-tsavoritesi Dec 24, 2024
20649c5
FIR-442: M85 Banner and Logging
Dec 24, 2024
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
42 changes: 42 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2020,6 +2020,48 @@ add_custom_command(
COMMAND_EXPAND_LISTS
)

if(CONFIG_BUILD_OUTPUT_TSV_STRIPPED_HEX)
# Add post_build_commands to post-process the final .hex file produced by
# stripping first line of zephyr.hex
find_package(Perl REQUIRED)
set(MERGED_KERNEL_HEX_NAME merged.hex)
set(BIN_2_HEX_OPTION --width=64)
set(BIN2HEX scripts/build/bin2heximage)
add_custom_command(
OUTPUT ${MERGED_KERNEL_HEX_NAME}
COMMAND rm -fr ${PROJECT_BINARY_NAME}/*.hex
COMMAND ${PERL_EXECUTABLE} ${ZEPHYR_BASE}/${BIN2HEX} ${PROJECT_BINARY_DIR}/${KERNEL_BIN_NAME} ${PROJECT_BINARY_DIR}/${KERNEL_HEX_NAME} ${BIN_2_HEX_OPTION}
DEPENDS ${logical_target_for_zephyr_elf}
)

add_custom_target(bin2hex ALL DEPENDS ${MERGED_KERNEL_HEX_NAME})
list(APPEND RUNNERS_DEPS bin2hex)
message(VERBOSE "Creating hex files: ${MERGED_KERNEL_HEX_NAME}")

# Remove the 1st line of elf header from the zepher.hex file
# and call the enw file as zephyrstrp.hex

set(STRIPPED_KERNEL_HEX_NAME stripped.hex)
set(STRIPPED_HEX_NAME zephyrstrp.hex)
set(TAIL_EXECUTABLE /usr/bin/tail)
set(HEAD_EXECUTABLE /usr/bin/head)
set(TSVBOOTLOADER_NAME scripts/build/tsvbootloader.hex)
set(TSVIMAGELOADER_NAME IMAGE0_testfile.hex)
add_custom_command(
OUTPUT ${STRIPPED_KERNEL_HEX_NAME}
COMMAND ${TAIL_EXECUTABLE} -n +2 ${PROJECT_BINARY_DIR}/${KERNEL_HEX_NAME} >> ${PROJECT_BINARY_DIR}/${STRIPPED_HEX_NAME}
COMMAND ${HEAD_EXECUTABLE} -n +48 ${ZEPHYR_BASE}/${TSVBOOTLOADER_NAME} >> ${PROJECT_BINARY_DIR}/${TSVIMAGELOADER_NAME}
COMMAND ${HEAD_EXECUTABLE} -n +1 ${PROJECT_BINARY_DIR}/${STRIPPED_HEX_NAME} >> ${PROJECT_BINARY_DIR}/${TSVIMAGELOADER_NAME}
COMMAND ${TAIL_EXECUTABLE} -n +50 ${ZEPHYR_BASE}/${TSVBOOTLOADER_NAME} >> ${PROJECT_BINARY_DIR}/${TSVIMAGELOADER_NAME}
COMMAND ${TAIL_EXECUTABLE} -n +1 ${PROJECT_BINARY_DIR}/${STRIPPED_HEX_NAME} >> ${PROJECT_BINARY_DIR}/${TSVIMAGELOADER_NAME}
DEPENDS ${MERGED_KERNEL_HEX_NAME}
)

add_custom_target(strippedhex ALL DEPENDS ${STRIPPED_KERNEL_HEX_NAME})
list(APPEND RUNNERS_DEPS strippedhex)
message(VERBOSE "strippng hex files: ${STRIPPED_KERNEL_HEX_NAME}")
endif()

# To populate with hex files to merge, do the following:
# set_property(GLOBAL APPEND PROPERTY HEX_FILES_TO_MERGE ${my_local_list})
# Note that the zephyr.hex file will not be included automatically.
Expand Down
9 changes: 8 additions & 1 deletion Kconfig.zephyr
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,13 @@ config OUTPUT_SYMBOLS

config OUTPUT_DISASSEMBLY
bool "Create a disassembly file"
default y
help
Create an .lst file with the assembly listing of the firmware.

config OUTPUT_DISASSEMBLE_ALL
bool "Disassemble all sections with source. Fill zeros."
default n
default y
depends on OUTPUT_DISASSEMBLY
help
The .lst file will contain complete disassembly of the firmware
Expand Down Expand Up @@ -707,6 +708,12 @@ config BUILD_OUTPUT_BIN
Build a "raw" binary zephyr/zephyr.bin in the build directory.
The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.

config BUILD_OUTPUT_TSV_STRIPPED_HEX
bool "Build a Stripped Hex file"
default n
help
Build a "raw" hex zephyr/zephyrstrp.hex in the build directory.

config BUILD_OUTPUT_EFI
bool "Build as an EFI application"
default n
Expand Down
5 changes: 5 additions & 0 deletions boards/tsi/skyp/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 TSI
# SPDX-License-Identifier: Apache-2.0

# config BOARD_TSI
# select QEMU_TARGET
21 changes: 21 additions & 0 deletions boards/tsi/skyp/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2024 TSI
# SPDX-License-Identifier: Apache-2.0

if BOARD_TSI

# MPU-based null-pointer dereferencing detection cannot
# be applied as the (0x0 - 0x400) is unmapped but QEMU
# will still permit bus access.
choice NULL_POINTER_EXCEPTION_DETECTION
bool
default NULL_POINTER_EXCEPTION_DETECTION_NONE if QEMU_TARGET
endchoice

if SERIAL

config UART_INTERRUPT_DRIVEN
default n

endif # SERIAL

endif
7 changes: 7 additions & 0 deletions boards/tsi/skyp/Kconfig.tsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2024 TSI
# SPDX-License-Identifier: Apache-2.0

config BOARD_TSI
select SOC_PART_NUMBER_MIMX8ML8DVNLZ
select SOC_SKYP_M85 if BOARD_TSI_SKYP_M85
select SOC_MIMX8ML8_ADSP if BOARD_TSI_SKYP_TXE
10 changes: 10 additions & 0 deletions boards/tsi/skyp/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
board:
name: tsi
vendor: tsi
socs:
- name: skyp
variants:
- name: tensilica
cpucluster: txe
- name: cortex-m85
cpucluster: m85
20 changes: 20 additions & 0 deletions boards/tsi/skyp/tsi_skyp_m85-common.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2019-2021 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/

sysclk: system-clock {
compatible = "fixed-clock";
clock-frequency = <25000000>;
#clock-cells = <0>;
};

uart0: uart@14001000 {
compatible = "arm,cmsdk-uart";
reg = <0x14001000 0x1000>;
interrupts = <34 3 33 3>;
interrupt-names = "tx", "rx";
clocks = <&sysclk>;
current-speed = <115200>;
};
110 changes: 110 additions & 0 deletions boards/tsi/skyp/tsi_skyp_m85.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*
* Copyright (c) 2024 TSI
* Copyright 2022 Arm Limited and/or its affiliates <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <arm/armv8.1-m.dtsi>
#include <zephyr/dt-bindings/i2c/i2c.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <mem.h>

/ {
compatible = "arm,mps3-an547";
#address-cells = <1>;
#size-cells = <1>;

chosen {
zephyr,console = &jtag_uart;
zephyr,shell-uart = &jtag_uart;
zephyr,sram = &sram;
zephyr,flash = &sram0;
};

jtag_uart: uart@85003000 {
compatible = "altr,jtag-uart";
reg = <0x85003000 0x8>;
status = "enabled";
};

cpus {
#address-cells = <1>;
#size-cells = <0>;

cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-m85";
reg = <0>;
#address-cells = <1>;
#size-cells = <1>;

mpu: mpu@e000ed90 {
compatible = "arm,armv8.1m-mpu";
reg = <0xe000ed90 0x40>;
};
};
};

/* We utilize the secure addresses, if you subtract 0x10000000
* you'll get the non-secure alias
*/
itcm: itcm@4000 { /* alias @ 0x4000 */
compatible = "zephyr,memory-region";
reg = <0x4000 DT_SIZE_K(16)>;
zephyr,memory-region = "ITCM";
};

sram0: sram0@60000000 { /* alias @ 0x60000000 */
compatible = "zephyr,memory-region";
reg = <0x60000000 DT_SIZE_K(256)>;
zephyr,memory-region = "SRAM0";
};

sram: sram@60040000 { /* alias @ 0x60040000 */
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x60040000 DT_SIZE_K(1792)>;
zephyr,memory-region = "SRAM";
};

dtcm: dtcm@20000000 { /* alias @ 0x20000000 */
compatible = "zephyr,memory-region";
reg = <0x20000000 DT_SIZE_K(16)>;
zephyr,memory-region = "DTCM";
};

isram: sram@60200000 {/* alias @ 0x60200000, lower 1MB of 2 MB SRAM1 */
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x60200000 DT_SIZE_M(1)>;
zephyr,memory-region = "ISRAM";
};

/* Higher 1 MB of 2MB high SRAM */
sram1: memory@60300000 {
device_type = "memory";
compatible = "zephyr,memory-region";
reg = <0x60300000 DT_SIZE_M(1)>;
zephyr,memory-region = "SRAM1";
};

/*soc {
peripheral@71000000 {
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x71000000 0x1effffff>;

#include "tsi_skyp_m85-common.dtsi"
};
};*/
};

&jtag_uart {
status = "okay";
current-speed = <9600>;
};

&nvic {
arm,num-irq-priority-bits = <3>;
};
12 changes: 12 additions & 0 deletions boards/tsi/skyp/tsi_skyp_m85.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
identifier: tsi/skyp/m85
name: TSI sky-p
type: mcu
arch: arm
ram: 1792
flash: 256
simulation: qemu
toolchain:
- zephyr
- gnuarmemb
- xtools
vendor: arm
18 changes: 18 additions & 0 deletions boards/tsi/skyp/tsi_skyp_m85_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2024 TSI
# SPDX-License-Identifier: Apache-2.0

CONFIG_RUNTIME_NMI=y
CONFIG_ARM_TRUSTZONE_M=n
CONFIG_ARM_MPU=y
CONFIG_QEMU_ICOUNT_SHIFT=7

# Serial
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y

# Build a Secure firmware image
CONFIG_TRUSTED_EXECUTION_SECURE=n

# Build the zephyr.hex and zephyrstrp.hex for FPGA
CONFIG_BUILD_OUTPUT_TSV_STRIPPED_HEX=y
47 changes: 47 additions & 0 deletions boards/tsi/skyp/tsi_skyp_txe.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2021, 2023, 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <nxp/nxp_imx8m.dtsi>
#include <nxp/nxp_imx/mimx8ml8dvnlz-pinctrl.dtsi>

/ {
model = "NXP i.MX 8MPLUS Audio DSP";
compatible = "nxp";

chosen {
//zephyr,sram = &sram0;
zephyr,sram = &sram_txe;

zephyr,console = &uart4;
zephyr,shell-uart = &uart4;
};
sram_txe: memory@60040000 {
device_type = "memory";
compatible = "mmio-sram";
reg = <0x60040000 DT_SIZE_K(512)>;
};
};

&pinctrl {
uart4_default: uart4_default {
group0 {
pinmux = <&iomuxc_uart4_rxd_uart_rx_uart4_rx>,
<&iomuxc_uart4_txd_uart_tx_uart4_tx>;
bias-pull-up;
slew-rate = "slow";
drive-strength = "x1";
};
};
};

&uart4 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart4_default>;
pinctrl-names = "default";
};
16 changes: 16 additions & 0 deletions boards/tsi/skyp/tsi_skyp_txe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
identifier: tsi/skyp/txe
name: TSI DSP
type: mcu
arch: xtensa
toolchain:
- xcc
- xt-clang
- zephyr
supported:
- uart
testing:
ignore_tags:
- net
- bluetooth
- mcumgr
vendor: nxp
26 changes: 26 additions & 0 deletions boards/tsi/skyp/tsi_skyp_txe_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SPDX-License-Identifier: Apache-2.0

# size of stack for initialization and main thread
CONFIG_MAIN_STACK_SIZE=3072

# enable logger
CONFIG_LOG=y

# no need for a "raw" binary zephyr/zephyr.bin in the build directory
CONFIG_BUILD_OUTPUT_BIN=y
CONFIG_BUILD_OUTPUT_HEX=y

# enable uart driver
CONFIG_SERIAL=y

# clock configuration
CONFIG_CLOCK_CONTROL=y

# console (remote proc console by default)
CONFIG_CONSOLE=y

# uart console (overrides remote proc console)
CONFIG_UART_CONSOLE=y

# enable pin controller
CONFIG_PINCTRL=y
1 change: 1 addition & 0 deletions dts/bindings/vendor-prefixes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ tronfy Tronfy
tronsmart Tronsmart
truly Truly Semiconductors Limited
tsd Theobroma Systems Design und Consulting GmbH
tsi Tsavorite Scalable Intelligence
tyan Tyan Computer Corporation
u-blox u-blox
u-boot U-Boot bootloader
Expand Down
Loading
Loading