]> git.baikalelectronics.ru Git - uboot.git/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)
commiteadf94c919e3213746521e4c333114ddb25c2880
tree8d378511c850861725f80b68c4637de7e7890457
parent2439dd5260859976c9c4d8aef9eb55126183a323
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