Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Copyright 2012 (C), Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
0004  *
0005  * arch/arm/mach-orion5x/board-dt.c
0006  *
0007  * Flattened Device Tree board initialization
0008  */
0009 
0010 #include <linux/kernel.h>
0011 #include <linux/init.h>
0012 #include <linux/of.h>
0013 #include <linux/of_platform.h>
0014 #include <linux/cpu.h>
0015 #include <linux/mbus.h>
0016 #include <linux/clocksource.h>
0017 #include <asm/system_misc.h>
0018 #include <asm/mach/arch.h>
0019 #include <asm/mach/map.h>
0020 #include <plat/irq.h>
0021 #include <plat/time.h>
0022 #include "orion5x.h"
0023 #include "bridge-regs.h"
0024 #include "common.h"
0025 
0026 static struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = {
0027     OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
0028     OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
0029                NULL),
0030     OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
0031     OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
0032     OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1090000, "mv_crypto", NULL),
0033     {},
0034 };
0035 
0036 static void __init orion5x_dt_init(void)
0037 {
0038     char *dev_name;
0039     u32 dev, rev;
0040 
0041     orion5x_id(&dev, &rev, &dev_name);
0042     printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
0043 
0044     BUG_ON(mvebu_mbus_dt_init(false));
0045 
0046     /*
0047      * Setup Orion address map
0048      */
0049     orion5x_setup_wins();
0050 
0051     /*
0052      * Don't issue "Wait for Interrupt" instruction if we are
0053      * running on D0 5281 silicon.
0054      */
0055     if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) {
0056         printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
0057         cpu_idle_poll_ctrl(true);
0058     }
0059 
0060     if (of_machine_is_compatible("maxtor,shared-storage-2"))
0061         mss2_init();
0062 
0063     of_platform_default_populate(NULL, orion5x_auxdata_lookup, NULL);
0064 }
0065 
0066 static const char *orion5x_dt_compat[] = {
0067     "marvell,orion5x",
0068     NULL,
0069 };
0070 
0071 DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)")
0072     /* Maintainer: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> */
0073     .map_io     = orion5x_map_io,
0074     .init_machine   = orion5x_dt_init,
0075     .restart    = orion5x_restart,
0076     .dt_compat  = orion5x_dt_compat,
0077 MACHINE_END