11bffb4a8SThomas Petazzoni /* 21bffb4a8SThomas Petazzoni * Copyright 2012 (C), Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 31bffb4a8SThomas Petazzoni * 41bffb4a8SThomas Petazzoni * arch/arm/mach-orion5x/board-dt.c 51bffb4a8SThomas Petazzoni * 61bffb4a8SThomas Petazzoni * Flattened Device Tree board initialization 71bffb4a8SThomas Petazzoni * 81bffb4a8SThomas Petazzoni * This file is licensed under the terms of the GNU General Public 91bffb4a8SThomas Petazzoni * License version 2. This program is licensed "as is" without any 101bffb4a8SThomas Petazzoni * warranty of any kind, whether express or implied. 111bffb4a8SThomas Petazzoni */ 121bffb4a8SThomas Petazzoni 131bffb4a8SThomas Petazzoni #include <linux/kernel.h> 141bffb4a8SThomas Petazzoni #include <linux/init.h> 151bffb4a8SThomas Petazzoni #include <linux/of.h> 161bffb4a8SThomas Petazzoni #include <linux/of_platform.h> 171bffb4a8SThomas Petazzoni #include <asm/system_misc.h> 181bffb4a8SThomas Petazzoni #include <asm/mach/arch.h> 191bffb4a8SThomas Petazzoni #include <mach/orion5x.h> 201bffb4a8SThomas Petazzoni #include <plat/irq.h> 211bffb4a8SThomas Petazzoni #include "common.h" 221bffb4a8SThomas Petazzoni 231bffb4a8SThomas Petazzoni struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = { 241bffb4a8SThomas Petazzoni OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), 251bffb4a8SThomas Petazzoni OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", 261bffb4a8SThomas Petazzoni NULL), 271bffb4a8SThomas Petazzoni OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), 281bffb4a8SThomas Petazzoni OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), 291bffb4a8SThomas Petazzoni OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1090000, "mv_crypto", NULL), 301bffb4a8SThomas Petazzoni {}, 311bffb4a8SThomas Petazzoni }; 321bffb4a8SThomas Petazzoni 331bffb4a8SThomas Petazzoni static void __init orion5x_dt_init(void) 341bffb4a8SThomas Petazzoni { 351bffb4a8SThomas Petazzoni char *dev_name; 361bffb4a8SThomas Petazzoni u32 dev, rev; 371bffb4a8SThomas Petazzoni 381bffb4a8SThomas Petazzoni orion5x_id(&dev, &rev, &dev_name); 391bffb4a8SThomas Petazzoni printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); 401bffb4a8SThomas Petazzoni 411bffb4a8SThomas Petazzoni /* 421bffb4a8SThomas Petazzoni * Setup Orion address map 431bffb4a8SThomas Petazzoni */ 441bffb4a8SThomas Petazzoni orion5x_setup_cpu_mbus_bridge(); 451bffb4a8SThomas Petazzoni 461bffb4a8SThomas Petazzoni /* Setup root of clk tree */ 471bffb4a8SThomas Petazzoni clk_init(); 481bffb4a8SThomas Petazzoni 491bffb4a8SThomas Petazzoni /* 501bffb4a8SThomas Petazzoni * Don't issue "Wait for Interrupt" instruction if we are 511bffb4a8SThomas Petazzoni * running on D0 5281 silicon. 521bffb4a8SThomas Petazzoni */ 531bffb4a8SThomas Petazzoni if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) { 541bffb4a8SThomas Petazzoni printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n"); 551bffb4a8SThomas Petazzoni disable_hlt(); 561bffb4a8SThomas Petazzoni } 571bffb4a8SThomas Petazzoni 5807f645dfSThomas Petazzoni if (of_machine_is_compatible("lacie,ethernet-disk-mini-v2")) 5907f645dfSThomas Petazzoni edmini_v2_init(); 6007f645dfSThomas Petazzoni 611bffb4a8SThomas Petazzoni of_platform_populate(NULL, of_default_bus_match_table, 621bffb4a8SThomas Petazzoni orion5x_auxdata_lookup, NULL); 631bffb4a8SThomas Petazzoni } 641bffb4a8SThomas Petazzoni 651bffb4a8SThomas Petazzoni static const char *orion5x_dt_compat[] = { 661bffb4a8SThomas Petazzoni "marvell,orion5x", 671bffb4a8SThomas Petazzoni NULL, 681bffb4a8SThomas Petazzoni }; 691bffb4a8SThomas Petazzoni 701bffb4a8SThomas Petazzoni DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)") 711bffb4a8SThomas Petazzoni /* Maintainer: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> */ 721bffb4a8SThomas Petazzoni .map_io = orion5x_map_io, 731bffb4a8SThomas Petazzoni .init_early = orion5x_init_early, 741bffb4a8SThomas Petazzoni .init_irq = orion_dt_init_irq, 751bffb4a8SThomas Petazzoni .timer = &orion5x_timer, 761bffb4a8SThomas Petazzoni .init_machine = orion5x_dt_init, 771bffb4a8SThomas Petazzoni .restart = orion5x_restart, 781bffb4a8SThomas Petazzoni .dt_compat = orion5x_dt_compat, 791bffb4a8SThomas Petazzoni MACHINE_END 80