diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2014-04-10 17:01:50 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-06-24 08:25:42 +0200 |
commit | 198eb8bf500d854f6ff35f93104142c70180bdaf (patch) | |
tree | 02528cf36891f463fb9ade0dca3c59bfb99d2df6 /arch/arm/mach-mvebu | |
parent | 8cd9edec989f02661e2d1f5e29979319fee287ce (diff) | |
download | barebox-198eb8bf500d854f6ff35f93104142c70180bdaf.tar.gz barebox-198eb8bf500d854f6ff35f93104142c70180bdaf.tar.xz |
ARM: mvebu: convert Armada 370/XP devices to be probed from DT
With Armada 370/XP DT files available, convert Armada 370/XP SoC init
to register basic devices from DT only. Makefile targets for dtbs will
be removed again as soon as MULTI_PBL is available.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Diffstat (limited to 'arch/arm/mach-mvebu')
-rw-r--r-- | arch/arm/mach-mvebu/armada-370-xp.c | 66 |
1 files changed, 1 insertions, 65 deletions
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c index 051323eeb3..e416a38765 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/armada-370-xp.c @@ -17,18 +17,9 @@ #include <common.h> #include <init.h> #include <io.h> -#include <ns16550.h> -#include <linux/clk.h> -#include <linux/clkdev.h> #include <asm/memory.h> #include <mach/armada-370-xp-regs.h> -#define CONSOLE_UART_BASE \ - ARMADA_370_XP_UARTn_BASE(CONFIG_MVEBU_CONSOLE_UART) - -static struct clk *tclk; -static struct clk *refclk; - static inline void armada_370_xp_memory_find(unsigned long *phys_base, unsigned long *phys_size) { @@ -52,53 +43,6 @@ static inline void armada_370_xp_memory_find(unsigned long *phys_base, } } -static struct NS16550_plat uart_plat = { - .shift = 2, -}; - -static int armada_370_xp_add_uart(void) -{ - uart_plat.clock = clk_get_rate(tclk); - if (!add_ns16550_device(DEVICE_ID_DYNAMIC, - (unsigned int)CONSOLE_UART_BASE, 32, - IORESOURCE_MEM | IORESOURCE_MEM_32BIT, - &uart_plat)) - return -ENODEV; - return 0; -} - -#if defined(CONFIG_ARCH_ARMADA_370) -static int armada_370_init_clocks(void) -{ - u32 val = readl(ARMADA_370_XP_SAR_BASE + SAR_LOW); - unsigned int rate; - - /* - * On Armada 370, the TCLK frequency can be either - * 166 Mhz or 200 Mhz - */ - if ((val & SAR_TCLK_FREQ) == SAR_TCLK_FREQ) - rate = 200000000; - else - rate = 166000000; - - tclk = clk_fixed("tclk", rate); - return clk_register_clkdev(tclk, NULL, "mvebu-timer"); -} -#define armada_370_xp_init_clocks() armada_370_init_clocks() -#endif - -#if defined(CONFIG_ARCH_ARMADA_XP) -static int armada_xp_init_clocks(void) -{ - /* On Armada XP, the TCLK frequency is always 250 Mhz */ - tclk = clk_fixed("tclk", 250000000); - refclk = clk_fixed("ref25M", 25000000); - return 0; -} -#define armada_370_xp_init_clocks() armada_xp_init_clocks() -#endif - static int armada_370_xp_init_soc(void) { unsigned long phys_base, phys_size; @@ -106,17 +50,9 @@ static int armada_370_xp_init_soc(void) barebox_set_model("Marvell Armada 370/XP"); barebox_set_hostname("armada"); - armada_370_xp_init_clocks(); - clkdev_add_physbase(tclk, (unsigned int)ARMADA_370_XP_TIMER_BASE, NULL); - if (refclk && !IS_ERR(refclk)) - clkdev_add_physbase(refclk, (u32)ARMADA_370_XP_TIMER_BASE, - "fixed"); - add_generic_device("mvebu-timer", DEVICE_ID_SINGLE, NULL, - (unsigned int)ARMADA_370_XP_TIMER_BASE, 0x30, - IORESOURCE_MEM, NULL); armada_370_xp_memory_find(&phys_base, &phys_size); arm_add_mem_device("ram0", phys_base, phys_size); - armada_370_xp_add_uart(); + return 0; } core_initcall(armada_370_xp_init_soc); |