From ba79d132393c88e704e4529d915a22a2fbef1103 Mon Sep 17 00:00:00 2001 From: sorgelig Date: Tue, 4 Aug 2020 05:54:57 +0800 Subject: [PATCH] ao486: 3mbit for high speed UART mode. --- support/x86/x86.cpp | 5 +++++ support/x86/x86.h | 1 + user_io.cpp | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/support/x86/x86.cpp b/support/x86/x86.cpp index 56fa66b..1eaa804 100644 --- a/support/x86/x86.cpp +++ b/support/x86/x86.cpp @@ -956,3 +956,8 @@ void x86_set_fdd_boot(uint32_t boot) { boot_from_floppy = (boot != 0); } + +void x86_set_uart_mode(int mode) +{ + dma_sdio(mode ? 0x40 : 0x80); +} diff --git a/support/x86/x86.h b/support/x86/x86.h index cc05bba..73343f6 100644 --- a/support/x86/x86.h +++ b/support/x86/x86.h @@ -9,5 +9,6 @@ void x86_set_image(int num, char *filename); void x86_config_load(); void x86_config_save(); void x86_set_fdd_boot(uint32_t boot); +void x86_set_uart_mode(int mode); #endif diff --git a/user_io.cpp b/user_io.cpp index 0892a0e..2c15ee5 100644 --- a/user_io.cpp +++ b/user_io.cpp @@ -567,8 +567,10 @@ int GetUARTMode() void SetUARTMode(int mode) { + if (is_x86()) x86_set_uart_mode(mode != 3); + MakeFile("/tmp/CORENAME", user_io_get_core_name_ex()); - MakeFile("/tmp/UART_SPEED", is_st() ? "19200" : (is_x86() && (user_io_8bit_set_status(0, 0, 0) & (1 << 10))) ? "1152000" : "115200"); + MakeFile("/tmp/UART_SPEED", is_st() ? "19200" : (is_x86() && (user_io_8bit_set_status(0, 0, 0) & (1 << 10))) ? "4000000" : "115200"); char cmd[32]; sprintf(cmd, "uartmode %d", mode & 0xFF);