Merge branch 'clk-fixes' into clk-next
This commit is contained in:
Коммит
dae7df47ab
|
@ -211,7 +211,7 @@ static inline void spear310_clk_init(void) { }
|
||||||
/* array of all spear 320 clock lookups */
|
/* array of all spear 320 clock lookups */
|
||||||
#ifdef CONFIG_MACH_SPEAR320
|
#ifdef CONFIG_MACH_SPEAR320
|
||||||
|
|
||||||
#define SPEAR320_CONTROL_REG (soc_config_base + 0x0000)
|
#define SPEAR320_CONTROL_REG (soc_config_base + 0x0010)
|
||||||
#define SPEAR320_EXT_CTRL_REG (soc_config_base + 0x0018)
|
#define SPEAR320_EXT_CTRL_REG (soc_config_base + 0x0018)
|
||||||
|
|
||||||
#define SPEAR320_UARTX_PCLK_MASK 0x1
|
#define SPEAR320_UARTX_PCLK_MASK 0x1
|
||||||
|
@ -245,7 +245,8 @@ static const char *smii0_parents[] = { "smii_125m_pad", "ras_pll2_clk",
|
||||||
"ras_syn0_gclk", };
|
"ras_syn0_gclk", };
|
||||||
static const char *uartx_parents[] = { "ras_syn1_gclk", "ras_apb_clk", };
|
static const char *uartx_parents[] = { "ras_syn1_gclk", "ras_apb_clk", };
|
||||||
|
|
||||||
static void __init spear320_clk_init(void __iomem *soc_config_base)
|
static void __init spear320_clk_init(void __iomem *soc_config_base,
|
||||||
|
struct clk *ras_apb_clk)
|
||||||
{
|
{
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
|
|
||||||
|
@ -342,6 +343,8 @@ static void __init spear320_clk_init(void __iomem *soc_config_base)
|
||||||
SPEAR320_CONTROL_REG, UART1_PCLK_SHIFT, UART1_PCLK_MASK,
|
SPEAR320_CONTROL_REG, UART1_PCLK_SHIFT, UART1_PCLK_MASK,
|
||||||
0, &_lock);
|
0, &_lock);
|
||||||
clk_register_clkdev(clk, NULL, "a3000000.serial");
|
clk_register_clkdev(clk, NULL, "a3000000.serial");
|
||||||
|
/* Enforce ras_apb_clk */
|
||||||
|
clk_set_parent(clk, ras_apb_clk);
|
||||||
|
|
||||||
clk = clk_register_mux(NULL, "uart2_clk", uartx_parents,
|
clk = clk_register_mux(NULL, "uart2_clk", uartx_parents,
|
||||||
ARRAY_SIZE(uartx_parents),
|
ARRAY_SIZE(uartx_parents),
|
||||||
|
@ -349,6 +352,8 @@ static void __init spear320_clk_init(void __iomem *soc_config_base)
|
||||||
SPEAR320_EXT_CTRL_REG, SPEAR320_UART2_PCLK_SHIFT,
|
SPEAR320_EXT_CTRL_REG, SPEAR320_UART2_PCLK_SHIFT,
|
||||||
SPEAR320_UARTX_PCLK_MASK, 0, &_lock);
|
SPEAR320_UARTX_PCLK_MASK, 0, &_lock);
|
||||||
clk_register_clkdev(clk, NULL, "a4000000.serial");
|
clk_register_clkdev(clk, NULL, "a4000000.serial");
|
||||||
|
/* Enforce ras_apb_clk */
|
||||||
|
clk_set_parent(clk, ras_apb_clk);
|
||||||
|
|
||||||
clk = clk_register_mux(NULL, "uart3_clk", uartx_parents,
|
clk = clk_register_mux(NULL, "uart3_clk", uartx_parents,
|
||||||
ARRAY_SIZE(uartx_parents),
|
ARRAY_SIZE(uartx_parents),
|
||||||
|
@ -379,12 +384,12 @@ static void __init spear320_clk_init(void __iomem *soc_config_base)
|
||||||
clk_register_clkdev(clk, NULL, "60100000.serial");
|
clk_register_clkdev(clk, NULL, "60100000.serial");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline void spear320_clk_init(void __iomem *soc_config_base) { }
|
static inline void spear320_clk_init(void __iomem *sb, struct clk *rc) { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_base)
|
void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_base)
|
||||||
{
|
{
|
||||||
struct clk *clk, *clk1;
|
struct clk *clk, *clk1, *ras_apb_clk;
|
||||||
|
|
||||||
clk = clk_register_fixed_rate(NULL, "osc_32k_clk", NULL, CLK_IS_ROOT,
|
clk = clk_register_fixed_rate(NULL, "osc_32k_clk", NULL, CLK_IS_ROOT,
|
||||||
32000);
|
32000);
|
||||||
|
@ -613,6 +618,7 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_
|
||||||
clk = clk_register_gate(NULL, "ras_apb_clk", "apb_clk", 0, RAS_CLK_ENB,
|
clk = clk_register_gate(NULL, "ras_apb_clk", "apb_clk", 0, RAS_CLK_ENB,
|
||||||
RAS_APB_CLK_ENB, 0, &_lock);
|
RAS_APB_CLK_ENB, 0, &_lock);
|
||||||
clk_register_clkdev(clk, "ras_apb_clk", NULL);
|
clk_register_clkdev(clk, "ras_apb_clk", NULL);
|
||||||
|
ras_apb_clk = clk;
|
||||||
|
|
||||||
clk = clk_register_gate(NULL, "ras_32k_clk", "osc_32k_clk", 0,
|
clk = clk_register_gate(NULL, "ras_32k_clk", "osc_32k_clk", 0,
|
||||||
RAS_CLK_ENB, RAS_32K_CLK_ENB, 0, &_lock);
|
RAS_CLK_ENB, RAS_32K_CLK_ENB, 0, &_lock);
|
||||||
|
@ -659,5 +665,5 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_
|
||||||
else if (of_machine_is_compatible("st,spear310"))
|
else if (of_machine_is_compatible("st,spear310"))
|
||||||
spear310_clk_init();
|
spear310_clk_init();
|
||||||
else if (of_machine_is_compatible("st,spear320"))
|
else if (of_machine_is_compatible("st,spear320"))
|
||||||
spear320_clk_init(soc_config_base);
|
spear320_clk_init(soc_config_base, ras_apb_clk);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче