]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
clk-bcm2835: Read max core clock from firmware
authorPhil Elwell <phil@raspberrypi.org>
Mon, 6 Mar 2017 09:06:18 +0000 (09:06 +0000)
committerJuerg Haefliger <juerg.haefliger@canonical.com>
Thu, 29 Jun 2017 13:15:04 +0000 (15:15 +0200)
commitee35ab8e8e0222c361fa5c55d364a86a8c638480
tree7c1152483c07858118f93f227e094fb64d00ead2
parent8c205ade427df62254f3e9d2fa02f9d8e195eff7
clk-bcm2835: Read max core clock from firmware

The VPU is responsible for managing the core clock, usually under
direction from the bcm2835-cpufreq driver but not via the clk-bcm2835
driver. Since the core frequency can change without warning, it is
safer to report the maximum clock rate to users of the core clock -
I2C, SPI and the mini UART - to err on the safe side when calculating
clock divisors.

If the DT node for the clock driver includes a reference to the
firmware node, use the firmware API to query the maximum core clock
instead of reading the divider registers.

Prior to this patch, a "100KHz" I2C bus was sometimes clocked at about
160KHz. In particular, switching to the 4.9 kernel was likely to break
SenseHAT usage on a Pi3.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/arm/boot/dts/bcm2708-rpi.dtsi
drivers/clk/bcm/clk-bcm2835.c