On Thu, Jan 31, 2019 at 10:40 AM Simon Horman <horms+renesas@xxxxxxxxxxxx> wrote: > Support Z and Z2 clocks with parent frequencies greater than > UINT32_MAX Hz (~4.29GHz). > > The DIV_ROUND_CLOSEST_ULL() macro accepts a 64bit numerator and 32bit > denominator. This leads to truncation of the numerator, which is the Z or > Z2 parent clock frequency in HZ, on platforms where frequency of that clock > is greater than UINT32_MAX Hz. > > To resolve this problem the DIV_ROUND_CLOSEST() macro, which accepts the > prevailing types of the numerator and denominator, is used. In this case > the type of the numerator is unsigned long long (64 bit) and the type of > the denominator is unsigned long (64bit on 64bit platforms and 32bit on > 32bit platforms). This allows parents whose frequency is greater than > UINT32_MAX Hz on 64bit platforms. > > This appears to be sufficient as this driver is only intended for use > on 64bit systems. And in particular, the motivation for this change is > to allow a 4.8GHz clock on the R-Car Gen3 E3 (r8a77990) SoC which is > a 64bit platform. > > Signed-off-by: Simon Horman <horms+renesas@xxxxxxxxxxxx> 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