Skip to content

Commit 6629108

Browse files
committed
Merge branches 'clk-amlogic', 'clk-microchip' and 'clk-imx' into clk-next
* clk-amlogic: clk: meson: introduce symbol namespace for amlogic clocks clk: meson: axg-audio: add sm1 earcrx clocks clk: meson: axg-audio: setup regmap max_register based on the SoC dt-bindings: clock: axg-audio: add earcrx clock ids clk: meson: s4: pll: Constify struct regmap_config clk: meson: s4: peripherals: Constify struct regmap_config clk: meson: c3: pll: Constify struct regmap_config clk: meson: c3: peripherals: Constify struct regmap_config clk: meson: a1: pll: Constify struct regmap_config clk: meson: a1: peripherals: Constify struct regmap_config * clk-microchip: clk: at91: sama7g5: Allocate only the needed amount of memory for PLLs clk: at91: sam9x7: add sam9x7 pmc driver dt-bindings: clock: at91: Allow PLLs to be exported and referenced in DT clk: at91: sama7g5: move mux table macros to header file clk: at91: sam9x7: add support for HW PLL freq dividers clk: at91: clk-sam9x60-pll: re-factor to support individual core freq outputs dt-bindings: clocks: atmel,at91rm9200-pmc: add sam9x7 clock controller dt-bindings: clocks: atmel,at91sam9x5-sckc: add sam9x7 * clk-imx: (27 commits) clk: imx6ul: fix clock parent for IMX6UL_CLK_ENETx_REF_SEL clk: imx95: enable the clock of NETCMIX block control dt-bindings: clock: add RMII clock selection dt-bindings: clock: add i.MX95 NETCMIX block control clk: imx: imx8: Use clk_hw pointer for self registered clock in clk_parent_data clk: imx: composite-7ulp: Use NULL instead of 0 clk: imx: add missing MODULE_DESCRIPTION() macros clk: imx: clk-imx8mp: Allow media_disp pixel clock reconfigure parent rate clk: imx: fracn-gppll: update rate table clk: imx: imx8qxp: Parent should be initialized earlier than the clock clk: imx: imx8qxp: Register dc0_bypass0_clk before disp clk clk: imx: imx8qxp: Add clock muxes for MIPI and PHY ref clocks clk: imx: imx8qxp: Add LVDS bypass clocks clk: imx: imx8mm: Change the 'nand_usdhc_bus' clock to non-critical one clk: imx: imx8mn: add sai7_ipg_clk clock settings clk: imx: add CLK_SET_RATE_PARENT for lcdif_pixel_src for i.MX7D clk: imx: Remove CLK_SET_PARENT_GATE for DRAM mux for i.MX7D clk: imx: imx8mp: fix clock tree update of TF-A managed clocks clk: imx: fracn-gppll: fix fractional part of PLL getting lost clk: imx: composite-7ulp: Check the PCC present bit ...
4 parents c7183ff + 554bc24 + 1d777b0 + a09e3cf commit 6629108

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1395
-130
lines changed

Documentation/devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ properties:
4242
- atmel,sama5d3-pmc
4343
- atmel,sama5d4-pmc
4444
- microchip,sam9x60-pmc
45+
- microchip,sam9x7-pmc
4546
- microchip,sama7g5-pmc
4647
- const: syscon
4748

@@ -88,6 +89,7 @@ allOf:
8889
contains:
8990
enum:
9091
- microchip,sam9x60-pmc
92+
- microchip,sam9x7-pmc
9193
- microchip,sama7g5-pmc
9294
then:
9395
properties:

Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ properties:
1818
- atmel,sama5d4-sckc
1919
- microchip,sam9x60-sckc
2020
- items:
21-
- const: microchip,sama7g5-sckc
21+
- enum:
22+
- microchip,sam9x7-sckc
23+
- microchip,sama7g5-sckc
2224
- const: microchip,sam9x60-sckc
2325

2426
reg:

Documentation/devicetree/bindings/clock/imx8mp-audiomix.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ properties:
4444
ID in its "clocks" phandle cell. See include/dt-bindings/clock/imx8mp-clock.h
4545
for the full list of i.MX8MP IMX8MP_CLK_AUDIOMIX_ clock IDs.
4646

