Skip to content

SNOOP:phytium:update phytium SNOOP driver support to 6.6.0.4#1766

Open
Chengyulai wants to merge 4 commits into
deepin-community:linux-6.6.yfrom
Chengyulai:SNOOP-6.6.y
Open

SNOOP:phytium:update phytium SNOOP driver support to 6.6.0.4#1766
Chengyulai wants to merge 4 commits into
deepin-community:linux-6.6.yfrom
Chengyulai:SNOOP-6.6.y

Conversation

@Chengyulai
Copy link
Copy Markdown
Contributor

@Chengyulai Chengyulai commented May 26, 2026

This patches update the support for phytium SNOOP driver.

1.update the DT description for the Phytium snoop controller.
2.add snoop description for pe220x platforms, which usually used as BMC cards.
3.update the snoop node description for pe220x platforms to ensure its driver is functioning normally.

Summary by Sourcery

Documentation:

  • Add a Devicetree binding document for the Phytium BMC snoop controller, describing its properties and usage on supported platforms.

This patch update the DT description for the Phytium snoop controller.

Signed-off-by: Li Yuze <liyuze@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Signed-off-by: Xia Qian <xiaqian1486@phytium.com.cn>
This patch update the description for the Phytium snoop controller
to ensure its driver is functioning normally.

Signed-off-by: Li Yuze <liyuze@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Signed-off-by: Xia Qian <xiaqian1486@phytium.com.cn>
This patch add snoop description for pe220x platforms, which usually used
as BMC cards.

Signed-off-by: Li Yuze <liyuze@phytium.com.cn>
Signed-off-by: Xia Qian <xiaqian1486@phytium.com.cn>
This patch update the snoop node description for pe220x platforms
to ensure its driver is functioning normally.

Signed-off-by: Li Yuze <liyuze@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Signed-off-by: Xia Qian <xiaqian1486@phytium.com.cn>
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 26, 2026

Reviewer's Guide

Updates Phytium BMC Snoop controller support by adding a formal DT binding schema and wiring up/adjusting the snoop controller node for pe220x BMC platforms so the driver can probe correctly on 6.6.0.4.

File-Level Changes

Change Details Files
Introduce a Devicetree binding schema for the Phytium BMC Snoop controller.
  • Add a YAML binding describing the Phytium snoop controller compatible string and basic resources (reg, interrupts).
  • Define a snoop-ports uint32-array property to specify host I/O ports to monitor.
  • Provide an example snoop controller node including syscon usage, address/size, interrupt, and snoop-ports values.
Documentation/devicetree/bindings/misc/phytium,snoop-ctrl.yaml
Update pe220x platform Devicetree to describe the Phytium snoop controller for BMC use.
  • Declare or adjust a snoop controller node in the pe220x DTSI to match the new binding (compatible, reg, interrupts, snoop-ports).
  • Ensure the node naming and properties conform to the binding so the snoop driver probes correctly on pe220x-based BMC cards.
arch/arm64/boot/dts/phytium/pe220x.dtsi

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link
Copy Markdown

Hi @Chengyulai. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign opsiff for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • In the binding, reg is defined but not listed as required, which seems inconsistent with the example and typical controller bindings; consider adding reg to required if the controller always has an MMIO region.
  • The compatible schema only constrains the first string to phytium,snoop-ctrl, but the example also uses "syscon"; if syscon is expected, model this explicitly (e.g., with oneOf and items/additionalItems: false) so the example passes validation and the allowed combinations are clear.
  • Consider tightening the snoop-ports property by specifying constraints such as minItems, a sensible maximum, and possibly value ranges to catch misconfigurations early.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the binding, `reg` is defined but not listed as required, which seems inconsistent with the example and typical controller bindings; consider adding `reg` to `required` if the controller always has an MMIO region.
- The `compatible` schema only constrains the first string to `phytium,snoop-ctrl`, but the example also uses `"syscon"`; if `syscon` is expected, model this explicitly (e.g., with `oneOf` and `items`/`additionalItems: false`) so the example passes validation and the allowed combinations are clear.
- Consider tightening the `snoop-ports` property by specifying constraints such as `minItems`, a sensible maximum, and possibly value ranges to catch misconfigurations early.

