]> git.sur5r.net Git - u-boot/commit
powerpc, 8xx: Simplify brgclk calculation and remove get_brgclk()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 13 Jul 2017 13:09:44 +0000 (15:09 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 23 Jul 2017 02:22:47 +0000 (22:22 -0400)
commit7a0a550c7f0cc1ca1e510c47c45e474122789bd6
tree8d378511c850861725f80b68c4637de7e7890457
parentb2f2c7be3429ad4dc9b242b85a7e87e0ded0487a
powerpc, 8xx: Simplify brgclk calculation and remove get_brgclk()

divider is calculated based on SCCR_DFBRG, with:
SCCR_DFBRG 00 => divider 1  = 1 << 0
SCCR_DFBRG 01 => divider 4  = 1 << 2
SCCR_DFBRG 10 => divider 16 = 1 << 4
SCCR_DFBRG 11 => divider 64 = 1 << 6

This can be easily converted to a single shift operation:
divider = 1 << (SCCR_DFBRG * 2)

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
arch/powerpc/cpu/mpc8xx/speed.c