northbridge/intel/sandybridge: Enable x86_64 for mrc.bin
Enable x86_64 support for MRC.bin: - Add a wrapper function for console printing that calls into long mode to call native do_putchar - Remove Kconfig guard for x86_64 when MRC is being used Tested: Booted Lenovo X220 using mrc.bin under x86_64 and MRC is able to print to the console. Change-Id: I21ffcb5f5d4bf155593e8111531bdf0ed7071dfc Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79754 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
committed by
Felix Held
parent
3052e9e642
commit
1d718def05
@@ -1,7 +1,7 @@
|
|||||||
config CPU_INTEL_MODEL_206AX
|
config CPU_INTEL_MODEL_206AX
|
||||||
bool
|
bool
|
||||||
select ARCH_X86
|
select ARCH_X86
|
||||||
select HAVE_EXP_X86_64_SUPPORT if USE_NATIVE_RAMINIT
|
select HAVE_EXP_X86_64_SUPPORT
|
||||||
select SSE2
|
select SSE2
|
||||||
select UDELAY_TSC
|
select UDELAY_TSC
|
||||||
select TSC_MONOTONIC_TIMER
|
select TSC_MONOTONIC_TIMER
|
||||||
|
@@ -25,3 +25,13 @@ mrc_wrapper:
|
|||||||
mov %ebp, %esp
|
mov %ebp, %esp
|
||||||
popal
|
popal
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Callback for MRC to print a character on the console.
|
||||||
|
* As MRC is x86_32 call into long mode and use the x86_64
|
||||||
|
* function do_putchar to print to console.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <src/cpu/x86/64bit/prot2long.inc>
|
||||||
|
|
||||||
|
prot2lm_wrapper do_putchar
|
||||||
|
@@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
/* Assembly functions: */
|
/* Assembly functions: */
|
||||||
void mrc_wrapper(void *func_ptr, uint32_t arg1);
|
void mrc_wrapper(void *func_ptr, uint32_t arg1);
|
||||||
|
void __prot2lm_do_putchar(uint8_t byte);
|
||||||
|
|
||||||
static void save_mrc_data(struct pei_data *pei_data)
|
static void save_mrc_data(struct pei_data *pei_data)
|
||||||
{
|
{
|
||||||
@@ -154,7 +155,13 @@ static void sdram_initialize(struct pei_data *pei_data)
|
|||||||
system_reset();
|
system_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pass console handler in pei_data */
|
/*
|
||||||
|
* Pass console handler in pei_data. On x86_64 provide a wrapper around
|
||||||
|
* do_putchar that switches to long mode before calling do_putchar.
|
||||||
|
*/
|
||||||
|
if (ENV_X86_64)
|
||||||
|
pei_data->tx_byte_ptr = (uintptr_t)__prot2lm_do_putchar;
|
||||||
|
else
|
||||||
pei_data->tx_byte_ptr = (uintptr_t)do_putchar;
|
pei_data->tx_byte_ptr = (uintptr_t)do_putchar;
|
||||||
|
|
||||||
/* Locate and call UEFI System Agent binary. */
|
/* Locate and call UEFI System Agent binary. */
|
||||||
|
Reference in New Issue
Block a user