Skip to content

Commit

Permalink
Add armv8m support
Browse files Browse the repository at this point in the history
JIRA: RTOS-881
  • Loading branch information
agkaminski committed Aug 2, 2024
1 parent a30f728 commit f995fe1
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 10 deletions.
45 changes: 45 additions & 0 deletions build-core-armv8m33-mcxn94x.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 13 additions & 4 deletions makes/include-target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,29 @@

# checking allowed TARGETs

# ARM Cortex Mx
TARGETS_ARMCORTEXM := \
# ARMv7 Cortex Mx
TARGETS_ARM7CORTEXM := \
armv7m3-stm32l152xd \
armv7m3-stm32l152xe \
armv7m4-stm32l4x6 \
armv7m7-imxrt105x \
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 \
Expand Down
2 changes: 1 addition & 1 deletion target/armv7a.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Makefile for libphoenix
# Makefile for Phoenix-RTOS 3
#
# ARM (Cortex-A5/A7/A9) options
#
Expand Down
2 changes: 1 addition & 1 deletion target/armv7m.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Makefile for libphoenix
# Makefile for Phoenix-RTOS 3
#
# ARMv7 (Cortex-M3/M4) options
#
Expand Down
47 changes: 47 additions & 0 deletions target/armv8m.mk
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion target/host.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Common Makefile for host
# Makefile for Phoenix-RTOS 3
#
# Copyright 2018-2021 Phoenix Systems
#
Expand Down
2 changes: 1 addition & 1 deletion target/ia32.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Makefile for libphoenix
# Makefile for Phoenix-RTOS 3
#
# IA32 options
#
Expand Down
2 changes: 1 addition & 1 deletion target/riscv64.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Makefile for libphoenix
# Makefile for Phoenix-RTOS 3
#
# RISCV64 options
#
Expand Down

0 comments on commit f995fe1

Please sign in to comment.