From 1d7dcdd017f3446d1011f0107cf992e34fb2d4c8 Mon Sep 17 00:00:00 2001 From: Angelo Garofalo Date: Wed, 1 Apr 2020 20:33:28 +0200 Subject: [PATCH] add fpga config for marsellus --- configs/fpgas/marsellus/virtex7.sh | 5 ++--- include/archi/chips/marsellus/properties.h | 9 +++++++++ kernel/chips/marsellus/soc.c | 13 +++++++++++++ rules/pulpos/targets/marsellus.mk | 5 +++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/configs/fpgas/marsellus/virtex7.sh b/configs/fpgas/marsellus/virtex7.sh index 02a6612..6a876c4 100644 --- a/configs/fpgas/marsellus/virtex7.sh +++ b/configs/fpgas/marsellus/virtex7.sh @@ -1,4 +1,3 @@ - #!/bin/bash -e export PULPRT_TARGET=marsellus @@ -18,6 +17,6 @@ source $scriptDir/../../common.sh export PULPRUN_PLATFORM=fpga #Virtex7 uses 50MHz SoC Frequency -export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=50000000' +export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=20000000' -export io=uart \ No newline at end of file +export io=uart diff --git a/include/archi/chips/marsellus/properties.h b/include/archi/chips/marsellus/properties.h index 248321d..28b9894 100644 --- a/include/archi/chips/marsellus/properties.h +++ b/include/archi/chips/marsellus/properties.h @@ -22,8 +22,17 @@ * FPGA */ +#ifndef ARCHI_FPGA_FREQUENCY #define ARCHI_FPGA_FREQUENCY 5000000 +#endif +#ifndef ARCHI_FPGA_FC_FREQUENCY +#define ARCHI_FPGA_FC_FREQUENCY 5000000 +#endif + +#ifndef ARCHI_FPGA_CL_FREQUENCY +#define ARCHI_FPGA_CL_FREQUENCY 5000000 +#endif /* * MEMORIES */ diff --git a/kernel/chips/marsellus/soc.c b/kernel/chips/marsellus/soc.c index 5c3c9a4..8626f91 100644 --- a/kernel/chips/marsellus/soc.c +++ b/kernel/chips/marsellus/soc.c @@ -18,12 +18,25 @@ void pos_soc_init() { +#if __PLATFORM__ != ARCHI_PLATFORM_FPGA + pos_fll_constructor(); pos_freq_domains[PI_FREQ_DOMAIN_FC] = pos_fll_init(POS_FLL_FC); pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = pos_fll_init(POS_FLL_PERIPH); + pos_freq_domains[PI_FREQ_DOMAIN_CL] = pos_fll_init(POS_FLL_CL); + +#else + + pos_freq_domains[PI_FREQ_DOMAIN_FC] = ARCHI_FPGA_FC_FREQUENCY; + + pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = ARCHI_FPGA_FREQUENCY; + + pos_freq_domains[PI_FREQ_DOMAIN_CL] = ARCHI_FPGA_CL_FREQUENCY; + +#endif } diff --git a/rules/pulpos/targets/marsellus.mk b/rules/pulpos/targets/marsellus.mk index 9b47b38..61e7fec 100644 --- a/rules/pulpos/targets/marsellus.mk +++ b/rules/pulpos/targets/marsellus.mk @@ -41,4 +41,9 @@ PULP_SRCS += kernel/chips/marsellus/soc.c include $(PULPRT_HOME)/rules/pulpos/configs/default.mk + +ifeq '$(platform)' 'fpga' +CONFIG_IO_UART=1 +endif + include $(PULPRT_HOME)/rules/pulpos/default_rules.mk \ No newline at end of file