[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 08/18] hw/arm/fsl-imx8mp: Add PCIe support
From: |
Bernhard Beschow |
Subject: |
Re: [PATCH v2 08/18] hw/arm/fsl-imx8mp: Add PCIe support |
Date: |
Mon, 17 Feb 2025 16:33:20 +0000 |
Am 17. Februar 2025 13:40:48 UTC schrieb Peter Maydell
<peter.maydell@linaro.org>:
>On Tue, 4 Feb 2025 at 09:21, Bernhard Beschow <shentey@gmail.com> wrote:
>>
>> Linux checks for the PLLs in the PHY to be locked, so implement a model
>> emulating that.
>>
>> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>> ---
>
>> +static const VMStateDescription fsl_imx8m_pcie_phy_vmstate = {
>> + .name = "fsl-imx8m-pcie-phy",
>> + .version_id = 1,
>> + .minimum_version_id = 1,
>> + .fields = (const VMStateField[]) {
>> + VMSTATE_UINT8_ARRAY(data, FslImx8mPciePhyState,
>> + ARRAY_SIZE(((FslImx8mPciePhyState
>> *)NULL)->data)),
>
>Use a defined constant for the number of array elements, please.
>We don't do this thing with ARRAY_SIZE of a cast NULL pointer
>anywhere else in the codebase.
Ack -- will change to a named constant. I think I took inspiration from
<https://gitlab.com/qemu-project/qemu/-/blob/v9.2.1/hw/scsi/vmw_pvscsi.c?ref_type=tags#L1276>
>
>> + VMSTATE_END_OF_LIST()
>> + }
>> +};
>> +
>> +static void fsl_imx8m_pcie_phy_class_init(ObjectClass *klass, void *data)
>> +{
>> + DeviceClass *dc = DEVICE_CLASS(klass);
>> +
>> + dc->realize = fsl_imx8m_pcie_phy_realize;
>> + dc->vmsd = &fsl_imx8m_pcie_phy_vmstate;
>> +}
>
>This is missing the reset method.
Indeed. I'll add it.
Thanks for the review,
Bernhard
>
>thanks
>-- PMM
- Re: [PATCH v2 04/18] hw/arm: Add i.MX 8M Plus EVK board, (continued)
- [PATCH v2 05/18] hw/arm/fsl-imx8mp: Implement clock tree, Bernhard Beschow, 2025/02/04
- [PATCH v2 07/18] hw/arm/fsl-imx8mp: Add USDHC storage controllers, Bernhard Beschow, 2025/02/04
- [PATCH v2 09/18] hw/arm/fsl-imx8mp: Add GPIO controllers, Bernhard Beschow, 2025/02/04
- [PATCH v2 08/18] hw/arm/fsl-imx8mp: Add PCIe support, Bernhard Beschow, 2025/02/04
- [PATCH v2 10/18] hw/arm/fsl-imx8mp: Add I2C controllers, Bernhard Beschow, 2025/02/04
- [PATCH v2 12/18] hw/arm/fsl-imx8mp: Add watchdog support, Bernhard Beschow, 2025/02/04
- [PATCH v2 11/18] hw/arm/fsl-imx8mp: Add SPI controllers, Bernhard Beschow, 2025/02/04
- [PATCH v2 13/18] hw/arm/fsl-imx8mp: Implement gneral purpose timers, Bernhard Beschow, 2025/02/04
- [PATCH v2 14/18] hw/arm/fsl-imx8mp: Add Ethernet controller, Bernhard Beschow, 2025/02/04