forked from ninolomata/bao-cva6-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bruno Sa <[email protected]>
- Loading branch information
1 parent
bd9a170
commit ad56bf5
Showing
5 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <uart.h> | ||
#include <8250_uart.h> | ||
|
||
#define CVA6_DEFAULT_UART_ADDR 0x10000000 | ||
#define CVA6_DEFAULT_UART_FREQ 50000000 | ||
#define CVA6_DEFAULT_UART_BAUDRATE 115200 | ||
#define CVA6_DEFAULT_UART_REG_SHIFT 2 | ||
#define CVA6_DEFAULT_UART_REG_WIDTH 4 | ||
|
||
|
||
void uart_init(){ | ||
uart8250_init(CVA6_DEFAULT_UART_ADDR, | ||
CVA6_DEFAULT_UART_FREQ, | ||
CVA6_DEFAULT_UART_BAUDRATE, | ||
CVA6_DEFAULT_UART_REG_SHIFT, | ||
CVA6_DEFAULT_UART_REG_WIDTH); | ||
} | ||
|
||
void uart_putc(char c) | ||
{ | ||
uart8250_putc(c); | ||
} | ||
|
||
char uart_getchar(void) | ||
{ | ||
return uart8250_getc(); | ||
} | ||
|
||
void uart_enable_rxirq() | ||
{ | ||
uart8250_enable_rx_int(); | ||
} | ||
|
||
void uart_clear_rxirq() | ||
{ | ||
uart8250_interrupt_handler(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef PLAT_H | ||
#define PLAT_H | ||
|
||
#define PLAT_MEM_BASE 0x80200000 | ||
#define PLAT_MEM_SIZE 0x4000000 | ||
|
||
#define PLAT_TIMER_FREQ (1000000ull) | ||
#define UART_IRQ_ID (1) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ARCH:=riscv | ||
drivers:=8250_uart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
plat_c_srcs:=cva6.c | ||
plat_s_srcs:= |