xref: /OK3568_Linux_fs/kernel/arch/arm/mach-mv78xx0/mpp.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * arch/arm/mach-mv78x00/mpp.c
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * MPP functions for Marvell MV78x00 SoCs
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * This file is licensed under the terms of the GNU General Public
7*4882a593Smuzhiyun  * License version 2.  This program is licensed "as is" without any
8*4882a593Smuzhiyun  * warranty of any kind, whether express or implied.
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun #include <linux/gpio.h>
11*4882a593Smuzhiyun #include <linux/kernel.h>
12*4882a593Smuzhiyun #include <linux/init.h>
13*4882a593Smuzhiyun #include <linux/io.h>
14*4882a593Smuzhiyun #include <plat/mpp.h>
15*4882a593Smuzhiyun #include "mv78xx0.h"
16*4882a593Smuzhiyun #include "common.h"
17*4882a593Smuzhiyun #include "mpp.h"
18*4882a593Smuzhiyun 
mv78xx0_variant(void)19*4882a593Smuzhiyun static unsigned int __init mv78xx0_variant(void)
20*4882a593Smuzhiyun {
21*4882a593Smuzhiyun 	u32 dev, rev;
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun 	mv78xx0_pcie_id(&dev, &rev);
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun 	if (dev == MV78100_DEV_ID && rev >= MV78100_REV_A0)
26*4882a593Smuzhiyun 		return MPP_78100_A0_MASK;
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun 	printk(KERN_ERR "MPP setup: unknown mv78x00 variant "
29*4882a593Smuzhiyun 			"(dev %#x rev %#x)\n", dev, rev);
30*4882a593Smuzhiyun 	return 0;
31*4882a593Smuzhiyun }
32*4882a593Smuzhiyun 
mv78xx0_mpp_conf(unsigned int * mpp_list)33*4882a593Smuzhiyun void __init mv78xx0_mpp_conf(unsigned int *mpp_list)
34*4882a593Smuzhiyun {
35*4882a593Smuzhiyun 	orion_mpp_conf(mpp_list, mv78xx0_variant(),
36*4882a593Smuzhiyun 		       MPP_MAX, DEV_BUS_VIRT_BASE);
37*4882a593Smuzhiyun }
38