2020-02-29 08:25:20 +00:00
|
|
|
From cfe0832e8306cd9955f682b7314a5a6fc3b9d514 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Eric Anholt <eric@anholt.net>
|
|
|
|
Date: Thu, 2 May 2019 15:11:05 -0700
|
|
|
|
Subject: [PATCH] clk: bcm2835: Add support for setting leaf clock
|
|
|
|
rates while running.
|
|
|
|
|
|
|
|
As long as you wait for !BUSY, you can do glitch-free updates of clock
|
|
|
|
rate while the clock is running.
|
|
|
|
|
|
|
|
Signed-off-by: Eric Anholt <eric@anholt.net>
|
|
|
|
---
|
|
|
|
drivers/clk/bcm/clk-bcm2835.c | 22 +++++++++++++---------
|
|
|
|
1 file changed, 13 insertions(+), 9 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/clk/bcm/clk-bcm2835.c
|
|
|
|
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
2020-08-21 16:16:42 +00:00
|
|
|
@@ -1114,15 +1114,19 @@ static int bcm2835_clock_set_rate(struct
|
2020-02-29 08:25:20 +00:00
|
|
|
|
|
|
|
spin_lock(&cprman->regs_lock);
|
|
|
|
|
|
|
|
- /*
|
|
|
|
- * Setting up frac support
|
|
|
|
- *
|
|
|
|
- * In principle it is recommended to stop/start the clock first,
|
|
|
|
- * but as we set CLK_SET_RATE_GATE during registration of the
|
|
|
|
- * clock this requirement should be take care of by the
|
|
|
|
- * clk-framework.
|
|
|
|
+ ctl = cprman_read(cprman, data->ctl_reg);
|
|
|
|
+
|
|
|
|
+ /* If the clock is running, we have to pause clock generation while
|
|
|
|
+ * updating the control and div regs. This is glitchless (no clock
|
|
|
|
+ * signals generated faster than the rate) but each reg access is two
|
|
|
|
+ * OSC cycles so the clock will slow down for a moment.
|
|
|
|
*/
|
|
|
|
- ctl = cprman_read(cprman, data->ctl_reg) & ~CM_FRAC;
|
|
|
|
+ if (ctl & CM_ENABLE) {
|
|
|
|
+ cprman_write(cprman, data->ctl_reg, ctl & ~CM_ENABLE);
|
|
|
|
+ bcm2835_clock_wait_busy(clock);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ctl &= ~CM_FRAC;
|
|
|
|
ctl |= (div & CM_DIV_FRAC_MASK) ? CM_FRAC : 0;
|
|
|
|
cprman_write(cprman, data->ctl_reg, ctl);
|
|
|
|
|
kernel: bump 5.4 to 5.4.73
Removed upstreamed patches:
generic/pending-5.4
445-mtd-spinand-gigadevice-Only-one-dummy-byte-in-QUA.patch
446-mtd-spinand-gigadevice-Add-QE-Bit.patch
pistachio/patches-5.4
150-pwm-img-Fix-null-pointer-access-in-probe.patch
Manually rebased:
layerscape/patches-5.4
801-audio-0011-Revert-ASoC-fsl_sai-add-of_match-data.patch
801-audio-0039-MLK-16224-6-ASoC-fsl_sai-fix-DSD-suspend-resume.patch
801-audio-0073-MLK-21957-3-ASoC-fsl_sai-add-bitcount-and-timestamp-.patch
820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch
All modifications made by update_kernel.sh
Build system: x86_64
Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711,
mvebu (mamba, rango), x86_64, ramips/mt7621
Run-tested: ipq806x/R7800, mvebu (mamba, rango), x86_64, ramips (RT-AC57U)
No dmesg regressions, everything functional
Signed-off-by: John Audia <graysky@archlinux.us>
[alter 820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-31 11:35:12 +00:00
|
|
|
@@ -1494,7 +1498,7 @@ static struct clk_hw *bcm2835_register_c
|
2020-02-29 08:25:20 +00:00
|
|
|
init.ops = &bcm2835_vpu_clock_clk_ops;
|
|
|
|
} else {
|
|
|
|
init.ops = &bcm2835_clock_clk_ops;
|
|
|
|
- init.flags |= CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE;
|
|
|
|
+ init.flags |= CLK_SET_PARENT_GATE;
|
|
|
|
|
|
|
|
/* If the clock wasn't actually enabled at boot, it's not
|
|
|
|
* critical.
|