casaroli opened a new pull request, #21014:
URL: https://github.com/apache/nuttx/pull/21014

   ## Summary
   
   Since commit 2227f232f09 ("arch/risc-v: Add clkdev driver for mtime."), 
`arch/risc-v/src/common/riscv_mtimer.c` implements the count-based oneshot 
operations, which need `CONFIG_ONESHOT_COUNT`. Every other chip that uses 
`riscv_mtimer.c` selects it, but `ARCH_CHIP_LITEX` does not. `ONESHOT_COUNT` 
has no prompt, so a defconfig cannot enable it, and `arty_a7:knsh-tickless` 
(the LiteX configuration with `CONFIG_ONESHOT`) does not build on master:
   
   ```
   common/riscv_mtimer.c:69:4: error: 'const struct oneshot_operations_s' has 
no member named 'start_absolute'
   common/riscv_mtimer.c:174:3: error: implicit declaration of function 
'oneshot_count_init'; did you mean 'oneshot_current'? 
[-Wimplicit-function-declaration]
   ```
   
   This PR adds `select ONESHOT_COUNT if ONESHOT` to `ARCH_CHIP_LITEX`, as the 
Espressif chips do.
   
   ## Impact
   
   LiteX configurations with `CONFIG_ONESHOT` build again. No change for LiteX 
configurations without it. CI does not build `arty_a7` 
(`tools/ci/testlist/risc-v-04.dat`), so it did not see the failure.
   
   ## Testing
   
   Make builds:
   
   | Config | ONESHOT | master 3196e0e090c | this PR |
   |---|---|---|---|
   | `arty_a7:knsh-tickless` | y | `riscv_mtimer.c` errors | builds 
(`CONFIG_ONESHOT_COUNT=y`) |
   | `arty_a7:nsh-tickless` | n | builds | builds |
   | `arty_a7:nsh` | n | builds | builds |
   
   Run: `arty_a7:knsh-tickless` with this PR and #21013 (which `knsh` and 
`knsh-tickless` need to boot), in Renode 1.16.1 with one VexRiscv hart and the 
prebuilt LiteX VexRiscv OpenSBI from the Renode demos. It boots in tickless 
mode and runs `hello`:
   
   ```
   NuttShell (NSH) NuttX-13.0.1-RC0
   nsh> hello
   Hello, World!!
   ```
   
   Not tested on a real Arty A7 board.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to