xref: /openbmc/linux/arch/arm/mach-mv78xx0/mpp.c (revision f5c27da4)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * arch/arm/mach-mv78x00/mpp.c
4  *
5  * MPP functions for Marvell MV78x00 SoCs
6  */
7 #include <linux/gpio.h>
8 #include <linux/kernel.h>
9 #include <linux/init.h>
10 #include <linux/io.h>
11 #include <plat/mpp.h>
12 #include "mv78xx0.h"
13 #include "common.h"
14 #include "mpp.h"
15 
16 static unsigned int __init mv78xx0_variant(void)
17 {
18 	u32 dev, rev;
19 
20 	mv78xx0_pcie_id(&dev, &rev);
21 
22 	if (dev == MV78100_DEV_ID && rev >= MV78100_REV_A0)
23 		return MPP_78100_A0_MASK;
24 
25 	printk(KERN_ERR "MPP setup: unknown mv78x00 variant "
26 			"(dev %#x rev %#x)\n", dev, rev);
27 	return 0;
28 }
29 
30 void __init mv78xx0_mpp_conf(unsigned int *mpp_list)
31 {
32 	orion_mpp_conf(mpp_list, mv78xx0_variant(),
33 		       MPP_MAX, DEV_BUS_VIRT_BASE);
34 }
35