Skip to content

增加 A210 芯片支持 #329

Open
ifnfn wants to merge 17 commits into
RVCK-Project:rvck-6.6from
ifnfn:rvck-6.6
Open

增加 A210 芯片支持 #329
ifnfn wants to merge 17 commits into
RVCK-Project:rvck-6.6from
ifnfn:rvck-6.6

Conversation

@ifnfn

@ifnfn ifnfn commented Jul 8, 2026

Copy link
Copy Markdown

fixed #313

This pull request adds initial support for the ZhiHe A210 SoC platform.

The series includes:

  • ZhiHe A210 SoC binding documentation
  • ARCH_ZHIHE Kconfig support
  • ZhiHe A210 DT binding headers
  • A210 clock controller driver
  • A210 reset controller driver
  • A210 pin controller driver
  • A210 power domain driver
  • A210 mailbox controller driver
  • A210 AON subsystem driver
  • A210 AON regulator driver
  • ZhiHe A210 DWMAC glue driver
  • ZhiHe A210 device tree support
  • defconfig updates for A210 platform support

Changes since previous version

  • Addressed reset controller review comments by using subsystem-specific compatibles.
  • Cleaned up reset controller match data and signal table formatting.
  • Improved clock helper macros and clock table formatting.
  • Consolidated A210 DTSI files.
  • Cleaned up unsupported DTS nodes.
  • Reworked power-domain child node reg representation.
  • Improved power-domain debugfs naming.
  • Added explicit regulator firmware ID property.
  • Updated DWMAC binding to reference snps,dwmac.yaml.
  • Removed non-standard eMMC/SDHCI properties.
  • Improved board DTS comments for default jumper settings.
  • Added Zicbom/Zicbop/Zicboz ISA information and cbom-block-size.
  • Addressed DTS/checkpatch line length warnings.
  • Updated Kconfig and defconfig for A210 support.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

开始测试 log: https://github.com/RVCK-Project/rvck/actions/runs/28926267994

参数解析结果
args value
repository RVCK-Project/rvck
head ref pull/329/head
base ref rvck-6.6
LAVA repo RVCK-Project/lavaci
LAVA hardware ['qemu']
LAVA Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:
check result
kunit-test success
kernel-build success
check-patch success
lava-trigger-qemu success
lava-trigger-sg2042 skipped
lava-trigger-k1 skipped
lava-trigger-lpi4a skipped

Kunit Test Result

[07:50:03] Testing complete. Ran 482 tests: passed: 465, skipped: 17

Kernel Build Result

Check Patch Result

Total Errors 0
Total Warnings 294

LAVA Check (qemu)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/qemu/qemu-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck/329_28926267994_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck/329_28926267994_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.img.zst
testcase_ref main
testitem_name RVCK-Project_rvck_pull_request_target_329__common-test_qemu

result: Lava check done!

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

开始测试 log: https://github.com/RVCK-Project/rvck/actions/runs/28998159202

参数解析结果
args value
repository RVCK-Project/rvck
head ref pull/329/head
base ref rvck-6.6
LAVA repo RVCK-Project/lavaci
LAVA hardware ['qemu']
LAVA Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:
check result
kunit-test success
kernel-build success
check-patch success
lava-trigger-qemu success
lava-trigger-sg2042 skipped
lava-trigger-k1 skipped
lava-trigger-lpi4a skipped

Kunit Test Result

[06:21:36] Testing complete. Ran 482 tests: passed: 465, skipped: 17

Kernel Build Result

Check Patch Result

Total Errors 0
Total Warnings 294

LAVA Check (qemu)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/qemu/qemu-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck/329_28998159202_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck/329_28998159202_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.img.zst
testcase_ref main
testitem_name RVCK-Project_rvck_pull_request_target_329__common-test_qemu

result: Lava check done!

Comment thread arch/riscv/errata/thead/errata.c Outdated
return false;

if (arch_id != 0 || impid != 0)
if (!check_xuantie_family(arch_id, impid))

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.

Should Zicbom be used instead of Xthead CMO?


