blob: b6ddd7a5db6ac77eb63de44f4cfd6d9f2b6c8937 [file] [log] [blame]
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +02001/*
2 * arch/arm/mach-orion5x/mpp.c
3 *
4 * MPP functions for Marvell Orion 5x 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 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mbus.h>
Russell Kingfced80c2008-09-06 12:10:45 +010014#include <linux/io.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010015#include <mach/hardware.h>
Andrew Lunn554cdae2011-05-15 13:32:53 +020016#include <plat/mpp.h>
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020017#include "mpp.h"
Andrew Lunn554cdae2011-05-15 13:32:53 +020018#include "common.h"
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020019
Andrew Lunn554cdae2011-05-15 13:32:53 +020020static unsigned int __init orion5x_variant(void)
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020021{
22 u32 dev;
23 u32 rev;
24
25 orion5x_pcie_id(&dev, &rev);
26
Imre Kaloze8885cb2011-07-18 22:05:12 +020027 if (dev == MV88F5181_DEV_ID)
Andrew Lunn554cdae2011-05-15 13:32:53 +020028 return MPP_F5181_MASK;
29
30 if (dev == MV88F5182_DEV_ID)
31 return MPP_F5182_MASK;
32
33 if (dev == MV88F5281_DEV_ID)
34 return MPP_F5281_MASK;
35
36 printk(KERN_ERR "MPP setup: unknown orion5x variant "
37 "(dev %#x rev %#x)\n", dev, rev);
38 return 0;
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020039}
40
Andrew Lunn554cdae2011-05-15 13:32:53 +020041void __init orion5x_mpp_conf(unsigned int *mpp_list)
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020042{
Andrew Lunn554cdae2011-05-15 13:32:53 +020043 orion_mpp_conf(mpp_list, orion5x_variant(),
44 MPP_MAX, ORION5X_DEV_BUS_VIRT_BASE);
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020045}