xref: /openbmc/linux/arch/arm/mach-orion5x/board-dt.c (revision f8ef1233)
10fdebc5eSThomas 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 
orion5x_dt_init(void)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 
63*f8ef1233SArnd Bergmann 	if (of_machine_is_compatible("lacie,d2-network"))
64*f8ef1233SArnd Bergmann 		d2net_init();
65*f8ef1233SArnd Bergmann 
66435ebcbcSKefeng Wang 	of_platform_default_populate(NULL, orion5x_auxdata_lookup, NULL);
671bffb4a8SThomas Petazzoni }
681bffb4a8SThomas Petazzoni 
691bffb4a8SThomas Petazzoni static const char *orion5x_dt_compat[] = {
701bffb4a8SThomas Petazzoni 	"marvell,orion5x",
711bffb4a8SThomas Petazzoni 	NULL,
721bffb4a8SThomas Petazzoni };
731bffb4a8SThomas Petazzoni 
741bffb4a8SThomas Petazzoni DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)")
751bffb4a8SThomas Petazzoni 	/* Maintainer: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> */
761bffb4a8SThomas Petazzoni 	.map_io		= orion5x_map_io,
771bffb4a8SThomas Petazzoni 	.init_machine	= orion5x_dt_init,
781bffb4a8SThomas Petazzoni 	.restart	= orion5x_restart,
791bffb4a8SThomas Petazzoni 	.dt_compat	= orion5x_dt_compat,
801bffb4a8SThomas Petazzoni MACHINE_END
81