You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "yf13 (via GitHub)" <gi...@apache.org> on 2023/12/29 07:23:28 UTC
[PR] This PR adds kernel build support for CanMV-K230 device. [nuttx]
yf13 opened a new pull request, #11465:
URL: https://github.com/apache/nuttx/pull/11465
## Summary
Changes:
- Documentation/platforms/risc-v/k230 revised for both modes
- arch/risc-v/include/k230/irq.h add S-mode IRQs
- under arch/risc-v/src/k230 folder:
- Make.defs drop use of k230_exception_m.S
- hardware/k230_clint.h add S-mode defs, revised freq
- k230_head.S unified flat/kernel mode support
- k230_irq.c add S-mode support with debug dump
- k230_mm_init.c revised for K230 S-mode
- k230_start.c revised for flat/s-mode,
- k230_timerisr.c unified flat/s-mode support.
- under boards/risc-v/k230/canmv230 folder:
- configs/nsh/defconfig fix RAM size
- include/board_memorymap.h cleanup for S-mode
- src/.gitignore ignore generated romfs_boot.c
- src/Makefile add romfs support
Renames:
- under boards/risc-v/k230/canmv230/src/ folder:
- canmv_init.c from k230_appinit.c making room for more k230 devices
Dropped:
- under arch/risc-v/src/k230/
- k230_exception_m.S as hybrid mode not ready yet.
New files in boards/riscv/k230/canmv230:
- configs/knsh/defconfig S-mode config
- scripts/ld-kernel.script S-mode linker script
- src/romfs.h S-mode user space ROMFS defs
- src/romfs_stub.c S-mode user space ROMFS stub
## Impact
None to other ports
## Testing
Checked on CanMV-k230 board
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] adding kernel build for CanMV-K230 device [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #11465:
URL: https://github.com/apache/nuttx/pull/11465#issuecomment-1871931246
Hi @yf13: We need some fixes here:
```text
Configuration/Tool: canmv230/nsh
------------------------------------------------------------------------------------
Cleaning...
Configuring...
Building NuttX...
chip/k230_start.c: In function 'k230_start':
##[error]chip/k230_start.c:100:5: error: "CONFIG_BUILD_KERNEL" is not defined, evaluates to 0 [-Werror=undef]
100 | #if CONFIG_BUILD_KERNEL
| ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:145: k230_start.o] Error 1
make[1]: Target 'libarch.a' not remade because of errors.
make: *** [tools/LibTargets.mk:164: arch/risc-v/src/libarch.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 370: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
Normalize canmv230/nsh
====================================================================================
Configuration/Tool: canmv230/knsh
------------------------------------------------------------------------------------
Cleaning...
Configuring...
Building NuttX...
##[error]chip/k230_mm_init.c:108:13: error: 'dump_pgtable' defined but not used [-Werror=unused-function]
108 | static void dump_pgtable(const size_t * pgt, uint32_t len, const char * name)
| ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:145: k230_mm_init.o] Error 1
In file included from common/riscv_misaligned.c:30:
common/riscv_misaligned.c: In function 'decode_insn':
##[error]common/riscv_misaligned.c:547:16: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t' {aka 'unsigned int'} [-Werror=format=]
547 | _alert("Uncompressed: %lx\n", insn.insn);
| ^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
| |
| uint32_t {aka unsigned int}
common/riscv_misaligned.c:547:33: note: format string is defined here
547 | _alert("Uncompressed: %lx\n", insn.insn);
| ~~^
| |
| long unsigned int
| %x
cc1: all warnings being treated as errors
make[1]: *** [Makefile:145: riscv_misaligned.o] Error 1
make[1]: Target 'libkarch.a' not remade because of errors.
make: *** [tools/LibTargets.mk:53: arch/risc-v/src/libkarch.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 370: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
Normalize canmv230/knsh
.config:174:warning: symbol value '' invalid for ARCH_KMAP_VBASE
22d21
< CONFIG_ARCH_LAZYFPU=y
33a33
> CONFIG_ARCH_LAZYFPU=y
47,48d46
< CONFIG_DEBUG_ASSERTIONS=y
< CONFIG_DEBUG_FULLOPT=y
60d57
< CONFIG_RAW_BINARY=y
76a74
> CONFIG_RAW_BINARY=y
Saving the new configuration file
.config:174:warning: symbol value '' invalid for ARCH_KMAP_VBASE
HEAD detached at pull/11465/merge
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: boards/risc-v/k230/canmv230/configs/knsh/defconfig
no changes added to commit (use "git add" and/or "git commit -a")
```
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] adding kernel build for CanMV-K230 device [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #11465:
URL: https://github.com/apache/nuttx/pull/11465
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] adding kernel build for CanMV-K230 device [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #11465:
URL: https://github.com/apache/nuttx/pull/11465#discussion_r1438534089
##########
arch/risc-v/include/k230/irq.h:
##########
@@ -31,8 +31,16 @@
/* Map RISC-V exception code to NuttX IRQ */
+#ifndef CONFIG_BUILD_KERNEL
+#define K230_IRQ_TIMER (RISCV_IRQ_MTIMER)
#define K230_IRQ_UART0 (RISCV_IRQ_MEXT + 16)
+#else
+#define K230_IRQ_TIMER (RISCV_IRQ_STIMER)
Review Comment:
indent too
##########
arch/risc-v/include/k230/irq.h:
##########
@@ -31,8 +31,16 @@
/* Map RISC-V exception code to NuttX IRQ */
+#ifndef CONFIG_BUILD_KERNEL
+#define K230_IRQ_TIMER (RISCV_IRQ_MTIMER)
Review Comment:
Add the indent
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] adding kernel build for CanMV-K230 device [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on code in PR #11465:
URL: https://github.com/apache/nuttx/pull/11465#discussion_r1438144694
##########
boards/risc-v/k230/canmv230/configs/knsh/defconfig:
##########
Review Comment:
Wonder if some of these settings might be redundant?
```text
Normalize canmv230/knsh
22d21
< CONFIG_ARCH_LAZYFPU=y
33a33
> CONFIG_ARCH_LAZYFPU=y
47,48d46
< CONFIG_DEBUG_ASSERTIONS=y
< CONFIG_DEBUG_FULLOPT=y
60d57
< CONFIG_RAW_BINARY=y
76a74
> CONFIG_RAW_BINARY=y
```
[(Source)](https://github.com/apache/nuttx/actions/runs/7355047555/job/20023156038?pr=11465)
Normally I do this to check my config settings:
```bash
make menuconfig \
&& make savedefconfig \
&& grep -v CONFIG_HOST defconfig \
>boards/risc-v/k230/canmv230/configs/knsh/defconfig
```
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] adding kernel build for CanMV-K230 device [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on code in PR #11465:
URL: https://github.com/apache/nuttx/pull/11465#discussion_r1438141611
##########
arch/risc-v/src/k230/k230_start.c:
##########
@@ -100,12 +91,23 @@ uintptr_t g_idle_topstack = K230_IDLESTACK_TOP;
* Name: k230_start
****************************************************************************/
-#ifdef CONFIG_BUILD_KERNEL
-void k230_start_s(int mhartid, const char *dtb)
-#else
void k230_start(int mhartid, const char *dtb)
-#endif
{
+ if (0 == mhartid)
+ {
+ k230_clear_bss();
+
+#if CONFIG_BUILD_KERNEL
Review Comment:
Should be `#ifdef CONFIG_BUILD_KERNEL`
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] adding kernel build for CanMV-K230 device [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on code in PR #11465:
URL: https://github.com/apache/nuttx/pull/11465#discussion_r1438161377
##########
arch/risc-v/src/k230/k230_start.c:
##########
@@ -100,12 +91,23 @@ uintptr_t g_idle_topstack = K230_IDLESTACK_TOP;
* Name: k230_start
****************************************************************************/
-#ifdef CONFIG_BUILD_KERNEL
-void k230_start_s(int mhartid, const char *dtb)
-#else
void k230_start(int mhartid, const char *dtb)
-#endif
{
+ if (0 == mhartid)
+ {
+ k230_clear_bss();
+
+#if CONFIG_BUILD_KERNEL
Review Comment:
fixed
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] adding kernel build for CanMV-K230 device [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on code in PR #11465:
URL: https://github.com/apache/nuttx/pull/11465#discussion_r1438161696
##########
boards/risc-v/k230/canmv230/configs/knsh/defconfig:
##########
Review Comment:
Sorry, my use of "tools/refresh.sh" must be wrong before sending the PR. just rerun it.
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org