Commit a5ab04af authored by Tudor Ambarus's avatar Tudor Ambarus Committed by Stephen Boyd

clk: at91: sama7g5: Allow MCK1 to be exported and referenced in DT

MCK1 feeds the External Bus Interface (EBI). EBI's clock rate is used
to translate EBI's timmings to SMC timings, thus we need to handle MCK1
in the EBI driver. Allow MCK1 to be referenced as a PMC_TYPE_CORE clock
from phandle in DT.
Signed-off-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20220111125310.902856-1-tudor.ambarus@microchip.comReviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent ea2be22f
...@@ -302,6 +302,7 @@ static const struct { ...@@ -302,6 +302,7 @@ static const struct {
* @ep_count: extra parents count * @ep_count: extra parents count
* @ep_mux_table: mux table for extra parents * @ep_mux_table: mux table for extra parents
* @id: clock id * @id: clock id
* @eid: export index in sama7g5->chws[] array
* @c: true if clock is critical and cannot be disabled * @c: true if clock is critical and cannot be disabled
*/ */
static const struct { static const struct {
...@@ -311,6 +312,7 @@ static const struct { ...@@ -311,6 +312,7 @@ static const struct {
u8 ep_count; u8 ep_count;
u8 ep_mux_table[4]; u8 ep_mux_table[4];
u8 id; u8 id;
u8 eid;
u8 c; u8 c;
} sama7g5_mckx[] = { } sama7g5_mckx[] = {
{ .n = "mck1", { .n = "mck1",
...@@ -319,6 +321,7 @@ static const struct { ...@@ -319,6 +321,7 @@ static const struct {
.ep_mux_table = { 5, }, .ep_mux_table = { 5, },
.ep_count = 1, .ep_count = 1,
.ep_chg_id = INT_MIN, .ep_chg_id = INT_MIN,
.eid = PMC_MCK1,
.c = 1, }, .c = 1, },
{ .n = "mck2", { .n = "mck2",
...@@ -913,7 +916,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np) ...@@ -913,7 +916,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
if (IS_ERR(regmap)) if (IS_ERR(regmap))
return; return;
sama7g5_pmc = pmc_data_allocate(PMC_CPU + 1, sama7g5_pmc = pmc_data_allocate(PMC_MCK1 + 1,
nck(sama7g5_systemck), nck(sama7g5_systemck),
nck(sama7g5_periphck), nck(sama7g5_periphck),
nck(sama7g5_gck), 8); nck(sama7g5_gck), 8);
...@@ -1027,6 +1030,9 @@ static void __init sama7g5_pmc_setup(struct device_node *np) ...@@ -1027,6 +1030,9 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
goto err_free; goto err_free;
alloc_mem[alloc_mem_size++] = mux_table; alloc_mem[alloc_mem_size++] = mux_table;
if (sama7g5_mckx[i].eid)
sama7g5_pmc->chws[sama7g5_mckx[i].eid] = hw;
} }
hw = at91_clk_sama7g5_register_utmi(regmap, "utmick", "main_xtal"); hw = at91_clk_sama7g5_register_utmi(regmap, "utmick", "main_xtal");
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define PMC_AUDIOIOPLL (PMC_MAIN + 7) #define PMC_AUDIOIOPLL (PMC_MAIN + 7)
#define PMC_ETHPLL (PMC_MAIN + 8) #define PMC_ETHPLL (PMC_MAIN + 8)
#define PMC_CPU (PMC_MAIN + 9) #define PMC_CPU (PMC_MAIN + 9)
#define PMC_MCK1 (PMC_MAIN + 10)
#ifndef AT91_PMC_MOSCS #ifndef AT91_PMC_MOSCS
#define AT91_PMC_MOSCS 0 /* MOSCS Flag */ #define AT91_PMC_MOSCS 0 /* MOSCS Flag */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment