diff --git a/arch/risc-v/src/jh7110/Kconfig b/arch/risc-v/src/jh7110/Kconfig index e69de29bb2d1d..728fe9e1c301c 100644 --- a/arch/risc-v/src/jh7110/Kconfig +++ b/arch/risc-v/src/jh7110/Kconfig @@ -0,0 +1,124 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +comment "BL602 Configuration Options" + +menu "BL602 Peripheral Support" + +config BL602_DMA + bool "DMA" + default n + select ARCH_DMA + +config BL602_HAVE_UART0 + bool "UART0" + select BL602_UART0 + select ARCH_HAVE_UART0 + select UART0_SERIALDRIVER + select ARCH_HAVE_SERIAL_TERMIOS + select ARCH_HAVE_PWM_MULTICHAN + +config BL602_UART0 + bool + default n + +config BL602_HAVE_UART1 + bool "UART1" + select BL602_UART1 + select ARCH_HAVE_UART1 + select UART1_SERIALDRIVER + select ARCH_HAVE_SERIAL_TERMIOS + +config BL602_UART1 + bool + default n + +config BL602_TIMER0 + bool "TIMER0" + +config BL602_TIMER1 + bool "TIMER1" + +config BL602_PWM0 + bool "PWM0" + +config BL602_I2C0 + bool "I2C0" + +config BL602_I2C_DMA + bool "I2C DMA support" + default n + depends on BL602_DMA + ---help--- + Select to enable DMA SPI transfers + +config BL602_SPI0 + bool "SPI0" + +config BL602_SPI_DMA + bool "SPI DMA support" + default n + depends on BL602_DMA + ---help--- + Select to enable DMA SPI transfers + +config BL602_RTC + bool "RTC" + +config BL602_RTC_USE_XTAL32K + bool "Select enable RTC XTAL32K clock source, otherwise use internal RC32K" + default n + depends on BL602_RTC + +config BL602_SPIFLASH + bool "SPI Flash" + default n + select MTD + select MTD_PARTITION + +menu "SPI Flash configuration" + depends on BL602_SPIFLASH + +config BL602_MTD_OFFSET + hex "MTD base address in SPI Flash" + default 0x001c5000 + ---help--- + MTD base address in SPI Flash. + +config BL602_MTD_SIZE + hex "MTD size in SPI Flash" + default 0x30000 + ---help--- + MTD size in SPI Flash. + +endmenu # BL602_SPIFLASH + +config BL602_WIRELESS + bool "Wireless & WiFi Support" + depends on SCHED_WORKQUEUE + default n + +config BL602_WIRELESS_DEBUG + bool "Wireless Debug Log" + depends on BL602_WIRELESS + default n + +config BL602_WIRELESS_CONTRY_CODE + string "WiFi Contry Code" + depends on BL602_WIRELESS + default "CN" + +config BL602_NET_MULTI_INTERFACE + bool "STA and AP as independent interfaces" + depends on BL602_WIRELESS + default n + +config BL602_BLE_CONTROLLER + bool "ble controller support" + default n + depends on !DISABLE_MQUEUE + depends on SCHED_WORKQUEUE + depends on BL602_WIRELESS +endmenu diff --git a/arch/risc-v/src/jh7110/bl602_serial.c b/arch/risc-v/src/jh7110/bl602_serial.c index 6a723b43100f2..5795790d5159d 100644 --- a/arch/risc-v/src/jh7110/bl602_serial.c +++ b/arch/risc-v/src/jh7110/bl602_serial.c @@ -79,8 +79,6 @@ * provide some minimal implementation of up_putc. */ -#ifdef USE_SERIALDRIVER - /* Which UART with be tty0/console and which tty1? The console will always * be ttyS0. If there is no console then will use the lowest numbered UART. */ @@ -114,8 +112,6 @@ * up_putc(). */ -#ifdef HAVE_UART_DEVICE - /**************************************************************************** * Private Types ****************************************************************************/ @@ -808,10 +804,8 @@ static bool bl602_txempty(struct uart_dev_s *dev) * Public Functions ****************************************************************************/ -#ifdef USE_EARLYSERIALINIT - /**************************************************************************** - * Name: riscv_earlyserialinit + * Name: bl602_earlyserialinit * * Description: * Performs the low level UART initialization early in debug so that the @@ -822,7 +816,7 @@ static bool bl602_txempty(struct uart_dev_s *dev) * ****************************************************************************/ -void riscv_earlyserialinit(void) +void bl602_earlyserialinit(void) { #ifdef HAVE_SERIAL_CONSOLE /* Configuration whichever one is the console */ @@ -831,10 +825,9 @@ void riscv_earlyserialinit(void) bl602_setup(&CONSOLE_DEV); #endif } -#endif /**************************************************************************** - * Name: riscv_serialinit + * Name: bl602_serialinit * * Description: * Register serial console and serial ports. This assumes @@ -842,7 +835,7 @@ void riscv_earlyserialinit(void) * ****************************************************************************/ -void riscv_serialinit(void) +void bl602_serialinit(void) { int i; char devname[16]; @@ -885,9 +878,9 @@ void riscv_serialinit(void) * ****************************************************************************/ +#ifdef HAVE_SERIAL_CONSOLE int up_putc(int ch) { -#ifdef HAVE_SERIAL_CONSOLE irqstate_t flags = enter_critical_section(); /* Check for LF */ @@ -901,61 +894,6 @@ int up_putc(int ch) riscv_lowputc(ch); leave_critical_section(flags); -#endif return ch; } - -/**************************************************************************** - * Name: riscv_earlyserialinit, riscv_serialinit, and up_putc - * - * Description: - * stubs that may be needed. These stubs would be used if all UARTs are - * disabled. In that case, the logic in common/up_initialize() is not - * smart enough to know that there are not UARTs and will still expect - * these interfaces to be provided. - * - ****************************************************************************/ - -#else /* HAVE_UART_DEVICE */ -void riscv_earlyserialinit(void) -{ -} - -void riscv_serialinit(void) -{ -} - -int up_putc(int ch) -{ - return ch; -} - -#endif /* HAVE_UART_DEVICE */ -#else /* USE_SERIALDRIVER */ - -/**************************************************************************** - * Name: up_putc - * - * Description: - * Provide priority, low-level access to support OS debug writes - * - ****************************************************************************/ - -int up_putc(int ch) -{ -#ifdef HAVE_SERIAL_CONSOLE - /* Check for LF */ - - if (ch == '\n') - { - /* Add CR */ - - riscv_lowputc('\r'); - } - - riscv_lowputc(ch); #endif - return ch; -} - -#endif /* USE_SERIALDRIVER */ diff --git a/arch/risc-v/src/jh7110/jh7110_start.c b/arch/risc-v/src/jh7110/jh7110_start.c index c73f724328859..e53a4bc2574f0 100644 --- a/arch/risc-v/src/jh7110/jh7110_start.c +++ b/arch/risc-v/src/jh7110/jh7110_start.c @@ -156,3 +156,13 @@ void jh7110_start(int mhartid) jh7110_start_s(mhartid); } + +void riscv_earlyserialinit(void) +{ + bl602_earlyserialinit(); +} + +void riscv_serialinit(void) +{ + bl602_serialinit(); +} diff --git a/boards/risc-v/jh7110/star64/configs/nsh/defconfig b/boards/risc-v/jh7110/star64/configs/nsh/defconfig index 882b8350f7973..fdbca38411cbd 100644 --- a/boards/risc-v/jh7110/star64/configs/nsh/defconfig +++ b/boards/risc-v/jh7110/star64/configs/nsh/defconfig @@ -7,6 +7,7 @@ # # CONFIG_DISABLE_OS_API is not set # CONFIG_NSH_DISABLE_LOSMART is not set +# CONFIG_STANDARD_SERIAL is not set CONFIG_ARCH="risc-v" CONFIG_ARCH_ADDRENV=y CONFIG_ARCH_BOARD="star64" @@ -30,6 +31,7 @@ CONFIG_ARCH_TEXT_VBASE=0xC0000000 CONFIG_ARCH_USE_MMU=y CONFIG_ARCH_USE_MPU=y CONFIG_ARCH_USE_S_MODE=y +CONFIG_BL602_HAVE_UART0=y CONFIG_BOARDCTL_ROMDISK=y CONFIG_BOARD_LATE_INITIALIZE=y CONFIG_BOARD_LOOPSPERMSEC=116524