From 27e4a75ef24abf19c01a32a46499b71fd97c17fa Mon Sep 17 00:00:00 2001 From: Lee Lup Yuen Date: Fri, 10 Nov 2023 16:31:34 +0800 Subject: [PATCH] Serial OK. Fail to mount RAM Disk yay! --- arch/risc-v/src/jh7110/bl602_serial.c | 11 ++++++++--- boards/risc-v/jh7110/star64/configs/nsh/defconfig | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/risc-v/src/jh7110/bl602_serial.c b/arch/risc-v/src/jh7110/bl602_serial.c index 45e4e6df86514..7e242b81097cd 100644 --- a/arch/risc-v/src/jh7110/bl602_serial.c +++ b/arch/risc-v/src/jh7110/bl602_serial.c @@ -47,6 +47,9 @@ ////#include "bl602_config.h" #include "chip.h" +////TODO +#define HAVE_SERIAL_CONSOLE 1 + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -885,6 +888,7 @@ void bl602_serialinit(void) #ifdef HAVE_SERIAL_CONSOLE int up_putc(int ch) { + struct bl602_uart_s *priv = (struct bl602_uart_s *)CONSOLE_DEV.priv; irqstate_t flags = enter_critical_section(); /* Check for LF */ @@ -893,13 +897,14 @@ int up_putc(int ch) { /* Add CR */ - riscv_lowputc('\r'); + bl602_send(priv, '\r'); } - riscv_lowputc(ch); + bl602_send(priv, ch); leave_critical_section(flags); return ch; } #endif -void bl602_uart_configure(const struct uart_config_s *config) {} ////TODO +////TODO +void bl602_uart_configure(const struct uart_config_s *config) {} diff --git a/boards/risc-v/jh7110/star64/configs/nsh/defconfig b/boards/risc-v/jh7110/star64/configs/nsh/defconfig index 43f5952abedc9..de1572f590498 100644 --- a/boards/risc-v/jh7110/star64/configs/nsh/defconfig +++ b/boards/risc-v/jh7110/star64/configs/nsh/defconfig @@ -84,4 +84,5 @@ CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_NSH_PROGNAME="init" CONFIG_TESTING_GETPRIME=y CONFIG_UART0_BAUD=2000000 +CONFIG_UART0_SERIAL_CONSOLE=y CONFIG_USEC_PER_TICK=1000