Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net> |
| 3 | * |
| 4 | * arch/arm/mach-kirkwood/board-dt.c |
| 5 | * |
Jason Cooper | 6fa6b87 | 2012-03-15 00:52:31 +0000 | [diff] [blame] | 6 | * Flattened Device Tree board initialization |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 7 | * |
| 8 | * This file is licensed under the terms of the GNU General Public |
| 9 | * License version 2. This program is licensed "as is" without any |
| 10 | * warranty of any kind, whether express or implied. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/init.h> |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 15 | #include <linux/of.h> |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 16 | #include <linux/of_platform.h> |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 17 | #include <asm/mach/arch.h> |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 18 | #include <asm/mach/map.h> |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 19 | #include <mach/bridge-regs.h> |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 20 | #include "common.h" |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 21 | |
| 22 | static struct of_device_id kirkwood_dt_match_table[] __initdata = { |
| 23 | { .compatible = "simple-bus", }, |
| 24 | { } |
| 25 | }; |
| 26 | |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 27 | static void __init kirkwood_dt_init(void) |
| 28 | { |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 29 | pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk); |
| 30 | |
| 31 | /* |
| 32 | * Disable propagation of mbus errors to the CPU local bus, |
| 33 | * as this causes mbus errors (which can occur for example |
| 34 | * for PCI aborts) to throw CPU aborts, which we're not set |
| 35 | * up to deal with. |
| 36 | */ |
| 37 | writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); |
| 38 | |
| 39 | kirkwood_setup_cpu_mbus(); |
| 40 | |
| 41 | #ifdef CONFIG_CACHE_FEROCEON_L2 |
| 42 | kirkwood_l2_init(); |
| 43 | #endif |
| 44 | |
Andrew Lunn | 2f129bf | 2011-12-15 08:15:07 +0100 | [diff] [blame^] | 45 | /* Setup root of clk tree */ |
| 46 | kirkwood_clk_init(); |
| 47 | |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 48 | /* internal devices that every board has */ |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 49 | kirkwood_wdt_init(); |
| 50 | kirkwood_xor0_init(); |
| 51 | kirkwood_xor1_init(); |
| 52 | kirkwood_crypto_init(); |
| 53 | |
| 54 | #ifdef CONFIG_KEXEC |
| 55 | kexec_reinit = kirkwood_enable_pcie; |
| 56 | #endif |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 57 | |
| 58 | if (of_machine_is_compatible("globalscale,dreamplug")) |
| 59 | dreamplug_init(); |
| 60 | |
| 61 | of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL); |
| 62 | } |
| 63 | |
| 64 | static const char *kirkwood_dt_board_compat[] = { |
| 65 | "globalscale,dreamplug", |
| 66 | NULL |
| 67 | }; |
| 68 | |
| 69 | DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") |
| 70 | /* Maintainer: Jason Cooper <jason@lakedaemon.net> */ |
| 71 | .map_io = kirkwood_map_io, |
| 72 | .init_early = kirkwood_init_early, |
| 73 | .init_irq = kirkwood_init_irq, |
| 74 | .timer = &kirkwood_timer, |
| 75 | .init_machine = kirkwood_dt_init, |
| 76 | .restart = kirkwood_restart, |
| 77 | .dt_compat = kirkwood_dt_board_compat, |
| 78 | MACHINE_END |