Nicolas Pitre | 0100def | 2009-01-30 22:44:20 -0500 | [diff] [blame] | 1 | /* |
| 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 King | 2f8163b | 2011-07-26 10:53:52 +0100 | [diff] [blame^] | 10 | #include <linux/gpio.h> |
Nicolas Pitre | 0100def | 2009-01-30 22:44:20 -0500 | [diff] [blame] | 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/mbus.h> |
| 14 | #include <linux/io.h> |
Nicolas Pitre | 0100def | 2009-01-30 22:44:20 -0500 | [diff] [blame] | 15 | #include <mach/hardware.h> |
Andrew Lunn | b2f427a | 2011-05-15 13:32:52 +0200 | [diff] [blame] | 16 | #include <plat/mpp.h> |
Nicolas Pitre | 0100def | 2009-01-30 22:44:20 -0500 | [diff] [blame] | 17 | #include "common.h" |
| 18 | #include "mpp.h" |
| 19 | |
| 20 | static unsigned int __init kirkwood_variant(void) |
| 21 | { |
| 22 | u32 dev, rev; |
| 23 | |
| 24 | kirkwood_pcie_id(&dev, &rev); |
| 25 | |
Saeed Bishara | 1e4d2d3 | 2010-06-01 18:09:27 +0300 | [diff] [blame] | 26 | if ((dev == MV88F6281_DEV_ID && rev >= MV88F6281_REV_A0) || |
| 27 | (dev == MV88F6282_DEV_ID)) |
Nicolas Pitre | 0100def | 2009-01-30 22:44:20 -0500 | [diff] [blame] | 28 | return MPP_F6281_MASK; |
| 29 | 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 | |
| 34 | printk(KERN_ERR "MPP setup: unknown kirkwood variant " |
| 35 | "(dev %#x rev %#x)\n", dev, rev); |
| 36 | return 0; |
| 37 | } |
| 38 | |
Nicolas Pitre | 0100def | 2009-01-30 22:44:20 -0500 | [diff] [blame] | 39 | void __init kirkwood_mpp_conf(unsigned int *mpp_list) |
| 40 | { |
Andrew Lunn | b2f427a | 2011-05-15 13:32:52 +0200 | [diff] [blame] | 41 | orion_mpp_conf(mpp_list, kirkwood_variant(), |
| 42 | MPP_MAX, DEV_BUS_VIRT_BASE); |
Nicolas Pitre | 0100def | 2009-01-30 22:44:20 -0500 | [diff] [blame] | 43 | } |