Skip to content

Commit

Permalink
Add armv8m33-mcxn94x-frdm target
Browse files Browse the repository at this point in the history
JIRA: RTOS-881
  • Loading branch information
agkaminski committed Aug 2, 2024
1 parent 2349cdb commit 4655e65
Show file tree
Hide file tree
Showing 11 changed files with 296 additions and 8 deletions.
159 changes: 159 additions & 0 deletions _projects/armv8m33-mcxn94x-frdm/board_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/*
* Phoenix-RTOS
*
* Board config for armv8m33-mcxn94x-frdm
*
* Copyright 2024 Phoenix Systems
* Author: Aleksander Kaminski
*
* This file is part of Phoenix-RTOS.
*
* %LICENSE%
*/

#ifndef _BOARD_CONFIG_H_
#define _BOARD_CONFIG_H_


/*
* libpseudodev and libposixsrv shall be used exclusively, libpseudodev uses
* less resources, but libposixsrv provides POSIX support and may be resource
* hungry, by default libposixsrv is enabled.
*/

// #define PSEUDODEV 1
#define BUILTIN_POSIXSRV 1
#define BUILTIN_DUMMYFS 1

/* plo params */

#define RAM_ADDR 0x20000000
#define RAM_BANK_SIZE (384 * 1024)
#define UART_MAX_CNT 10


/* Peripherals */

/* ROSC */
#define ROSC_EXTALCAP_PF 12 /* 0-30 pF */
#define ROSC_CAP_PF 12 /* 0-30 pF */
#define ROSC_AMP_GAIN 0 /* 0-3 */

/* SOSC */
#define SOSC_FREQ (24 * 1000 * 1000)

/* FlexComm configuration options */
#define FLEXCOMM_NONE 0
#define FLEXCOMM_UART 1
#define FLEXCOMM_SPI 2
#define FLEXCOMM_I2C 3
#define FLEXCOMM_UARTI2C 7

/* FlexComm selections */
#define FLEXCOMM0_SEL FLEXCOMM_NONE
#define FLEXCOMM1_SEL FLEXCOMM_NONE
#define FLEXCOMM2_SEL FLEXCOMM_NONE
#define FLEXCOMM3_SEL FLEXCOMM_NONE
#define FLEXCOMM4_SEL FLEXCOMM_UART
#define FLEXCOMM5_SEL FLEXCOMM_NONE
#define FLEXCOMM6_SEL FLEXCOMM_NONE
#define FLEXCOMM7_SEL FLEXCOMM_NONE
#define FLEXCOMM8_SEL FLEXCOMM_NONE
#define FLEXCOMM9_SEL FLEXCOMM_NONE

#define FLEXCOMM0_BASE ((void *)0x40092000)
#define FLEXCOMM1_BASE ((void *)0x40093000)
#define FLEXCOMM2_BASE ((void *)0x40094000)
#define FLEXCOMM3_BASE ((void *)0x40095000)
#define FLEXCOMM4_BASE ((void *)0x400b4000)
#define FLEXCOMM5_BASE ((void *)0x400b5000)
#define FLEXCOMM6_BASE ((void *)0x400b6000)
#define FLEXCOMM7_BASE ((void *)0x400b7000)
#define FLEXCOMM8_BASE ((void *)0x400b8000)
#define FLEXCOMM9_BASE ((void *)0x400b9000)

#define FLEXCOMM0_IRQ lp_flexcomm0_irq
#define FLEXCOMM1_IRQ lp_flexcomm1_irq
#define FLEXCOMM2_IRQ lp_flexcomm2_irq
#define FLEXCOMM3_IRQ lp_flexcomm3_irq
#define FLEXCOMM4_IRQ lp_flexcomm4_irq
#define FLEXCOMM5_IRQ lp_flexcomm5_irq
#define FLEXCOMM6_IRQ lp_flexcomm6_irq
#define FLEXCOMM7_IRQ lp_flexcomm7_irq
#define FLEXCOMM8_IRQ lp_flexcomm8_irq
#define FLEXCOMM9_IRQ lp_flexcomm9_irq

#define UART_CONSOLE 4
#define UART_CLK 12000000 /* FRO_12M */

#define UART0_BAUDRATE 115200
#define UART0_BUFFSZ 512
#define UART0_RX_PIN -1
#define UART0_TX_PIN -1
#define UART0_RX_ALT -1
#define UART0_TX_ALT -1

#define UART1_BAUDRATE 115200
#define UART1_BUFFSZ 512
#define UART1_RX_PIN -1
#define UART1_TX_PIN -1
#define UART1_RX_ALT -1
#define UART1_TX_ALT -1

#define UART2_BAUDRATE 115200
#define UART2_BUFFSZ 512
#define UART2_RX_PIN -1
#define UART2_TX_PIN -1
#define UART2_RX_ALT -1
#define UART2_TX_ALT -1

#define UART3_BAUDRATE 115200
#define UART3_BUFFSZ 512
#define UART3_RX_PIN -1
#define UART3_TX_PIN -1
#define UART3_RX_ALT -1
#define UART3_TX_ALT -1

#define UART4_BAUDRATE 115200
#define UART4_BUFFSZ 512
#define UART4_RX_PIN pctl_pin_p1_8
#define UART4_TX_PIN pctl_pin_p1_9
#define UART4_RX_ALT 2
#define UART4_TX_ALT 2

