Skip to content

增加全志 V861 MMC 认卡与扇区读取 - #12080

Open
cms19859230182-lang wants to merge 4 commits into
RT-Thread:masterfrom
cms19859230182-lang:bsp/avaota-f2-mmc
Open

cms19859230182-lang wants to merge 4 commits into
RT-Thread:masterfrom
cms19859230182-lang:bsp/avaota-f2-mmc

Conversation

@cms19859230182-lang

Copy link
Copy Markdown
Contributor

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

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

在 #12079 之上,为全志 V861(Avaota F2)C907 侧补上 MMC0:板上已过 identify 与扇区 0 读取。

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

  • 修正 SMHC module clock 与 update_clk 顺序
  • solo 冷链下 rt_hw_mmc0_probe_from_fdt():identify + CMD17 读 LBA0
  • 通过口:mmc0 card OK / mmc0 read OK(证据 MBR sig=55aa)

依赖/关联:#12079(进而 #12078 / #12077)

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

  • BSP: bsp/allwinner/avaota-f2(solo c907_boot)
  • 通过口见 ACCEPTANCE.md
  • 未宣称:文件系统 / DFS / 写块

当前拉取/合并请求的状态 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-mmc
    Enter PR branch bsp/avaota-f2-mmc 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-mmc 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the bsp/avaota-f2-mmc 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 github-actions Bot added the BSP label Nov 21, 2026
@cms19859230182-lang
cms19859230182-lang force-pushed the bsp/avaota-f2-mmc branch 2 times, most recently from 385cddd to dc16a7e Compare November 22, 2026 08:36
新增 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。
ACK 在 echo 的 len/payload/seq 全部写完之后才发布(doorbell 与 DRAM fallback
两条 recv 路径,C907/E907 同源);MSGBOX 硬复位只在启动对端之前做一次
(E907 用 once 标志,C907 只确保时钟与解复位、不再脉冲复位),
wait/kick/send/recv/openamp_*_start 都不再复位两侧邮箱,避免清掉已发出的 token。

C907/E907 的 drv_openamp.c 按仓库 clang-format 排好(OFF_* 宏行尾注释单空格),过 CI format check。
@cms19859230182-lang
cms19859230182-lang force-pushed the bsp/avaota-f2-mmc branch 2 times, most recently from 10ff180 to 11874b0 Compare November 23, 2026 17:25
mmio_r(SUNXI_GPIO_BASE + PIO_PORT_F * SUNXI_GPIO_PORT_STRIDE + 0x24U),
mmio_r(SUNXI_GPIO_BASE + PIO_PORT_F * SUNXI_GPIO_PORT_STRIDE + 0x14U),
mmio_r(0x02001000U + 0x84cU));
return -21;

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.

SD 1.x 卡不支持 CMD8,在这里直接退出后,后续的 SDSC 字节寻址分支无法服务这类卡。请区分卡不支持 CMD8 与控制器错误,前者用不带 HCS 的 ACMD41 继续识别。

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 矩阵修复,再确认本分支能实际编译对应板卡。 失败运行

- 新增/完善 C907/E907 的 sunxi SMHC 驱动(drv_mmc),支持认卡与扇区读写,
  applications/main.c 增加 MMC 验证命令。
- 同步 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 项目)。

Co-Authored-By: DeepSeek Flash 1017
Co-Authored-By: Gemini 3.8 Flash
@github-actions github-actions Bot added the action github action yml imporve label Nov 24, 2026
@github-actions

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 04:47 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.

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