Merge tag 'v3.10.91' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-kirkwood / mpp.c
CommitLineData
0100defd
NP
1/*
2 * arch/arm/mach-kirkwood/mpp.c
3 *
4 * MPP functions for Marvell Kirkwood SoCs
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
2f8163ba 10#include <linux/gpio.h>
0100defd
NP
11#include <linux/kernel.h>
12#include <linux/init.h>
0100defd 13#include <linux/io.h>
0100defd 14#include <mach/hardware.h>
b2f427a1 15#include <plat/mpp.h>
0100defd
NP
16#include "common.h"
17#include "mpp.h"
18
19static unsigned int __init kirkwood_variant(void)
20{
21 u32 dev, rev;
22
23 kirkwood_pcie_id(&dev, &rev);
24
4089fe95 25 if (dev == MV88F6281_DEV_ID && rev >= MV88F6281_REV_A0)
0100defd 26 return MPP_F6281_MASK;
4089fe95
NS
27 if (dev == MV88F6282_DEV_ID)
28 return MPP_F6282_MASK;
0100defd
NP
29 if (dev == MV88F6192_DEV_ID && rev >= MV88F6192_REV_A0)
30 return MPP_F6192_MASK;
31 if (dev == MV88F6180_DEV_ID)
32 return MPP_F6180_MASK;
33
98adf932
AL
34 pr_err("MPP setup: unknown kirkwood variant (dev %#x rev %#x)\n",
35 dev, rev);
0100defd
NP
36 return 0;
37}
38
0100defd
NP
39void __init kirkwood_mpp_conf(unsigned int *mpp_list)
40{
b2f427a1
AL
41 orion_mpp_conf(mpp_list, kirkwood_variant(),
42 MPP_MAX, DEV_BUS_VIRT_BASE);
0100defd 43}