mirror of
https://github.com/saymrwulf/pulp-runtime.git
synced 2026-06-26 03:01:08 +00:00
Fix for setting frequency on fpga
This commit is contained in:
parent
da4157a0e2
commit
280f5755ed
5 changed files with 23 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@
|
|||
#define ARCHI_FPGA_FREQUENCY 5000000
|
||||
#endif
|
||||
|
||||
#ifndef ARCHI_FPGA_FC_FREQUENCY
|
||||
#define ARCHI_FPGA_FC_FREQUENCY 5000000
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* MEMORIES
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue