-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<ibex> Add support for ibex simple system platform
- Fixed elf.mk to print size when flash is absent - Add support for rv32imc cpu - Add platform drivers for ibex - Add console driver for ibex family
- Loading branch information
1 parent
35b69a7
commit 6c78930
Showing
37 changed files
with
1,380 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2024, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : This file builds and gathers project properties | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# 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 |
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,18 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2019, Cyancore Team | ||
# | ||
# File Name : config.mk | ||
# Description : This file consists of project config | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
COMPILER := gcc | ||
FAMILY := ibex | ||
PLATFORM := simple_system | ||
STDLOG_MEMBUF := 1 | ||
BOOTMSGS := 1 | ||
EARLYCON_SERIAL := 1 | ||
OBRDLED_ENABLE := 0 | ||
TERRAKERN := 0 |
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,43 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2022, Cyancore Team | ||
* | ||
* File Name : project.c | ||
* Description : This file consists of project srouces | ||
* Primary Author : Akash Kollipara [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#include <status.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <terravisor/bootstrap.h> | ||
#include <driver.h> | ||
#include <time.h> | ||
|
||
void plug() | ||
{ | ||
bootstrap(); | ||
driver_setup_all(); | ||
|
||
printf("Demo Program!\n"); | ||
return; | ||
} | ||
|
||
|
||
void play() | ||
{ | ||
static unsigned char i = 0; | ||
char progress[] = "-\\|/"; | ||
uint64_t time; | ||
char c = progress[(i++) % strlen(progress)]; | ||
get_timestamp(&time); | ||
time /= 1000U; | ||
|
||
printf("[%012llu] Running Blinky ... [%c]", time, c); | ||
|
||
mdelay(500); | ||
|
||
printf("\r"); | ||
return; | ||
} |
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,9 @@ | ||
# RV32 IMC-Extension | ||
|
||
#### Supported Extensions | ||
* RV32I baseline | ||
* M - Hardware multiplication | ||
* C - Compressed instructions | ||
|
||
#### Supported execution level | ||
* Terravisor |
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,7 @@ | ||
# RV32 IMAC [Terravisor] | ||
|
||
Home directory for RV32imac Terravisor | ||
|
||
For terravisor documentation please read [Terravisor README](../../../../../visor/terravisor/README.md) | ||
|
||
Please refer [README.md](../../i/terravisor/README.md) in i/terravisor directory. |
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,16 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2024, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : Build script for this directory. | ||
# Primary Authod : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
RV32IMC_T_ARCH_DIR := $(GET_PATH) | ||
|
||
include $(RV32IMC_T_ARCH_DIR)/../../i/terravisor/build.mk | ||
|
||
DIR := $(RV32IMC_T_ARCH_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,20 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2019, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : This file accumulates sources of console serial | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
DIR := $(GET_PATH) | ||
|
||
EARLYCON_SERIAL ?= 0 | ||
CONSOLE_SERIAL := 0 | ||
|
||
$(eval $(call add_define,EARLYCON_SERIAL)) | ||
|
||
ifeq ($(filter $(CONSOLE_SERIAL) $(EARLYCON_SERIAL),1),1) | ||
include mk/obj.mk | ||
endif |
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,92 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : earlycon_serial.c | ||
* Description : This file contains sources of uart earlycon | ||
* Primary Author : Akash Kollipara [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#include <stdint.h> | ||
#include <stddef.h> | ||
#include <stdbool.h> | ||
#include <status.h> | ||
#include <stdlib.h> | ||
#include <syslog.h> | ||
#include <lock/spinlock.h> | ||
#include <resource.h> | ||
#include <visor_call.h> | ||
#include <arch.h> | ||
#include <driver.h> | ||
#include <interrupt.h> | ||
#include <hal/uart.h> | ||
#include <driver/console.h> | ||
#include <driver/sysclk.h> | ||
|
||
static uart_port_t *earlycon_port; | ||
|
||
static status_t earlycon_serial_setup() | ||
{ | ||
uart_get_properties(earlycon_port, console_uart); | ||
|
||
sysdbg2("UART engine @ %p\n", earlycon_port->baddr); | ||
/* | ||
* If memory mapping is applicable, | ||
* put it in mmu supported guide. | ||
*/ | ||
return success; | ||
} | ||
|
||
static status_t earlycon_serial_write(const char c) | ||
{ | ||
status_t ret; | ||
ret = uart_tx(earlycon_port, c); | ||
return ret; | ||
} | ||
|
||
static console_t *earlycon_serial_driver; | ||
|
||
status_t earlycon_serial_driver_exit() | ||
{ | ||
status_t ret; | ||
ret = console_release_device(); | ||
free(earlycon_port); | ||
free(earlycon_serial_driver); | ||
return ret; | ||
} | ||
|
||
status_t earlycon_serial_driver_setup() | ||
{ | ||
status_t ret; | ||
|
||
earlycon_port = (uart_port_t *)malloc(sizeof(uart_port_t)); | ||
if(!earlycon_port) | ||
{ | ||
ret = error_memory_low; | ||
goto cleanup_1; | ||
} | ||
|
||
earlycon_serial_driver = (console_t *)malloc(sizeof(console_t)); | ||
if(!earlycon_serial_driver) | ||
{ | ||
ret = error_memory_low; | ||
goto cleanup_1; | ||
} | ||
earlycon_serial_driver->write = &earlycon_serial_write; | ||
|
||
ret = earlycon_serial_setup(); | ||
if(ret) | ||
goto cleanup_1; | ||
ret = console_attach_device(ret, earlycon_serial_driver); | ||
if(!ret) | ||
goto exit; | ||
cleanup_1: | ||
earlycon_serial_driver_exit(); | ||
exit: | ||
return ret; | ||
} | ||
|
||
#if EARLYCON_SERIAL==1 | ||
INCLUDE_DRIVER(earlycon, earlycon_serial_driver_setup, earlycon_serial_driver_exit, 0, 2, 2); | ||
#endif |
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,14 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2019, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : This file accumulates the build fe310 series | ||
# platform arch sources | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
DIR := $(GET_PATH) | ||
|
||
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,15 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : panic.S | ||
* Description : This file contains platform panic handler | ||
* Primary Author : Akash Kollipara [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#include <asm.inc> | ||
|
||
function plat_panic_handler | ||
wfi | ||
j plat_panic_handler |
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,16 @@ | ||
#include <stdint.h> | ||
#include <status.h> | ||
#include <syslog.h> | ||
#include <arch.h> | ||
#include <platform.h> | ||
|
||
void platform_print_cpu_info() | ||
{ | ||
unsigned int core_id = arch_core_index(), | ||
isa = arch_core_isa(), | ||
arch_id = arch_core_archid(), | ||
imp_id = arch_core_impid(), | ||
vendor_id = arch_core_vendor(); | ||
|
||
syslog(info, "CPU Info: ID = %u\n-------------------------------\nISA\t\t: 0x%x\nArch ID\t\t: 0x%x\nImp ID\t\t: 0x%x\nVendor ID\t: 0x%x\n\n", core_id, isa, arch_id, imp_id, vendor_id); | ||
}; |
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 @@ | ||
#include <stdint.h> | ||
#include <status.h> | ||
#include <string.h> | ||
#include <platform.h> | ||
|
||
extern uintptr_t _bss_start, _bss_size; | ||
|
||
status_t platform_bss_clear() | ||
{ | ||
memset(&_bss_start, 0, (size_t)&_bss_size); | ||
return success; | ||
} | ||
|
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,35 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2024, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : This file provides and accumulates configs | ||
# and sources for simple system by ibex | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
SIMSYS_DIR := $(GET_PATH) | ||
|
||
ARCH := riscv | ||
BIT := 32 | ||
ARCH_VARIANT := imc | ||
ARCH_ABI := ilp32 | ||
TARGET_FLAGS += -march=rv32imc -mabi=$(ARCH_ABI) | ||
PLAT_INCLUDE += $(SIMSYS_DIR)/include | ||
OUTPUT_FORMAT := elf32-littleriscv | ||
|
||
|
||
LD_SCRIPT := $(SIMSYS_DIR)/sections.ld.sx | ||
PLAT_INCLUDE += $(SIMSYS_DIR)/include | ||
LINT_FLAGS += --platform=unix32 | ||
|
||
USE_DEFAULT_RESOURCES := 1 | ||
LOCAL_INTERRUPT_DEVICE := 1 | ||
PLAT_INTERRUPT_DEVICE := 0 | ||
|
||
include $(SIMSYS_DIR)/config.mk | ||
include $(SIMSYS_DIR)/arch/build.mk | ||
include $(SIMSYS_DIR)/hal/build.mk | ||
include $(SIMSYS_DIR)/platform/build.mk | ||
$(eval $(call check_and_include,USE_DEFAULT_RESOURCES,$(SIMSYS_DIR)/resources/build.mk)) |
Oops, something went wrong.