-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
296 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
} |
Submodule libphoenix
updated
10 files
+2 −0 | arch/arm/Makefile | |
+8 −0 | arch/arm/v8m/Makefile | |
+56 −0 | arch/arm/v8m/reboot.c | |
+42 −0 | arch/arm/v8m/syscalls.S | |
+34 −0 | arch/arm/v8m/tls.c | |
+3 −1 | include/arch.h | |
+69 −0 | include/arch/armv8m/arch.h | |
+66 −0 | include/arch/armv8m/limits.h | |
+37 −0 | include/arch/armv8m/setjmp.h | |
+125 −0 | include/arch/armv8m/stdint.h |
Submodule phoenix-rtos-build
updated
9 files
+45 −0 | build-core-armv8m33-mcxn94x.sh | |
+1 −1 | build.sh | |
+13 −4 | makes/include-target.mk | |
+1 −1 | target/armv7a.mk | |
+1 −1 | target/armv7m.mk | |
+47 −0 | target/armv8m.mk | |
+1 −1 | target/host.mk | |
+1 −1 | target/ia32.mk | |
+1 −1 | target/riscv64.mk |
Submodule phoenix-rtos-devices
updated
9 files
+9 −0 | _targets/Makefile.armv8m33-mcxn94x | |
+15 −0 | multi/mcxn94x-multi/Makefile | |
+43 −0 | multi/mcxn94x-multi/common.h | |
+102 −0 | multi/mcxn94x-multi/dev.c | |
+36 −0 | multi/mcxn94x-multi/dev.h | |
+184 −0 | multi/mcxn94x-multi/dummyfs.c | |
+126 −0 | multi/mcxn94x-multi/mcxn94x-multi.c | |
+537 −0 | multi/mcxn94x-multi/uart.c | |
+21 −0 | multi/mcxn94x-multi/uart.h |
Submodule phoenix-rtos-kernel
updated
23 files
+0 −2 | hal/armv7a/imx6ull/interrupts.c | |
+0 −1 | hal/armv7a/zynq7000/interrupts.c | |
+0 −3 | hal/armv7m/stm32/interrupts.c | |
+3 −0 | hal/armv8m/Makefile | |
+0 −5 | hal/armv8m/arch/cpu.h | |
+3 −1 | hal/armv8m/cpu.c | |
+12 −0 | hal/armv8m/mcx/Makefile | |
+359 −0 | hal/armv8m/mcx/_init.S | |
+197 −0 | hal/armv8m/mcx/interrupts.c | |
+9 −0 | hal/armv8m/mcx/n94x/Makefile | |
+29 −0 | hal/armv8m/mcx/n94x/config.h | |
+138 −0 | hal/armv8m/mcx/n94x/console.c | |
+663 −0 | hal/armv8m/mcx/n94x/mcxn94x.c | |
+59 −0 | hal/armv8m/mcx/n94x/mcxn94x.h | |
+176 −0 | hal/armv8m/mcx/n94x/timer.c | |
+24 −0 | hal/armv8m/nrf/_init.S | |
+3 −4 | hal/armv8m/nrf/interrupts.c | |
+12 −0 | hal/armv8m/pmap.c | |
+15 −15 | hal/armv8m/spinlock.c | |
+0 −1 | hal/sparcv8leon3/gaisler/irqamp.c | |
+0 −1 | hal/sparcv8leon3/gaisler/irqmp.c | |
+171 −0 | include/arch/armv8m/mcx/n94x/mcxn94x.h | |
+33 −0 | include/arch/armv8m/mcx/syspage.h |
Submodule plo
updated
19 files
+9 −0 | devices/flash-mcxn94x/Makefile | |
+157 −0 | devices/flash-mcxn94x/flash.c | |
+9 −0 | devices/uart-mcxn94x/Makefile | |
+435 −0 | devices/uart-mcxn94x/uart.c | |
+2 −0 | hal/armv8m/Makefile | |
+1 −1 | hal/armv8m/interrupts.c | |
+11 −0 | hal/armv8m/mcx/Makefile | |
+196 −0 | hal/armv8m/mcx/hal.c | |
+20 −0 | hal/armv8m/mcx/n94x/Makefile | |
+96 −0 | hal/armv8m/mcx/n94x/_init.S | |
+40 −0 | hal/armv8m/mcx/n94x/config.h | |
+128 −0 | hal/armv8m/mcx/n94x/console.c | |
+957 −0 | hal/armv8m/mcx/n94x/n94x.c | |
+37 −0 | hal/armv8m/mcx/n94x/n94x.h | |
+29 −0 | hal/armv8m/mcx/n94x/peripherals.h | |
+90 −0 | hal/armv8m/mcx/n94x/timer.c | |
+46 −0 | hal/armv8m/mcx/types.h | |
+2 −2 | hal/armv8m/nrf/91/config.h | |
+56 −0 | ld/armv8m33-mcxn94x.ldt |