diff options
author | Iru Cai <mytbk920423@gmail.com> | 2019-01-01 19:30:48 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2019-11-17 15:10:46 +0800 |
commit | 3c7343686d7ff061f8a18a5b20f1f24640905588 (patch) | |
tree | 03c7bd9bed7410ce6e2f6a6b02c1f4804937c7c1 /src | |
parent | 8b1fed86bb5d3429d876e2393ffc529e87dfe57c (diff) | |
download | coreboot-3c7343686d7ff061f8a18a5b20f1f24640905588.tar.xz |
[NOT TESTED] expand frag_fffa1e83
Diffstat (limited to 'src')
-rw-r--r-- | src/northbridge/intel/haswell/mrc.asm | 116 | ||||
-rw-r--r-- | src/northbridge/intel/haswell/mrc_frags.c | 69 |
2 files changed, 69 insertions, 116 deletions
diff --git a/src/northbridge/intel/haswell/mrc.asm b/src/northbridge/intel/haswell/mrc.asm index 02c99555fa..6a4f052469 100644 --- a/src/northbridge/intel/haswell/mrc.asm +++ b/src/northbridge/intel/haswell/mrc.asm @@ -1445,122 +1445,6 @@ push ebx call frag_fffa1e83 add esp, 12 -loc_fffa2673: -cmp byte [edi], 0xa -jbe short loc_fffa2698 ; jbe 0xfffa2698 -mov al, byte [esi + 0xc2] -mov byte [ebx + 0x59], al -mov al, byte [esi + 0xc3] -mov byte [ebx + 0x5a], al -mov al, byte [esi + 0xc4] -mov byte [ebx + 0x6e5], al -jmp short loc_fffa26a7 ; jmp 0xfffa26a7 - -loc_fffa2698: -mov byte [ebx + 0x59], 1 -mov byte [ebx + 0x5a], 1 -mov byte [ebx + 0x6e5], 0 - -loc_fffa26a7: -cmp byte [edi], 0xb -mov al, byte [ebx + 0x6dd] -jbe short loc_fffa26c5 ; jbe 0xfffa26c5 -mov dl, byte [esi + 0xc5] -and eax, 0xfffffff7 -and edx, 1 -shl edx, 3 -or eax, edx -jmp short loc_fffa26c8 ; jmp 0xfffa26c8 - -loc_fffa26c5: -or eax, 8 - -loc_fffa26c8: -mov byte [ebx + 0x6dd], al -cmp byte [edi], 0xe -mov al, 1 -jbe short loc_fffa26de ; jbe 0xfffa26de -mov al, byte [esi + 0xc7] -and eax, 1 - -loc_fffa26de: -mov dl, al -mov al, byte [ebx + 0x6de] -shl edx, 4 -and eax, 0xffffffef -or eax, edx -mov dword [ebx + 0x41], 0 -mov byte [ebx + 0x6de], al -mov byte [ebx + 0x40], 0 -mov al, byte [esi + 0x11] -cmp dword [ebx + 0x2d], HASWELL_FAMILY_ULT -mov byte [ebx + 0x56], al -mov al, byte [esi + 0x2c] -mov byte [ebx + 0x58], al -mov al, byte [esi] -mov byte [ebx + 0x53], al -mov al, byte [esi + 0x52] -mov byte [ebx + 0x6e1], al -jne short loc_fffa2732 ; jne 0xfffa2732 -mov al, byte [esi + 0x57] -mov byte [ebx + 0x6e3], 0 -mov byte [ebx + 0x6e2], al - -loc_fffa2732: -lea ecx, [ebx + 0xdf] -mov byte [ebx + 0xe3], 0 -mov dword [ebp - 0x1c], 0 - -loc_fffa2746: -imul edx, dword [ebp - 0x1c], 0x2fa -add edx, ecx -mov eax, edx -mov dword [ebp - 0x28], edx -mov edx, dword [ebp - 0x1c] -add eax, 5 -mov dl, byte [esi + edx + 0x2a] -cmp dl, 2 -mov byte [ebp - 0x20], dl -je short loc_fffa2782 ; je 0xfffa2782 -cmp dl, 3 -je short loc_fffa27a9 ; je 0xfffa27a9 -dec dl -jne short loc_fffa27cd ; jne 0xfffa27cd -mov dword [eax + 8], 1 -mov dword [eax + 0x157], 0 -jmp short loc_fffa2793 ; jmp 0xfffa2793 - -loc_fffa2782: -mov dword [eax + 8], 0 -mov dword [eax + 0x157], 1 - -loc_fffa2793: -mov edx, dword [ebp - 0x28] -mov dword [edx + 5], 2 -inc byte [ecx + 4] -mov dword [eax + 4], 1 -jmp short loc_fffa27f2 ; jmp 0xfffa27f2 - -loc_fffa27a9: -mov edx, dword [ebp - 0x28] -mov dword [eax + 8], 1 -mov dword [eax + 0x157], 1 -mov dword [edx + 5], 1 -mov dword [eax + 4], 0 -jmp short loc_fffa27f2 ; jmp 0xfffa27f2 - -loc_fffa27cd: -mov edx, dword [ebp - 0x28] -mov dword [eax + 8], 0 -mov dword [eax + 0x157], 0 -mov dword [edx + 5], 2 -inc byte [ecx + 4] -mov dword [eax + 4], 2 - -loc_fffa27f2: -inc dword [ebp - 0x1c] -cmp dword [ebp - 0x1c], 2 -jne loc_fffa2746 ; jne 0xfffa2746 mov eax, dword [edi + 1] mov al, byte [eax] mov byte [ebx + 0x23a], al diff --git a/src/northbridge/intel/haswell/mrc_frags.c b/src/northbridge/intel/haswell/mrc_frags.c index 4e28fc3611..a4826399df 100644 --- a/src/northbridge/intel/haswell/mrc_frags.c +++ b/src/northbridge/intel/haswell/mrc_frags.c @@ -208,6 +208,75 @@ void frag_fffa1e83(void *ebx, void *esi, void *edi) *(u8*)(ebx + 0xde) = 0x40; } } + + if (v > 10) { + T8(0x59, 0xc2); T8(0x5a, 0xc3); T8(0x6e5, 0xc4); + } else { + *(u8*)(ebx + 0x59) = 1; + *(u8*)(ebx + 0x5a) = 1; + *(u8*)(ebx + 0x6e5) = 0; + } + + tmp = *(u8*)(ebx + 0x6dd); + if (v > 11) { + tmp = shupd(tmp, *(u8*)(esi + 0xc5), 3); + } else { + tmp |= 8; + } + *(u8*)(ebx + 0x6dd) = tmp; + + tmp = *(u8*)(ebx + 0x6de); + if (v > 0xe) { + tmp = shupd(tmp, *(u8*)(esi + 0xc7), 4); + } else { + tmp = shupd(tmp, 1, 4); + } + *(u8*)(ebx + 0x6de) = tmp; + + *(u32*)(ebx + 0x41) = 0; + *(u8*)(ebx + 0x40) = 0; + T8(0x56, 0x11); + T8(0x58, 0x2c); + T8(0x53, 0); + T8(0x6e1, 0x52); + + if (*(u32*)(ebx + 0x2d) == HASWELL_FAMILY_ULT) { + *(u8*)(ebx + 0x6e3) = 0; + T8(0x6e2, 0x57); + } + + void *ptr0 = ebx + 0xdf; + *(u8*)(ebx + 0xe3) = 0; + for (int i = 0; i < 2; i++) { + void *ptr1 = ptr0 + i * 0x2fa; + void *ptr2 = ptr1 + 5; + tmp = *(u8*)(esi + i + 0x2a); + if (tmp == 2) { + *(u32*)(ptr2 + 8) = 0; + *(u32*)(ptr2 + 0x157) = 1; + *(u32*)(ptr1 + 5) = 2; + (*(u8*)(ptr0 + 4))++; + *(u32*)(ptr2 + 4) = 1; + } else if (tmp == 3) { + *(u32*)(ptr2 + 8) = 1; + *(u32*)(ptr2 + 0x157) = 1; + *(u32*)(ptr1 + 5) = 1; + *(u32*)(ptr2 + 4) = 0; + } else if (tmp != 1) { + *(u32*)(ptr2 + 8) = 0; + *(u32*)(ptr2 + 0x157) = 0; + *(u32*)(ptr1 + 5) = 2; + (*(u8*)(ptr0 + 4))++; + *(u32*)(ptr2 + 4) = 2; + } else { /* tmp == 1 */ + *(u32*)(ptr2 + 8) = 1; + *(u32*)(ptr2 + 0x157) = 0; + *(u32*)(ptr1 + 5) = 2; + (*(u8*)(ptr0 + 4))++; + *(u32*)(ptr2 + 4) = 1; + } + } + } void frag_fffa5d3c(void *bar, uint32_t offset); |