~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/asm-ppc64/iSeries/iSeries_pci.h

Version: ~ [ linux-5.1-rc1 ] ~ [ linux-5.0.3 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.30 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.107 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.164 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.176 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.136 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.63 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _ISERIES_64_PCI_H
  2 #define _ISERIES_64_PCI_H
  3 /************************************************************************/
  4 /* File iSeries_pci.h created by Allan Trautman on Tue Feb 20, 2001.    */
  5 /************************************************************************/
  6 /* Define some useful macros for the iSeries pci routines.              */
  7 /* Copyright (C) 20yy  Allan H Trautman, IBM Corporation                */
  8 /*                                                                      */
  9 /* This program is free software; you can redistribute it and/or modify */
 10 /* it under the terms of the GNU General Public License as published by */
 11 /* the Free Software Foundation; either version 2 of the License, or    */
 12 /* (at your option) any later version.                                  */
 13 /*                                                                      */
 14 /* This program is distributed in the hope that it will be useful,      */ 
 15 /* but WITHOUT ANY WARRANTY; without even the implied warranty of       */
 16 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
 17 /* GNU General Public License for more details.                         */
 18 /*                                                                      */
 19 /* You should have received a copy of the GNU General Public License    */ 
 20 /* along with this program; if not, write to the:                       */
 21 /* Free Software Foundation, Inc.,                                      */ 
 22 /* 59 Temple Place, Suite 330,                                          */ 
 23 /* Boston, MA  02111-1307  USA                                          */
 24 /************************************************************************/
 25 /* Change Activity:                                                     */
 26 /*   Created Feb 20, 2001                                               */
 27 /*   Added device reset, March 22, 2001                                 */
 28 /*   Ported to ppc64, May 25, 2001                                      */
 29 /* End Change Activity                                                  */
 30 /************************************************************************/
 31 #include <asm/iSeries/HvCallPci.h>
 32 
 33 struct pci_dev;                         /* For Forward Reference        */
 34 struct iSeries_Device_Node;
 35 /************************************************************************/
 36 /* Gets iSeries Bus, SubBus, of DevFn using pci_dev* structure          */
 37 /************************************************************************/
 38 #define ISERIES_BUS(DevPtr)    DevPtr->DsaAddr.busNumber
 39 #define ISERIES_SUBBUS(DevPtr) DevPtr->DsaAddr.subBusNumber
 40 #define ISERIES_DEVICE(DevPtr) DevPtr->DsaAddr.deviceId
 41 #define ISERIES_DEVFUN(DevPtr) DevPtr->DevFn
 42 #define ISERIES_DSA(DevPtr)   (*(u64*)&DevPtr->DsaAddr)
 43 #define ISERIES_DEVNODE(PciDev) ((struct iSeries_Device_Node*)PciDev->sysdata)
 44 
 45 #define EADsMaxAgents 7
 46 /************************************************************************************/
 47 /* Decodes Linux DevFn to iSeries DevFn, bridge device, or function.                */
 48 /* For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h                      */
 49 /************************************************************************************/
 50 #define ISERIES_DECODE_DEVFN(linuxdevfn)  (((linuxdevfn & 0x71) << 1) | (linuxdevfn & 0x07))
 51 #define ISERIES_DECODE_DEVICE(linuxdevfn) (((linuxdevfn & 0x38) >> 3) |(((linuxdevfn & 0x40) >> 2) + 0x10))
 52 #define ISERIES_DECODE_FUNCTION(linuxdevfn) (linuxdevfn & 0x07)
 53 #define ISERIES_PCI_AGENTID(idsel,func) ((idsel & 0x0F) << 4) | (func  & 0x07)
 54 
 55 #define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus)   ((subbus >> 5) & 0x7)
 56 #define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7)
 57 
 58 #define ISERIES_ENCODE_DEVICE(agentid)  ((0x10) | ((agentid&0x20)>>2) | (agentid&07))
 59 /************************************************************************************/
 60 /* Converts Virtual Address to Real Address for Hypervisor calls                    */
 61 /************************************************************************************/
 62 #define REALADDR(virtaddr)  (0x8000000000000000 | (virt_to_absolute((u64)virtaddr) ))
 63 
 64 /************************************************************************************/
 65 /* Define TRUE and FALSE Values for Al                                              */
 66 /************************************************************************************/
 67 #ifndef TRUE
 68 #define TRUE 1
 69 #endif
 70 #ifndef FALSE
 71 #define FALSE 0
 72 #endif
 73 
 74 /************************************************************************/
 75 /* iSeries Device Information                                           */
 76 /************************************************************************/
 77 struct iSeries_Device_Node {
 78         struct list_head Device_List;    /* Must be first for cast to wo*/
 79         struct pci_dev*  PciDev;         /* Pointer to pci_dev structure*/
 80         struct HvCallPci_DsaAddr DsaAddr;/* Direct Select Address       */
 81                                          /* busNumber,subBusNumber,     */ 
 82                                          /* deviceId, barNumber         */
 83         HvAgentId        AgentId;        /* Hypervisor DevFn            */
 84         int              DevFn;          /* Linux devfn                 */
 85         int              BarOffset;
 86         int              Irq;            /* Assigned IRQ                */
 87         int              ReturnCode;     /* Return Code Holder          */
 88         int              IoRetry;        /* Current Retry Count         */
 89         int              Flags;          /* Possible flags(disable/bist)*/
 90         u16              Vendor;         /* Vendor ID                   */
 91         u8               LogicalSlot;    /* Hv Slot Index for Tces      */
 92         struct TceTable* DevTceTable;    /* Device TCE Table            */ 
 93         u8               PhbId;          /* Phb Card is on.             */
 94         u16              Board;          /* Board Number                */
 95         u8               FrameId;        /* iSeries spcn Frame Id       */
 96         char             CardLocation[4];/* Char format of planar vpd   */
 97         char             Location[20];   /* Frame  1, Card C10          */
 98 };
 99 /************************************************************************/
100 /* Location Data extracted from the VPD list and device info.           */
101 /************************************************************************/
102 struct LocationDataStruct {     /* Location data structure for device  */
103         u16  Bus;               /* iSeries Bus Number              0x00*/
104         u16  Board;             /* iSeries Board                   0x02*/
105         u8   FrameId;           /* iSeries spcn Frame Id           0x04*/
106         u8   PhbId;             /* iSeries Phb Location            0x05*/
107         u8   AgentId;           /* iSeries AgentId                 0x06*/
108         u8   Card;
109         char CardLocation[4];      
110 };
111 typedef struct LocationDataStruct  LocationData;
112 #define LOCATION_DATA_SIZE      48
113 /************************************************************************/
114 /* Flight Recorder tracing                                              */
115 /************************************************************************/
116 extern int  iSeries_Set_PciTraceFlag(int TraceFlag);
117 extern int  iSeries_Get_PciTraceFlag(void);
118 
119 /************************************************************************/
120 /* Functions                                                            */
121 /************************************************************************/
122 extern LocationData* iSeries_GetLocationData(struct pci_dev* PciDev);
123 extern int           iSeries_Device_Information(struct pci_dev*,char*, int);
124 extern void          iSeries_Get_Location_Code(struct iSeries_Device_Node*);
125 extern int           iSeries_Device_ToggleReset(struct pci_dev* PciDev, int AssertTime, int DelayTime);
126 
127 #endif /* _ISERIES_64_PCI_H */
128 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp