Skip to content

Commit 3d87f6c

Browse files
committed
Merge tag 'clk-microchip-fixes-6.0' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-fixes
Pull Microchip clock fixes for Polarfire SoCs: - fix panic at boot in clock initialization when building with clang-15 - make RTC's AHB clock critical as rtc will stop if the AHB interface clock is disabled * tag 'clk-microchip-fixes-6.0' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: clk: microchip: mpfs: make the rtc's ahb clock critical clk: microchip: mpfs: fix clk_cfg array bounds violation
2 parents 6726d55 + 05d2709 commit 3d87f6c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/clk/microchip/clk-mpfs.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ static const struct clk_ops mpfs_clk_cfg_ops = {
239239
.hw.init = CLK_HW_INIT(_name, _parent, &mpfs_clk_cfg_ops, 0), \
240240
}
241241

242+
#define CLK_CPU_OFFSET 0u
243+
#define CLK_AXI_OFFSET 1u
244+
#define CLK_AHB_OFFSET 2u
245+
#define CLK_RTCREF_OFFSET 3u
246+
242247
static struct mpfs_cfg_hw_clock mpfs_cfg_clks[] = {
243248
CLK_CFG(CLK_CPU, "clk_cpu", "clk_msspll", 0, 2, mpfs_div_cpu_axi_table, 0,
244249
REG_CLOCK_CONFIG_CR),
@@ -362,14 +367,16 @@ static const struct clk_ops mpfs_periph_clk_ops = {
362367
_flags), \
363368
}
364369

365-
#define PARENT_CLK(PARENT) (&mpfs_cfg_clks[CLK_##PARENT].hw)
370+
#define PARENT_CLK(PARENT) (&mpfs_cfg_clks[CLK_##PARENT##_OFFSET].hw)
366371

367372
/*
368373
* Critical clocks:
369374
* - CLK_ENVM: reserved by hart software services (hss) superloop monitor/m mode interrupt
370375
* trap handler
371376
* - CLK_MMUART0: reserved by the hss
372377
* - CLK_DDRC: provides clock to the ddr subsystem
378+
* - CLK_RTC: the onboard RTC's AHB bus clock must be kept running as the rtc will stop
379+
* if the AHB interface clock is disabled
373380
* - CLK_FICx: these provide the processor side clocks to the "FIC" (Fabric InterConnect)
374381
* clock domain crossers which provide the interface to the FPGA fabric. Disabling them
375382
* causes the FPGA fabric to go into reset.
@@ -394,7 +401,7 @@ static struct mpfs_periph_hw_clock mpfs_periph_clks[] = {
394401
CLK_PERIPH(CLK_CAN0, "clk_periph_can0", PARENT_CLK(AHB), 14, 0),
395402
CLK_PERIPH(CLK_CAN1, "clk_periph_can1", PARENT_CLK(AHB), 15, 0),
396403
CLK_PERIPH(CLK_USB, "clk_periph_usb", PARENT_CLK(AHB), 16, 0),
397-
CLK_PERIPH(CLK_RTC, "clk_periph_rtc", PARENT_CLK(AHB), 18, 0),
404+
CLK_PERIPH(CLK_RTC, "clk_periph_rtc", PARENT_CLK(AHB), 18, CLK_IS_CRITICAL),
398405
CLK_PERIPH(CLK_QSPI, "clk_periph_qspi", PARENT_CLK(AHB), 19, 0),
399406
CLK_PERIPH(CLK_GPIO0, "clk_periph_gpio0", PARENT_CLK(AHB), 20, 0),
400407
CLK_PERIPH(CLK_GPIO1, "clk_periph_gpio1", PARENT_CLK(AHB), 21, 0),

0 commit comments

Comments
 (0)