47+
'#reset-cells':
48+
const: 1
49+
4750
required:
4851
- compatible
4952
- reg

Documentation/devicetree/bindings/clock/nxp,imx95-blk-ctl.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ properties:
1616
- nxp,imx95-lvds-csr
1717
- nxp,imx95-display-csr
1818
- nxp,imx95-camera-csr
19+
- nxp,imx95-netcmix-blk-ctrl
1920
- nxp,imx95-vpu-csr
2021
- const: syscon
2122

drivers/clk/at91/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ obj-$(CONFIG_SOC_AT91SAM9) += at91sam9260.o at91sam9rl.o at91sam9x5.o dt-compat.
2020
obj-$(CONFIG_SOC_AT91SAM9) += at91sam9g45.o dt-compat.o
2121
obj-$(CONFIG_SOC_AT91SAM9) += at91sam9n12.o at91sam9x5.o dt-compat.o
2222
obj-$(CONFIG_SOC_SAM9X60) += sam9x60.o
23+
obj-$(CONFIG_SOC_SAM9X7) += sam9x7.o
2324
obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o dt-compat.o
2425
obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o dt-compat.o
2526
obj-$(CONFIG_SOC_SAMA5D2) += sama5d2.o dt-compat.o

drivers/clk/at91/clk-sam9x60-pll.c

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
#define UPLL_DIV 2
2424
#define PLL_MUL_MAX (FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, UINT_MAX) + 1)
2525

26-
#define FCORE_MIN (600000000)
27-
#define FCORE_MAX (1200000000)
28-
2926
#define PLL_MAX_ID 7
3027

