Skip to content

[bsp][k230] add K230D support and Smart improvements - #11897

Open
BernardXiong wants to merge 6 commits into
RT-Thread:masterfrom
BernardXiong:pr/k230-k230d-smart
Open

BernardXiong wants to merge 6 commits into
RT-Thread:masterfrom
BernardXiong:pr/k230-k230d-smart

Conversation

@BernardXiong

@BernardXiong BernardXiong commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

拉取/合并请求描述:(PR description)

为什么提交这份PR (why to submit this PR)

The K230 BSP only targeted the 512MB K230 board and had no K230D (128MB DDR)
variant. It also lacked a pin device, ext4 rootfs support and pseudo terminal
mount points required by the Smart configuration.

你的解决方案是什么 (what is your solution)

  • add SOC_K230/SOC_K230D selection and size the default memory layout for 128MB DDR
  • register GPIO as an RT-Thread pin device
  • add ext4 rootfs support and mount ptyfs and procfs
  • remove unused board peripheral definitions
  • keep the SDK riscv64-unknown-linux-musl toolchain and lp64d ABI
  • regenerate .config and rtconfig.h

Dependencies

请提供验证的bsp和config (provide the config and bsp)

  • BSP: bsp/k230 (K230D, 128MB DDR)
  • .config: CONFIG_SOC_K230D=y, CONFIG_BSP_ROOTFS_TYPE_EXT4=y, CONFIG_BSP_USING_GPIO=y, CONFIG_RT_USING_PIN=y
  • action: built locally with the K230 SDK riscv64-unknown-linux-musl toolchain; CI will verify the configuration

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用clang-format 源码格式化工具确保格式符合RT-Thread代码规范 This PR has been formatted with clang-format and complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@BernardXiong BernardXiong mentioned this pull request Oct 18, 2026
10 tasks
@BernardXiong
BernardXiong marked this pull request as ready for review October 18, 2026 12:08
@github-actions github-actions Bot added the BSP label Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

k230

  • SRAM: .bss +57,440 B, .data +1,080 B, .eh_frame +21,504 B, .sbss +64 B, .srodata.cst8 +24 B, .stack +8 B, .text +99,408 B (+14.8%, 1,388,700 B / 60,682,240 B, total: 2% used)

Catch memory regressions in CI with MemBrowse. Free for open source.

Comment thread bsp/k230/rtconfig.h Outdated
Comment on lines +605 to +617
#define BSP_ROOTFS_TYPE_EXT4
#define BSP_RISCV_FPU_SOFT
#define RT_USING_DFS_V2
#define RT_USING_DFS_DEVFS
#define RT_USING_DFS_PTYFS
#define RT_USING_DFS_PROCFS
#define RT_USING_DFS_CROMFS
#define RT_USING_DFS_TMPFS
#define PKG_USING_LWEXT4
#define RT_USING_DFS_LWEXT4
#define PKG_USING_LWEXT4_LATEST_VERSION
#define PKG_USING_ZLIB
#define PKG_USING_ZLIB_LATEST_VERSION

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方感觉怪怪的,建议是通过 menuconfig 重新刷一遍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已按建议改用 scons --pyconfig-silent 重新生成 bsp/k230/.config 和 rtconfig.h(commit 87a0051),并把分支 rebase 到最新 master。

原来手动追加在 rtconfig.h 末尾的 SOC_K230D、BSP_ROOTFS_TYPE_EXT4、RT_USING_DFS_*、PKG_USING_LWEXT4、PKG_USING_ZLIB 等宏,现在都由 Kconfig 输出到各自对应的 section。生成时为了与 #11892 的依赖保持一致,临时应用了 #11892 的 libcpu/Kconfig 变更,提交中不包含该文件。

BernardXiong and others added 6 commits November 1, 2026 00:02
- add SOC_K230/SOC_K230D selection and a 128MB memory layout
- register GPIO as an RT-Thread pin device
- support ext4 rootfs and mount ptyfs and procfs
- remove unused board peripheral definitions
- switch the toolchain to the musleabi ABI
- regenerate .config and rtconfig.h
- use the lp64d ABI expected by libc_kernel.a and libgcc.a
- restore the riscv64-unknown-linux-musl toolchain prefix
- fix the double-float and soft-float link failure
- format memory layout macros
- format the pin device callbacks
- no functional change
- initialize all RTC register fields before writing them to hardware
- fix the cppcheck uninitvar warning for reserved fields
- initialize alarm date and time register fields before use
- fix the cppcheck uninitvar warning for reserved fields
Normalize bsp/k230/.config and rtconfig.h with scons --pyconfig-silent so
the Kconfig symbols are emitted in their proper sections instead of being
appended at the end of the file. The previous configuration choices are
preserved.

Co-Authored-By: Claude Code <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants