summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-12-28 17:37:32 +0800
committerIru Cai <mytbk920423@gmail.com>2019-11-17 15:10:45 +0800
commit266dc671913c3cbba1ae9e45a5d451378a15a88e (patch)
treef7f5cdbecd616bc5180a12665f4a25446e1d0999
parent29caf121436859f5be30c34c0b250347e01e4a3e (diff)
downloadcoreboot-266dc671913c3cbba1ae9e45a5d451378a15a88e.tar.xz
frag_fffa9029
-rw-r--r--src/northbridge/intel/haswell/do_raminit_frag.c9
-rw-r--r--src/northbridge/intel/haswell/mrc.asm46
-rw-r--r--src/northbridge/intel/haswell/mrc_frags.c19
-rw-r--r--src/northbridge/intel/haswell/mrc_utils.h19
4 files changed, 44 insertions, 49 deletions
diff --git a/src/northbridge/intel/haswell/do_raminit_frag.c b/src/northbridge/intel/haswell/do_raminit_frag.c
index 100fb3e941..6518096c70 100644
--- a/src/northbridge/intel/haswell/do_raminit_frag.c
+++ b/src/northbridge/intel/haswell/do_raminit_frag.c
@@ -527,15 +527,6 @@ void fill_ram_param(pei_ram_param *param, struct pei_data *pd)
}
}
-static inline void
-bar_update32(void *bar, uint32_t offset, uint32_t andv, uint32_t orv)
-{
- u32 tmp = read32(bar + offset);
- tmp &= andv;
- tmp |= orv;
- write32(bar + offset, tmp);
-}
-
static void frag_fffa40d3(void * dmibar)
{
for (uint32_t i = 0xa00; i < 0xa40; i += 0x10) {
diff --git a/src/northbridge/intel/haswell/mrc.asm b/src/northbridge/intel/haswell/mrc.asm
index 6d23692db2..0fb2df1b46 100644
--- a/src/northbridge/intel/haswell/mrc.asm
+++ b/src/northbridge/intel/haswell/mrc.asm
@@ -182,6 +182,7 @@ extern frag_fffa5d3c
extern frag_fffa627c
extern frag_fffa0ff3
extern frag_fffa1e83
+extern frag_fffa9029
;;
@@ -7245,46 +7246,11 @@ mov eax, dword [edi + 0x103f]
mov dword [eax + 0x50fc], 0x8f
cmp byte [edi + 0x102f], 0
je loc_fffa913e ; je 0xfffa913e
-mov edx, dword [edi + 0x103b]
-mov eax, dword [edx + 0xa0]
-or eax, 1
-mov dword [edx + 0xa0], eax
-mov edx, dword [edi + 0x103b]
-mov eax, dword [edx + 0xbc]
-or eax, 1
-mov dword [edx + 0xbc], eax
-mov edx, dword [edi + 0x103b]
-mov eax, dword [edx + 0xa8]
-or eax, 1
-mov dword [edx + 0xa8], eax
-mov edx, dword [edi + 0x103b]
-mov eax, dword [edx + 0x90]
-or eax, 1
-mov dword [edx + 0x90], eax
-mov edx, dword [edi + 0x103b]
-mov eax, dword [edx + 0x98]
-or eax, 1
-mov dword [edx + 0x98], eax
-mov edx, dword [edi + 0x103b]
-mov eax, dword [edx + 0x5c]
-or eax, 1
-mov dword [edx + 0x5c], eax
-mov edx, dword [edi + 0x103b]
-mov eax, dword [edx + 0xb0]
-or eax, 1
-mov dword [edx + 0xb0], eax
-mov edx, dword [edi + 0x103b]
-mov eax, dword [edx + 0xb4]
-or eax, 1
-mov dword [edx + 0xb4], eax
-mov edx, dword [edi + 0x103b]
-mov eax, dword [edx + 0x78]
-or ah, 4
-mov dword [edx + 0x78], eax
-mov edx, dword [edi + 0x103b]
-mov eax, dword [edx + 0x50]
-or eax, 1
-mov dword [edx + 0x50], eax
+
+push dword [edi + 0x103b]
+call frag_fffa9029
+add esp, 4
+
mov ecx, dword [edi + 0x103f]
movzx edx, byte [edi + 0x107c]
and edx, 1
diff --git a/src/northbridge/intel/haswell/mrc_frags.c b/src/northbridge/intel/haswell/mrc_frags.c
index 3739839c09..590ea884f2 100644
--- a/src/northbridge/intel/haswell/mrc_frags.c
+++ b/src/northbridge/intel/haswell/mrc_frags.c
@@ -108,3 +108,22 @@ void frag_fffa627c(void *mchbar, uint32_t eax, void * edx)
write32(mchbar + eax + 0x220c, 0);
write32(mchbar + eax + 0x600, 0);
}
+
+void frag_fffa9029(void *bar);
+void frag_fffa9029(void *bar)
+{
+ /* bar is 0xf0000000 (PCIEXBAR)
+ printk(BIOS_DEBUG, "[edi + 0x103b] is 0x%08x.\n", (u32)bar);
+ */
+
+ bar_or32(bar, 0xa0, 1);
+ bar_or32(bar, 0xbc, 1);
+ bar_or32(bar, 0xa8, 1);
+ bar_or32(bar, 0x90, 1);
+ bar_or32(bar, 0x98, 1);
+ bar_or32(bar, 0x5c, 1);
+ bar_or32(bar, 0xb0, 1);
+ bar_or32(bar, 0xb4, 1);
+ bar_or32(bar, 0x78, 0x0400);
+ bar_or32(bar, 0x50, 1);
+}
diff --git a/src/northbridge/intel/haswell/mrc_utils.h b/src/northbridge/intel/haswell/mrc_utils.h
index 10811c4b43..bfd4cd4992 100644
--- a/src/northbridge/intel/haswell/mrc_utils.h
+++ b/src/northbridge/intel/haswell/mrc_utils.h
@@ -11,6 +11,8 @@
* GNU General Public License for more details.
*/
+#include <arch/mmio.h>
+
void __attribute((regparm(3))) mrc_setmem(void *s, size_t n, int c);
void __attribute((regparm(3))) mrc_memcpy(void *dst, const void *src, size_t n);
void __attribute((regparm(3))) mrc_fillword(int *s, int c, size_t n);
@@ -20,3 +22,20 @@ void __attribute((regparm(1))) printGuid(const void *g);
void *__attribute((regparm(1))) mrc_alloc(int n);
void __attribute((regparm(1))) usleep(int usec);
uint32_t __attribute((regparm(2))) crc32(uint8_t data[], size_t len);
+
+static inline void
+bar_update32(void *bar, uint32_t offset, uint32_t andv, uint32_t orv)
+{
+ u32 tmp = read32(bar + offset);
+ tmp &= andv;
+ tmp |= orv;
+ write32(bar + offset, tmp);
+}
+
+static inline void
+bar_or32(void *bar, uint32_t offset, uint32_t orv)
+{
+ u32 tmp = read32(bar + offset);
+ tmp |= orv;
+ write32(bar + offset, tmp);
+}