#define UART5_BAUDRATE 115200
#define UART5_BUFFSZ 512
#define UART5_RX_PIN -1
#define UART5_TX_PIN -1
#define UART5_RX_ALT -1
#define UART5_TX_ALT -1

#define UART6_BAUDRATE 115200
#define UART6_BUFFSZ 512
#define UART6_RX_PIN -1
#define UART6_TX_PIN -1
#define UART6_RX_ALT -1
#define UART6_TX_ALT -1

#define UART7_BAUDRATE 115200
#define UART7_BUFFSZ 512
#define UART7_RX_PIN -1
#define UART7_TX_PIN -1
#define UART7_RX_ALT -1
#define UART7_TX_ALT -1

#define UART8_BAUDRATE 115200
#define UART8_BUFFSZ 512
#define UART8_RX_PIN -1
#define UART8_TX_PIN -1
#define UART8_RX_ALT -1
#define UART8_TX_ALT -1

#define UART9_BAUDRATE 115200
#define UART9_BUFFSZ 512
#define UART9_RX_PIN -1
#define UART9_TX_PIN -1
#define UART9_RX_ALT -1
#define UART9_TX_ALT -1

#endif
16 changes: 16 additions & 0 deletions _projects/armv8m33-mcxn94x-frdm/build.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
#
# Shell script for building armv7m7-imxrt117x-evk project
#
# Copyright 2022 Phoenix Systems
# Author: Lukasz Kosinski
#

[ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1

: "${WATCHDOG:=0}"
export WATCHDOG

b_image_project () {
b_log "The images have been built for the ${TARGET} platform"
}
113 changes: 113 additions & 0 deletions _targets/build.project.armv8m33-mcxn94x
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/bin/bash
#
# Shell script for building armv8m33-mcxn94x project
#
# Copyright 2018, 2019, 2020, 2024 Phoenix Systems
# Author: Kaja Swat, Aleksander Kaminski, Pawel Pisarczyk, Lukasz Kosinski
#
[ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1

. "_targets/build.common"

CROSS=arm-phoenix-

export BUSYBOX_CONFIG=$(realpath "busybox_config")
export DROPBEAR_CUSTOM_CFLAGS="-DLTC_NO_BSWAP"
export PSH_DEFUSRPWDHASH="0B1ANiYi45IhxkfmUW155/GBd4IRE="

#
# Ports configuration
#
export PORTS_BUSYBOX=n
export PORTS_PCRE=n
export PORTS_OPENSSL=n
export PORTS_LIGHTTPD=n
export PORTS_DROPBEAR=n
export PORTS_LUA=n
export PORTS_LZO=n
export PORTS_OPENVPN=n
export PORTS_JANSSON=n
export PORTS_CURL=n


#
# Platform dependent parameters
#
SIZE_PAGE=$((0x200))
PAGE_MASK=$((0xfffffe00))


#
# Project specific build
#

BOOT_DEVICE="flash0"
NAME_USER_SCRIPT="user.plo"
OFFS_USER_SCRIPT=$((0xc800))
MAGIC_USER_SCRIPT=$((0xdabaabad))
KERNEL_OFFS=$((0xd000))


# Physical kernel address
KERNEL_PHBASE=$((0)) # flash0 start address
KERNEL_PHOFFS=$KERNEL_OFFS
export KERNEL_PHADDR=$(printf "%08x" $(($KERNEL_PHBASE + KERNEL_PHOFFS)))

# All data/code maps need to be cacheable to allow unaligned accesses

# Pre-init script is launched before user script
PREINIT_SCRIPT=(
"map flash0 0x00000000 0x00100000 rxcb"
"map flash1 0x00100000 0x00200000 rxcb"
"map ramx 0x14000000 0x14020000 rxcb"
"map ram 0x20000000 0x20070000 rwxcb" # RAM A ... RAM H
"map io 0x40000000 0x80000000 rw"
"phfs flash0 2.0 raw"
"phfs flash1 2.1 raw"
"phfs ramdev 4.0 raw"
"console 0.4")


# Production user script contains applications to run Phoenix-RTOS
USER_SCRIPT=(
"kernelimg ${BOOT_DEVICE}"
"app ${BOOT_DEVICE} -x mcxn94x-multi flash0 ram;io"
"app ${BOOT_DEVICE} -x psh flash0 ram"
"wait 2000"
"go!")

# Example of user dev script which call remotely script
DEV_USER_SCRIPT=(
"echo on"
"wait 3000")


REMOTE_USER_SCRIPT=("5a5aa5a5")


b_build_project() {
b_log "Building user applications"
make -C "_user" all install
}


b_build_target() {
b_log "Building $TARGET project"
b_log "Building phoenix-rtos-loader"

b_mkscript_preinit

make -C plo all
}


b_image_target() {
b_mkscript_user "${USER_SCRIPT[@]}"
b_prod_image
b_dev_image
}

b_test_target() {
b_log "Build and install tests in the phoenix-rtos filesystem"
make -C "phoenix-rtos-tests" all install
}
2 changes: 1 addition & 1 deletion phoenix-rtos-filesystems
2 changes: 1 addition & 1 deletion phoenix-rtos-hostutils
2 changes: 1 addition & 1 deletion phoenix-rtos-utils

0 comments on commit 4655e65

Please sign in to comment.