1*0fdebc5eSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only 21bffb4a8SThomas Petazzoni /* 31bffb4a8SThomas Petazzoni * Copyright 2012 (C), Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 41bffb4a8SThomas Petazzoni * 51bffb4a8SThomas Petazzoni * arch/arm/mach-orion5x/board-dt.c 61bffb4a8SThomas Petazzoni * 71bffb4a8SThomas Petazzoni * Flattened Device Tree board initialization 81bffb4a8SThomas Petazzoni */ 91bffb4a8SThomas Petazzoni 101bffb4a8SThomas Petazzoni #include <linux/kernel.h> 111bffb4a8SThomas Petazzoni #include <linux/init.h> 121bffb4a8SThomas Petazzoni #include <linux/of.h> 131bffb4a8SThomas Petazzoni #include <linux/of_platform.h> 14f7b861b7SThomas Gleixner #include <linux/cpu.h> 155c697664SThomas Petazzoni #include <linux/mbus.h> 16ab5ab9dbSThomas Petazzoni #include <linux/clocksource.h> 171bffb4a8SThomas Petazzoni #include <asm/system_misc.h> 181bffb4a8SThomas Petazzoni #include <asm/mach/arch.h> 195c697664SThomas Petazzoni #include <asm/mach/map.h> 201bffb4a8SThomas Petazzoni #include <plat/irq.h> 215c697664SThomas Petazzoni #include <plat/time.h> 22c22c2c60SArnd Bergmann #include "orion5x.h" 23c22c2c60SArnd Bergmann #include "bridge-regs.h" 241bffb4a8SThomas Petazzoni #include "common.h" 251bffb4a8SThomas Petazzoni 2642366666SAndrew Lunn static struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = { 271bffb4a8SThomas Petazzoni OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), 281bffb4a8SThomas Petazzoni OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", 291bffb4a8SThomas Petazzoni NULL), 301bffb4a8SThomas Petazzoni OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), 311bffb4a8SThomas Petazzoni OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), 321bffb4a8SThomas Petazzoni OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1090000, "mv_crypto", NULL), 331bffb4a8SThomas Petazzoni {}, 341bffb4a8SThomas Petazzoni }; 351bffb4a8SThomas Petazzoni 361bffb4a8SThomas Petazzoni static void __init orion5x_dt_init(void) 371bffb4a8SThomas Petazzoni { 381bffb4a8SThomas Petazzoni char *dev_name; 391bffb4a8SThomas Petazzoni u32 dev, rev; 401bffb4a8SThomas Petazzoni 411bffb4a8SThomas Petazzoni orion5x_id(&dev, &rev, &dev_name); 421bffb4a8SThomas Petazzoni printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); 431bffb4a8SThomas Petazzoni 4406fde1a0SArnd Bergmann BUG_ON(mvebu_mbus_dt_init(false)); 455c697664SThomas Petazzoni 461bffb4a8SThomas Petazzoni /* 471bffb4a8SThomas Petazzoni * Setup Orion address map 481bffb4a8SThomas Petazzoni */ 495d1190eaSThomas Petazzoni orion5x_setup_wins(); 501bffb4a8SThomas Petazzoni 511bffb4a8SThomas Petazzoni /* 521bffb4a8SThomas Petazzoni * Don't issue "Wait for Interrupt" instruction if we are 531bffb4a8SThomas Petazzoni * running on D0 5281 silicon. 541bffb4a8SThomas Petazzoni */ 551bffb4a8SThomas Petazzoni if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) { 561bffb4a8SThomas Petazzoni printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n"); 57f7b861b7SThomas Gleixner cpu_idle_poll_ctrl(true); 581bffb4a8SThomas Petazzoni } 591bffb4a8SThomas Petazzoni 60fbf04d81SThomas Petazzoni if (of_machine_is_compatible("maxtor,shared-storage-2")) 61fbf04d81SThomas Petazzoni mss2_init(); 62fbf04d81SThomas Petazzoni 63435ebcbcSKefeng Wang of_platform_default_populate(NULL, orion5x_auxdata_lookup, NULL); 641bffb4a8SThomas Petazzoni } 651bffb4a8SThomas Petazzoni 661bffb4a8SThomas Petazzoni static const char *orion5x_dt_compat[] = { 671bffb4a8SThomas Petazzoni "marvell,orion5x", 681bffb4a8SThomas Petazzoni NULL, 691bffb4a8SThomas Petazzoni }; 701bffb4a8SThomas Petazzoni 711bffb4a8SThomas Petazzoni DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)") 721bffb4a8SThomas Petazzoni /* Maintainer: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> */ 731bffb4a8SThomas Petazzoni .map_io = orion5x_map_io, 741bffb4a8SThomas Petazzoni .init_machine = orion5x_dt_init, 751bffb4a8SThomas Petazzoni .restart = orion5x_restart, 761bffb4a8SThomas Petazzoni .dt_compat = orion5x_dt_compat, 771bffb4a8SThomas Petazzoni MACHINE_END 78