Re: [PATCH net-next v2 1/1] ptp: clockmatrix: support 32-bit address space

From: Simon Horman
Date: Thu Nov 09 2023 - 17:25:19 EST


On Thu, Nov 09, 2023 at 01:13:52PM -0500, Min Li wrote:
> From: Min Li <min.li.xe@xxxxxxxxxxx>
>
> We used to assume 0x2010xxxx address. Now that
> we need to access 0x2011xxxx address, we need
> to support read/write the whole 32-bit address space.
>
> Signed-off-by: Min Li <min.li.xe@xxxxxxxxxxx>
> ---
> - Drop MAX_ABS_WRITE_PHASE_PICOSECONDS advised by Rahul

...

> @@ -62,7 +62,8 @@ static int contains_full_configuration(struct idtcm *idtcm,
> const struct firmware *fw)
> {
> struct idtcm_fwrc *rec = (struct idtcm_fwrc *)fw->data;
> - u16 scratch = IDTCM_FW_REG(idtcm->fw_ver, V520, SCRATCH);
> + u16 scratch = SCSR_ADDR(IDTCM_FW_REG(idtcm->fw_ver, V520, SCRATCH));

Hi Min Li,

I think a similar conversion for scratch in idtcm_load_firmware()
is required.

As flagged by clang-16 W=1, and Smatch.
`
> + u16 gpio_control = SCSR_ADDR(GPIO_USER_CONTROL);
> s32 full_count;
> s32 count = 0;
> u16 regaddr;

...