18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * arch/arm/mach-orion5x/mpp.c 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * MPP functions for Marvell Orion 5x SoCs 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public 78c2ecf20Sopenharmony_ci * License version 2. This program is licensed "as is" without any 88c2ecf20Sopenharmony_ci * warranty of any kind, whether express or implied. 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#include <linux/kernel.h> 128c2ecf20Sopenharmony_ci#include <linux/init.h> 138c2ecf20Sopenharmony_ci#include <linux/io.h> 148c2ecf20Sopenharmony_ci#include <plat/mpp.h> 158c2ecf20Sopenharmony_ci#include "orion5x.h" 168c2ecf20Sopenharmony_ci#include "mpp.h" 178c2ecf20Sopenharmony_ci#include "common.h" 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_cistatic unsigned int __init orion5x_variant(void) 208c2ecf20Sopenharmony_ci{ 218c2ecf20Sopenharmony_ci u32 dev; 228c2ecf20Sopenharmony_ci u32 rev; 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci orion5x_pcie_id(&dev, &rev); 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci if (dev == MV88F5181_DEV_ID) 278c2ecf20Sopenharmony_ci return MPP_F5181_MASK; 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci if (dev == MV88F5182_DEV_ID) 308c2ecf20Sopenharmony_ci return MPP_F5182_MASK; 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci if (dev == MV88F5281_DEV_ID) 338c2ecf20Sopenharmony_ci return MPP_F5281_MASK; 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci printk(KERN_ERR "MPP setup: unknown orion5x variant " 368c2ecf20Sopenharmony_ci "(dev %#x rev %#x)\n", dev, rev); 378c2ecf20Sopenharmony_ci return 0; 388c2ecf20Sopenharmony_ci} 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_civoid __init orion5x_mpp_conf(unsigned int *mpp_list) 418c2ecf20Sopenharmony_ci{ 428c2ecf20Sopenharmony_ci orion_mpp_conf(mpp_list, orion5x_variant(), 438c2ecf20Sopenharmony_ci MPP_MAX, ORION5X_DEV_BUS_VIRT_BASE); 448c2ecf20Sopenharmony_ci} 45