Merge tag 'locking-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / arm / mach-orion5x / board-mss2.c
blobb0f16d223adf58334ace45a59ae128a36ef50e37
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Maxtor Shared Storage II Board Setup
5 * Maintainer: Sylver Bruneau <sylver.bruneau@googlemail.com>
6 */
8 #include <linux/kernel.h>
9 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <linux/pci.h>
12 #include <linux/irq.h>
13 #include <asm/mach-types.h>
14 #include <asm/mach/arch.h>
15 #include <asm/mach/pci.h>
16 #include "orion5x.h"
17 #include "bridge-regs.h"
18 #include "common.h"
20 /*****************************************************************************
21 * Maxtor Shared Storage II Info
22 ****************************************************************************/
24 /****************************************************************************
25 * PCI setup
26 ****************************************************************************/
27 static int __init mss2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
29 int irq;
32 * Check for devices with hard-wired IRQs.
34 irq = orion5x_pci_map_irq(dev, slot, pin);
35 if (irq != -1)
36 return irq;
38 return -1;
41 static struct hw_pci mss2_pci __initdata = {
42 .nr_controllers = 2,
43 .setup = orion5x_pci_sys_setup,
44 .scan = orion5x_pci_sys_scan_bus,
45 .map_irq = mss2_pci_map_irq,
48 static int __init mss2_pci_init(void)
50 if (machine_is_mss2())
51 pci_common_init(&mss2_pci);
53 return 0;
55 subsys_initcall(mss2_pci_init);
57 /*****************************************************************************
58 * MSS2 power off method
59 ****************************************************************************/
61 * On the Maxtor Shared Storage II, the shutdown process is the following :
62 * - Userland modifies U-boot env to tell U-boot to go idle at next boot
63 * - The board reboots
64 * - U-boot starts and go into an idle mode until the user press "power"
66 static void mss2_power_off(void)
68 u32 reg;
71 * Enable and issue soft reset
73 reg = readl(RSTOUTn_MASK);
74 reg |= 1 << 2;
75 writel(reg, RSTOUTn_MASK);
77 reg = readl(CPU_SOFT_RESET);
78 reg |= 1;
79 writel(reg, CPU_SOFT_RESET);
82 void __init mss2_init(void)
84 /* register mss2 specific power-off method */
85 pm_power_off = mss2_power_off;