Commit 27cb1c20 authored by Boris BREZILLON's avatar Boris BREZILLON Committed by Nicolas Ferre

clk: at91: rework main clk implementation

AT91 main clk is a clk multiplexer and not a simple fixed rate clk as
currently implemented.

In some SoCs (sam9x5, sama5, sam9g45 families) this multiplexer can
choose among 2 sources: an internal RC oscillator circuit and an
oscillator using an external crystal.

In other Socs (sam9260, rm9200 families) the multiplexer source is
hardcoded to the external crystal oscillator.
Signed-off-by: default avatarBoris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: default avatarMike Turquette <mturquette@linaro.org>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
parent cf2e933c
This diff is collapsed.
...@@ -230,10 +230,22 @@ static struct at91_pmc *__init at91_pmc_init(struct device_node *np, ...@@ -230,10 +230,22 @@ static struct at91_pmc *__init at91_pmc_init(struct device_node *np,
static const struct of_device_id pmc_clk_ids[] __initconst = { static const struct of_device_id pmc_clk_ids[] __initconst = {
/* Main clock */ /* Main clock */
{
.compatible = "atmel,at91rm9200-clk-main-osc",
.data = of_at91rm9200_clk_main_osc_setup,
},
{
.compatible = "atmel,at91sam9x5-clk-main-rc-osc",
.data = of_at91sam9x5_clk_main_rc_osc_setup,
},
{ {
.compatible = "atmel,at91rm9200-clk-main", .compatible = "atmel,at91rm9200-clk-main",
.data = of_at91rm9200_clk_main_setup, .data = of_at91rm9200_clk_main_setup,
}, },
{
.compatible = "atmel,at91sam9x5-clk-main",
.data = of_at91sam9x5_clk_main_setup,
},
/* PLL clocks */ /* PLL clocks */
{ {
.compatible = "atmel,at91rm9200-clk-pll", .compatible = "atmel,at91rm9200-clk-pll",
......
...@@ -58,8 +58,14 @@ static inline void pmc_write(struct at91_pmc *pmc, int offset, u32 value) ...@@ -58,8 +58,14 @@ static inline void pmc_write(struct at91_pmc *pmc, int offset, u32 value)
int of_at91_get_clk_range(struct device_node *np, const char *propname, int of_at91_get_clk_range(struct device_node *np, const char *propname,
struct clk_range *range); struct clk_range *range);
extern void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np,
struct at91_pmc *pmc);
extern void __init of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np,
struct at91_pmc *pmc);
extern void __init of_at91rm9200_clk_main_setup(struct device_node *np, extern void __init of_at91rm9200_clk_main_setup(struct device_node *np,
struct at91_pmc *pmc); struct at91_pmc *pmc);
extern void __init of_at91sam9x5_clk_main_setup(struct device_node *np,
struct at91_pmc *pmc);
extern void __init of_at91rm9200_clk_pll_setup(struct device_node *np, extern void __init of_at91rm9200_clk_pll_setup(struct device_node *np,
struct at91_pmc *pmc); struct at91_pmc *pmc);
......
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