From: Andrew Lunn <andrew@lunn.ch>
To: Wen Gu <guwen@linux.alibaba.com>
Cc: richardcochran@gmail.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, xuanzhuo@linux.alibaba.com,
dust.li@linux.alibaba.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2] ptp: add Alibaba CIPU PTP clock driver
Date: Fri, 27 Jun 2025 09:46:26 +0200 [thread overview]
Message-ID: <69ee8a60-3134-4b7a-8217-be9bbc79a8fa@lunn.ch> (raw)
In-Reply-To: <20250627072921.52754-1-guwen@linux.alibaba.com>
> +#define DRV_VER_MAJOR 1
> +#define DRV_VER_MINOR 3
> +#define DRV_VER_SUBMINOR 0
> +#define LINUX_UPSTREAM 0x1F
> +static int ptp_cipu_set_drv_version(struct ptp_cipu_ctx *ptp_ctx)
> +{
> + struct ptp_cipu_regs *regs = &ptp_ctx->regs;
> + int version, patchlevel, sublevel;
> + u32 env_ver, drv_ver;
> + int rc;
> +
> + if (sscanf(utsname()->release, "%u.%u.%u",
> + &version, &patchlevel, &sublevel) != 3)
> + return -EINVAL;
> + sublevel = sublevel < 0xFF ? sublevel : 0xFF;
> +
> + env_ver = (LINUX_UPSTREAM << 27) | (version << 16) |
> + (patchlevel << 8) | sublevel;
> +
> + rc = cipu_iowrite32_and_check(ptp_ctx->reg_addr +
> + PTP_CIPU_REG(env_ver),
> + env_ver, ®s->env_ver);
> + if (rc)
> + return rc;
> +
> + drv_ver = (DRV_TYPE << 24) | (DRV_VER_MAJOR << 16) |
> + (DRV_VER_MINOR << 8) | DRV_VER_SUBMINOR;
> +
> + return cipu_iowrite32_and_check(ptp_ctx->reg_addr +
> + PTP_CIPU_REG(drv_ver), drv_ver,
> + ®s->drv_ver);
> +}
Please could you explain what this is doing.
Andrew
next prev parent reply other threads:[~2025-06-27 7:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 7:29 Wen Gu
2025-06-27 7:46 ` Andrew Lunn [this message]
2025-06-30 9:04 ` Wen Gu
2025-06-27 7:57 ` Andrew Lunn
2025-06-27 10:59 ` Vadim Fedorenko
2025-06-30 11:23 ` Wen Gu
2025-06-30 13:42 ` Richard Cochran
2025-06-30 12:45 ` Wen Gu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=69ee8a60-3134-4b7a-8217-be9bbc79a8fa@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dust.li@linux.alibaba.com \
--cc=edumazet@google.com \
--cc=guwen@linux.alibaba.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®