AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / CPU / Family / 0x10 / RevD / F10RevD32.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     .586P
44
45 ;===============================================
46 ;===============================================
47 ;==
48 ;== M E M O R Y   P R E S E N T   S E G M E N T
49 ;==
50 ;===============================================
51 ;===============================================
52     .MODEL flat
53     .CODE
54
55 ;======================================================================
56 ; F10RevDProbeFilterCritical:  Performs critical sequence for probe
57 ;                              filter initialization.
58 ;
59 ;   In:
60 ;       PciAddress          Full PCI address of the node to init
61 ;       LocalPciRegister    Current value of F3x1D4
62 ;
63 ;
64 ;   Out:
65 ;       None
66 ;
67 ;   Destroyed:
68 ;       None
69 ;
70 ;======================================================================
71 F10RevDProbeFilterCritical PROC NEAR C PUBLIC USES EAX ECX EDX, PciAddress:DWORD, LocalPciRegister:DWORD
72
73   mov    ecx, 0C001001Fh
74   rdmsr
75   push   eax
76   push   ecx
77   push   edx
78   or     dh, 40h
79   wrmsr
80
81   mov    eax, 810003D4h
82
83   mov    ecx, LocalPciRegister
84   mov    edx, PciAddress
85   shr    edx, 4
86   and    dh, 0F8h
87   or     ah, dh
88
89   or     cl, 2
90   db     0Fh, 0AEh, 0F0h  ; MFENCE
91
92   mov    dx, 0CF8h        ; Set Reg Config Space
93   db     0Fh, 0AEh, 0F0h  ; MFENCE
94
95   out    dx, eax
96   db     0Fh, 0AEh, 0F0h  ; MFENCE
97
98   mov    dl, 0FCh         ; Set DX to Pci Config Data
99   mov    eax, ecx         ;Set config Reg data
100   db     0Fh, 0AEh, 0F0h  ; MFENCE
101
102   out    dx, eax          ; move data to return position
103   db     0Fh, 0AEh, 0F0h  ; MFENCE
104
105   pop    edx
106   pop    ecx
107   pop    eax
108   wrmsr
109   ret
110
111 F10RevDProbeFilterCritical ENDP
112
113 END