On Thu, 4 Dec 2025 at 09:35, Corvin Köhne <[email protected]> wrote:
>
> From: YannickV <[email protected]>
>
> Introduce a new machine type 'beckhoff-cx7200' that inherits from the
> xilinx-zynq-a9 machine. The CX7200 is an industrial PC based on the
> Xilinx Zynq-7000 SoC.
> The machine preserves all standard Zynq features (boot-mode selection,
> SPI, UART, Ethernet, etc.) while adding CX7200-specific hardware
> components.

> +    /* Find A9MPCore and set timer frequencies directly */
> +    a9mpcore_dev = DEVICE(object_resolve_path_type("", TYPE_A9MPCORE_PRIV,
> +                                                   NULL));
> +    if (a9mpcore_dev) {
> +        a9mp_priv_state = A9MPCORE_PRIV(a9mpcore_dev);
> +
> +        /* Direct struct access - devices are already realized */
> +        a9mp_priv_state->gtimer.freq_hz = CX7200_PS7_CPU_CLK_FREQUENCY;
> +        a9mp_priv_state->gtimer.periphclk_divider = CX7200_PERIPHCLK_DIVIDER;
> +        a9mp_priv_state->mptimer.freq_hz = CX7200_PS7_CPU_CLK_FREQUENCY;
> +        a9mp_priv_state->mptimer.periphclk_divider = 
> CX7200_PERIPHCLK_DIVIDER;
> +        a9mp_priv_state->wdt.freq_hz = CX7200_PS7_CPU_CLK_FREQUENCY;
> +        a9mp_priv_state->wdt.periphclk_divider = CX7200_PERIPHCLK_DIVIDER;

You shouldn't be reaching inside the device's private state
struct fields like this -- please find another way to
configure it with the correct frequency info.

-- PMM

Reply via email to