Merge tag 'clk-microchip-6.14' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-microchip

Pull Microchip clk driver updates from Claudiu Beznea:

 - Support for the SAMA7D65 SoC
 - Clock IDs for for the slow clock controller

* tag 'clk-microchip-6.14' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  clk: at91: sama7d65: add sama7d65 pmc driver
  dt-bindings: clock: Add SAMA7D65 PMC compatible string
  dt-bindings: clocks: atmel,at91sam9x5-sckc: add sama7d65
  clk: at91: sckc: Use SCKC_{TD, MD}_SLCK IDs for clk32k clocks
  dt-bindings: clk: at91: Add clock IDs for the slow clock controller
This commit is contained in:
Stephen Boyd
2025-01-07 11:37:05 -08:00
9 changed files with 1403 additions and 13 deletions
@@ -43,6 +43,7 @@ properties:
- atmel,sama5d4-pmc
- microchip,sam9x60-pmc
- microchip,sam9x7-pmc
- microchip,sama7d65-pmc
- microchip,sama7g5-pmc
- const: syscon
@@ -90,6 +91,7 @@ allOf:
enum:
- microchip,sam9x60-pmc
- microchip,sam9x7-pmc
- microchip,sama7d65-pmc
- microchip,sama7g5-pmc
then:
properties:
@@ -20,6 +20,7 @@ properties:
- items:
- enum:
- microchip,sam9x7-sckc
- microchip,sama7d65-sckc
- microchip,sama7g5-sckc
- const: microchip,sam9x60-sckc
+1
View File
@@ -24,4 +24,5 @@ obj-$(CONFIG_SOC_SAM9X7) += sam9x7.o
obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o dt-compat.o
obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o dt-compat.o
obj-$(CONFIG_SOC_SAMA5D2) += sama5d2.o dt-compat.o
obj-$(CONFIG_SOC_SAMA7D65) += sama7d65.o
obj-$(CONFIG_SOC_SAMA7G5) += sama7g5.o
+1 -1
View File
@@ -20,7 +20,7 @@
#define PMC_MCR_CSS_SHIFT (16)
#define MASTER_MAX_ID 4
#define MASTER_MAX_ID 9
#define to_clk_master(hw) container_of(hw, struct clk_master, hw)
+1 -1
View File
@@ -23,7 +23,7 @@
#define UPLL_DIV 2
#define PLL_MUL_MAX (FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, UINT_MAX) + 1)
#define PLL_MAX_ID 7
#define PLL_MAX_ID 9
struct sam9x60_pll_core {
struct regmap *regmap;
+1
View File
@@ -151,6 +151,7 @@ static struct syscore_ops pmc_syscore_ops = {
static const struct of_device_id pmc_dt_ids[] = {
{ .compatible = "atmel,sama5d2-pmc" },
{ .compatible = "microchip,sama7g5-pmc", },
{ .compatible = "microchip,sama7d65-pmc", },
{ /* sentinel */ }
};
File diff suppressed because it is too large Load Diff
+13 -11
View File
@@ -12,6 +12,8 @@
#include <linux/of_address.h>
#include <linux/io.h>
#include <dt-bindings/clock/at91.h>
#define SLOW_CLOCK_FREQ 32768
#define SLOWCK_SW_CYCLES 5
#define SLOWCK_SW_TIME_USEC ((SLOWCK_SW_CYCLES * USEC_PER_SEC) / \
@@ -470,7 +472,7 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np)
{
void __iomem *regbase = of_iomap(np, 0);
struct clk_hw_onecell_data *clk_data;
struct clk_hw *slow_rc, *slow_osc;
struct clk_hw *slow_rc, *slow_osc, *hw;
const char *xtal_name;
const struct clk_hw *parent_hws[2];
static struct clk_parent_data parent_data = {
@@ -506,19 +508,19 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np)
/* MD_SLCK and TD_SLCK. */
clk_data->num = 2;
clk_data->hws[0] = clk_hw_register_fixed_rate_parent_hw(NULL, "md_slck",
slow_rc,
0, 32768);
if (IS_ERR(clk_data->hws[0]))
hw = clk_hw_register_fixed_rate_parent_hw(NULL, "md_slck", slow_rc,
0, 32768);
if (IS_ERR(hw))
goto clk_data_free;
clk_data->hws[SCKC_MD_SLCK] = hw;
parent_hws[0] = slow_rc;
parent_hws[1] = slow_osc;
clk_data->hws[1] = at91_clk_register_sam9x5_slow(regbase, "td_slck",
parent_hws, 2,
&at91sam9x60_bits);
if (IS_ERR(clk_data->hws[1]))
hw = at91_clk_register_sam9x5_slow(regbase, "td_slck", parent_hws,
2, &at91sam9x60_bits);
if (IS_ERR(hw))
goto unregister_md_slck;
clk_data->hws[SCKC_TD_SLCK] = hw;
ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data);
if (WARN_ON(ret))
@@ -527,9 +529,9 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np)
return;
unregister_td_slck:
at91_clk_unregister_sam9x5_slow(clk_data->hws[1]);
at91_clk_unregister_sam9x5_slow(clk_data->hws[SCKC_TD_SLCK]);
unregister_md_slck:
clk_hw_unregister(clk_data->hws[0]);
clk_hw_unregister(clk_data->hws[SCKC_MD_SLCK]);
clk_data_free:
kfree(clk_data);
unregister_slow_osc:
+8
View File
@@ -42,6 +42,10 @@
#define PMC_PLLADIV2 (PMC_MAIN + 11)
#define PMC_LVDSPLL (PMC_MAIN + 12)
/* SAMA7D65 */
#define PMC_MCK3 (PMC_MAIN + 13)
#define PMC_MCK5 (PMC_MAIN + 14)
#ifndef AT91_PMC_MOSCS
#define AT91_PMC_MOSCS 0 /* MOSCS Flag */
#define AT91_PMC_LOCKA 1 /* PLLA Lock */
@@ -55,4 +59,8 @@
#define AT91_PMC_GCKRDY 24 /* Generated Clocks */
#endif
/* Slow clock. */
#define SCKC_MD_SLCK 0
#define SCKC_TD_SLCK 1
#endif