Commit Graph

10 Commits

Author SHA1 Message Date
Henry Rovner 42eafcdfa5 risc-v/bl808: Add watchdog driver
This change implements a driver for the two watchdog timers on the BL808, and enables it as part of the timer config. The driver is based on the GP timer driver.
2024-07-27 22:59:23 +08:00
Henry Rovner 049a6da098 risc-v/bl808: Add timer driver
This change implements a driver for the hardware timer blocks on the BL808, as well as a config with the timer example enabled.
2024-07-24 10:06:54 +08:00
Henry Rovner 091372069c risc-v/bl808: Add SPI driver
This commit implements a driver for SPI0 and SPI1 on the BL808 and introduces an accompanying example configuration.
2024-07-11 11:32:24 +08:00
Henry Rovner a83e7ced77 ox64: Add adc example config 2024-07-05 13:17:02 +08:00
Rushabh Gala ece78993b6 risc-v/ox64: Add LED Driver
- This PR adds the LED Driver for Ox64 Board (User LEDs and Auto LEDs)
- Ox64 LED Driver will be used by the Rust Blinky App for Google Summer of Code
- User LED 1 is configured for GPIO 29. Other User LEDs and Auto LEDs shall be configured by the NuttX Dev.
- The code is derived from NuttX PinePhone LED Driver
2024-07-03 17:54:09 +08:00
Henry Rovner d5657196d5 ox64:nsh - normalize defconfig after adding UART parameters 2024-06-26 09:06:38 +08:00
Henry Rovner 023bd08faa BL808: Add support for UARTs 0-2 and serial configuration
This commit modifies the existing serial driver to add support for the remaining UARTs on the BL808. It also introduces support for setting baud rate, character length, stop bits, parity, flow control and which serial port acts as the console.
2024-06-26 09:06:38 +08:00
Ville Juven 74702085f0 defconfigs: Add SCHED_HAVE_PARENT=y to configs with WAITPID && BUILD_KERNEL
The added depencendy broke some of the defconfigs
2024-06-03 18:00:40 +02:00
Lee Lup Yuen 62c358946d risc-v/bl808: Flush MMU Cache after updating SATP
Ox64 BL808 crashes with a Page Fault when we run `getprime` then `hello`. This is caused by the T-Head C906 MMU incorrectly accessing the MMU Page Tables of the Previous Process (`getprime`) while starting the New Process (`hello`).

To fix the problem, this PR flushes the MMU Cache whenever we point the MMU SATP Register to the New Page Tables. We execute 2 RISC-V Instructions that are specific to T-Head C906:

- DCACHE.IALL: Invalidate all Page Table Entries in the D-Cache
- SYNC.S: Ensure that all Cache Operations are completed

This is derived from the T-Head Errata for Linux Kernel. More details here: https://lupyuen.github.io/articles/mmu#appendix-flush-the-mmu-cache-for-t-head-c906

Modified Files:

- `arch/risc-v/src/common/riscv_mmu.h`: If needed, `mmu_write_satp()` calls `mmu_flush_cache()` (weak function) to flush the MMU Cache. (Like for T-Head C906)

- `arch/risc-v/src/bl808/bl808_mm_init.c`: Flush the MMU Cache for T-Head C906. Extend `mmuflags` from 32-bit to 64-bit to be consistent with `mmu_ln_setentry()`.

- `boards/risc-v/bl808/ox64/configs/nsh/defconfig`: Enable `ostest` in the Build Config. Update `CONFIG_BOARD_LOOPSPERMSEC` according to `calib_udelay`.
2024-01-23 01:25:20 -08:00
Lee Lup Yuen 87c1b81857 boards/riscv: Add support for PINE64 Ox64 BL808 SBC
This PR adds support for PINE64 Ox64 64-bit RISC-V SBC, based on Bouffalo Lab BL808 SoC (T-Head C906 Core). Most of the code is derived from NuttX for Star64 JH7110. The source files are explained in the articles here: https://github.com/lupyuen/nuttx-ox64

### Modified Files

`boards/Kconfig`: Added Ox64 board

### New Files in boards/risc-v/bl808/ox64

`src/bl808_appinit.c`: Startup Code

`include/board.h`: Ox64 Definitions

`include/board_memorymap.h`: Memory Map

`src/etc/init.d/rc.sysinit`, `rcS`: Startup Script

`src/.gitignore`: Ignore the tmp filesystem

`scripts/ld.script`: Linker Script

`scripts/Make.defs`: Ox64 Makefile

`src/Makefile`: Ox64 Makefile

`Kconfig`: Ox64 Config

`configs/nsh/defconfig`: Build Config for `ox64:nsh`

### Updated Documentation

`platforms/risc-v/bl808/index.rst`: New page for Bouffalo Lab BL808 SoC

`platforms/risc-v/bl808/boards/ox64/index.rst`: Building and booting NuttX for Ox64

`platforms/risc-v/jh7110/boards/star64/index.rst`: Fix typo
2023-12-15 18:52:16 -08:00