[PATCH v3 4/7] soc: xilinx: versal-net: Use zynqmp_pm_get_chipid() to get chip revision
Michal Simek
michal.simek at amd.com
Thu Jun 6 16:14:01 CEST 2024
On 6/4/24 16:27, lukas.funke-oss at weidmueller.com wrote:
> From: Lukas Funke <lukas.funke at weidmueller.com>
>
> Use common zynqmp_pm_get_chipid() function to get the chip revision
>
> Signed-off-by: Lukas Funke <lukas.funke at weidmueller.com>
> ---
>
> (no changes since v1)
>
> drivers/soc/soc_xilinx_versal_net.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/soc/soc_xilinx_versal_net.c b/drivers/soc/soc_xilinx_versal_net.c
> index 146d068bb4a..76467a3bbb5 100644
> --- a/drivers/soc/soc_xilinx_versal_net.c
> +++ b/drivers/soc/soc_xilinx_versal_net.c
> @@ -47,23 +47,22 @@ static const struct soc_ops soc_xilinx_versal_net_ops = {
> static int soc_xilinx_versal_net_probe(struct udevice *dev)
> {
> struct soc_xilinx_versal_net_priv *priv = dev_get_priv(dev);
> - u32 ret_payload[PAYLOAD_ARG_CNT];
> + u32 idcode, version;
> int ret;
>
> priv->family = versal_family;
>
> - if (IS_ENABLED(CONFIG_ZYNQMP_FIRMWARE)) {
> - ret = xilinx_pm_request(PM_GET_CHIPID, 0, 0, 0, 0,
> - ret_payload);
> + if (CONFIG_IS_ENABLED(ZYNQMP_FIRMWARE)) {
> + ret = zynqmp_pm_get_chipid(&idcode, &version);
> if (ret)
> return ret;
> } else {
> - ret_payload[2] = readl(PMC_TAP_VERSION);
> - if (!ret_payload[2])
> + version = readl(PMC_TAP_VERSION);
> + if (!version)
> return -EINVAL;
> }
>
> - priv->revision = FIELD_GET(PS_VERSION_MASK, ret_payload[2]);
> + priv->revision = FIELD_GET(PS_VERSION_MASK, version);
>
> return 0;
> }
Reviewed-by: Michal Simek <michal.simek at amd.com>
Thanks,
Michal
More information about the U-Boot
mailing list