Skip to content

soc: nuvoton: add Composite EAT mailbox client - #578

Open
helloxiling wants to merge 5 commits into
Nuvoton-Israel:NPCM-6.12-OpenBMCfrom
helloxiling:xsun/npcm-composite-eat-client
Open

soc: nuvoton: add Composite EAT mailbox client#578
helloxiling wants to merge 5 commits into
Nuvoton-Israel:NPCM-6.12-OpenBMCfrom
helloxiling:xsun/npcm-composite-eat-client

Conversation

@helloxiling

@helloxiling helloxiling commented Aug 21, 2026

Copy link
Copy Markdown

Depends on #576 (mailbox: synchronize NPCM channel shutdown).

GitHub requires the base branch to exist in the upstream repository, while the
dependency branch currently exists only in the contributor fork. Therefore this
draft temporarily includes the #576 mailbox commit followed by the four
Composite EAT commits. After #576 merges, this branch will be rebased onto the
updated NPCM-6.12-OpenBMC target so the mailbox commit drops from the diff. The
four-commit client series will then be revalidated before leaving draft status.

Summary

  • add the NPCM845 Composite EAT DT binding and fixed ABI-v1 resource contract
  • add a stable 48-byte 32/64-bit compatible ioctl UAPI and firmware status values
  • add /dev/npcm-composite-eat, an ioctl-only mailbox client
  • serialize requests and correlate request/response IDs
  • quarantine shared memory after timeout or mailbox transmit timeout until the matching late response
  • preserve required response length without truncating the signed token
  • add hardware-independent KUnit coverage for ABI, resource geometry, response metadata, IDs, timeout, stale responses, and reset

Feature gating

CONFIG_NPCM_COMPOSITE_EAT defaults to disabled. The generic client PR does not add or enable a board node. With the option disabled, the driver object and symbols are absent.

ABI v1

  • command 0x11; mailbox channel 4 / notification 0x10
  • scratchpads 24-31 at 0xF0800E60..0xF0800E7F
  • shared memory 0x06201000, size 0x5000
  • request region 0x1000; response region 0x4000
  • one request in flight; 10-second timeout
  • ioctl type 0xE6, command 1; structure size 48 bytes

Validation

  • strict per-commit checkpatch: 0 errors, warnings, or checks
  • git diff --check: pass
  • Composite EAT KUnit under UML: 8/8 pass
  • exported UAPI size/offset/ioctl assertions: pass for 32-bit and 64-bit
  • focused DT schema, lint, and example compilation: pass
  • ARM64 W=1 affected-directory build: pass
  • feature OFF: driver object and symbols absent
  • feature ON: driver object and symbols present
  • E2E hardware validation was done with a porting to MSFT OpenBMC, tested on DCSCM and compute platforms.

NPCM clients can be removed while the threaded mailbox IRQ is
handling a response. The existing shutdown path frees channel
metadata before the mailbox core clears the client pointer. This can
race the controller handler and client callback.

Keep channel metadata for the controller lifetime, mark it inactive
before shutdown, and synchronize the IRQ. Also acknowledge inactive
doorbells so the shared IRQ cannot retrigger indefinitely.

Signed-off-by: xilingsun <xilingsun@microsoft.com>
Describe the NPCM845 mailbox client used to request signed Composite
EAT tokens from TIP firmware.

Document the scratchpad resource, mailbox doorbell, and fixed ABI
version 1 reserved-memory layout.

Signed-off-by: xilingsun <xilingsun@microsoft.com>
Define a versioned ioctl interface for submitting a bounded Composite
EAT request and receiving the signed response.

Use aligned 64-bit user pointers for an identical compat layout,
publish all firmware status values, and reserve ioctl type 0xE6.

Signed-off-by: xilingsun <xilingsun@microsoft.com>
Add an ioctl-only NPCM mailbox client that copies a bounded request
into the ABI version 1 shared-memory window. Return the signed
Composite EAT response generated by TIP firmware.

Serialize submissions, correlate request and response IDs, and
quarantine timed-out shared memory until the matching late response.
Validate firmware metadata, support compat ioctl, and keep open file
descriptors safe across driver removal.

Signed-off-by: xilingsun <xilingsun@microsoft.com>
Exercise the stable ioctl layout, request and response bounds, and
fixed shared-memory geometry. Also cover request ID wraparound,
in-flight rejection, stale responses, and timeout quarantine recovery.

The suite is hardware independent and remains optional unless
KUNIT_ALL_TESTS is selected.

Signed-off-by: xilingsun <xilingsun@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant