Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit e1270a4

Browse files
author
cesare
committed
Update dependencies polarfire-soc/platform 2021.11
1 parent aaa2b14 commit e1270a4

15 files changed

Lines changed: 574 additions & 476 deletions

File tree

.cproject

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.361158373" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
2323
<builder autoBuildTarget="all" buildPath="${workspace_loc:/multizone-sdk-pfsc}/" cleanBuildTarget="clean" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="cdt.managedbuild.builder.gnu.cross.323820810" incrementalBuildTarget="all" keepEnvironmentInBuildfile="true" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/>
2424
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.262651274" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
25+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.35641094" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
26+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/multizone-sdk-pfsc/ext/icicle-kit-es}&quot;"/>
27+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/multizone-sdk-pfsc/ext/icicle-kit-es/platform_config}&quot;"/>
28+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/multizone-sdk-pfsc/ext/pfsc-platform}&quot;"/>
29+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/multizone-sdk-pfsc/ext/pfsc-platform/platform_config_reference}&quot;"/>
30+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/multizone-sdk-pfsc/ext/multizone}&quot;"/>
31+
</option>
2532
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1939954707" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
2633
</tool>
2734
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.254994017" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler"/>
@@ -66,6 +73,13 @@
6673
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.149539586" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
6774
<builder buildPath="${workspace_loc:/multizone-sdk-pfsc}/" id="cdt.managedbuild.builder.gnu.cross.329880829" keepEnvironmentInBuildfile="true" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/>
6875
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.315548965" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
76+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.804731966" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
77+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/multizone-sdk-pfsc/ext/icicle-kit-es}&quot;"/>
78+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/multizone-sdk-pfsc/ext/icicle-kit-es/platform_config}&quot;"/>
79+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/multizone-sdk-pfsc/ext/pfsc-platform}&quot;"/>
80+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/multizone-sdk-pfsc/ext/pfsc-platform/platform_config_reference}&quot;"/>
81+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/multizone-sdk-pfsc/ext/multizone}&quot;"/>
82+
</option>
6983
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1116648218" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
7084
</tool>
7185
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1637123622" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler"/>

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
*.lst
66
*.map
77
*.siz
8-
ext/icicle-kit-es/soc_config/
8+
ext/icicle-kit-es/fpga_design_config/

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[submodule "ext/icicle-ref-design"]
2-
path = ext/icicle-ref-design
3-
url = https://github.com/polarfire-soc/icicle-kit-reference-design.git
41
[submodule "ext/pfsc-platform"]
52
path = ext/pfsc-platform
63
url = https://github.com/polarfire-soc/platform.git
4+
[submodule "ext/icicle-ref-design"]
5+
path = ext/icicle-ref-design
6+
url = https://github.com/polarfire-soc/icicle-kit-reference-design.git

.settings/org.eclipse.cdt.core.prefs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
doxygen/doxygen_new_line_after_brief=true
2+
doxygen/doxygen_use_brief_tag=false
3+
doxygen/doxygen_use_javadoc_tags=true
4+
doxygen/doxygen_use_pre_tag=false
5+
doxygen/doxygen_use_structural_commands=false
16
eclipse.preferences.version=1
27
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1359029007.668057433/BOARD/delimiter=\:
38
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1359029007.668057433/BOARD/operation=append

apps/hart0/bsp/boot/Makefile

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
TARGET = boot.elf
44

5-
EXT_DIR := ../../../../ext
6-
PLATFORM_DIR := $(EXT_DIR)/bare-metal-lib/src/platform
5+
EXT_DIR := $(abspath ../../../../ext)
6+
PLATFORM_DIR := $(EXT_DIR)/pfsc-platform
77
ICICLE_KIT_ES_DIR := $(EXT_DIR)/icicle-kit-es
8-
SOC_CONF_DIR := $(EXT_DIR)/icicle-kit-es/soc_config
9-
SOC_CONF_GEN_DIR := $(EXT_DIR)/bare-metal-lib/src/platform/soc_config_generator
8+
SOC_CONF_DIR := $(EXT_DIR)/icicle-kit-es/fpga_design_config
9+
SOC_CONF_GEN_DIR := $(EXT_DIR)/pfsc-platform/soc_config_generator
1010
SOC_CONF_XML_DIR := $(EXT_DIR)/icicle-ref-design/XML
1111
MULTIZONE_DIR := $(EXT_DIR)/multizone
1212

@@ -25,6 +25,7 @@ C_SRCS += ../../../hart3/u54_3.c
2525
C_SRCS += ../../../hart4/u54_4.c
2626

