diff --git a/build-core-armv8m33-mcxn94x.sh b/build-core-armv8m33-mcxn94x.sh new file mode 100755 index 00000000..67f4b25c --- /dev/null +++ b/build-core-armv8m33-mcxn94x.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# +# Shell script for building Phoenix-RTOS firmware +# +# Builder for Phoenix-RTOS core components +# +# Copyright 2018-2024 Phoenix Systems +# Author: Kaja Swat, Aleksander Kaminski, Pawel Pisarczyk +# + +# fail immediately if any of the commands fails +set -e + +b_log "Building phoenix-rtos-kernel" +make -C "phoenix-rtos-kernel" all + +if [ "$LIBPHOENIX_DEVEL_MODE" = "y" ]; then + make -C "phoenix-rtos-kernel" install-headers + + b_log "Building libphoenix" + make -C "libphoenix" all install +fi + +b_log "Building libtty" +make -C "phoenix-rtos-devices" libtty libtty-install + +b_log "Building libposixsrv" +make -C "phoenix-rtos-posixsrv" libposixsrv libposixsrv-install + +b_log "Building phoenix-rtos-corelibs" +make -C "phoenix-rtos-corelibs" all + +b_log "Building phoenix-rtos-filesystems" +make -C "phoenix-rtos-filesystems" all install + +b_log "Building phoenix-rtos-devices" +make -C "phoenix-rtos-devices" all install + +b_log "Building coreutils" +make -C "phoenix-rtos-utils" all install + +if [ "$CORE_NETWORKING_DISABLE" != "y" ]; then + b_log "phoenix-rtos-lwip" + make -C "phoenix-rtos-lwip" all install +fi diff --git a/build.sh b/build.sh index 21165ec6..9d997629 100755 --- a/build.sh +++ b/build.sh @@ -208,7 +208,7 @@ fi # always install hostutils if they are present b_log "Installing hostutils" -HOSTUTILS=(metaelf phoenixd psdisk psu syspagen) +HOSTUTILS=(metaelf phoenixd psdisk psu syspagen mcxisp) for tool in "${HOSTUTILS[@]}"; do toolfile="$PREFIX_BUILD_HOST/prog.stripped/$tool" [ -e "$toolfile" ] && cp -a "$toolfile" "$PREFIX_BOOT" diff --git a/makes/include-target.mk b/makes/include-target.mk index f84cecb6..e354068d 100644 --- a/makes/include-target.mk +++ b/makes/include-target.mk @@ -5,8 +5,8 @@ # checking allowed TARGETs -# ARM Cortex Mx -TARGETS_ARMCORTEXM := \ +# ARMv7 Cortex Mx +TARGETS_ARM7CORTEXM := \ armv7m3-stm32l152xd \ armv7m3-stm32l152xe \ armv7m4-stm32l4x6 \ @@ -14,11 +14,20 @@ TARGETS_ARMCORTEXM := \ armv7m7-imxrt106x \ armv7m7-imxrt117x -TARGETS := $(TARGETS_ARMCORTEXM) -ifneq (,$(filter $(TARGETS_ARMCORTEXM),$(TARGET_FAMILY)-$(TARGET_SUBFAMILY))) +TARGETS := $(TARGETS_ARM7CORTEXM) +ifneq (,$(filter $(TARGETS_ARM7CORTEXM),$(TARGET_FAMILY)-$(TARGET_SUBFAMILY))) TARGET_SUFF ?= armv7m endif +# ARMv8 Cortex Mx +TARGETS_ARM8CORTEXM := \ + armv8m33-mcxn94x + +TARGETS += $(TARGETS_ARM8CORTEXM) +ifneq (,$(filter $(TARGETS_ARM8CORTEXM),$(TARGET_FAMILY)-$(TARGET_SUBFAMILY))) + TARGET_SUFF ?= armv8m +endif + # ARM Cortex Ax TARGETS_ARMCORTEXA := \ armv7a7-imx6ull \ diff --git a/target/armv7a.mk b/target/armv7a.mk index cecf20fa..2388b837 100644 --- a/target/armv7a.mk +++ b/target/armv7a.mk @@ -1,5 +1,5 @@ # -# Makefile for libphoenix +# Makefile for Phoenix-RTOS 3 # # ARM (Cortex-A5/A7/A9) options # diff --git a/target/armv7m.mk b/target/armv7m.mk index 83ce31c4..42617f19 100644 --- a/target/armv7m.mk +++ b/target/armv7m.mk @@ -1,5 +1,5 @@ # -# Makefile for libphoenix +# Makefile for Phoenix-RTOS 3 # # ARMv7 (Cortex-M3/M4) options # diff --git a/target/armv8m.mk b/target/armv8m.mk new file mode 100644 index 00000000..efd4065d --- /dev/null +++ b/target/armv8m.mk @@ -0,0 +1,47 @@ +# +# Makefile for Phoenix-RTOS 3 +# +# ARMv8 (Cortex-M33) options +# +# Copyright 2018, 2020, 2024 Phoenix Systems +# + +CROSS ?= arm-phoenix- + +CC := $(CROSS)gcc +CXX := $(CROSS)g++ + +# common Cortex-M CFLAGS +OLVL ?= -O2 +CFLAGS += -mthumb -fomit-frame-pointer -mno-unaligned-access + +# TODO hard float perhaps? To be decided +CFLAGS += -mcpu=cortex-m33 -mfloat-abi=soft -fstack-usage + +VADDR_KERNEL_INIT := $(KERNEL_PHADDR) + +LDFLAGS := -Wl,-z,max-page-size=0x10 + +ifeq ($(KERNEL), 1) + CFLAGS += -ffixed-r9 + LDFLAGS += -Tbss=20000000 -Tdata=20000000 + STRIP := $(CROSS)strip +else + CFLAGS += -fpic -fpie -msingle-pic-base -mno-pic-data-is-text-relative + # output .rel.* sections to make ELF position-independent + LDFLAGS += -Wl,-q + STRIP := $(PREFIX_PROJECT)/phoenix-rtos-build/scripts/strip.py $(CROSS)strip --strip-unneeded -R .rel.text +endif + +CXXFLAGS := $(CFLAGS) + +AR := $(CROSS)ar +ARFLAGS := -r + +LD := $(CROSS)gcc +LDFLAGS_PREFIX := -Wl, + +OBJCOPY := $(CROSS)objcopy +OBJDUMP := $(CROSS)objdump + +HAVE_MMU := n diff --git a/target/host.mk b/target/host.mk index 5b24df7c..daacd8a8 100644 --- a/target/host.mk +++ b/target/host.mk @@ -1,5 +1,5 @@ # -# Common Makefile for host +# Makefile for Phoenix-RTOS 3 # # Copyright 2018-2021 Phoenix Systems # diff --git a/target/ia32.mk b/target/ia32.mk index 82051ed2..43cc29eb 100644 --- a/target/ia32.mk +++ b/target/ia32.mk @@ -1,5 +1,5 @@ # -# Makefile for libphoenix +# Makefile for Phoenix-RTOS 3 # # IA32 options # diff --git a/target/riscv64.mk b/target/riscv64.mk index 647972ed..7fccd497 100644 --- a/target/riscv64.mk +++ b/target/riscv64.mk @@ -1,5 +1,5 @@ # -# Makefile for libphoenix +# Makefile for Phoenix-RTOS 3 # # RISCV64 options #