-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<Qemu SiFive-E> Add platform support for Qemu SiFive-E
- Add qemu sifive_e platform and bootloader support Note: Bootloader to be used with following command `qemu-system-riscv32 ... -device loader,file=<path to build.elf> ...` - Updates on platform files to reduce size for bootloader - Add USE_TIMER to enable/disable from platform config. - [driver] PLIC will only build if N_PLAT_IRQS are non 0 Issue: #233
- Loading branch information
1 parent
d9be046
commit 02c6179
Showing
21 changed files
with
746 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2019, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : This file accumulates the build scripts from | ||
# all other directories that have HiFive 1 Rev B | ||
# board support sources | ||
# Primary Author : Akash Kollipara [akashkollipara@gmail.com] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
FE310G002_DIR := $(GET_PATH) | ||
|
||
ARCH := riscv | ||
BIT := 32 | ||
ARCH_VARIANT := imac | ||
ARCH_ABI := ilp32 | ||
TARGET_FLAGS += -march=rv32imac -mabi=$(ARCH_ABI) | ||
PLAT_INCLUDE += $(FE310G002_DIR)/include | ||
OUTPUT_FORMAT := elf32-littleriscv | ||
|
||
include $(FE310G002_DIR)/config.mk | ||
include $(FE310G002_DIR)/../common_fe310/build.mk | ||
$(eval $(call check_and_include,USE_DEFAULT_RESOURCES,$(FE310G002_DIR)/resources/build.mk)) | ||
|
||
DIR := $(FE310G002_DIR) | ||
include mk/obj.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2019, Cyancore Team | ||
# | ||
# File Name : config.mk | ||
# Description : This file defines configuration for HiFive 1B | ||
# Primary Author : Akash Kollipara [akashkollipara@gmail.com] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
#====================================================================== | ||
# Configuration file for Platforms | ||
#====================================================================== | ||
|
||
#====================================================================== | ||
# Platform Configuration | ||
# Do not alter below FLAGS unless explicitly mentioned | ||
#====================================================================== | ||
N_CORES := 1 | ||
$(eval $(call add_define,N_CORES)) | ||
|
||
CCSMP := 0 | ||
$(eval $(call add_define,CCSMP)) | ||
|
||
$(eval $(call add_define,BIT)) | ||
|
||
BOOT_CORE_ID:= 0 | ||
$(eval $(call add_define,BOOT_CORE_ID)) | ||
|
||
FLASH_START := 0x000001000 | ||
FLASH_SIZE := 0x2000 # 8K | ||
RAM_START := 0x80000000 | ||
RAM_SIZE := 0x4000 # 16K | ||
ITIM_START := 0x08000000 | ||
ITIM_SIZE := 0x2000 # 8K | ||
HEAP_SIZE ?= 512 | ||
STACK_SIZE ?= 0xc00 | ||
STACK_SIZE_PCPU ?= 0xc00 | ||
|
||
$(eval $(call add_define,HEAP_SIZE)) | ||
$(eval $(call add_define,STACK_SIZE)) | ||
$(eval $(call add_define,STACK_SIZE_PCPU)) | ||
|
||
# Call this FLAG from Project config file if needed | ||
XCLK ?= 16000000 | ||
ICLK ?= 72000000 | ||
$(eval $(call add_define,XCLK)) | ||
$(eval $(call add_define,ICLK)) | ||
|
||
N_EXCEP := 12 | ||
$(eval $(call add_define,N_EXCEP)) | ||
|
||
N_IRQ := 12 | ||
$(eval $(call add_define,N_IRQ)) | ||
|
||
N_PLAT_IRQS := 0 | ||
$(eval $(call add_define,N_PLAT_IRQS)) | ||
|
||
MAX_INTERRUPTS_PER_DEVICE := 1 | ||
$(eval $(call add_define,MAX_INTERRUPTS_PER_DEVICE)) | ||
|
||
USE_SPINLOCK ?= 1 | ||
$(eval $(call add_define,USE_SPINLOCK)) | ||
|
||
#====================================================================== | ||
# MEMBUF Configuration | ||
#====================================================================== | ||
MEMBUF_SIZE ?= 1024 | ||
$(eval $(call add_define,MEMBUF_SIZE)) | ||
#====================================================================== | ||
|
||
#====================================================================== | ||
# GPIO Configuration | ||
#====================================================================== | ||
N_PORT := 1 | ||
$(eval $(call add_define,N_PORT)) | ||
#====================================================================== | ||
|
||
#====================================================================== | ||
# Errata CIP-578 | ||
#====================================================================== | ||
ERRATA_CIP578 := 1 | ||
$(eval $(call add_define,ERRATA_CIP578)) | ||
#====================================================================== | ||
|
||
#====================================================================== | ||
# PRCI Sysclk Configuration | ||
#====================================================================== | ||
SYSCLK_ENABLE := 1 | ||
PRCI_CLK := 0 | ||
$(eval $(call add_define,SYSCLK_ENABLE)) | ||
$(eval $(call add_define,PRCI_CLK)) | ||
#====================================================================== | ||
|
||
#====================================================================== | ||
# Bootload Configuration | ||
#====================================================================== | ||
USE_TIMER ?= 0 | ||
$(eval $(call add_define,USE_TIMER)) | ||
$(eval $(call add_define,BOOTLOADER)) | ||
#====================================================================== |
20 changes: 20 additions & 0 deletions
20
src/platform/sifive/qemu-sifive-e-bl/include/plat_defines.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2022, Cyancore Team | ||
* | ||
* File Name : plat_mem.h | ||
* Description : This file contains defines corresponding to | ||
* fe310-g002 board | ||
* Primary Author : Akash Kollipara [akashkollipara@gmail.com] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define __RISCV_FE310G002__ | ||
|
||
enum pinmux_functions | ||
{ | ||
serial = 0, | ||
pwm = 1 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2022, Cyancore Team | ||
* | ||
* File Name : plat_mem.h | ||
* Description : This file contains memory config of fe310-g002 | ||
* Primary Author : Akash Kollipara [akashkollipara@gmail.com] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define FLASH_SIZE 8K | ||
#define RAM_SIZE 16K | ||
|
||
#define V_ITMEM_START 0x08000000 | ||
#define V_IMEM_START 0x00001000 | ||
#define V_DMEM_START 0x80000000 | ||
|
||
#define L_MEM_START 0x00001000 | ||
#define L_MEM_LENGTH 0x00002000 | ||
|
||
#define ITMEM_LENGTH 0x00002000 | ||
#define IMEM_LENGTH 0x00002000 | ||
#define DMEM_LENGTH 0x00004000 | ||
|
||
#define ALIGN_BOUND 4 | ||
#define HEAP_ALIGN ALIGN_BOUND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2022, Cyancore Team | ||
* | ||
* File Name : platform.c | ||
* Description : This file contains sources for platform apis | ||
* Primary Author : Akash Kollipara [akashkollipara@gmail.com] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#include <platform.h> | ||
|
||
void platform_jump_to_user_code(void) | ||
{ | ||
void (*jmp)(void) = (void *) 0x20000000; | ||
jmp(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2019, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : This file builds resources sources | ||
# Primary Author : Akash Kollipara [akashkollipara@gmail.com] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
DIR := $(GET_PATH) | ||
|
||
include mk/obj.mk |
Oops, something went wrong.