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 */
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. */
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. */
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 /************************************************************************/
32 struct iSeries_Device_Node;
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;
41 * iSeries_IoMmTable_Initialize
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.
50 extern void iSeries_IoMmTable_Initialize(void);
51 extern void iSeries_IoMmTable_Status(void);
54 * iSeries_allocateDeviceBars
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.
62 * pci_dev = Pointer to pci_dev structure that will be mapped to pseudo
66 * The pci_dev I/O resources updated with pseudo I/O Addresses.
68 extern void iSeries_allocateDeviceBars(struct pci_dev *);
71 * iSeries_xlateIoMmAddress
73 * - Translates an I/O Memory address to Device Node that has been the
74 * allocated the psuedo I/O Address.
77 * IoAddress = I/O Memory Address.
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.
83 extern struct iSeries_Device_Node *iSeries_xlateIoMmAddress(void *IoAddress);
85 #endif /* _ISERIES_IOMMTABLE_H */