Skip to content

增加全志 V861 硬件 MSGBOX / OpenAMP 形通信 - #12079

Open
cms19859230182-lang wants to merge 3 commits into
RT-Thread:masterfrom
cms19859230182-lang:bsp/avaota-f2-msgbox-openamp
Open

cms19859230182-lang wants to merge 3 commits into
RT-Thread:masterfrom
cms19859230182-lang:bsp/avaota-f2-msgbox-openamp

Conversation

@cms19859230182-lang

Copy link
Copy Markdown
Contributor

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

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

在 #12078 异构通路之上,增加全志 V861 硬件 MSGBOX 门铃,以及 OpenAMP 形命名端点互通(板上已过 OPENAMP-EPT-OK)。

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

  • 新增 drv_hw_msgbox / drv_openamp(C907 + E907)
  • MSGBOX views 按 Tina DTB:0x06020000 / 0x0800b000
  • OpenAMP 形端点:ept avaota-ept,SHM @0x41001000;非 libmetal / virtio-rpmsg 全栈

依赖/关联:#12078

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

  • BSP: bsp/allwinner/avaota-f2-e907 + bsp/allwinner/avaota-f2
  • 通过口:[E907] OPENAMP-EPT-OK name=avaota-ept tx=3 rx=3
  • 范围见各 BSP ACCEPTANCE.md

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

  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

  • 已经仔细查看过代码改动的对比
  • 代码风格正确
  • 没有垃圾代码
  • 所有变更均有原因及合理的
  • 已经使用 clang-format
  • 如果是新增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-msgbox-openamp
    Enter PR branch bsp/avaota-f2-msgbox-openamp 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-msgbox-openamp 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the bsp/avaota-f2-msgbox-openamp 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!

@Rbb666 Rbb666 left a comment

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.

MSGBOX 的复位时机和回包 ACK 顺序需要调整。 / Please move the MSGBOX reset and publish ACK after the echo.

}
oa_read_bytes(OFF_M2S_PAY, (uint8_t *)data, n);
*len = n;
oa_w32(OFF_M2S_ACK, seq);

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.

E907 的 openamp_send() 看到 OFF_M2S_ACK 就会返回,调用方随即读取回包。这里先写 ACK 再写回包,另一核可能先读到上一包。请在长度、数据和序号都写好后再发布 ACK,下面的 DRAM fallback 也一样。

openamp_send() on E907 can return as soon as it sees OFF_M2S_ACK, and the caller immediately reads the echo. Publishing the ACK here lets it read the previous payload. Publish the ACK after the echo length, payload and sequence in both receive paths.

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.

okok

rt_kprintf("[C907] magic=0xc907a11c\n");

/* Optional Phase1 MAGIC (may arrive after magic). Non-fatal. */
rt_hw_msgbox_clk_enable();

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.

C907 在等 doorbell 前会再次复位两侧 MSGBOX。如果 E907 已经发出 token,这次复位会把它清掉,接收端只剩超时。请在启动对端前统一初始化,收发路径不要再复位。

C907 resets both MSGBOX banks before waiting for the doorbell. If E907 has already sent the token, this reset can clear it and leave the receiver waiting until timeout. Initialize the mailbox before starting the peer and keep resets out of the send/receive paths.

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.

好,等我看看

新增 bsp/allwinner/avaota-f2(UART/msh 最小 BSP),并在 bsp/README.md 登记。
按 review 删除 ACCEPTANCE.md,编译说明改为推荐 Env 2.x / sdk。

board.dtb 不再假设树里已有:board/SConscript 调用 board/gen_board_dtb.py 在构建时生成,
builtin_fdt.o 显式依赖该产物,源变化会重新生成。生成需要 python3 + fdt 模块,
README 写明了这一步;board/board.dtb 作为构建产物加入 .gitignore。
新增 avaota-f2-e907,并更新 C907 侧 DRAM ping 应答样例以便异构演示。
按 review 删除 ACCEPTANCE.md,编译说明改为推荐 Env 2.x / sdk。

board.dtb 不再入库:board/SConscript 调用 gen_board_dtb.py 在构建时生成,
builtin_fdt.o 显式依赖该产物,设备树源变化会重新生成。生成需要 python3 + fdt
模块,README 已注明;board/board.dtb 加入 .gitignore。
@cms19859230182-lang
cms19859230182-lang force-pushed the bsp/avaota-f2-msgbox-openamp branch 3 times, most recently from 1916bbd to b4a00b0 Compare November 23, 2026 08:47
{
continue;
}
seq = oa_r32(OFF_M2S_SEQ);

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.

奇了怪了,这是为啥

@Rbb666

Rbb666 commented Nov 24, 2026

Copy link
Copy Markdown
Member

BSP 检查在展开空矩阵时失败,未执行编译。请同步 #12077、#12078 的 BSP 矩阵修复,再确认本分支能实际编译对应板卡。 失败运行

@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.

@github-actions github-actions Bot added the action github action yml imporve label Nov 24, 2026
- 新增 C907/E907 的硬件 MSGBOX 门铃与 OpenAMP 形通信(drv_hw_msgbox、drv_openamp),
  applications/main.c 增加跨核验证命令。
- 同步 C907/E907:board.dts + dtc 生成 board.dtb(删 gen_board_dtb.py)、
  uart0 走 PLIC INT_RX、trap 分发 M 外部中断、rtconfig.h 由 Kconfig/.config 生成。
- driver 用 RTT_ROOT 定位 libfdt,scons --dist 项目也能编。
- CI:riscv-none leg 加入 allwinner/avaota-f2 与 avaota-f2-e907,并安装 dtc。
- 未上板验证;本机只做干净构建(含 --dist 项目)。
- clang-format 22.1.8:对齐 board/plic.c、board/plic.h 的宏定义与注释(无语义改动)。

Co-Authored-By: DeepSeek Flash 1017
Co-Authored-By: Gemini 3.8 Flash
@cms19859230182-lang
cms19859230182-lang force-pushed the bsp/avaota-f2-msgbox-openamp branch from a5d0a11 to 9cdb3a3 Compare November 25, 2026 09:42

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.

2 participants