rt-thread icon indicating copy to clipboard operation
rt-thread copied to clipboard

bsp/spacemit/k1:first version

Open Ironside-Zhang opened this issue 2 months ago • 5 comments

本次提交为对 SpacemiT KeyStone K1的初步支持。K1芯片采用双集群(2x4核)架构,搭载X60核心,支持RVA22标准和RVV 1.0向量扩展。

本次移植遵循RT-Thread现代BSP的最佳实践,采用了libcpu分层架构和模块化驱动设计: libcpu 专用层: 在 libcpu/risc-v/spacemit/k1/ 目录下创建了K1的专用CPU适配层。(完善中) BSP 板级支持包 (bsp/spacemit_k1/): board 目录: 提供了针对MUSE-Pi-Pro开发板的精确硬件定义,包括内存布局(mem_layout.h)、外设基地址(board.h)和中断号(irq_num.h)。所有信息均从官方Linux SDK的DTS文件中提取,保证了准确性。 drivers 目录: 实现了pinctrl和sysctl_clk驱动框架,用于管理引脚复用和时钟。其实现逻辑同样基于对Linux DTS和驱动源码的分析。 实现了一个功能完整的drv_uart.c驱动,该驱动兼容16550A标准,并能在rt_hw_board_init中正确调用pinctrl和sysctl完成初始化,最终作为FinSH控制台。 link.lds: 编写了链接脚本,将内核加载到U-Boot期望的0x80200000地址。 Kconfig: 提供了清晰的、集中式的配置选项,允许用户方便地使能BSP和相关驱动。

Ironside-Zhang avatar Oct 15 '25 09:10 Ironside-Zhang

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page 点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • 设置需排除的文件/目录(目录请以"/"结尾) Set files/directories to exclude (directories should end with "/")
  • 将目标分支设置为 \ Set the target branch to:spacemit/k1
  • 设置PR number为 \ Set the PR number to:10817
  1. 等待工作流完成 | Wait for the workflow to complete 格式化后的代码将自动推送至你的分支。 The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 spacemit/k1 分支,关联的 Pull Request 也会同步更新。 Once completed, commits will be pushed to the spacemit/k1 branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐 If you have any questions, feel free to reach out. Thanks again for your contribution!

github-actions[bot] avatar Oct 15 '25 09:10 github-actions[bot]

Hi @Ironside-Zhang,

感谢你为 K1 芯片所做的初步工作。我也在用 K1 的开发板(Banana Pi BPI-F3),非常希望能看到它在 RT-Thread 上运行。

我在分析这个 PR 时发现,"Files changed" 中似乎遗漏了您在描述中提到的 libcpu/risc-v/spacemit/k1 适配层代码,这导致了 CI 编译失败。同时,我还注意到 drv_pinctrl.h 中有一个宏语法错误,并且 rtconfig.py 里有一个硬编码的本地工具链路径。

请问您最近是否还有时间来更新这个 PR 并补全 libcpu 的文件?

如果您暂时比较忙,我计划在您的工作基础上(特别是 board.h 和 drv_pinctrl.h 中的寄存器定义)开始一份新的移植,目标是提交一个包含完整 libcpu 适配和 BPI-F3 BSP 的 PR。

谢谢

lhxj avatar Nov 02 '25 09:11 lhxj

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Ironside seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 04 '25 06:11 CLAassistant

Hi @Ironside-Zhang,

感谢你为 K1 芯片所做的初步工作。我也在用 K1 的开发板(Banana Pi BPI-F3),非常希望能看到它在 RT-Thread 上运行。

我在分析这个 PR 时发现,"Files changed" 中似乎遗漏了您在描述中提到的 libcpu/risc-v/spacemit/k1 适配层代码,这导致了 CI 编译失败。同时,我还注意到 drv_pinctrl.h 中有一个宏语法错误,并且 rtconfig.py 里有一个硬编码的本地工具链路径。

请问您最近是否还有时间来更新这个 PR 并补全 libcpu 的文件?

如果您暂时比较忙,我计划在您的工作基础上(特别是 board.h 和 drv_pinctrl.h 中的寄存器定义)开始一份新的移植,目标是提交一个包含完整 libcpu 适配和 BPI-F3 BSP 的 PR。

谢谢

大佬可以留个联系方式不,内部有一个兴趣小组,可以拉你入伙一起讨论

Rbb666 avatar Nov 12 '25 07:11 Rbb666

大佬可以留个联系方式不,内部有一个兴趣小组,可以拉你入伙一起讨论

好的,我的微信ywx2743257167

lhxj avatar Nov 13 '25 09:11 lhxj