1 #ifndef _ISERIES_IOMMTABLE_H
2 #define _ISERIES_IOMMTABLE_H
3 /************************************************************************/
4 /* File iSeries_IoMmTable.h created by Allan Trautman on Dec 12 2001.   */
5 /************************************************************************/
6 /* Interfaces for the write/read Io address translation table.          */
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 December 12, 2000                                          */
27 /*   Ported to ppc64, August 30, 2001                                   */
28 /* End Change Activity                                                  */
29 /************************************************************************/
30 
31 struct pci_dev;
32 struct iSeries_Device_Node;
33 
34 extern struct iSeries_Device_Node** iSeries_IoMmTable;
35 extern u8*                          iSeries_IoBarTable;
36 extern unsigned long iSeries_Base_Io_Memory;
37 extern unsigned long iSeries_Max_Io_Memory;
38 extern unsigned long iSeries_Base_Io_Memory;
39 extern unsigned long iSeries_IoMmTable_Entry_Size;
40 /************************************************************************/
41 /* iSeries_IoMmTable_Initialize                                         */
42 /************************************************************************/
43 /* - Initalizes the Address Translation Table and get it ready for use. */
44 /*   Must be called before any client calls any of the other methods.   */
45 /*                                                                      */
46 /* Parameters: None.                                                    */
47 /*                                                                      */
48 /* Return: None.                                                        */
49 /************************************************************************/
50 extern  void iSeries_IoMmTable_Initialize(void);
51 extern  void iSeries_IoMmTable_Status(void);
52 
53 /************************************************************************/
54 /* iSeries_allocateDeviceBars                                           */
55 /************************************************************************/
56 /* - Allocates ALL pci_dev BAR's and updates the resources with the BAR */
57 /*   value.  BARS with zero length will not have the resources.  The    */
58 /*   HvCallPci_getBarParms is used to get the size of the BAR space.    */
59 /*   It calls iSeries_IoMmTable_AllocateEntry to allocate each entry.   */
60 /*                                                                      */
61 /* Parameters:                                                          */
62 /* pci_dev = Pointer to pci_dev structure that will be mapped to pseudo */
63 /*           I/O Address.                                               */
64 /*                                                                      */
65 /* Return:                                                              */
66 /*   The pci_dev I/O resources updated with pseudo I/O Addresses.       */
67 /************************************************************************/
68 extern  void iSeries_allocateDeviceBars(struct pci_dev* );
69 
70 /************************************************************************/
71 /* iSeries_xlateIoMmAddress                                             */
72 /************************************************************************/
73 /* - Translates an I/O Memory address to Device Node that has been the  */
74 /*   allocated the pseudo I/O Address.                                  */
75 /*                                                                      */
76 /* Parameters:                                                          */
77 /* IoAddress = I/O Memory Address.                                      */
78 /*                                                                      */
79 /* Return:                                                              */
80 /*   An iSeries_Device_Node to the device mapped to the I/O address. The*/
81 /*   BarNumber and BarOffset are valid if the Device Node is returned.  */
82 /************************************************************************/
83 extern struct iSeries_Device_Node* iSeries_xlateIoMmAddress(void* IoAddress);
84 
85 #endif /* _ISERIES_IOMMTABLE_H */
86