From 20fa3436d223bf245f38e4e7f5b447c1ff2afd21 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Wed, 19 Dec 2018 14:32:14 +0800 Subject: mrc_sku_* -> nb_usb{2,3}_ports --- src/northbridge/intel/haswell/mrc.asm | 20 ++++++++++---------- src/northbridge/intel/haswell/mrc_sku.c | 17 ++++++----------- src/northbridge/intel/haswell/mrc_sku.h | 5 +++++ src/northbridge/intel/haswell/pei_usb.asm | 14 +++++++------- 4 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 src/northbridge/intel/haswell/mrc_sku.h (limited to 'src') diff --git a/src/northbridge/intel/haswell/mrc.asm b/src/northbridge/intel/haswell/mrc.asm index 4c970dc4e8..321e1c0b63 100644 --- a/src/northbridge/intel/haswell/mrc.asm +++ b/src/northbridge/intel/haswell/mrc.asm @@ -17,8 +17,8 @@ extern mrc_alloc extern mrc_sku_type extern mrc_smbus_inb extern mrc_smbus_outb -extern mrc_sku_5d89 -extern mrc_sku_5da5 +extern nb_usb2_ports +extern nb_usb3_ports extern fcn_fffa0250 extern printGuid extern usleep @@ -626,7 +626,7 @@ loc_fffa0742: inc ebx loc_fffa0743: -call mrc_sku_5da5 +call nb_usb3_ports cmp bl, al jb loc_fffa06aa ; jb 0xfffa06aa mov dword [ebp - 0x60], 0 @@ -766,7 +766,7 @@ loc_fffa08db: xor ebx, ebx loc_fffa08dd: -call mrc_sku_5da5 +call nb_usb3_ports cmp bl, al jb short loc_fffa08b9 ; jb 0xfffa08b9 mov edx, dword [ebp - 0x44] @@ -3070,7 +3070,7 @@ loc_fffa3aa7: xor ebx, ebx loc_fffa3aa9: -call mrc_sku_5d89 +call nb_usb2_ports movzx eax, al cmp ebx, eax jl short loc_fffa3a6d ; jl 0xfffa3a6d @@ -3162,7 +3162,7 @@ loc_fffa3ba2: xor ebx, ebx loc_fffa3ba4: -call mrc_sku_5d89 +call nb_usb2_ports movzx eax, al cmp ebx, eax jl short loc_fffa3b4e ; jl 0xfffa3b4e @@ -3222,7 +3222,7 @@ loc_fffa3c1b: xor ebx, ebx loc_fffa3c1d: -call mrc_sku_5d89 +call nb_usb2_ports movzx eax, al cmp ebx, eax jl short loc_fffa3bc0 ; jl 0xfffa3bc0 @@ -30095,7 +30095,7 @@ loc_fffb9c90: xor ebx, ebx loc_fffb9c92: -call mrc_sku_5da5 +call nb_usb3_ports cmp bl, al jb short loc_fffb9c57 ; jb 0xfffb9c57 jmp short loc_fffb9c35 ; jmp 0xfffb9c35 @@ -30310,7 +30310,7 @@ loc_fffb9f25: inc byte [ebp - 0x34] loc_fffb9f28: -call mrc_sku_5da5 +call nb_usb3_ports cmp byte [ebp - 0x34], al jb short loc_fffb9ec7 ; jb 0xfffb9ec7 mov eax, esi @@ -30350,7 +30350,7 @@ inc edx loc_fffb9f95: mov byte [ebp - 0x48], dl -call mrc_sku_5da5 +call nb_usb3_ports mov dl, byte [ebp - 0x48] cmp dl, al jb short loc_fffb9f46 ; jb 0xfffb9f46 diff --git a/src/northbridge/intel/haswell/mrc_sku.c b/src/northbridge/intel/haswell/mrc_sku.c index 320103bb1e..7c21d1e96a 100644 --- a/src/northbridge/intel/haswell/mrc_sku.c +++ b/src/northbridge/intel/haswell/mrc_sku.c @@ -1,22 +1,17 @@ -#include +#include "mrc_sku.h" -int mrc_sku_type(void); - -uint8_t mrc_sku_5d89(void); -uint8_t mrc_sku_5da5(void); - -uint8_t mrc_sku_5d89(void) +uint8_t nb_usb2_ports(void) { int t = mrc_sku_type(); if (t > 2) return 0; - if (t == 1) - return 0x0e; - else + if (t == 1) /* t = 1, not low power */ + return 14; + else /* t = 2, low power */ return 8; } -uint8_t mrc_sku_5da5(void) +uint8_t nb_usb3_ports(void) { int t = mrc_sku_type(); if (t > 2) diff --git a/src/northbridge/intel/haswell/mrc_sku.h b/src/northbridge/intel/haswell/mrc_sku.h new file mode 100644 index 0000000000..e9e7ba0bf8 --- /dev/null +++ b/src/northbridge/intel/haswell/mrc_sku.h @@ -0,0 +1,5 @@ +#include + +int mrc_sku_type(void); +uint8_t nb_usb2_ports(void); +uint8_t nb_usb3_ports(void); diff --git a/src/northbridge/intel/haswell/pei_usb.asm b/src/northbridge/intel/haswell/pei_usb.asm index d1bfbb0ff2..ee7b4dcd85 100644 --- a/src/northbridge/intel/haswell/pei_usb.asm +++ b/src/northbridge/intel/haswell/pei_usb.asm @@ -4,7 +4,7 @@ extern PeiServiceGetBootMode extern fcn_fffc5dc1 extern usleep extern mrc_pch_iobp_update -extern mrc_sku_5d89 +extern nb_usb2_ports extern mrc_sku_type extern ref_fffcb998 extern ref_fffcb99c @@ -248,7 +248,7 @@ call mrc_pch_iobp_update add esp, 0x10 loc_fffaed00: -call mrc_sku_5d89 +call nb_usb2_ports mov ecx, esi cmp cl, al jb short loc_fffaecdc ; jb 0xfffaecdc @@ -1057,7 +1057,7 @@ inc ebx loc_fffaf635: mov dword [ebp - 0x70], edx -call mrc_sku_5d89 +call nb_usb2_ports movzx eax, al mov ecx, dword [ebp - 0x30] cmp ebx, eax @@ -1119,7 +1119,7 @@ mov dword [ebp - 0x34], 0 xor ebx, ebx loc_fffaf6d2: -call mrc_sku_5d89 +call nb_usb2_ports movzx eax, al cmp ebx, eax jb short loc_fffaf684 ; jb 0xfffaf684 @@ -1196,7 +1196,7 @@ add esi, 6 add esp, 0x10 loc_fffaf797: -call mrc_sku_5d89 +call nb_usb2_ports movzx eax, al cmp ebx, eax jb short loc_fffaf762 ; jb 0xfffaf762 @@ -1279,7 +1279,7 @@ loc_fffaf865: inc ebx loc_fffaf866: -call mrc_sku_5d89 +call nb_usb2_ports movzx eax, al cmp ebx, eax jb loc_fffaf7d8 ; jb 0xfffaf7d8 @@ -1318,7 +1318,7 @@ loc_fffaf8cb: inc ebx loc_fffaf8cc: -call mrc_sku_5d89 +call nb_usb2_ports movzx eax, al cmp ebx, eax jb short loc_fffaf89b ; jb 0xfffaf89b -- cgit v1.2.3