summaryrefslogtreecommitdiffstats
path: root/util/cbfstool/linux_trampoline.S
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2021-05-29 20:07:42 +0200
committerArthur Heymans <arthur@aheymans.xyz>2021-06-02 07:47:01 +0000
commit71971c9d7e3102f4568d24107dec9ac44277d073 (patch)
tree485187e929c9772336c1971ec3c1df957b5a8bf2 /util/cbfstool/linux_trampoline.S
parent29228286a20b377d77e17249d1a968b40edf90a7 (diff)
downloadcoreboot-71971c9d7e3102f4568d24107dec9ac44277d073.tar.gz
coreboot-71971c9d7e3102f4568d24107dec9ac44277d073.tar.bz2
coreboot-71971c9d7e3102f4568d24107dec9ac44277d073.zip
cbfstool/linux_trampoline.S: Fix up the e820 table
The e820 type don't fully match the LB_TAG_MEMORY types, so change all unknown types to e820 to '2', reserved memory. TESTED with Linuxboot: e820 now shows the CBMEM region as reserved. Change-Id: Ie0e41c66e002919e41590327afe0f543e0037369 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55074 Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com> Reviewed-by: Rocky Phagura Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/cbfstool/linux_trampoline.S')
-rw-r--r--util/cbfstool/linux_trampoline.S15
1 files changed, 14 insertions, 1 deletions
diff --git a/util/cbfstool/linux_trampoline.S b/util/cbfstool/linux_trampoline.S
index f1619cfb1793..726852804ff2 100644
--- a/util/cbfstool/linux_trampoline.S
+++ b/util/cbfstool/linux_trampoline.S
@@ -72,7 +72,20 @@ lea 8(%ebx), %esi /* e820 data source */
mov $(LINUX_PARAM_LOC + E820_OFFSET), %edi
rep movsl
xchg %eax, %ecx
-jmp .endScan
+/* e820 and LB_TAG_MEMORY type don't fully match: remap unknown type to 2, reserved memory */
+mov (LINUX_PARAM_LOC + E820_NR_OFFSET), %eax
+mov $(LINUX_PARAM_LOC + E820_OFFSET), %edi
+.test_e820_entry:
+cmp $0, %eax
+je .endScan
+cmp $12, 16(%edi) /* type */
+jng .next_e820_entry
+/* Fixup the type to 2, reserved memory */
+mov $2, 16(%edi)
+.next_e820_entry:
+dec %eax
+add $20, %edi
+jmp .test_e820_entry
.testFramebuffer:
cmp $CB_TAG_FRAMEBUFFER, (%ebx)