zhihe,ccu-mode:
$ref: /schemas/types.yaml#/definitions/uint32
description: CCU operating mode (0 = gating, 1 = scaling).

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.

This sounds weird, and is this really needed? (This property isn't shown in the example below)


examples:
- |
ccu@0 {

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.

Unit address should match reg base address.

const: zhihe,a210-aon

reg:
minItems: 1

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.

Can some memory addresses be omitted while the AON subsystem still work? If not so, minItems should be also 3.

maxItems: 3

reg-names:
minItems: 1

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.

Ditto.

items:
- const: aon0

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.

Should this use a vendor-specific name instead? e.g. "zhihe,protocol-version" .


version:
$ref: /schemas/types.yaml#/definitions/uint32
description: Mailbox hardware version (1 = V1, 2 = V2).

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.

Hardware version information should be part of the compatible string.

- items:
- const: zhihe,a210-dwmac
- const: snps,dwmac-5.20
- const: zhihe,a210-dwmac

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.

Why is there two options with one omitting generic dwmac compatible and one not?

an SoC-specific glue layer. The node also carries the standard
snps,dwmac properties documented in net/snps,dwmac.yaml.

select:

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.

This snippet looks weird although this exists in th1520 binding too.

Maybe adding some comment like display/msm/gpu.yaml is good?

In that file:

# dtschema does not select nodes based on pattern+const, so add custom select
# as a work-around:

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.

Oh sorry this comment does not apply here.

items:
- const: pclk

zhihe,group-id:

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.

Why is this group index necessary? Having such index is usually weird.


required:
- "#power-domain-cells"
- id

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.

Maybe it's better to make this reg instead of id ?
In such case the subnode name should also be changed to something like power-domain@xxx.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe it's better to make this reg instead of id ? In such case the subnode name should also be changed to something like power-domain@xxx.

同意,请在 Documentation/devicetree/bindings/power/ 下搜索 ”power-domain“ 及其用法的例子。

regulators {
compatible = "zhihe,a210-aon-regulator";

dvdd_core {

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.

Usually node name shouldn't contain _ .

physically controlled by the Always-On (AON) subsystem firmware and
are accessed from the application processor over the AON mailbox.
Each supported rail is described by a child node whose regulator-name
identifies the corresponding AON virtual regulator.

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.

I think regulator-name property usually means the regulator name registered to the operating system, should it be decoupled from the firmware regulator name? (In this case, the firmware regulator name will have another property like zhihe,regulator-id ).

reset-controller {
compatible = "zhihe,a210-reset-controller";
reg = <0x06b20400 0x200>;
reg-names = "VP_RST";

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.

I think multiple reset controllers should have different compatible strings instead of different reg-names, see upstream reset/thead,th1520-reset.yaml as an example.


properties:
compatible:
const: zhihe,a210-reset-sample

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.

As it's already in a SoC, is it still a "sample"?

Maybe it's better to name it zhihe,a210-cpu-reset .

- |
reset-sample {
compatible = "zhihe,a210-reset-sample";
reg = <0x00 0x00>;

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.

This reg value looks very weird, maybe it's better to specify the registers via reg/reg-names instead of custom properties.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

这里沿用了 th1520 的做法,在 opensbi 中共用相同的代码

oneOf:
- description: Boards based on the Zhihe A210 SoC
items:
- const: zhihe,a210

@Icenowy Icenowy Jul 10, 2026

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.

Individual board names should be also added here.


zhihe,bm-name:
$ref: /schemas/types.yaml#/definitions/string
description: Name of this BMU instance.

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.

Ah, why is there both different compatible and these properties? Aren't these properties detectable by compatible?

minItems: 1
maxItems: 4
description:
Per-channel BMU interrupts, two per monitored register group.

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.

Maybe it will be good to constrain the interrupt count based on the compatible string.


properties:
compatible:
const: zhihe,a210-iopmp

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.

BTW in my memory TH1520 IOPMP isn't controlled by rich OS, is this changed in A210?

In addition, how would IOPMP device nodes be referenced by the corresponding bus master device nodes?

$id: http://devicetree.org/schemas/clock/zhihe,a210-clk.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Zhihe A210 Clock Controller

@Icenowy Icenowy Jul 10, 2026

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.

BTW what's the difference between this and the "CCU"?

@Icenowy

Icenowy commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

The pinctrl driver looks similar to the TH1520 one, maybe some code deduplication should be done?

Comment thread drivers/soc/zhihe/Kconfig Outdated

menu "ZHIHE SoC drivers"

config A210_MEMTESTER

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.

These two options should be part of the corresponding commits instead of this one.

Comment thread drivers/regulator/zhihe-aon-regulator.c Outdated
struct zhihe_aon_msg_regulator_ctrl {
struct aon_rpc_msg_hdr hdr;
union rpc_func_t {
struct rpc_msg_regu_vol_set regu_vol_set;

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.

The alignment is weird here.


static struct regulator_desc zhihe_a210_aon_regu_desc[] = {
/*common regu , no need to adjust vol dynamicaly */
REGU_DSC_DEF(A210_AVDD33_EMMC, "avdd33_emmc"),

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.

Should the map of numeric regulator IDs to names be part of the device tree instead of the driver?

Comment thread include/linux/firmware/zhihe/ipc.h Outdated
#include <linux/device.h>
#include <linux/types.h>

#define AON_RPC_MSG_MAGIC (0xef)

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.

@unicornx unicornx left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

对于完全新的产品支持,一个 PR 包含太多的模块会导致 review 不方便。所以请将这个 PR 按照模块/子系统 拆分后分成多个 PR 提交。这也是上游 review 时 maintainer 的基本要求。从现在做起来对以后正式向上游提交也是有帮助的(btw, A210 现在还没有去往上游正式提交,是吗?)

建议的提交顺序可以是先从基础的设备树开始(cpu 基本信息+最简单的 soc,一般先只有串口,使得系统可以启动进入控制台并打印输出即可),然后逐步添加功能模组。
模组的划分一般按照 clock,reset,pinctrl ... 的顺序,可以参考目前上游化做的比较好的产品的补丁提交流程,譬如 https://github.com/spacemit-com/linux/wiki 或者 https://github.com/sophgo/linux/wiki

几个提交补丁中的通用规则:

  • binding/dts 信息同样按照模组拆分,而不是整体性提交。每个模组 PR 时一般都会包括各自对应的 binding/driver/dts 三件套
  • dts 提交时需要自行提前运行 dtbcheck 确保没有告警和错误
  • 代码提交时需要自行提前运行 checkpatch 确保没有告警和错误,有时允许一些小的告警,但不能有错误。
  • 所有涉及项目列表时都要按照英文字母的字典顺序排列,譬如 arch/riscv/Kconfig.socs 中添加 ARCH_ZHIHE 时应该排在 ARCH_VIRT 后面,诸如此类 ......

感谢您的支持!

@unicornx

Copy link
Copy Markdown

fixed #313

See https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue
可以通过这种方式将 PR 和 issue 关联起来,好处是以后PR merge时 issue 会自动关闭。

另外结合我前面提的拆分 PR 的操作,我建议拆分 PR 后,您也能够相应地创建对应的 sub-issue,并将 #313 作为一个 主 issue。

image

@sterling-teng

Copy link
Copy Markdown
Contributor

对于完全新的产品支持,一个 PR 包含太多的模块会导致 review 不方便。所以请将这个 PR 按照模块/子系统 拆分后分成多个 PR 提交。这也是上游 review 时 maintainer 的基本要求。从现在做起来对以后正式向上游提交也是有帮助的(btw, A210 现在还没有去往上游正式提交,是吗?)

建议的提交顺序可以是先从基础的设备树开始(cpu 基本信息+最简单的 soc,一般先只有串口,使得系统可以启动进入控制台并打印输出即可),然后逐步添加功能模组。 模组的划分一般按照 clock,reset,pinctrl ... 的顺序,可以参考目前上游化做的比较好的产品的补丁提交流程,譬如 https://github.com/spacemit-com/linux/wiki 或者 https://github.com/sophgo/linux/wiki。

几个提交补丁中的通用规则:

  • binding 信息同样按照模组拆分,而不是整体性提交。每个模组 PR 时一般都会包括各自对应的 binding/driver/dts 三件套
  • dts 提交时需要自行提前运行 dtbcheck 确保没有告警和错误
  • 代码提交时需要自行提前运行 checkpatch 确保没有告警和错误,有时允许一些小的告警,但不能有错误。
  • 所有涉及项目列表时都要按照英文字母的字典顺序排列,譬如 arch/riscv/Kconfig.socs 中添加 ARCH_ZHIHE 时应该排在 ARCH_VIRT 后面,诸如此类 ......

感谢您的支持!

先以这个pr作为第一版的审阅吧,按照达成共识的审阅意见修改,修改后的补丁和没问题补丁按照其内在的逻辑关系拆分出来,单独提交pr。即改一部分、拆一部分、提交一部分、合并一部分,这样合并也快一些,好吗?

@sterling-teng

Copy link
Copy Markdown
Contributor

fixed #313

提供的信息太少了,这里应该作为所有补丁的摘要,能够让开发者一眼看懂你的代码都做了什么事情,而不是去一遍一遍地过补丁来推测做了什么。

@unicornx
unicornx requested a review from Icenowy July 13, 2026 01:16

zhihe,ccu-mode:
$ref: /schemas/types.yaml#/definitions/uint32
description: CCU operating mode (0 = gating, 1 = scaling).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ccu-mode 不是 required?有默认值吗?


examples:
- |
ccu@0 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

作为一个时钟控制器,其节点名称必须是 ”clock-controller“,"ccu" 更适合作为一个 tag。

建议对 dts 文件都运行一下 dtbcheck

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.

看上去这东西并不作为 Linux CLK framework 的时钟输出?
感觉这个更像一个 SoC 特定的特殊配置,只是它恰好叫 CCU (

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.

虽然我还是觉得如果可以的话也许给它起一个没那么容易混淆的名字比较合适

$id: http://devicetree.org/schemas/clock/zhihe,a210-clk.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Zhihe A210 Clock Controller

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

同问,ccu 和这些 xxx-clk 地位有何区别,是否都可以合并到一个 ccu 的 binding 中去。

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

不一样的, ccu 是硬件自己完成调频的,没有 ccu 也可以工作,没有 clk 就不能工作了。

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.

所以 ccu 的功能到底是什么,对硬件调频的部分时钟行为进行微调?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

对的,是硬件内部会根据负载自动升频或降频,只需要 enable + 阈值

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.

那我觉得第一阶段可以先去掉,不得不调的时候再拿出来?

$id: http://devicetree.org/schemas/reset/zhihe,a210-reset-sample.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Zhihe A210 CPU Reset (reset-sample)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

这里叫 ”sample“ 是什么意思?是不是可以换个说法?sample 给人感觉是个 ”例子“ ?


required:
- "#power-domain-cells"
- id

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe it's better to make this reg instead of id ? In such case the subnode name should also be changed to something like power-domain@xxx.

同意,请在 Documentation/devicetree/bindings/power/ 下搜索 ”power-domain“ 及其用法的例子。

interrupts:
maxItems: 1

icu_cpu_id:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

这是什么,是 vendor 扩展的属性?

Comment thread arch/riscv/Kconfig.socs Outdated
help
This enables support for SiFive SoC platform hardware.

config ARCH_ZHIHE

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

所有涉及项目列表时都要按照英文字母的字典顺序排列,ARCH_ZHIHE 应该排在 ARCH_VIRT 后面

Comment thread arch/riscv/configs/a210_evb_defconfig Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

rvck 使用统一的 defconfig,而不是一个产品一个 config。

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

开始测试 log: https://github.com/RVCK-Project/rvck/actions/runs/29390531061

参数解析结果
args value
repository RVCK-Project/rvck
head ref pull/329/head
base ref rvck-6.6
LAVA repo RVCK-Project/lavaci
LAVA hardware ['qemu']
LAVA Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:
check result
kunit-test success
kernel-build success
check-patch success
lava-trigger-qemu success
lava-trigger-sg2042 skipped
lava-trigger-k1 skipped
lava-trigger-lpi4a skipped

Kunit Test Result

[05:09:17] Testing complete. Ran 482 tests: passed: 465, skipped: 17

Kernel Build Result

Check Patch Result

Total Errors 0
Total Warnings 0

LAVA Check (qemu)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/qemu/qemu-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck/329_29390531061_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck/329_29390531061_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.img.zst
testcase_ref main
testitem_name RVCK-Project_rvck_pull_request_target_329__common-test_qemu

result: Lava check done!

Zhiguo Zhu added 17 commits July 15, 2026 13:05
Add devicetree binding schema documentation for the ZhiHe A210 SoC,
covering clock, reset, pinctrl, power domain, mailbox, AON firmware,
regulator, IOPMP, DWMAC, BMU and memtester. Also register the
"zhihe" vendor prefix and add A210 compatibles to the existing
dw-axi-dmac and dwcmshc-sdhci bindings.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Introduce the ARCH_ZHIHE platform Kconfig symbol to enable support for
ZhiHe SoCs.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add dt-bindings header files for the ZhiHe A210 SoC:
  - clock/a210-clock.h: clock IDs
  - reset/a210-reset.h: reset IDs
  - power/a210-power.h: power domain IDs
  - iopmp/a210-iopmp.h: IOPMP IDs

These headers are referenced by both device tree sources and drivers.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add a clock controller driver for the ZhiHe A210 SoC that manages:

  - PLLs (integer and fractional)
  - Clock gates, dividers, and muxes for peripheral clocks

The driver registers with the common clock framework and is referenced
by device tree nodes through the clock binding IDs defined in
dt-bindings/clock/a210-clock.h.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add a reset controller driver for the ZhiHe A210 SoC that manages
hardware reset lines for various on-chip IP blocks.  The driver uses
reset line IDs defined in dt-bindings/reset/a210-reset.h.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add a pin controller driver for the ZhiHe A210 SoC supporting pin
multiplexing and pin configuration (pull-up/down, drive strength, etc.).

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add a generic power domain driver for the ZhiHe A210 SoC to manage
power gating of on-chip IP blocks.  The driver uses power domain IDs
defined in dt-bindings/power/a210-power.h.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add a mailbox controller driver for the ZhiHe A210 SoC used for
inter-processor communication between the application processor and the
Always-On (AON) E902 core.

The driver implements the standard mailbox controller API and supports
interrupt-driven message passing.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add the Always-On (AON) subsystem driver for the ZhiHe A210 SoC.  This
driver manages IPC communication with the E902 AON core and provides:

  - Mailbox-based IPC message transport
  - Power, clock, and resource management requests to the AON firmware
  - Proc debug interface for runtime diagnostics

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add a virtual regulator driver for the ZhiHe A210 SoC that controls
voltage regulators through the AON subsystem IPC interface.  The driver
translates standard regulator framework calls into IPC messages to the
AON firmware which performs the actual hardware control.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add "zhihe,a210-axi-dma" compatible string to the dw-axi-dmac driver
with HAS_RESETS and USE_CFG2 chip flags matching the A210 DMA
controller configuration.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add "zhihe,a210-dwcmshc" compatible string to the sdhci-of-dwcmshc
driver for the ZhiHe A210 SDHCI controller. The A210 SDHCI IP behaves
identically to the TH1520 one, so the existing TH1520 platform data
and callbacks are reused directly.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add a platform glue driver for the Synopsys DWMAC Ethernet controller
integrated in ZhiHe SoCs.  The driver handles SoC-specific clock and
reset management and configures the MAC interface mode through a syscon
register.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
When a UART port is deferred-probed (e.g. due to pinctrl dependencies),
the re-registration path calls dw8250_set_termios() via
register_console() -> console_call_setup() -> uart_set_options().

The original code unconditionally calls clk_disable_unprepare() which
drops the enable count to zero, causing the clock framework to gate the
UART hardware clock.  Since the bootconsole (earlycon) is still
actively writing to the same port, the MMIO access to the clock-gated
peripheral causes a bus-level hang.

Fix this by removing the disable/enable pair and only calling
clk_set_rate() when the rate actually needs to change.  For fixed-rate
clock sources the rate never differs so clk_set_rate() is never called.

Fixes: 4e26b13 ("serial: 8250_dw: clock rate handling for all ACPI platforms")

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add the IO Physical Memory Protection (IOPMP) driver for the ZhiHe
A210 SoC. The IOPMP controls peripheral DMA memory access permissions.

The driver issues SBI extension calls (SBI_EXT_CONFIG_IOPMP) to
configure protection rules from S-mode. Define the corresponding
SBI extension ID and function IDs in asm/sbi.h.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Add device tree files for the ZhiHe A210 SoC:

  - a210-soc-core.dtsi: CPU cluster, interrupt controller, memory,
    clocks, resets, and core bus infrastructure
  - a210-soc-peri.dtsi: peripheral devices (UART, SPI, I2C, etc.)
  - a210-evb.dts: A210 EVB (Evaluation Board) configuration
  - a210-dev.dts: A210 development board configuration

The device tree describes the Always-On (AON) subsystem, power domains,
pin controller, and all on-chip peripherals.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
Enable ARCH_ZHIHE in the generic RISC-V defconfig so the ZhiHe A210
 platform can be built by default.

A210 provides ten DesignWare 8250 UART controllers, so raise both
the build-time and runtime 8250 UART limits to cover all of them.

Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
@ifnfn ifnfn reopened this Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

开始测试 log: https://github.com/RVCK-Project/rvck/actions/runs/29391037683

参数解析结果
args value
repository RVCK-Project/rvck
head ref pull/329/head
base ref rvck-6.6
LAVA repo RVCK-Project/lavaci
LAVA hardware ['qemu']
LAVA Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:
check result
kunit-test success
kernel-build success
check-patch success
lava-trigger-qemu success
lava-trigger-sg2042 skipped
lava-trigger-k1 skipped
lava-trigger-lpi4a skipped

Kunit Test Result

[05:21:09] Testing complete. Ran 482 tests: passed: 465, skipped: 17

Kernel Build Result

Check Patch Result

Total Errors 0
Total Warnings 100

LAVA Check (qemu)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/qemu/qemu-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck/329_29391037683_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck/329_29391037683_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.img.zst
testcase_ref main
testitem_name RVCK-Project_rvck_pull_request_target_329__common-test_qemu

result: Lava check done!

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

开始测试 log: https://github.com/RVCK-Project/rvck/actions/runs/29391037987

参数解析结果
args value
repository RVCK-Project/rvck
head ref pull/329/head
base ref rvck-6.6
LAVA repo RVCK-Project/lavaci
LAVA hardware ['qemu']
LAVA Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:
check result
kunit-test success
kernel-build success
check-patch success
lava-trigger-qemu success
lava-trigger-sg2042 skipped
lava-trigger-k1 skipped
lava-trigger-lpi4a skipped

Kunit Test Result

[05:21:40] Testing complete. Ran 482 tests: passed: 465, skipped: 17

Kernel Build Result

Check Patch Result

Total Errors 0
Total Warnings 100

LAVA Check (qemu)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/qemu/qemu-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck/329_29391037987_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck/329_29391037987_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.img.zst
testcase_ref main
testitem_name RVCK-Project_rvck_pull_request_target_329__common-test_qemu

result: Lava check done!

@unicornx

Copy link
Copy Markdown

@ifnfn 第一轮 review 就先到这里吧,请根据 #329 (review) 的要求将这个 PR 拆分成多个 PR 我们再继续 review ,如何?

注意根据我们的要求,一个 PR 需要对应一个 issue,所以拆分后,请为每个 PR 先创建对应的 issue。具体建议可以参考 #329 (comment) 可以先把 issue 提出来,我们就基本上了解你的 拆分思路了。请确保拆分后的 PR 都是可以编译过的。

PR 拆分后请关闭本 PR。

谢谢

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.

增加 A210 芯片支持

4 participants