Skip to content

Commit

Permalink
<Qemu SiFive-E> Add project and bootloader
Browse files Browse the repository at this point in the history
Issue: #233
  • Loading branch information
akashkollipara committed Feb 18, 2023
1 parent 02c6179 commit d2f3529
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 0 deletions.
20 changes: 20 additions & 0 deletions projects/demo_qemu_sifive_e/build.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# CYANCORE LICENSE
# Copyrights (C) 2019, Cyancore Team
#
# File Name : build.mk
# Description : This file builds and gathers project properties
# Primary Author : Akash Kollipara [akashkollipara@gmail.com]
# Organisation : Cyancore Core-Team
#

PROJECT_DIR := $(GET_PATH)

include $(PROJECT_DIR)/../demo.src/build.mk
include $(PROJECT_DIR)/config.mk

DIR := $(PROJECT_DIR)
include mk/obj.mk

aux_target:
make qemu_sifive_e_bl
20 changes: 20 additions & 0 deletions projects/demo_qemu_sifive_e/config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# CYANCORE LICENSE
# Copyrights (C) 2019, Cyancore Team
#
# File Name : config.mk
# Description : This file consists of project config
# Primary Author : Akash Kollipara [akashkollipara@gmail.com]
# Organisation : Cyancore Core-Team
#

COMPILER := gcc
TC_VER := 10.2.0
FAMILY := sifive
PLATFORM := qemu-sifive-e
STDLOG_MEMBUF := 0
BOOTMSGS := 0
EARLYCON_SERIAL := 1
CONSOLE_SERIAL := 1
OBRDLED_ENABLE := 1
TERRAKERN := 0
21 changes: 21 additions & 0 deletions projects/qemu_sifive_e_bl/build.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# CYANCORE LICENSE
# Copyrights (C) 2022, Cyancore Team
#
# File Name : build.mk
# Description : This file build project sources and specifies
# project properties
# Primary Author : Akash Kollipara [akashkollipara@gmail.com]
# Organisation : Cyancore Core-Team
#

PROJECT_DIR := $(GET_PATH)

OPTIMIZATION := s

EXE_MODE := terravisor

include $(PROJECT_DIR)/config.mk

DIR := $(PROJECT_DIR)
include mk/obj.mk
21 changes: 21 additions & 0 deletions projects/qemu_sifive_e_bl/config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# CYANCORE LICENSE
# Copyrights (C) 2019, Cyancore Team
#
# File Name : config.mk
# Description : This file consists of project config
# Primary Author : Akash Kollipara [akashkollipara@gmail.com]
# Organisation : Cyancore Core-Team
#

COMPILER := gcc
TC_VER := 10.2.0
FAMILY := sifive
PLATFORM := qemu-sifive-e-bl
USE_FLOAT := 0
STDLOG_MEMBUF := 0
BOOTMSGS := 0
EARLYCON_SERIAL := 1
CONSOLE_SERIAL := 0
OBRDLED_ENABLE := 0
TERRAKERN := 0
41 changes: 41 additions & 0 deletions projects/qemu_sifive_e_bl/project.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* CYANCORE LICENSE
* Copyrights (C) 2022, Cyancore Team
*
* File Name : project.c
* Description : This file consists of project srouces
* Primary Author : Akash Kollipara [akashkollipara@gmail.com]
* Organisation : Cyancore Core-Team
*/

#include <status.h>
#include <syslog.h>
#include <terravisor/bootstrap.h>
#include <arch.h>
#include <driver.h>
#include <interrupt.h>
#include <platform.h>
#include <time.h>

void no_program(void);
void plug()
{
bootstrap();
driver_setup_all();
syslog_stdout_enable();
link_interrupt(int_arch, 2, no_program);
syslog(info, "Bootloader!\n");
syslog(info, "Jumping to XIP...\n");
driver_exit_all();
arch_di();
platform_jump_to_user_code();
return;
}

void no_program()
{
driver_setup_all();
syslog(fail, "No User program found!\n");
plat_panic_handler();
}

0 comments on commit d2f3529

Please sign in to comment.