Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wang Yang" <yang.wang@deepcomputing.io>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 06/13] dt-bindings: bus: Add SpacemiT K3 Intel eSPI controller
Date: Fri, 04 Dec 2026 04:44:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-249102@kernel.org> (raw)
In-Reply-To: <20261204042112.2985112-7-yang.wang@deepcomputing.io>

Thank you for your contribution! Sashiko AI review found 8 potential
issues to consider:
- [Medium] dt-bindings: bus: raw uint32 spacemit,pr-mem-base1 instead of
  ranges/reg
- [Medium] dt-bindings: bus: unitless watchdog counter and policy
  toggles in DT ABI
- [Medium] dt-bindings: bus: patternProperties locks eSPI bus to single
  EC compatible
- [Medium] dt-bindings: bus: spacemit,k3-espi: exposes internal CCU mux
  in clocks
- [Low] dt-bindings: bus: unprefixed max-frequency property misnamed and
  misordered
- [Low] dt-bindings: bus: missing schema constraints for dependent eSPI
  properties
- [Low] dt-bindings: bus: multiple resets lack reset-names and invert
  clocks order
- [Low] dt-bindings: commit message has inaccurate series reference and
  revision notes
--

commit 622dd2b421fba8b4cbf3a78e0da3e8ce4dbb3c5d
Author: Wang Yang <yang.wang@deepcomputing.io>

> dt-bindings: bus: Add SpacemiT K3 Intel eSPI controller
>
> Describe the Intel eSPI protocol replacing LPC and its CPU-accessible
> peripheral window. Reference the already-added K3 EC schema from
> the first commit. Use vendor properties and frequency units in Hz.
>
> Prepared with OpenAI Codex assistance.
>
> Signed-off-by: Wang Yang <yang.wang@deepcomputing.io>

[Severity: Low]
The commit message refers to "the already-added K3 EC schema from the first
commit", but spacemit,k3-cros-ec.yaml was added in commit "dt-bindings:
embedded-controller: Add SpacemiT K3 EC window", not the first patch of the
series.  Permanent git history should name the schema directly rather than
relying on series numbering.

The changelog also reads like revision notes rather than a standalone
explanation of the new binding, and "Use vendor properties and frequency
units in Hz" does not match the schema (max-frequency has neither a vendor
prefix nor a -hz suffix, and spacemit,watchdog-timeout is a raw counter).

> diff --git a/Documentation/devicetree/bindings/bus/spacemit,k3-espi.yaml b/Documentation/devicetree/bindings/bus/spacemit,k3-espi.yaml
> new file mode 100644
> index 0000000000000..4bd13cc33c908
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/bus/spacemit,k3-espi.yaml

[ ... ]

> +  clocks:
> +    items:
> +      - description: Serial clock source
> +      - description: Serial clock
> +      - description: Bus clock
> +
> +  clock-names:
> +    items:
> +      - const: sclk_src
> +      - const: sclk
> +      - const: mclk

[Severity: Medium]
Should sclk_src be required in clocks?  In drivers/clk/spacemit/ccu-k3.c,
APMU_ESPI_CLK_RES_CTRL has only two gated clock outputs to the eSPI block
(espi_mclk and espi_sclk, matching the two reset domains), while
espi_sclk_src is an ungated internal APMU parent mux feeding espi_sclk.

Exposing sclk_src bakes a Linux CCU driver limitation (espi_sclk lacking
CLK_SET_RATE_PARENT and ccu_mix_calc_best_rate() not propagating rate
rounding to parents) into the permanent DT ABI.  Propagating
CLK_SET_RATE_PARENT in the clock driver and using assigned-clocks in DT
would let clocks list only sclk and mclk.

> +  resets:
> +    items:
> +      - description: Bus reset
> +      - description: Serial clock reset

[Severity: Low]
Should this binding include a reset-names property for the two resets?
Documentation/devicetree/bindings/writing-bindings.rst recommends
reset-names when there is more than one reset entry, and listing bus before
serial here inverts the order used by clocks, inviting positional mixups in
DTS files.

> +  spacemit,pr-mem-base1:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: Base address programmed into the controller's second peripheral-channel memory base register.

[Severity: Medium]
Why is a hardware memory base address modeled as a required uint32 vendor
property instead of ranges or reg?  Encoding an address as uint32 hardcodes
32-bit addressing on a 64-bit SoC (k3.dtsi uses 2-cell addresses under soc),
bypasses DT address translation, and leaves the address space unspecified.

In the example, spacemit,pr-mem-base1 is set to 0xcac8c000, duplicating the
controller's own MMIO reg base.  If this register describes a second
peripheral window it should use ranges or reg; if it only parks an unused
window at the controller base, that address is already known from reg.