2727
ASM_SRCS+= $(PLATFORM_DIR)/mpfs_hal/startup_gcc/mss_entry.S
28+
ASM_SRCS+= $(PLATFORM_DIR)/mpfs_hal/startup_gcc/mss_utils.S
2829
#ASM_SRCS+= $(PLATFORM_DIR)/mpfs_hal/startup_gcc/mss_mutex.S
2930
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/startup_gcc/system_startup.c
3031
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/startup_gcc/newlib_stubs.c
@@ -35,8 +36,9 @@ C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/mss_irq_handler_stubs.c
3536
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/mss_l2_cache.c
3637
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/mss_mpu.c
3738
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/mss_mtrap.c
39+
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/mss_peripherals.c
3840
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/mss_plic.c
39-
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/mss_pmp.c
41+
#C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/mss_pmp.c
4042
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/mss_util.c
4143
#C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/nwc/mss_cfm.c
4244
#C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/nwc/mss_ddr.c
@@ -45,15 +47,16 @@ C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/nwc/mss_io.c
4547
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/nwc/mss_nwc_init.c
4648
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/nwc/mss_pll.c
4749
C_SRCS += $(PLATFORM_DIR)/mpfs_hal/common/nwc/mss_sgmii.c
48-
C_SRCS += $(PLATFORM_DIR)/drivers/mss_mmuart/mss_uart.c
50+
C_SRCS += $(PLATFORM_DIR)/drivers/mss/mss_mmuart/mss_uart.c
4951

5052
CFLAGS += -march=rv64gc -mabi=lp64d # g = imafd
5153
CFLAGS += -mcmodel=medany -msmall-data-limit=8
5254
CFLAGS += -mstrict-align -mno-save-restore
5355
CFLAGS += -fmessage-length=0 -fsigned-char
5456
CFLAGS += -ffunction-sections -fdata-sections
5557
CFLAGS += -Og -g # MCHP Bug: anything but -O0 => GDB msg "The riscv_frame_cache's start_addr is ..."
56-
CFLAGS += -Wextra -DNDEBUG
58+
CFLAGS += -Wall -Wextra -DNDEBUG -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function
59+
CFLAGS += -DNDEBUG
5760
CFLAGS += -std=gnu11 -Wstrict-prototypes -Wbad-function-cast
5861

5962
LDFLAGS += -T $(LINKER_SCRIPT)
@@ -91,10 +94,12 @@ $(ASM_OBJS): %.o: %.S $(HEADERS) $(SOC_CONF_DIR)
9194
$(C_OBJS): %.o: %.c $(HEADERS) $(SOC_CONF_DIR)
9295
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
9396

97+
.SILENT: $(SOC_CONF_DIR)
9498
$(SOC_CONF_DIR):
95-
@python3 $(SOC_CONF_GEN_DIR)/mpfs_configuration_generator.py \
96-
$(SOC_CONF_XML_DIR)/ICICLE_MSS_cfg.xml \
97-
$(ICICLE_KIT_ES_DIR)
99+
# MCHP Bug - mpfs_configuration_generator.py v2021.11: xml file name ignored unless in current folder
100+
echo "mpfs_configuration_generator.py ICICLE_MSS_cfg.xml"
101+
cd $(SOC_CONF_XML_DIR); \
102+
python3 $(SOC_CONF_GEN_DIR)/mpfs_configuration_generator.py ICICLE_MSS_cfg.xml $(ICICLE_KIT_ES_DIR) > /dev/null
98103

99104
.PHONY: clean
100105
clean:

apps/hart0/e51.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "mpfs_hal/mss_hal.h"
44

