Skip to content

feat(config): enable PL031 RTC + HCTOSYS on arm64#8

Merged
AprilNEA merged 2 commits into
masterfrom
feat/rtc-pl031
Jul 8, 2026
Merged

feat(config): enable PL031 RTC + HCTOSYS on arm64#8
AprilNEA merged 2 commits into
masterfrom
feat/rtc-pl031

Conversation

@AprilNEA

@AprilNEA AprilNEA commented Jul 8, 2026

Copy link
Copy Markdown
Member

Companion to arcboxlabs/arcbox#373 (ABX-416).

The ArcBox HV backend now exposes a PL031 RTC backed by the host wall clock. This enables:

  • CONFIG_RTC_CLASS=y + CONFIG_RTC_DRV_PL031=y — bind the device via the AMBA bus
  • CONFIG_RTC_HCTOSYS=y (+ _DEVICE="rtc0") — set CLOCK_REALTIME from rtc0 at boot, so the guest has correct wall time before the agent's clock-sync ping (TLS validation during early boot)

Inert under VZ, which exposes no PL031. Local build verification against the new arcbox PL031 device in progress.

The ArcBox HV backend now exposes a PL031 RTC backed by the host wall
clock. RTC_CLASS + RTC_DRV_PL031 bind it via the AMBA bus; RTC_HCTOSYS
sets CLOCK_REALTIME from rtc0 at boot, so the guest has correct wall
time before the agent's clock-sync ping (TLS validation during early
boot). Inert under VZ, which exposes no PL031.
@greptile-apps

greptile-apps Bot commented Jul 8, 2026

Copy link
Copy Markdown

Greptile Summary

This PR enables early wall-clock initialization for the arm64 ArcBox kernel. The main changes are:

  • Adds built-in RTC class support.
  • Enables CONFIG_RTC_DRV_PL031 for the HV-backed PL031 RTC.
  • Enables CONFIG_RTC_HCTOSYS from rtc0 at boot.
  • Keeps CONFIG_RTC_SYSTOHC disabled so the guest does not write time back to the host-backed RTC.

Confidence Score: 5/5

Safe to merge with minimal risk.

The change is limited to arm64 kernel config and matches the described one-way RTC-to-system clock flow.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Verified that the after RTC config shows all RTC/HCTOSYS assertions passing, as captured in the after-log evidence.
  • Compared against the prior HEAD^ config, which showed a failed assertion for missing explicit SYSTOHC disablement in the before-log evidence.
  • Documented the prerequisites that were missing for a local arm64 olddefconfig preservation check, including Docker, the arm64 cross-compiler, QEMU arm64, and dtc, as recorded in the prerequisites-after log.
  • Described the olddefconfig blocker evidence that these missing prerequisites prevented a preserved make ARCH=arm64 olddefconfig step, as shown in the olddefconfig-after log.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
configs/arcbox-arm64.config Adds built-in PL031 RTC and HCTOSYS configuration for arm64 guests; no blocking issues identified.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant HV as ArcBox HV backend
participant AMBA as AMBA bus
participant RTC as PL031 RTC driver
participant Kernel as Linux timekeeping
participant Agent as ArcBox agent

HV->>AMBA: Expose PL031 RTC device
AMBA->>RTC: Bind built-in `CONFIG_RTC_DRV_PL031`
RTC->>Kernel: Register `rtc0`
Kernel->>RTC: `CONFIG_RTC_HCTOSYS` reads `rtc0` at boot
RTC-->>Kernel: Host-backed wall clock
Kernel->>Kernel: Set `CLOCK_REALTIME`
Agent->>Kernel: Later clock-sync ping runs after early TLS validation
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant HV as ArcBox HV backend
participant AMBA as AMBA bus
participant RTC as PL031 RTC driver
participant Kernel as Linux timekeeping
participant Agent as ArcBox agent

HV->>AMBA: Expose PL031 RTC device
AMBA->>RTC: Bind built-in `CONFIG_RTC_DRV_PL031`
RTC->>Kernel: Register `rtc0`
Kernel->>RTC: `CONFIG_RTC_HCTOSYS` reads `rtc0` at boot
RTC-->>Kernel: Host-backed wall clock
Kernel->>Kernel: Set `CLOCK_REALTIME`
Agent->>Kernel: Later clock-sync ping runs after early TLS validation
Loading

Reviews (2): Last reviewed commit: "fix(config): explicitly disable RTC_SYST..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26829c2a22

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread configs/arcbox-arm64.config
The virtual PL031 mirrors the host wall clock; an NTP-synced guest
must not write adjusted time back into it. Keep the flow one-way
(RTC -> system at boot via HCTOSYS).
@AprilNEA AprilNEA merged commit 338d3c7 into master Jul 8, 2026
5 checks passed
@AprilNEA AprilNEA deleted the feat/rtc-pl031 branch July 8, 2026 04:47
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