blob: e96fd71abd766b113c1479a272b1da0db2fea436 [file] [log] [blame]
Nicolas Pitre0100def2009-01-30 22:44:20 -05001/*
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 */
Russell King2f8163b2011-07-26 10:53:52 +010010#include <linux/gpio.h>
Nicolas Pitre0100def2009-01-30 22:44:20 -050011#include <linux/kernel.h>
12#include <linux/init.h>
Nicolas Pitre0100def2009-01-30 22:44:20 -050013#include <linux/io.h>
Nicolas Pitre0100def2009-01-30 22:44:20 -050014#include <mach/hardware.h>
Andrew Lunnb2f427a2011-05-15 13:32:52 +020015#include <plat/mpp.h>
Nicolas Pitre0100def2009-01-30 22:44:20 -050016#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
Nicolas Schichan4089fe92013-06-06 19:00:46 +020025 if (dev == MV88F6281_DEV_ID && rev >= MV88F6281_REV_A0)
Nicolas Pitre0100def2009-01-30 22:44:20 -050026 return MPP_F6281_MASK;
Nicolas Schichan4089fe92013-06-06 19:00:46 +020027 if (dev == MV88F6282_DEV_ID)
28 return MPP_F6282_MASK;
Nicolas Pitre0100def2009-01-30 22:44:20 -050029 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
Andrew Lunn98adf9322012-10-20 13:23:16 +020034 pr_err("MPP setup: unknown kirkwood variant (dev %#x rev %#x)\n",
35 dev, rev);
Nicolas Pitre0100def2009-01-30 22:44:20 -050036 return 0;
37}
38
Nicolas Pitre0100def2009-01-30 22:44:20 -050039void __init kirkwood_mpp_conf(unsigned int *mpp_list)
40{
Andrew Lunnb2f427a2011-05-15 13:32:52 +020041 orion_mpp_conf(mpp_list, kirkwood_variant(),
42 MPP_MAX, DEV_BUS_VIRT_BASE);
Nicolas Pitre0100def2009-01-30 22:44:20 -050043}