## Individual Comments

### Comment 1
<location path="Documentation/devicetree/bindings/misc/phytium,snoop-ctrl.yaml" line_range="21-30" />
<code_context>
+    items:
+      - enum:
+          - phytium,snoop-ctrl
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  snoop-ports:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description: Ports to snoop
+
+required:
+  - compatible
+  - interrupts
+  - snoop-ports
+
+examples:
</code_context>
<issue_to_address>
**suggestion (bug_risk):** `reg` is defined but not listed as required, which may not reflect the hardware requirement.

The example node uses `reg`, and this type of controller typically needs a register region. Since `reg` is defined but not required, please confirm whether MMIO is always present. If so, add `reg` to `required:`; if not, ensure the driver handles the absence of `reg` correctly.

Suggested implementation:

```
required:
  - compatible
  - reg
  - interrupts
  - snoop-ports

```

The change assumes that the hardware always exposes an MMIO region and that the driver depends on it. If that's not true, the alternative would be to leave `reg` out of `required:` and instead adjust the driver to tolerate the absence of a register region and document that behavior here.
</issue_to_address>

### Comment 2
<location path="Documentation/devicetree/bindings/misc/phytium,snoop-ctrl.yaml" line_range="27-29" />
<code_context>
+  interrupts:
+    maxItems: 1
+
+  snoop-ports:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description: Ports to snoop
+
+required:
</code_context>
<issue_to_address>
**suggestion:** `snoop-ports` could benefit from tighter schema constraints (e.g. item size or count).

`snoop-ports` is currently just a `uint32-array`:

```yaml
snoop-ports:
  $ref: /schemas/types.yaml#/definitions/uint32-array
  description: Ports to snoop
```

If the hardware only supports a limited number of snooped ports or a specific port-number range, please consider:
- Adding `minItems`/`maxItems` if there is a fixed or maximum number of ports.
- Constraining values with `minimum`/`maximum` if ports are within a defined range.

This will catch invalid DTs earlier via `dt_binding_check` and better document the hardware limits.

Suggested implementation:

```
  snoop-ports:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    description: Ports to snoop
    minItems: 1
    uniqueItems: true

```

```
          interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
          snoop-ports = <0 1>;

```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +21 to +30
reg:
maxItems: 1

interrupts:
maxItems: 1

snoop-ports:
$ref: /schemas/types.yaml#/definitions/uint32-array
description: Ports to snoop

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (bug_risk): reg is defined but not listed as required, which may not reflect the hardware requirement.

The example node uses reg, and this type of controller typically needs a register region. Since reg is defined but not required, please confirm whether MMIO is always present. If so, add reg to required:; if not, ensure the driver handles the absence of reg correctly.

Suggested implementation:

required:
  - compatible
  - reg
  - interrupts
  - snoop-ports

The change assumes that the hardware always exposes an MMIO region and that the driver depends on it. If that's not true, the alternative would be to leave reg out of required: and instead adjust the driver to tolerate the absence of a register region and document that behavior here.

Comment on lines +27 to +29
snoop-ports:
$ref: /schemas/types.yaml#/definitions/uint32-array
description: Ports to snoop
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: snoop-ports could benefit from tighter schema constraints (e.g. item size or count).

snoop-ports is currently just a uint32-array:

snoop-ports:
  $ref: /schemas/types.yaml#/definitions/uint32-array
  description: Ports to snoop

If the hardware only supports a limited number of snooped ports or a specific port-number range, please consider:

  • Adding minItems/maxItems if there is a fixed or maximum number of ports.
  • Constraining values with minimum/maximum if ports are within a defined range.

This will catch invalid DTs earlier via dt_binding_check and better document the hardware limits.

Suggested implementation:

  snoop-ports:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    description: Ports to snoop
    minItems: 1
    uniqueItems: true

          interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
          snoop-ports = <0 1>;

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants