summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2018-12-22 02:16:59 +0300
committerAtish Patra <atish.patra@wdc.com>2018-12-22 03:00:28 +0300
commit95fbe7d49587beb4f92b6e5e7b8adb5e54b81366 (patch)
tree9e98007300001d1e86243ae99deebb83f34624a3 /platform
parent27332e63faaf6d3220a9d56bcfb280921114f012 (diff)
downloadopensbi-95fbe7d49587beb4f92b6e5e7b8adb5e54b81366.tar.xz
Move hardcoded uart constant to macros.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'platform')
-rw-r--r--platform/kendryte/k210/platform.c4
-rw-r--r--platform/qemu/virt/platform.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/platform/kendryte/k210/platform.c b/platform/kendryte/k210/platform.c
index 03c2c2d..487b7cc 100644
--- a/platform/kendryte/k210/platform.c
+++ b/platform/kendryte/k210/platform.c
@@ -16,9 +16,11 @@
#include "platform.h"
#include "uarths.h"
+#define K210_UART_BAUDRATE 115200
+
int k210_console_init(void)
{
- uarths_init(115200, UARTHS_STOP_1);
+ uarths_init(K210_UART_BAUDRATE, UARTHS_STOP_1);
return 0;
}
diff --git a/platform/qemu/virt/platform.c b/platform/qemu/virt/platform.c
index fe91fc8..84ea58f 100644
--- a/platform/qemu/virt/platform.c
+++ b/platform/qemu/virt/platform.c
@@ -23,6 +23,8 @@
#define VIRT_PLIC_NUM_PRIORITIES 7
#define VIRT_UART16550_ADDR 0x10000000
+#define VIRT_UART_BAUDRATE 115200
+#define VIRT_UART_SHIFTREG_ADDR 1843200
static int virt_cold_final_init(void)
{
@@ -56,7 +58,8 @@ static int virt_pmp_region_info(u32 target_hart, u32 index,
static int virt_console_init(void)
{
return uart8250_init(VIRT_UART16550_ADDR,
- 1843200, 115200, 0, 1);
+ VIRT_UART_SHIFTREG_ADDR,
+ VIRT_UART_BAUDRATE, 0, 1);
}
static int virt_cold_irqchip_init(void)