Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sparcv8leon3-generic target #198

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions build-core-sparcv8leon3-generic.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 2023 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
3 changes: 2 additions & 1 deletion makes/include-target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ endif
# SPARCV8 LEON 3
TARGETS_SPARC := \
sparcv8leon3-gr716 \
sparcv8leon3-gr712rc
sparcv8leon3-gr712rc \
sparcv8leon3-generic

TARGETS += $(TARGETS_SPARC)
ifneq (,$(filter $(TARGETS_SPARC),$(TARGET_FAMILY)-$(TARGET_SUBFAMILY)))
Expand Down
20 changes: 18 additions & 2 deletions target/sparcv8leon3.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SPARCv8 LEON3 options
#
# Copyright 2022, 2023 Phoenix Systems
# Copyright 2022-2024 Phoenix Systems
#
# %LICENSE%
#
Expand All @@ -22,6 +22,7 @@ ifeq ($(TARGET_SUBFAMILY), gr716)
VADDR_KERNEL_INIT := $(KERNEL_PHADDR)

CFLAGS += -msoft-float
CPPFLAGS += -DLEON3_USE_PWR

ifeq ($(KERNEL), 1)
LDFLAGS += -Wl,-z,max-page-size=0x200 -Tbss=40001800 -Tdata=40001800 -Wl,--section-start=.rodata=40000000
Expand All @@ -40,7 +41,22 @@ else ifeq ($(TARGET_SUBFAMILY), gr712rc)
endif
STRIP := $(CROSS)strip
VADDR_KERNEL_INIT := 0xc0000000
CFLAGS += -mfix-gr712rc -DLEON3_TN_0018_FIX
CFLAGS += -mfix-gr712rc
CPPFLAGS += -DLEON3_TN_0018_FIX
LDFLAGS += -Wl,-z,max-page-size=0x1000

HAVE_MMU := y
else ifeq ($(TARGET_SUBFAMILY), generic)
ifeq ($(KERNEL), 1)
CFLAGS +=
# `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
endif

STRIP := $(CROSS)strip
VADDR_KERNEL_INIT := 0xc0000000
LDFLAGS += -Wl,-z,max-page-size=0x1000

HAVE_MMU := y
Expand Down
Loading