2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 11:44:01 +08:00
linux-next/arch/arm/mach-orion5x/board-mss2.c
Arnd Bergmann c22c2c6008 ARM: orion5x: clean up mach/*.h headers
This is a simple move of all header files that are no longer
included by anything else from the include/mach directory
to the platform directory itself as preparation for
multiplatform support.

The mach/uncompress.h headers are left in place for now,
and are mildly modified to be independent of the other
headers. They will be removed entirely when ARCH_MULTIPLATFORM
gets enabled and they become obsolete.

Rather than updating the path names inside of the comments
of each header, I delete those comments to avoid having to
update them again, should they get moved or copied another
time.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2015-12-07 18:17:48 +01:00

91 lines
2.3 KiB
C

/*
* Maxtor Shared Storage II Board Setup
*
* Maintainer: Sylver Bruneau <sylver.bruneau@googlemail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/pci.h>
#include <linux/irq.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/pci.h>
#include "orion5x.h"
#include "bridge-regs.h"
#include "common.h"
/*****************************************************************************
* Maxtor Shared Storage II Info
****************************************************************************/
/****************************************************************************
* PCI setup
****************************************************************************/
static int __init mss2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int irq;
/*
* Check for devices with hard-wired IRQs.
*/
irq = orion5x_pci_map_irq(dev, slot, pin);
if (irq != -1)
return irq;
return -1;
}
static struct hw_pci mss2_pci __initdata = {
.nr_controllers = 2,
.setup = orion5x_pci_sys_setup,
.scan = orion5x_pci_sys_scan_bus,
.map_irq = mss2_pci_map_irq,
};
static int __init mss2_pci_init(void)
{
if (machine_is_mss2())
pci_common_init(&mss2_pci);
return 0;
}
subsys_initcall(mss2_pci_init);
/*****************************************************************************
* MSS2 power off method
****************************************************************************/
/*
* On the Maxtor Shared Storage II, the shutdown process is the following :
* - Userland modifies U-boot env to tell U-boot to go idle at next boot
* - The board reboots
* - U-boot starts and go into an idle mode until the user press "power"
*/
static void mss2_power_off(void)
{
u32 reg;
/*
* Enable and issue soft reset
*/
reg = readl(RSTOUTn_MASK);
reg |= 1 << 2;
writel(reg, RSTOUTn_MASK);
reg = readl(CPU_SOFT_RESET);
reg |= 1;
writel(reg, CPU_SOFT_RESET);
}
void __init mss2_init(void)
{
/* register mss2 specific power-off method */
pm_power_off = mss2_power_off;
}