Fix compilation of demo.bin on Rocket

- Adjust memory model to fix `relocation truncated` errors
- Make isr.c shared between BIOS and demo to resolve dep on `plic_init`

Based on: https://github.com/enjoy-digital/litex/issues/1168
This commit is contained in:
developandplay 2022-03-20 15:39:13 +01:00
parent f565bec7f1
commit 884ee45c28
6 changed files with 5 additions and 33 deletions

View File

@ -118,6 +118,7 @@ class Rocket(CPU):
flags = "-mno-save-restore "
flags += GCC_FLAGS[self.variant]
flags += "-D__rocket__ "
flags += "-mcmodel=medany"
return flags
def __init__(self, platform, variant="standard"):

View File

@ -6,8 +6,7 @@ ifdef TFTP_SERVER_PORT
CFLAGS += -DTFTP_SERVER_PORT=$(TFTP_SERVER_PORT)
endif
OBJECTS = isr.o \
boot-helper.o \
OBJECTS = boot-helper.o \
boot.o \
helpers.o \
cmd_bios.o \

View File

@ -3,7 +3,7 @@ BUILD_DIR?=../build/
include $(BUILD_DIR)/software/include/generated/variables.mak
include $(SOC_DIRECTORY)/software/common.mak
OBJECTS = isr.o donut.o helloc.o main.o crt0.o
OBJECTS = donut.o helloc.o main.o crt0.o
ifdef WITH_CXX
OBJECTS += hellocpp.o
endif

View File

@ -1,29 +0,0 @@
// This file is Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
// License: BSD
#include <generated/csr.h>
#include <generated/soc.h>
#include <irq.h>
#include <libbase/uart.h>
void isr(void);
#ifdef CONFIG_CPU_HAS_INTERRUPT
void isr(void)
{
__attribute__((unused)) unsigned int irqs;
irqs = irq_pending() & irq_getmask();
#ifndef UART_POLLING
if(irqs & (1 << UART_INTERRUPT))
uart_isr();
#endif
}
#else
void isr(void){};
#endif

View File

@ -10,7 +10,8 @@ OBJECTS = \
memtest.o \
uart.o \
spiflash.o \
i2c.o
i2c.o \
isr.o
all: libbase.a