^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * Copyright 2012 (C), Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * arch/arm/mach-orion5x/board-dt.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Flattened Device Tree board initialization
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * This file is licensed under the terms of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * License version 2. This program is licensed "as is" without any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * warranty of any kind, whether express or implied.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/of.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/of_platform.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/cpu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/mbus.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/clocksource.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <asm/system_misc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include <asm/mach/map.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <plat/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include <plat/time.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include "orion5x.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include "bridge-regs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include "common.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) static struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) NULL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1090000, "mv_crypto", NULL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) {},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) static void __init orion5x_dt_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) char *dev_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) u32 dev, rev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) orion5x_id(&dev, &rev, &dev_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) BUG_ON(mvebu_mbus_dt_init(false));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * Setup Orion address map
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) orion5x_setup_wins();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * Don't issue "Wait for Interrupt" instruction if we are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * running on D0 5281 silicon.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) cpu_idle_poll_ctrl(true);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) if (of_machine_is_compatible("maxtor,shared-storage-2"))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) mss2_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) of_platform_default_populate(NULL, orion5x_auxdata_lookup, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) static const char *orion5x_dt_compat[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) "marvell,orion5x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) /* Maintainer: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) .map_io = orion5x_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) .init_machine = orion5x_dt_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) .restart = orion5x_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) .dt_compat = orion5x_dt_compat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) MACHINE_END