Skip to content

增加全志 V861 C907 板级支持 - #12077

Open
cms19859230182-lang wants to merge 1 commit into
RT-Thread:masterfrom
cms19859230182-lang:bsp/avaota-f2
Open

cms19859230182-lang wants to merge 1 commit into
RT-Thread:masterfrom
cms19859230182-lang:bsp/avaota-f2

Conversation

@cms19859230182-lang

Copy link
Copy Markdown
Contributor

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

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

为全志 V861(Avaota F2)增加 C907 板级支持,便于在该硬件上运行 RT-Thread。

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

增加了 V861 的 BSP 支持;含有基础的 board、链接脚本和 config,并且已经登记。

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

  • BSP: bsp/allwinner/avaota-f2
  • .config: 使用该 BSP 目录下的 rtconfig.h(本地已能 scons 编过)
  • action: (push 后待补充 CI 链接)

当前拉取/合并请求的状态 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 代码规范
  • 如果是新增bsp, 已经添加ci检查到 .github/ALL_BSP_COMPILE.json

@github-actions

Copy link
Copy Markdown

👋 感谢您对 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

  • Use workflow from 保持默认分支(通常为 master)
    Keep the default branch (usually master) in Use workflow from
  • 在 branch 输入框填写 PR 分支 bsp/avaota-f2
    Enter PR branch bsp/avaota-f2 in the branch field
  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将作为独立提交推送至你的分支。
    The formatting changes will be pushed to your branch as a separate commit.

完成后,提交将自动更新至 bsp/avaota-f2 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the bsp/avaota-f2 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!

Comment thread bsp/allwinner/avaota-f2/ACCEPTANCE.md Outdated
@@ -0,0 +1,12 @@
# Avaota F2 C907 — 验收边界(PR 阶段 A)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

不接受这份文件的提交

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

成,我删掉这份文件

Comment thread bsp/allwinner/avaota-f2/README.md Outdated
## 编译

```text
set RTT_EXEC_PATH=<riscv-none-embed 或等价 gcc 的 bin>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

建议使用 env 2.x,可通过 sdk 命令管理工具链的安装和卸载。本地有工具链,简单配置即可自动探测并使用工具链。

@cms19859230182-lang

Copy link
Copy Markdown
Contributor Author

全改完啦,请验收

.global rt_hw_builtin_fdt_end
.type rt_hw_builtin_fdt, %object
rt_hw_builtin_fdt:
.incbin "board/board.dtb"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

干净检出没有 board/board.dtb,SCons 也没有调用生成脚本。按 README 直接跑 scons 会在这里报找不到文件。请把 DTB 的生成和依赖接进构建,再从干净目录跑一遍。

A clean checkout has no board/board.dtb, and SCons never runs the generator. The documented scons build will fail at this include. Please wire DTB generation into the build and verify it from a clean checkout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok没问题

config.baud_rate = g_uart_fdt.baud;
serial0.ops = &uart_ops;
serial0.config = config;
return rt_hw_serial_register(&serial0, "uart0", RT_DEVICE_FLAG_RDWR, RT_NULL);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FinSH 以 INT_RX 打开 uart0,这里只注册了 RDWR,打开会返回 -RT_EIO。请实现接收中断并上报 RX_IND,让 getc() 在 FIFO 为空时返回 -1,再验证能从串口输入一条 msh 命令。

@Rbb666

Rbb666 commented Nov 24, 2026

Copy link
Copy Markdown
Member

BSP 构建矩阵为空,C907 没有进入编译。请把 allwinner/avaota-f2 加入 .github/ALL_BSP_COMPILE.json 对应工具链的 SUB_RTT_BSP,并验证干净检出能生成 DTB、完成构建。 失败运行

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这个rtconfig.h感觉怪怪的,不像是env生成的,建议用env生成后提交上来

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

这是用 bring-up 写的时候最小配置哈哈,我用 menuconfig 重写一波

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

不建议添加这个脚本,建议把 gen_board_dtb.py 换成 board/board.dts,由 SCons 调用 dtc 编译。
把 env.Command 的输入改为 DTS,用 dtc -I dts -O dtb -o $TARGET $SOURCE 生成 board/board.dtb

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

📌 Code Review Assignment

🏷️ Tag: workflow

Reviewers: @Rbb666 @kurisaW @supperthomas

Changed Files (Click to expand)
  • .github/ALL_BSP_COMPILE.json
  • .github/workflows/bsp_buildings.yml

📊 Current Review Status (Last Updated: 2026-11-25 17:50 CST)


📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

@cms19859230182-lang

Copy link
Copy Markdown
Contributor Author

修不动了,明早起来再高

- uart0 走 PLIC 中断收数(板级 plic.c):FinSH 以 RDWR|INT_RX 打开,ISR 上报
  RT_SERIAL_EVENT_RX_IND,getc() 空时返回 -1;trap 增加 M 外部中断分发。
- 删除 board/gen_board_dtb.py,改为 board/board.dts,由 SCons 调 dtc 生成
  board/board.dtb;driver 用 RTT_ROOT 定位 libfdt,scons --dist 后也能编。
- rtconfig.h 改由 Kconfig + .config(menuconfig/defconfig)生成并提交。
- CI:riscv-none leg 里加入 allwinner/avaota-f2,并安装 device-tree-compiler。
- 未上板验证;本机只做干净构建(含 --dist 项目)与静态对照。

- board/plic.c、board/plic.h 按 clang-format 22.1.8 归一(CI format 门禁)。

Co-Authored-By: DeepSeek Flash 1017
Co-Authored-By: Gemini 3.8 Flash
#include <stdint.h>
#include <rtthread.h>

#define V861_PLIC_BASE 0x10000000U

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

V861 C907 的设备树把 PLIC 放在 0x30000000,这里和 board.dts 却用 0x10000000。v861_plic_init() 启动时就会按这个地址写寄存器。请确认 RV32 机器模式下的实际地址,同步两处,再上板验证 UART0 能接收 msh 命令。V861 DTS

#include "plic.h"

#define PLIC_PRIORITY_OFFSET 0x000000U
#define PLIC_ENABLE_OFFSET 0x002000U /* M-mode context 0 */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

clang-format 卡在这里和下一行,#12078 也报了同样的两处。请在这条 PR 修好后同步到 #12078。检查日志

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

action github action yml imporve BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants