Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * arch/arm/plat-orion/include/plat/mpp.h
0003  *
0004  * Marvell Orion SoC MPP handling.
0005  *
0006  * This file is licensed under the terms of the GNU General Public
0007  * License version 2.  This program is licensed "as is" without any
0008  * warranty of any kind, whether express or implied.
0009  */
0010 
0011 #ifndef __PLAT_MPP_H
0012 #define __PLAT_MPP_H
0013 
0014 #define MPP_NUM(x)  ((x) & 0xff)
0015 #define MPP_SEL(x)  (((x) >> 8) & 0xf)
0016 
0017 /* This is the generic MPP macro, without any variant information.
0018    Each machine architecture is expected to extend this with further
0019    bit fields indicating which MPP configurations are valid for a
0020    specific variant. */
0021 
0022 #define GENERIC_MPP(_num, _sel, _in, _out) ( \
0023     /* MPP number */        ((_num) & 0xff) | \
0024     /* MPP select value */      (((_sel) & 0xf) << 8) | \
0025     /* may be input signal */   ((!!(_in)) << 12) | \
0026     /* may be output signal */  ((!!(_out)) << 13))
0027 
0028 #define MPP_INPUT_MASK      GENERIC_MPP(0, 0x0, 1, 0)
0029 #define MPP_OUTPUT_MASK     GENERIC_MPP(0, 0x0, 0, 1)
0030 
0031 void __init orion_mpp_conf(unsigned int *mpp_list, unsigned int variant_mask,
0032                unsigned int mpp_max, void __iomem *dev_bus);
0033 
0034 #endif