AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / CPU / Family / 0x10 / RevD / F10RevD64.asm
1 ;/**
2 ; * @file
3 ; *
4 ; * AGESA Family 10h Revision D support routines.
5 ; *
6 ; * @xrefitem bom "File Content Label" "Release Content"
7 ; * @e project:      AGESA
8 ; * @e sub-project:  CPU/F10
9 ; * @e \$Revision: 44324 $   @e \$Date: 2010-12-22 02:16:51 -0700 (Wed, 22 Dec 2010) $
10 ; */
11 ;*****************************************************************************
12 ;
13 ; Copyright (C) 2012 Advanced Micro Devices, Inc.
14 ; All rights reserved.
15 ;
16 ; Redistribution and use in source and binary forms, with or without
17 ; modification, are permitted provided that the following conditions are met:
18 ;     * Redistributions of source code must retain the above copyright
19 ;       notice, this list of conditions and the following disclaimer.
20 ;     * Redistributions in binary form must reproduce the above copyright
21 ;       notice, this list of conditions and the following disclaimer in the
22 ;       documentation and/or other materials provided with the distribution.
23 ;     * Neither the name of Advanced Micro Devices, Inc. nor the names of
24 ;       its contributors may be used to endorse or promote products derived
25 ;       from this software without specific prior written permission.
26 ;
27 ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
28 ; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29 ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30 ; DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
31 ; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32 ; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33 ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
34 ; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 ;
38 ;*****************************************************************************
39
40     .XLIST
41     .LIST
42
43 ;===============================================
44 ;===============================================
45 ;==
46 ;== M E M O R Y   P R E S E N T   S E G M E N T
47 ;==
48 ;===============================================
49 ;===============================================
50     .CODE
51
52 ;======================================================================
53 ; F10RevDProbeFilterCritical:  Performs critical sequence for probe
54 ;                              filter initialization.
55 ;
56 ;   In:
57 ;       PciAddress           Full PCI address of the node to init
58 ;       LocalPciRegister     Current value of F3x1D4
59 ;
60 ;
61 ;   Out:
62 ;       None
63 ;
64 ;   Destroyed:
65 ;       None
66 ;
67 ;======================================================================
68 PUBLIC F10RevDProbeFilterCritical
69 F10RevDProbeFilterCritical PROC
70
71   push   rax
72   push   rcx
73   push   rdx
74   push   rsi
75   push   rdi
76
77   mov    esi, ecx
78   mov    edi, edx
79
80   mov    ecx, 0C001001Fh
81   rdmsr
82   push   rax
83   push   rcx
84   push   rdx
85   or     dh, 40h
86   wrmsr
87
88   mov    eax, 810003D4h
89
90   mov    ecx, edi
91   mov    edx, esi
92
93   shr    edx, 4
94   and    dh, 0F8h
95   or     ah, dh
96
97   or     cl, 2
98   mfence
99
100   mov    dx, 0CF8h        ; Set Reg Config Space
101   mfence
102
103   out    dx, eax
104   mfence
105
106   mov    dl, 0FCh         ; Set DX to Pci Config Data
107   mov    eax, ecx         ;Set config Reg data
108   mfence
109
110   out    dx, eax          ; move data to return position
111   mfence
112
113   pop    rdx
114   pop    rcx
115   pop    rax
116   wrmsr
117
118   pop    rdi
119   pop    rsi
120   pop    rdx
121   pop    rcx
122   pop    rax
123   ret
124
125 F10RevDProbeFilterCritical ENDP
126
127 END