blob: 19ef1859441587790f14f48b0de3bdbef024e7d1 [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>
Russell Kingfced80c2008-09-06 12:10:45 +010013#include <linux/io.h>
Andrew Lunn554cdae2011-05-15 13:32:53 +020014#include <plat/mpp.h>
Arnd Bergmannc22c2c62015-12-02 22:27:08 +010015#include "orion5x.h"
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020016#include "mpp.h"
Andrew Lunn554cdae2011-05-15 13:32:53 +020017#include "common.h"
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020018
Andrew Lunn554cdae2011-05-15 13:32:53 +020019static unsigned int __init orion5x_variant(void)
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020020{
21 u32 dev;
22 u32 rev;
23
24 orion5x_pcie_id(&dev, &rev);
25
Imre Kaloze8885cb2011-07-18 22:05:12 +020026 if (dev == MV88F5181_DEV_ID)
Andrew Lunn554cdae2011-05-15 13:32:53 +020027 return MPP_F5181_MASK;
28
29 if (dev == MV88F5182_DEV_ID)
30 return MPP_F5182_MASK;
31
32 if (dev == MV88F5281_DEV_ID)
33 return MPP_F5281_MASK;
34
35 printk(KERN_ERR "MPP setup: unknown orion5x variant "
36 "(dev %#x rev %#x)\n", dev, rev);
37 return 0;
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020038}
39
Andrew Lunn554cdae2011-05-15 13:32:53 +020040void __init orion5x_mpp_conf(unsigned int *mpp_list)
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020041{
Andrew Lunn554cdae2011-05-15 13:32:53 +020042 orion_mpp_conf(mpp_list, orion5x_variant(),
43 MPP_MAX, ORION5X_DEV_BUS_VIRT_BASE);
Lennert Buytenhek19cfd5c2008-05-10 23:25:46 +020044}