diff --git a/drivers/uart.c b/drivers/uart.c index 088848c..3459294 100644 --- a/drivers/uart.c +++ b/drivers/uart.c @@ -43,7 +43,7 @@ static void uart_wait_rx_done(int periph) static void uart_setup(int channel, int baudrate) { - int div = (PERIPH_FREQUENCY + baudrate/2) / baudrate; + int div = (pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] + baudrate/2) / baudrate; plp_uart_setup(channel - ARCHI_UDMA_UART_ID(0), 0, div-1); } diff --git a/include/archi/chips/pulp/properties.h b/include/archi/chips/pulp/properties.h index 0cbccff..6e4c292 100644 --- a/include/archi/chips/pulp/properties.h +++ b/include/archi/chips/pulp/properties.h @@ -22,7 +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/include/archi/chips/pulpissimo/properties.h b/include/archi/chips/pulpissimo/properties.h index 51bd2b7..32465c0 100644 --- a/include/archi/chips/pulpissimo/properties.h +++ b/include/archi/chips/pulpissimo/properties.h @@ -26,6 +26,10 @@ #define ARCHI_FPGA_FREQUENCY 5000000 #endif +#ifndef ARCHI_FPGA_FC_FREQUENCY +#define ARCHI_FPGA_FC_FREQUENCY 5000000 +#endif + /* * MEMORIES diff --git a/kernel/chips/pulp/soc.c b/kernel/chips/pulp/soc.c index 0375a6e..8626f91 100644 --- a/kernel/chips/pulp/soc.c +++ b/kernel/chips/pulp/soc.c @@ -31,7 +31,11 @@ void pos_soc_init() #else - pos_freq_domains[PI_FREQ_DOMAIN_CL] = ARCHI_FPGA_FREQUENCY; + 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/kernel/chips/pulpissimo/soc.c b/kernel/chips/pulpissimo/soc.c index b79ecad..1f239ac 100644 --- a/kernel/chips/pulpissimo/soc.c +++ b/kernel/chips/pulpissimo/soc.c @@ -28,7 +28,9 @@ void pos_soc_init() #else - pos_freq_domains[PI_FREQ_DOMAIN_CL] = ARCHI_FPGA_FREQUENCY; + pos_freq_domains[PI_FREQ_DOMAIN_FC] = ARCHI_FPGA_FC_FREQUENCY; + + pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = ARCHI_FPGA_FREQUENCY; #endif }