3128
struct sam9x60_pll_core {
@@ -76,9 +73,15 @@ static unsigned long sam9x60_frac_pll_recalc_rate(struct clk_hw *hw,
7673
{
7774
struct sam9x60_pll_core *core = to_sam9x60_pll_core(hw);
7875
struct sam9x60_frac *frac = to_sam9x60_frac(core);
76+
unsigned long freq;
7977

80-
return parent_rate * (frac->mul + 1) +
78+
freq = parent_rate * (frac->mul + 1) +
8179
DIV_ROUND_CLOSEST_ULL((u64)parent_rate * frac->frac, (1 << 22));
80+
81+
if (core->layout->div2)
82+
freq >>= 1;
83+
84+
return freq;
8285
}
8386

8487
static int sam9x60_frac_pll_set(struct sam9x60_pll_core *core)
@@ -194,7 +197,8 @@ static long sam9x60_frac_pll_compute_mul_frac(struct sam9x60_pll_core *core,
194197
unsigned long nmul = 0;
195198
unsigned long nfrac = 0;
196199

197-
if (rate < FCORE_MIN || rate > FCORE_MAX)
200+
if (rate < core->characteristics->core_output[0].min ||
201+
rate > core->characteristics->core_output[0].max)
198202
return -ERANGE;
199203

200204
/*
@@ -214,7 +218,8 @@ static long sam9x60_frac_pll_compute_mul_frac(struct sam9x60_pll_core *core,
214218
}
215219

216220
/* Check if resulted rate is a valid. */
217-
if (tmprate < FCORE_MIN || tmprate > FCORE_MAX)
221+
if (tmprate < core->characteristics->core_output[0].min ||
222+
tmprate > core->characteristics->core_output[0].max)
218223
return -ERANGE;
219224

220225
if (update) {
@@ -433,6 +438,12 @@ static unsigned long sam9x60_div_pll_recalc_rate(struct clk_hw *hw,
433438
return DIV_ROUND_CLOSEST_ULL(parent_rate, (div->div + 1));
434439
}
435440

441+
static unsigned long sam9x60_fixed_div_pll_recalc_rate(struct clk_hw *hw,
442+
unsigned long parent_rate)
443+
{
444+
return parent_rate >> 1;
445+
}
446+
436447
static long sam9x60_div_pll_compute_div(struct sam9x60_pll_core *core,
437448
unsigned long *parent_rate,
438449
unsigned long rate)
@@ -607,6 +618,16 @@ static const struct clk_ops sam9x60_div_pll_ops_chg = {
607618
.restore_context = sam9x60_div_pll_restore_context,
608619
};
609620

621+
static const struct clk_ops sam9x60_fixed_div_pll_ops = {
622+
.prepare = sam9x60_div_pll_prepare,
623+
.unprepare = sam9x60_div_pll_unprepare,
624+
.is_prepared = sam9x60_div_pll_is_prepared,
625+
.recalc_rate = sam9x60_fixed_div_pll_recalc_rate,
626+
.round_rate = sam9x60_div_pll_round_rate,
627+
.save_context = sam9x60_div_pll_save_context,
628+
.restore_context = sam9x60_div_pll_restore_context,
629+
};
630+
610631
struct clk_hw * __init
611632
sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock,
612633
const char *name, const char *parent_name,
@@ -669,7 +690,8 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock,
669690
goto free;
670691
}
671692

672-
ret = sam9x60_frac_pll_compute_mul_frac(&frac->core, FCORE_MIN,
693+
ret = sam9x60_frac_pll_compute_mul_frac(&frac->core,
694+
characteristics->core_output[0].min,
673695
parent_rate, true);
674696
if (ret < 0) {
675697
hw = ERR_PTR(ret);
@@ -725,10 +747,14 @@ sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock,
725747
else
726748
init.parent_names = &parent_name;
727749
init.num_parents = 1;
728-
if (flags & CLK_SET_RATE_GATE)
750+
751+
if (layout->div2)
752+
init.ops = &sam9x60_fixed_div_pll_ops;
753+
else if (flags & CLK_SET_RATE_GATE)
729754
init.ops = &sam9x60_div_pll_ops;
730755
else
731756
init.ops = &sam9x60_div_pll_ops_chg;
757+
732758
init.flags = flags;
733759

734760
div->core.id = id;

drivers/clk/at91/pmc.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ struct clk_pll_layout {
6464
u8 frac_shift;
6565
u8 div_shift;
6666
u8 endiv_shift;
67+
u8 div2;
6768
};
6869

6970
extern const struct clk_pll_layout at91rm9200_pll_layout;
@@ -75,6 +76,7 @@ struct clk_pll_characteristics {
7576
struct clk_range input;
7677
int num_output;
7778
const struct clk_range *output;
79+
const struct clk_range *core_output;
7880
u16 *icpll;
7981
u8 *out;
8082
u8 upll : 1;
@@ -119,6 +121,22 @@ struct at91_clk_pms {
119121

120122
#define ndck(a, s) (a[s - 1].id + 1)
121123
#define nck(a) (a[ARRAY_SIZE(a) - 1].id + 1)
124+
125+
#define PMC_INIT_TABLE(_table, _count) \
126+
do { \
127+
u8 _i; \
128+
for (_i = 0; _i < (_count); _i++) \
129+
(_table)[_i] = _i; \
130+
} while (0)
131+
132+
#define PMC_FILL_TABLE(_to, _from, _count) \
133+
do { \
134+
u8 _i; \
135+
for (_i = 0; _i < (_count); _i++) { \
136+
(_to)[_i] = (_from)[_i]; \
137+
} \
138+
} while (0)
139+
122140
struct pmc_data *pmc_data_allocate(unsigned int ncore, unsigned int nsystem,
123141
unsigned int nperiph, unsigned int ngck,
124142
unsigned int npck);

drivers/clk/at91/sam9x60.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ static const struct clk_range plla_outputs[] = {
2626
{ .min = 2343750, .max = 1200000000 },
2727
};
2828

29+
/* Fractional PLL core output range. */
30+
static const struct clk_range core_outputs[] = {
31+
{ .min = 600000000, .max = 1200000000 },
32+
};
33+
2934
static const struct clk_pll_characteristics plla_characteristics = {
3035
.input = { .min = 12000000, .max = 48000000 },
3136
.num_output = ARRAY_SIZE(plla_outputs),
3237
.output = plla_outputs,
38+
.core_output = core_outputs,
3339
};
3440

3541
static const struct clk_range upll_outputs[] = {
@@ -40,6 +46,7 @@ static const struct clk_pll_characteristics upll_characteristics = {
4046
.input = { .min = 12000000, .max = 48000000 },
4147
.num_output = ARRAY_SIZE(upll_outputs),
4248
.output = upll_outputs,
49+
.core_output = core_outputs,
4350
.upll = true,
4451
};
4552

0 commit comments

Comments
 (0)