summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2019-11-17 14:22:08 +0800
committerIru Cai <mytbk920423@gmail.com>2019-11-17 15:11:03 +0800
commite02c1606b0c5e1061f666507d20e76aca068168a (patch)
treea2bbbfd2771b4441cd5a6063ab36ec31c34925a1
parentec9d952e0d3226ebed56321feb903382026598d1 (diff)
downloadcoreboot-e02c1606b0c5e1061f666507d20e76aca068168a.tar.xz
wait_5084
-rw-r--r--src/northbridge/intel/haswell/mrc.asm34
-rw-r--r--src/northbridge/intel/haswell/mrc_misc.c13
-rw-r--r--src/northbridge/intel/haswell/mrc_misc.h1
3 files changed, 17 insertions, 31 deletions
diff --git a/src/northbridge/intel/haswell/mrc.asm b/src/northbridge/intel/haswell/mrc.asm
index 6d156e2013..4ffd451bc5 100644
--- a/src/northbridge/intel/haswell/mrc.asm
+++ b/src/northbridge/intel/haswell/mrc.asm
@@ -223,6 +223,7 @@ global fcn_fffb7866
extern frag_fffa5810
extern frag_fffa58f7
extern wait_5030
+extern wait_5084
;;
mrc_entry:
@@ -4582,7 +4583,7 @@ jmp short loc_fffa7821 ; jmp 0xfffa7821
loc_fffa77fb: ; not directly referenced
mov eax, ebx
-call fcn_fffbd79f ; call 0xfffbd79f
+call wait_5084
test eax, eax
mov edx, 0x11
jne short loc_fffa7821 ; jne 0xfffa7821
@@ -30528,35 +30529,6 @@ pop edi
pop ebp
ret
-fcn_fffbd79f: ; not directly referenced
-push ebp
-mov ebp, esp
-push esi
-mov esi, eax
-push ebx
-call mrc_get_timestamp
-lea ebx, [eax + 0x2710]
-
-loc_fffbd7b1: ; not directly referenced
-mov eax, dword [esi + 0x103f]
-mov eax, dword [eax + 0x5084]
-test eax, 0x10000
-jne short loc_fffbd7d4 ; jne 0xfffbd7d4
-call mrc_get_timestamp
-cmp ebx, eax
-ja short loc_fffbd7b1 ; ja 0xfffbd7b1
-mov eax, 0x11
-jmp short loc_fffbd7d6 ; jmp 0xfffbd7d6
-
-loc_fffbd7d4: ; not directly referenced
-xor eax, eax
-
-loc_fffbd7d6: ; not directly referenced
-pop ebx
-pop esi
-pop ebp
-ret
-
fcn_fffbd7da: ; not directly referenced
push ebp
mov ebp, esp
@@ -30570,7 +30542,7 @@ call wait_5030
test eax, eax
jne loc_fffbdf5f ; jne 0xfffbdf5f
mov eax, ebx
-call fcn_fffbd79f ; call 0xfffbd79f
+call wait_5084
test eax, eax
jne loc_fffbdf5f ; jne 0xfffbdf5f
mov eax, dword [ebx + 0x103f]
diff --git a/src/northbridge/intel/haswell/mrc_misc.c b/src/northbridge/intel/haswell/mrc_misc.c
index 260d0a0a1c..ac0d8bf574 100644
--- a/src/northbridge/intel/haswell/mrc_misc.c
+++ b/src/northbridge/intel/haswell/mrc_misc.c
@@ -1632,3 +1632,16 @@ int MRCABI wait_5030(void *ramdata)
} while (ts < end_ts);
return 0x11;
}
+
+int MRCABI wait_5084(void *ramdata)
+{
+ uint32_t end_ts = mrc_get_timestamp() + 10000;
+ uint32_t ts;
+ do {
+ uint32_t reg32 = MCHBAR32(0x5084);
+ if ((reg32 & 0x10000) != 0)
+ return 0;
+ ts = mrc_get_timestamp();
+ } while (ts < end_ts);
+ return 0x11;
+}
diff --git a/src/northbridge/intel/haswell/mrc_misc.h b/src/northbridge/intel/haswell/mrc_misc.h
index 0707b98f41..6dc54df413 100644
--- a/src/northbridge/intel/haswell/mrc_misc.h
+++ b/src/northbridge/intel/haswell/mrc_misc.h
@@ -57,3 +57,4 @@ int fcn_fffb8689(void *ramdata);
int fcn_fffa7a1c(void *ramdata);
int fcn_fffc7720(void *ramdata);
int MRCABI wait_5030(void *ramdata);
+int MRCABI wait_5084(void *ramdata);