sdk: use cmod_a7 for default board, its input clock = 12MHz

Signed-off-by: liangkangnan <liangkangnan@163.com>
verilator
liangkangnan 2023-03-28 10:25:49 +08:00
parent d6a14415c9
commit 09c0b531b0
2 changed files with 4 additions and 3 deletions

View File

@ -1,8 +1,8 @@
#ifndef _UTILS_H_
#define _UTILS_H_
#define CPU_FREQ_HZ (25000000) // 25MHz
#define CPU_FREQ_MHZ (25) // 25MHz
#define CPU_FREQ_HZ (12000000) // 12MHz
#define CPU_FREQ_MHZ (12) // 12MHz
#define read_csr(reg) ({ unsigned long __tmp; \

View File

@ -1,5 +1,6 @@
#include <stdint.h>
#include "../include/utils.h"
#include "../include/uart.h"
#include "../include/xprintf.h"
@ -57,7 +58,7 @@ void uart_init(uint32_t base, myputc put)
{
// enable tx and rx
UART_REG(base, UART_CTRL_REG_OFFSET) |= (1 << UART_CTRL_TX_EN_BIT) | (1 << UART_CTRL_RX_EN_BIT);
uart_set_baud_div(base, CPU_FREQ_HZ / 115200);
xdev_out(put);
}