Re: [PATCH net-next v1 1/3] dinghai: add firmware version check and? RISC-V readiness polling

From: Andrew Lunn

Date: Mon Aug 24 2026 - 14:00:58 EST


> + struct zxdh_fw_compat *fw_compat;

> + /* Firmware predating the compatibility region keeps the erased
> + * pattern, which fails the module id check below and defers the
> + * decision to the readiness wait.
> + */
> + ioread32_rep(compat_base, fw_compat, sizeof(*fw_compat) / 4);

> +/* Firmware version compatibility block at ZXDH_FW_COMPAT_OFFSET.
> + * Copied out with ioread32_rep(), which converts from little-endian.
> + */
> +struct zxdh_fw_compat {
> + u8 module_id;
> + u8 major;
> + s8 fw_minor;
> + u8 drv_minor;
> + u16 patch;
> + u16 rsv;

What are the endinness of these two u16? Should they be marked as
little endian?

> +} __packed;
> +
> +/* Health buffer at ZXDH_RISCV_HB_OFFSET, maintained by the RISC-V
> + * management core of the firmware. Fields are read through ioread*().
> + */
> +struct zxdh_health_buffer {
> + u32 synd; /* Bitmask of active syndrome flags. */
> + u32 health_counter; /* Incremented heartbeat counter. */

Same question here.

Andrew