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