Skip to content

Commit

Permalink
add sparcv8leon-gr740 target
Browse files Browse the repository at this point in the history
JIRA: RTOS-883
  • Loading branch information
lukileczo authored and agkaminski committed Jan 28, 2025
1 parent 4948ac9 commit 8c6ec6f
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
37 changes: 37 additions & 0 deletions build-core-sparcv8leon-gr740.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
#
# Shell script for building Phoenix-RTOS firmware
#
# Builder for Phoenix-RTOS core components
#
# Copyright 2024 Phoenix Systems
# Author: Lukasz Leczkowski
#

# 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 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

b_log "Building posixsrv"
make -C "phoenix-rtos-posixsrv" all install
1 change: 1 addition & 0 deletions makes/include-target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ endif
TARGETS_SPARC := \
sparcv8leon-gr716 \
sparcv8leon-gr712rc \
sparcv8leon-gr740 \
sparcv8leon-generic

TARGETS += $(TARGETS_SPARC)
Expand Down
16 changes: 14 additions & 2 deletions target/sparcv8leon.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ CC := $(CROSS)gcc
CXX := $(CROSS)g++

OLVL ?= -O2

# LEON4 CPU (GR740) still uses `-mcpu=leon3` flag
CFLAGS += -mcpu=leon3

LDFLAGS :=
Expand Down Expand Up @@ -48,8 +50,7 @@ else ifeq ($(TARGET_SUBFAMILY), gr712rc)
HAVE_MMU := y
else ifeq ($(TARGET_SUBFAMILY), generic)
ifeq ($(KERNEL), 1)
CFLAGS +=
# `mno-user-mode flag affects only `casa` instruction
# `mno-user-mode` flag affects only `casa` instruction
# funnily enough, real hw can run without it
# but qemu will throw an exception
CFLAGS += -msoft-float -mno-user-mode
Expand All @@ -60,6 +61,17 @@ else ifeq ($(TARGET_SUBFAMILY), generic)
LDFLAGS += -Wl,-z,max-page-size=0x1000

HAVE_MMU := y

else ifeq ($(TARGET_SUBFAMILY), gr740)
ifeq ($(KERNEL), 1)
CFLAGS += -msoft-float
endif
STRIP := $(CROSS)strip
VADDR_KERNEL_INIT := 0xc0000000
LDFLAGS += -Wl,-z,max-page-size=0x1000

HAVE_MMU := y

else
$(error Incorrect TARGET.)
endif
Expand Down
2 changes: 1 addition & 1 deletion toolchain/build-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare -A TOOLCHAN_TO_PHOENIX_TARGETS=(
[arm-phoenix]="armv7a9-zynq7000 armv7a7-imx6ull armv7m7-imxrt106x armv7m4-stm32l4x6"
[i386-pc-phoenix]="ia32-generic"
[riscv64-phoenix]="riscv64-generic"
[sparc-phoenix]="sparcv8leon-gr716 sparcv8leon-gr712rc sparcv8leon-generic"
[sparc-phoenix]="sparcv8leon-gr716 sparcv8leon-gr712rc sparcv8leon-gr740 sparcv8leon-generic"
)

TARGET="$1"
Expand Down

0 comments on commit 8c6ec6f

Please sign in to comment.