Re: [PATCH v2 2/4] soc: renesas: r8a779a0-sysc: Add r8a779a0 support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Shimoda-san,

On Thu, Sep 10, 2020 at 2:03 PM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@xxxxxxxxxxx> wrote:
> Add support for R-Car V3U (R8A779A0) SoC power areas and
> register access, because register specification differs
> from R-Car Gen2/3.
>
> Inspired by patches in the BSP by Tho Vu.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>

Thanks for the update!

> --- /dev/null
> +++ b/drivers/soc/renesas/r8a779a0-sysc.c

> +#define R8A779A0_PD_ALWAYS_ON  64      /* Always-on power area */

This can be dropped, as it's already defined in the bindings header.

> +static int r8a779a0_sysc_pwr_on_off(u8 pdr, bool on)
> +{
> +       unsigned int reg_offs;
> +       u32 val;
> +       int ret;
> +
> +       if (on)
> +               reg_offs = PDRONCR(pdr);
> +       else
> +               reg_offs = PDROFFCR(pdr);
> +
> +       /* Wait until SYSC is ready to accept a power request */
> +       ret = readl_poll_timeout_atomic(r8a779a0_sysc_base + SYSCSR, val,
> +                                       (val & SYSCSR_BUSY) == SYSCSR_BUSY,
> +                                       SYSCSR_DELAY_US, SYSCSR_RETRIES);

Please note the semantics of SYSCSR_RETRIES have changed,
compared to the old loop.
Before, it was the maximum number of retries of 10 µs each.
Now it is the maximum timeout in µs.
Perhaps

    #define SYSCSR_RETRIES          1000

should be replaced by

    #define SYSCSR_TIMEOUT          10000

?

Same for SYSCISR_RETRIES.

The rest looks good to me, so
Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux