Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / arm / mach-orion5x / board-mss2.c
blob79202fd626dfb9189c548f19f0ba0d0dc64f31c8
1 /*
2 * Maxtor Shared Storage II Board Setup
4 * Maintainer: Sylver Bruneau <sylver.bruneau@googlemail.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/platform_device.h>
15 #include <linux/pci.h>
16 #include <linux/irq.h>
17 #include <asm/mach-types.h>
18 #include <asm/mach/arch.h>
19 #include <asm/mach/pci.h>
20 #include "orion5x.h"
21 #include "bridge-regs.h"
22 #include "common.h"
24 /*****************************************************************************
25 * Maxtor Shared Storage II Info
26 ****************************************************************************/
28 /****************************************************************************
29 * PCI setup
30 ****************************************************************************/
31 static int __init mss2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
33 int irq;
36 * Check for devices with hard-wired IRQs.
38 irq = orion5x_pci_map_irq(dev, slot, pin);
39 if (irq != -1)
40 return irq;
42 return -1;
45 static struct hw_pci mss2_pci __initdata = {
46 .nr_controllers = 2,
47 .setup = orion5x_pci_sys_setup,
48 .scan = orion5x_pci_sys_scan_bus,
49 .map_irq = mss2_pci_map_irq,
52 static int __init mss2_pci_init(void)
54 if (machine_is_mss2())
55 pci_common_init(&mss2_pci);
57 return 0;
59 subsys_initcall(mss2_pci_init);
61 /*****************************************************************************
62 * MSS2 power off method
63 ****************************************************************************/
65 * On the Maxtor Shared Storage II, the shutdown process is the following :
66 * - Userland modifies U-boot env to tell U-boot to go idle at next boot
67 * - The board reboots
68 * - U-boot starts and go into an idle mode until the user press "power"
70 static void mss2_power_off(void)
72 u32 reg;
75 * Enable and issue soft reset
77 reg = readl(RSTOUTn_MASK);
78 reg |= 1 << 2;
79 writel(reg, RSTOUTn_MASK);
81 reg = readl(CPU_SOFT_RESET);
82 reg |= 1;
83 writel(reg, CPU_SOFT_RESET);
86 void __init mss2_init(void)
88 /* register mss2 specific power-off method */
89 pm_power_off = mss2_power_off;