summaryrefslogtreecommitdiff
path: root/Include/AMICSPLib.h
blob: 7fe493246f8cbacf7234898b061e9847dd909a57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2008, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************

//**********************************************************************
// $Header: /Alaska/BIN/Chipset/Template/CSPLibrary/AMICSPLib.h 5     2/22/11 4:25p Artems $
//
// $Revision: 5 $
//
// $Date: 2/22/11 4:25p $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/Chipset/Template/CSPLibrary/AMICSPLib.h $
// 
// 5     2/22/11 4:25p Artems
// EIP 51548 - Added AMI copyright headers, replaced TABs with spaces
// 
// 4     2/22/11 4:22p Artems
// EIP 51548 - Added AMI copyright headers, replaced TABs with spaces
// 
// 3     6/11/09 5:55p Robert
// CHM and coding standard update
// 
// 2     9/27/05 3:20p Sivagarn
// Included the macro "CSP_PCI_CFG_ADDRESS"
// 
// 1     1/21/05 12:46p Sivagarn
// Initial Checkin - Version 0.05
//
//**********************************************************************

//<AMI_FHDR_START>
//----------------------------------------------------------------------------
//
// Name: AmiCspLib.h
//
// Description: 
//  This file contains generic code to add functionality that can be used 
//  by any module.
//
//----------------------------------------------------------------------------
//<AMI_FHDR_END>

#ifndef __AMICSPLIB__H__
#define __AMICSPLIB__H__

#include <AmiCSPLibInc.H>

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Name: CSP_PCI_CFG_ADDRESS
//
// Description:
//  This MACRO Converts bus, device function and register number into 64bit 
//  PCI configuration address
//
// Input:
//  bus - PCI bus where the device resides
//  dev - PCI device number to access
//  func - function number of the device being accessed
//  reg - PCI register of the function being accessed
//
// Notes:
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
#define CSP_PCI_CFG_ADDRESS(bus,dev,func,reg)   \
 ((UINT64) ( (((UINTN)bus) <<   24) +   (((UINTN)dev)   << 16) + (((UINTN)func) << 8)   +   ((UINTN)reg) ))& 0x00000000ffffffff



#endif      // __AMICSPLIB__H__

//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2008, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************