5+
/* Overrides weak symbol in ext/pfsc-platform/mpfs_hal/startup_gcc/system_startup.c */
56
void e51(void) {
67

78
/* Enable UARTs */
@@ -37,3 +38,9 @@ void e51(void) {
3738
asm("csrr t0, mscratch; csrw mtvec, t0; ecall");
3839

3940
}
41+
42+
/* Overrides weak symbol in ext/pfsc-platform/mpfs_hal/startup_gcc/system_startup.c */
43+
uint8_t init_pmp(uint8_t hart_id) {
44+
//pmp_configure(hart_id);
45+
return (0U);
46+
}

apps/hart1/main.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
#include <stdlib.h> // strtoul()
66

77
#include "mpfs_hal/mss_hal.h"
8-
#include "drivers/mss_mmuart/mss_uart.h"
8+
#include "drivers/mss/mss_mmuart/mss_uart.h"
99
#include "mss_multizone.h"
1010

1111
#define mss_printf(format, args...) { \
1212
snprintf(mss_uart_tx_buf, sizeof mss_uart_tx_buf, format, ## args); \
13-
MSS_UART_polled_tx_string (uart, mss_uart_tx_buf); \
13+
MSS_UART_polled_tx_string (uart, (uint8_t *)mss_uart_tx_buf); \
1414
}
1515

1616
typedef enum {zone1=1, zone2, zone3, zone4} Zone;
@@ -33,25 +33,25 @@ void handle_m_trap_h1(uintptr_t * regs, uintptr_t mcause, uintptr_t mepc){
3333
switch(mcause){
3434

3535
case CAUSE_LOAD_ACCESS :
36-
mss_printf("Load access fault : 0x%08x 0x%08x 0x%08x \n\r", mcause, mepc, mtval);
36+
mss_printf("Load access fault : 0x%08x 0x%08x 0x%08x \n\r", (unsigned)mcause, (unsigned)mepc, (unsigned)mtval);
3737
write_csr(mepc, mepc + (((*(char *)mepc) & 0b11) == 0b11 ? 4 : 2)); // skip faulty instruction
3838
return;
3939

4040
case CAUSE_STORE_ACCESS :
41-
mss_printf("Store access fault : 0x%08x 0x%08x 0x%08x \n\r", mcause, mepc, mtval);
41+
mss_printf("Store access fault : 0x%08x 0x%08x 0x%08x \n\r", (unsigned)mcause, (unsigned)mepc, (unsigned)mtval);
4242
write_csr(mepc, mepc + (((*(char *)mepc) & 0b11) == 0b11 ? 4 : 2)); // skip faulty instruction
4343
return;
4444

4545
case CAUSE_FETCH_ACCESS :
46-
mss_printf("Instr access fault : 0x%08x 0x%08x 0x%08x \n\r", mcause, mepc, mtval);
46+
mss_printf("Instr access fault : 0x%08x 0x%08x 0x%08x \n\r", (unsigned)mcause, (unsigned)mepc, (unsigned)mtval);
4747
break;
4848

49-
default : mss_printf("Exception : 0x%08x 0x%08x 0x%08x \n\r", mcause, mepc, mtval);
49+
default : mss_printf("Exception : 0x%08x 0x%08x 0x%08x \n\r", (unsigned)mcause, (unsigned)mepc, (unsigned)mtval);
5050

5151
}
5252

5353
mss_printf("Press any key to continue \n\r");
54-
char c='\0'; while( MSS_UART_get_rx(uart, &c, 1) == 0 ){;}
54+
char c='\0'; while( MSS_UART_get_rx(uart, (uint8_t *)&c, 1) == 0 ){;}
5555
inputline[0]='\0';
5656
asm ("la t0, main; csrw mepc, t0" : : : "t0"); // TBD: asm("j _start");
5757

@@ -145,7 +145,7 @@ void print_pmp(void){
145145

146146
}
147147

148-
mss_printf("0x%02x%08x 0x%02x%08x %s %s \n\r", (uint8_t)(start>>32), start, (uint8_t)(end>>32), end, rwx, type);
148+
mss_printf("0x%02x%08x 0x%02x%08x %s %s \n\r", (unsigned)(start>>32), (unsigned)start, (unsigned)(end>>32), (unsigned)end, rwx, type);
149149

150150
}
151151

@@ -385,7 +385,7 @@ int main (void) {
385385
while(1){
386386

387387
// UART RX event handler
388-
if (MSS_UART_get_rx(uart, &c, 1) && readline(c)){
388+
if (MSS_UART_get_rx(uart, (uint8_t *)&c, 1) && readline(c)){
389389
cmd_handler();
390390
mss_printf("\n\rH1 > ");
391391
inputline[0]='\0';

apps/hart1/u54_1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <string.h>
55

66
#include "mpfs_hal/mss_hal.h"
7-
#include "drivers/mss_mmuart/mss_uart.h"
7+
#include "drivers/mss/mss_mmuart/mss_uart.h"
88

99
void u54_1(void) {
1010

apps/hart2/u54_2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <string.h>
55

66
#include "mpfs_hal/mss_hal.h"
7-
#include "drivers/mss_mmuart/mss_uart.h"
7+
#include "drivers/mss/mss_mmuart/mss_uart.h"
88

99
void u54_2(void) {
1010

@@ -27,7 +27,7 @@ void u54_2(void) {
2727

2828
MSS_UART_init(uart, MSS_UART_115200_BAUD, MSS_UART_DATA_8_BITS | MSS_UART_NO_PARITY | MSS_UART_ONE_STOP_BIT);
2929

30-
MSS_UART_polled_tx_string (uart, "H2> ");
30+
MSS_UART_polled_tx_string (uart, (uint8_t *)"H2> ");
3131

3232
while (1) {
3333

apps/hart3/u54_3.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <string.h>
55

66
#include "mpfs_hal/mss_hal.h"
7-
#include "drivers/mss_mmuart/mss_uart.h"
7+
#include "drivers/mss/mss_mmuart/mss_uart.h"
88

99
void u54_3(void) {
1010

@@ -27,7 +27,7 @@ void u54_3(void) {
2727

2828
MSS_UART_init(uart, MSS_UART_115200_BAUD, MSS_UART_DATA_8_BITS | MSS_UART_NO_PARITY | MSS_UART_ONE_STOP_BIT);
2929

30-
MSS_UART_polled_tx_string (uart, "H3> ");
30+
MSS_UART_polled_tx_string (uart, (uint8_t *)"H3> ");
3131

3232
while (1) {
3333

0 commit comments

Comments
 (0)