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> |
Ian Campbell | a7ac56d | 2012-04-29 14:40:42 +0100 | [diff] [blame] | 17 | #include <linux/kexec.h> |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 18 | #include <asm/mach/arch.h> |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 19 | #include <asm/mach/map.h> |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 20 | #include <mach/bridge-regs.h> |
Andrew Lunn | 278b45b | 2012-06-27 13:40:04 +0200 | [diff] [blame] | 21 | #include <plat/irq.h> |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 22 | #include "common.h" |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 23 | |
| 24 | static struct of_device_id kirkwood_dt_match_table[] __initdata = { |
| 25 | { .compatible = "simple-bus", }, |
| 26 | { } |
| 27 | }; |
| 28 | |
Michael Walle | 7637212 | 2012-06-06 20:30:57 +0200 | [diff] [blame] | 29 | struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = { |
| 30 | OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), |
Andrew Lunn | e91cac0 | 2012-07-20 13:51:55 +0200 | [diff] [blame] | 31 | OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", |
| 32 | NULL), |
Jason Gunthorpe | bff0844 | 2012-10-01 17:59:32 -0600 | [diff] [blame] | 33 | OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011100, "mv64xxx_i2c.1", |
| 34 | NULL), |
Andrew Lunn | 1e7bad0 | 2012-06-10 15:20:06 +0200 | [diff] [blame] | 35 | OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), |
Andrew Lunn | 97b414e | 2012-06-10 16:45:37 +0200 | [diff] [blame] | 36 | OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), |
Andrew Lunn | f39c110 | 2012-07-18 19:22:54 +0200 | [diff] [blame] | 37 | OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL), |
Andrew Lunn | f37fbd3 | 2012-09-03 20:29:34 +0200 | [diff] [blame] | 38 | OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1030000, "mv_crypto", NULL), |
Michael Walle | 7637212 | 2012-06-06 20:30:57 +0200 | [diff] [blame] | 39 | {}, |
| 40 | }; |
| 41 | |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 42 | static void __init kirkwood_dt_init(void) |
| 43 | { |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 44 | pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk); |
| 45 | |
| 46 | /* |
| 47 | * Disable propagation of mbus errors to the CPU local bus, |
| 48 | * as this causes mbus errors (which can occur for example |
| 49 | * for PCI aborts) to throw CPU aborts, which we're not set |
| 50 | * up to deal with. |
| 51 | */ |
| 52 | writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); |
| 53 | |
| 54 | kirkwood_setup_cpu_mbus(); |
| 55 | |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 56 | kirkwood_l2_init(); |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 57 | |
Andrew Lunn | 2f129bf | 2011-12-15 08:15:07 +0100 | [diff] [blame] | 58 | /* Setup root of clk tree */ |
| 59 | kirkwood_clk_init(); |
| 60 | |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 61 | /* internal devices that every board has */ |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 62 | kirkwood_xor0_init(); |
| 63 | kirkwood_xor1_init(); |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 64 | |
| 65 | #ifdef CONFIG_KEXEC |
| 66 | kexec_reinit = kirkwood_enable_pcie; |
| 67 | #endif |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 68 | |
| 69 | if (of_machine_is_compatible("globalscale,dreamplug")) |
| 70 | dreamplug_init(); |
| 71 | |
Jamie Lentin | 9007d10 | 2012-04-18 11:06:40 +0100 | [diff] [blame] | 72 | if (of_machine_is_compatible("dlink,dns-kirkwood")) |
| 73 | dnskw_init(); |
| 74 | |
Arnaud Patard (Rtp) | c06cd9b | 2012-04-18 23:16:41 +0200 | [diff] [blame] | 75 | if (of_machine_is_compatible("iom,iconnect")) |
| 76 | iconnect_init(); |
| 77 | |
Simon Baatz | f552036 | 2012-04-30 23:55:17 +0200 | [diff] [blame] | 78 | if (of_machine_is_compatible("raidsonic,ib-nas62x0")) |
| 79 | ib62x0_init(); |
| 80 | |
Andrew Lunn | 9eb61f4 | 2012-05-12 14:57:59 +0200 | [diff] [blame] | 81 | if (of_machine_is_compatible("qnap,ts219")) |
| 82 | qnap_dt_ts219_init(); |
| 83 | |
Sebastian Hesselbarth | dd88db7 | 2012-08-14 22:43:41 +0200 | [diff] [blame] | 84 | if (of_machine_is_compatible("seagate,dockstar")) |
| 85 | dockstar_dt_init(); |
| 86 | |
Josh Coombs | 5136b2a | 2012-07-16 11:52:50 +0200 | [diff] [blame] | 87 | if (of_machine_is_compatible("seagate,goflexnet")) |
| 88 | goflexnet_init(); |
| 89 | |
Michael Walle | 4aff38a | 2012-07-17 07:25:55 +0200 | [diff] [blame] | 90 | if (of_machine_is_compatible("buffalo,lsxl")) |
| 91 | lsxl_init(); |
| 92 | |
Alan M Butler | 4f48b7f | 2012-08-20 15:29:07 +0100 | [diff] [blame] | 93 | if (of_machine_is_compatible("iom,ix2-200")) |
| 94 | iomega_ix2_200_init(); |
| 95 | |
Valentin Longchamp | 0510c8a | 2012-09-04 11:55:02 +0200 | [diff] [blame] | 96 | if (of_machine_is_compatible("keymile,km_kirkwood")) |
| 97 | km_kirkwood_init(); |
| 98 | |
Simon Guinot | ecee1e4 | 2012-10-17 12:09:04 +0200 | [diff] [blame] | 99 | if (of_machine_is_compatible("lacie,inetspace_v2") || |
| 100 | of_machine_is_compatible("lacie,netspace_v2") || |
Simon Guinot | ca7d945 | 2012-10-17 12:09:05 +0200 | [diff] [blame] | 101 | of_machine_is_compatible("lacie,netspace_max_v2") || |
Simon Guinot | 7f9871d | 2012-10-17 12:09:06 +0200 | [diff] [blame] | 102 | of_machine_is_compatible("lacie,netspace_lite_v2") || |
| 103 | of_machine_is_compatible("lacie,netspace_mini_v2")) |
Simon Guinot | ecee1e4 | 2012-10-17 12:09:04 +0200 | [diff] [blame] | 104 | ns2_init(); |
| 105 | |
Stefan Peter | 5492a11 | 2012-11-18 16:46:16 +0100 | [diff] [blame] | 106 | if (of_machine_is_compatible("mpl,cec4")) |
| 107 | mplcec4_init(); |
| 108 | |
Nobuhiro Iwamatsu | f17073a | 2012-11-13 16:43:09 +0900 | [diff] [blame^] | 109 | if (of_machine_is_compatible("plathome,openblocks-a6")) |
| 110 | openblocks_a6_init(); |
| 111 | |
Jason Cooper | 767fc1e | 2012-10-22 02:15:35 +0000 | [diff] [blame] | 112 | if (of_machine_is_compatible("usi,topkick")) |
| 113 | usi_topkick_init(); |
| 114 | |
Tero Jaasko | afcad88 | 2012-10-26 18:56:16 +0300 | [diff] [blame] | 115 | if (of_machine_is_compatible("zyxel,nsa310")) |
| 116 | nsa310_init(); |
| 117 | |
Michael Walle | 7637212 | 2012-06-06 20:30:57 +0200 | [diff] [blame] | 118 | of_platform_populate(NULL, kirkwood_dt_match_table, |
| 119 | kirkwood_auxdata_lookup, NULL); |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | static const char *kirkwood_dt_board_compat[] = { |
| 123 | "globalscale,dreamplug", |
Jamie Lentin | 9007d10 | 2012-04-18 11:06:40 +0100 | [diff] [blame] | 124 | "dlink,dns-320", |
| 125 | "dlink,dns-325", |
Arnaud Patard (Rtp) | c06cd9b | 2012-04-18 23:16:41 +0200 | [diff] [blame] | 126 | "iom,iconnect", |
Simon Baatz | f552036 | 2012-04-30 23:55:17 +0200 | [diff] [blame] | 127 | "raidsonic,ib-nas62x0", |
Andrew Lunn | 9eb61f4 | 2012-05-12 14:57:59 +0200 | [diff] [blame] | 128 | "qnap,ts219", |
Sebastian Hesselbarth | dd88db7 | 2012-08-14 22:43:41 +0200 | [diff] [blame] | 129 | "seagate,dockstar", |
Josh Coombs | 5136b2a | 2012-07-16 11:52:50 +0200 | [diff] [blame] | 130 | "seagate,goflexnet", |
Michael Walle | 4aff38a | 2012-07-17 07:25:55 +0200 | [diff] [blame] | 131 | "buffalo,lsxl", |
Alan M Butler | 4f48b7f | 2012-08-20 15:29:07 +0100 | [diff] [blame] | 132 | "iom,ix2-200", |
Valentin Longchamp | 0510c8a | 2012-09-04 11:55:02 +0200 | [diff] [blame] | 133 | "keymile,km_kirkwood", |
Simon Guinot | ecee1e4 | 2012-10-17 12:09:04 +0200 | [diff] [blame] | 134 | "lacie,inetspace_v2", |
| 135 | "lacie,netspace_max_v2", |
| 136 | "lacie,netspace_v2", |
Simon Guinot | ca7d945 | 2012-10-17 12:09:05 +0200 | [diff] [blame] | 137 | "lacie,netspace_lite_v2", |
Simon Guinot | 7f9871d | 2012-10-17 12:09:06 +0200 | [diff] [blame] | 138 | "lacie,netspace_mini_v2", |
Stefan Peter | 5492a11 | 2012-11-18 16:46:16 +0100 | [diff] [blame] | 139 | "mpl,cec4", |
Nobuhiro Iwamatsu | f17073a | 2012-11-13 16:43:09 +0900 | [diff] [blame^] | 140 | "plathome,openblocks-a6", |
Jason Cooper | 767fc1e | 2012-10-22 02:15:35 +0000 | [diff] [blame] | 141 | "usi,topkick", |
Tero Jaasko | afcad88 | 2012-10-26 18:56:16 +0300 | [diff] [blame] | 142 | "zyxel,nsa310", |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 143 | NULL |
| 144 | }; |
| 145 | |
| 146 | DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") |
| 147 | /* Maintainer: Jason Cooper <jason@lakedaemon.net> */ |
| 148 | .map_io = kirkwood_map_io, |
| 149 | .init_early = kirkwood_init_early, |
Andrew Lunn | 278b45b | 2012-06-27 13:40:04 +0200 | [diff] [blame] | 150 | .init_irq = orion_dt_init_irq, |
Jason Cooper | 3d468b6 | 2012-02-27 16:07:13 +0000 | [diff] [blame] | 151 | .timer = &kirkwood_timer, |
| 152 | .init_machine = kirkwood_dt_init, |
| 153 | .restart = kirkwood_restart, |
| 154 | .dt_compat = kirkwood_dt_board_compat, |
| 155 | MACHINE_END |