Commit 5b03df9a authored by Sebastian Hesselbarth's avatar Sebastian Hesselbarth Committed by Thomas Petazzoni

ARM: dove: switch to DT clock providers

With true DT clock providers available switch Dove clock setup in DT-
enabled boards. While AUXDATA can be removed completely from bus probing,
some devices still don't know about DT at all. Therefore, some clock
aliases are created until the devices also move to DT.
Signed-off-by: default avatarSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
parent 307c2bf4
...@@ -533,6 +533,7 @@ config ARCH_IXP4XX ...@@ -533,6 +533,7 @@ config ARCH_IXP4XX
config ARCH_DOVE config ARCH_DOVE
bool "Marvell Dove" bool "Marvell Dove"
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select COMMON_CLK_DOVE
select CPU_V7 select CPU_V7
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select MIGHT_HAVE_PCI select MIGHT_HAVE_PCI
......
...@@ -31,6 +31,19 @@ intc: interrupt-controller { ...@@ -31,6 +31,19 @@ intc: interrupt-controller {
reg = <0x20204 0x04>, <0x20214 0x04>; reg = <0x20204 0x04>, <0x20214 0x04>;
}; };
core_clk: core-clocks@d0214 {
compatible = "marvell,dove-core-clock";
reg = <0xd0214 0x4>;
#clock-cells = <1>;
};
gate_clk: clock-gating-control@d0038 {
compatible = "marvell,dove-gating-clock";
reg = <0xd0038 0x4>;
clocks = <&core_clk 0>;
#clock-cells = <1>;
};
uart0: serial@12000 { uart0: serial@12000 {
compatible = "ns16550a"; compatible = "ns16550a";
reg = <0x12000 0x100>; reg = <0x12000 0x100>;
...@@ -100,6 +113,7 @@ spi0: spi@10600 { ...@@ -100,6 +113,7 @@ spi0: spi@10600 {
cell-index = <0>; cell-index = <0>;
interrupts = <6>; interrupts = <6>;
reg = <0x10600 0x28>; reg = <0x10600 0x28>;
clocks = <&core_clk 0>;
status = "disabled"; status = "disabled";
}; };
...@@ -110,6 +124,7 @@ spi1: spi@14600 { ...@@ -110,6 +124,7 @@ spi1: spi@14600 {
cell-index = <1>; cell-index = <1>;
interrupts = <5>; interrupts = <5>;
reg = <0x14600 0x28>; reg = <0x14600 0x28>;
clocks = <&core_clk 0>;
status = "disabled"; status = "disabled";
}; };
...@@ -121,6 +136,7 @@ i2c0: i2c@11000 { ...@@ -121,6 +136,7 @@ i2c0: i2c@11000 {
interrupts = <11>; interrupts = <11>;
clock-frequency = <400000>; clock-frequency = <400000>;
timeout-ms = <1000>; timeout-ms = <1000>;
clocks = <&core_clk 0>;
status = "disabled"; status = "disabled";
}; };
...@@ -128,6 +144,7 @@ sdio0: sdio@92000 { ...@@ -128,6 +144,7 @@ sdio0: sdio@92000 {
compatible = "marvell,dove-sdhci"; compatible = "marvell,dove-sdhci";
reg = <0x92000 0x100>; reg = <0x92000 0x100>;
interrupts = <35>, <37>; interrupts = <35>, <37>;
clocks = <&gate_clk 8>;
status = "disabled"; status = "disabled";
}; };
...@@ -135,6 +152,7 @@ sdio1: sdio@90000 { ...@@ -135,6 +152,7 @@ sdio1: sdio@90000 {
compatible = "marvell,dove-sdhci"; compatible = "marvell,dove-sdhci";
reg = <0x90000 0x100>; reg = <0x90000 0x100>;
interrupts = <36>, <38>; interrupts = <36>, <38>;
clocks = <&gate_clk 9>;
status = "disabled"; status = "disabled";
}; };
...@@ -142,6 +160,7 @@ sata0: sata@a0000 { ...@@ -142,6 +160,7 @@ sata0: sata@a0000 {
compatible = "marvell,orion-sata"; compatible = "marvell,orion-sata";
reg = <0xa0000 0x2400>; reg = <0xa0000 0x2400>;
interrupts = <62>; interrupts = <62>;
clocks = <&gate_clk 3>;
nr-ports = <1>; nr-ports = <1>;
status = "disabled"; status = "disabled";
}; };
...@@ -152,6 +171,7 @@ crypto: crypto@30000 { ...@@ -152,6 +171,7 @@ crypto: crypto@30000 {
<0xc8000000 0x800>; <0xc8000000 0x800>;
reg-names = "regs", "sram"; reg-names = "regs", "sram";
interrupts = <31>; interrupts = <31>;
clocks = <&gate_clk 15>;
status = "okay"; status = "okay";
}; };
}; };
......
...@@ -17,6 +17,8 @@ config MACH_CM_A510 ...@@ -17,6 +17,8 @@ config MACH_CM_A510
config MACH_DOVE_DT config MACH_DOVE_DT
bool "Marvell Dove Flattened Device Tree" bool "Marvell Dove Flattened Device Tree"
select MVEBU_CLK_CORE
select MVEBU_CLK_GATING
select USE_OF select USE_OF
help help
Say 'Y' here if you want your kernel to support the Say 'Y' here if you want your kernel to support the
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/clk/mvebu.h>
#include <linux/ata_platform.h> #include <linux/ata_platform.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/of.h> #include <linux/of.h>
...@@ -376,19 +377,52 @@ void dove_restart(char mode, const char *cmd) ...@@ -376,19 +377,52 @@ void dove_restart(char mode, const char *cmd)
#if defined(CONFIG_MACH_DOVE_DT) #if defined(CONFIG_MACH_DOVE_DT)
/* /*
* Auxdata required until real OF clock provider * There are still devices that doesn't even know about DT,
* get clock gates here and add a clock lookup.
*/ */
struct of_dev_auxdata dove_auxdata_lookup[] __initdata = { static void __init dove_legacy_clk_init(void)
OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), {
OF_DEV_AUXDATA("marvell,orion-spi", 0xf1014600, "orion_spi.1", NULL), struct device_node *np = of_find_compatible_node(NULL, NULL,
OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), "marvell,dove-gating-clock");
OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", struct of_phandle_args clkspec;
NULL),
OF_DEV_AUXDATA("marvell,orion-sata", 0xf10a0000, "sata_mv.0", NULL), clkspec.np = np;
OF_DEV_AUXDATA("marvell,dove-sdhci", 0xf1092000, "sdhci-dove.0", NULL), clkspec.args_count = 1;
OF_DEV_AUXDATA("marvell,dove-sdhci", 0xf1090000, "sdhci-dove.1", NULL),
{}, clkspec.args[0] = CLOCK_GATING_BIT_USB0;
}; orion_clkdev_add(NULL, "orion-ehci.0",
of_clk_get_from_provider(&clkspec));
clkspec.args[0] = CLOCK_GATING_BIT_USB1;
orion_clkdev_add(NULL, "orion-ehci.1",
of_clk_get_from_provider(&clkspec));
clkspec.args[0] = CLOCK_GATING_BIT_GBE;
orion_clkdev_add(NULL, "mv643xx_eth_port.0",
of_clk_get_from_provider(&clkspec));
clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
orion_clkdev_add("0", "pcie",
of_clk_get_from_provider(&clkspec));
clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
orion_clkdev_add("1", "pcie",
of_clk_get_from_provider(&clkspec));
clkspec.args[0] = CLOCK_GATING_BIT_XOR0;
orion_clkdev_add(NULL, "mv_xor_shared.0",
of_clk_get_from_provider(&clkspec));
clkspec.args[0] = CLOCK_GATING_BIT_XOR1;
orion_clkdev_add(NULL, "mv_xor_shared.1",
of_clk_get_from_provider(&clkspec));
}
static void __init dove_of_clk_init(void)
{
mvebu_clocks_init();
dove_legacy_clk_init();
}
static struct mv643xx_eth_platform_data dove_dt_ge00_data = { static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
.phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT, .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
...@@ -405,7 +439,7 @@ static void __init dove_dt_init(void) ...@@ -405,7 +439,7 @@ static void __init dove_dt_init(void)
dove_setup_cpu_mbus(); dove_setup_cpu_mbus();
/* Setup root of clk tree */ /* Setup root of clk tree */
dove_clk_init(); dove_of_clk_init();
/* Internal devices not ported to DT yet */ /* Internal devices not ported to DT yet */
dove_rtc_init(); dove_rtc_init();
...@@ -417,8 +451,7 @@ static void __init dove_dt_init(void) ...@@ -417,8 +451,7 @@ static void __init dove_dt_init(void)
dove_ehci1_init(); dove_ehci1_init();
dove_pcie_init(1, 1); dove_pcie_init(1, 1);
of_platform_populate(NULL, of_default_bus_match_table, of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
dove_auxdata_lookup, NULL);
} }
static const char * const dove_dt_board_compat[] = { static const char * const dove_dt_board_compat[] = {
......
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