> +  max-frequency:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: Maximum eSPI serial clock frequency in Hz.
> +    enum: [20000000, 25000000, 33333333, 50000000, 66666666]
> +    default: 20000000

[Severity: Low]
Is unprefixed max-frequency appropriate for a bus controller binding?
Across the tree max-frequency is an MMC-specific property, whereas bus and
controller bindings use the core clock-frequency property (ordered before
vendor properties) or a vendor-prefixed property with a -hz unit suffix such
as spacemit,max-frequency-hz.

[ ... ]

> +  spacemit,alert-mode:
> +    $ref: /schemas/types.yaml#/definitions/string
> +    description: Use the shared IO1 line or the dedicated alert pin.
> +    enum: [io1, pin]
> +    default: io1
> +
> +  spacemit,alert-type:
> +    $ref: /schemas/types.yaml#/definitions/string
> +    description: Electrical mode of the dedicated alert pin.
> +    enum: [open-drain, push-pull]
> +    default: open-drain

[Severity: Low]
Can spacemit,alert-type be restricted in the schema to when
spacemit,alert-mode is "pin"?  Without a constraint, contradictory nodes
that set alert-mode to "io1" alongside alert-type pass dtbs_check silently.

Similarly, spacemit,peripheral-channel-enable states in prose that it is
required for an enabled EC child, but no schema rule enforces it.

> +  spacemit,watchdog-timeout:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: Controller watchdog counter value.
> +    maximum: 65535
> +    default: 65535
> +
> +  spacemit,crc-enable:
> +    type: boolean
> +    description: Enable link CRC checking.
> +
> +  spacemit,auto-gating-enable:
> +    type: boolean
> +    description: Enable automatic controller clock gating.
> +
> +  spacemit,peripheral-channel-enable:
> +    type: boolean
> +    description: Enable the peripheral channel. Required for an enabled EC child.
> +
> +  spacemit,vwire-channel-enable:
> +    type: boolean
> +    description: Enable the virtual-wire channel.
> +
> +  spacemit,oob-channel-enable:
> +    type: boolean
> +    description: Enable the out-of-band channel.
> +
> +  spacemit,flash-channel-enable:
> +    type: boolean
> +    description: Enable the flash access channel.

[Severity: Medium]
Do these register-level and policy properties belong in the permanent DT
ABI?  spacemit,watchdog-timeout exposes a unitless 16-bit counter without a
standard time unit suffix (such as -us or -ms) or documented tick rate.

spacemit,crc-enable and spacemit,auto-gating-enable are runtime controller
policy rather than board hardware description, and the four
*-channel-enable booleans duplicate Intel eSPI capability negotiation and
child-node presence, forcing DTS files to mirror static driver defaults.

> +patternProperties:
> +  '^ec@[0-9a-f]+$':
> +    $ref: /schemas/embedded-controller/spacemit,k3-cros-ec.yaml#

[Severity: Medium]
Does patternProperties lock this SoC eSPI bus controller to a single
ChromeOS EC compatible?  Combined with additionalProperties: false and the
const compatible in spacemit,k3-cros-ec.yaml, no K3 board can attach a
different eSPI peripheral or use the standard embedded-controller@ node name
without modifying the controller schema.

Matching generic child nodes (such as '@[0-9a-f]+$' with type: object,
additionalProperties: true, and required: [reg]) lets each attached eSPI
device be validated by its own compatible-matched schema.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204042112.2985112-1-yang.wang@deepcomputing.io?part=6

  reply	other threads:[~2026-12-04  4:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  4:20 [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support Wang Yang
2026-12-04  4:21 ` [PATCH v2 05/13] dt-bindings: embedded-controller: Add SpacemiT K3 EC window Wang Yang
2026-12-04  4:32   ` sashiko-bot
2026-12-04  4:21 ` [PATCH v2 06/13] dt-bindings: bus: Add SpacemiT K3 Intel eSPI controller Wang Yang
2026-12-04  4:44   ` sashiko-bot [this message]
2026-12-04  4:21 ` [PATCH v2 10/13] riscv: dts: spacemit: Add K3 eSPI pin group Wang Yang
2026-12-04  4:41   ` sashiko-bot
2026-12-04  4:21 ` [PATCH v2 11/13] riscv: dts: spacemit: Describe the K3 eSPI controller Wang Yang
2026-12-04  4:48   ` sashiko-bot
2026-12-04  4:21 ` [PATCH v2 12/13] riscv: dts: spacemit: Enable the FML13V05 EC keyboard Wang Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-249102@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yang.wang@deepcomputing.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox