// SPDX-License-Identifier: GPL-2.0-or-later1/*2* Maxtor Shared Storage II Board Setup3*4* Maintainer: Sylver Bruneau <[email protected]>5*/67#include <linux/kernel.h>8#include <linux/init.h>9#include <linux/platform_device.h>10#include <linux/pci.h>11#include <linux/irq.h>12#include <asm/mach-types.h>13#include <asm/mach/arch.h>14#include <asm/mach/pci.h>15#include "orion5x.h"16#include "bridge-regs.h"17#include "common.h"1819/*****************************************************************************20* Maxtor Shared Storage II Info21****************************************************************************/2223/****************************************************************************24* PCI setup25****************************************************************************/26static int __init mss2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)27{28int irq;2930/*31* Check for devices with hard-wired IRQs.32*/33irq = orion5x_pci_map_irq(dev, slot, pin);34if (irq != -1)35return irq;3637return -1;38}3940static struct hw_pci mss2_pci __initdata = {41.nr_controllers = 2,42.setup = orion5x_pci_sys_setup,43.scan = orion5x_pci_sys_scan_bus,44.map_irq = mss2_pci_map_irq,45};4647static int __init mss2_pci_init(void)48{49if (machine_is_mss2())50pci_common_init(&mss2_pci);5152return 0;53}54subsys_initcall(mss2_pci_init);5556/*****************************************************************************57* MSS2 power off method58****************************************************************************/59/*60* On the Maxtor Shared Storage II, the shutdown process is the following :61* - Userland modifies U-boot env to tell U-boot to go idle at next boot62* - The board reboots63* - U-boot starts and go into an idle mode until the user press "power"64*/65static void mss2_power_off(void)66{67u32 reg;6869/*70* Enable and issue soft reset71*/72reg = readl(RSTOUTn_MASK);73reg |= 1 << 2;74writel(reg, RSTOUTn_MASK);7576reg = readl(CPU_SOFT_RESET);77reg |= 1;78writel(reg, CPU_SOFT_RESET);79}8081void __init mss2_init(void)82{83/* register mss2 specific power-off method */84register_platform_power_off(mss2_power_off);85}868788