x86: Various fixes to MTRR and FSP codes
cover x86: Various fixes to MTRR and FSP codes
At present Intel Crown Bay does not boot. This was caused by various regression issues introduced when supporting FSP2, and some flaws in MTRR codes.
With this series, U-Boot boot again on Intel Crown Bay board.
This series is available at u-boot-x86/crownbay for testing.
Bin Meng (7):
x86: fsp: Don't program MTRR for DRAM
x86: mtrr: Do not clear the unused ones in mtrr_commit()
x86: mtrr: Skip MSRs that were already programmed in mtrr_commit()
x86: mtrr: Abort if requested size is not power of 2
x86: cmd: hob: Fix the command usage and help messages
x86: cmd: hob: Fix display of resource type for system memory
x86: fsp: Only FSP2 has INIT_PHASE_END_FIRMWARE
arch/x86/cpu/mtrr.c | 13 ++++++++----- arch/x86/include/asm/mtrr.h | 7 ++++--- arch/x86/lib/fsp/fsp_common.c | 16 +++++++++------- arch/x86/lib/fsp/fsp_dram.c | 35 ++++++++++------------------------- cmd/x86/hob.c | 9 ++++----- 5 files changed, 35 insertions(+), 45 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/7 x86: fsp: Don't program MTRR for DRAM
This actually reverts the following 2 commits:
commit 427911001809 ("x86: Set up the MTRR for SDRAM")
commit d46c0932a9d4 ("x86: fsp: Adjust calculations for MTRR range and DRAM top")
There are several outstanding issues as to why:
* For FSP1, the system memory and reserved memory used by FSP are already programmed in the MTRR by FSP.
* The 'mtrr_top' mistakenly includes TSEG memory range that has the same RES_MEM_RESERVED resource type. Its address is programmed and reported by FSP to be near the top of 4 GiB space, which is not what we want for SDRAM.
* The call to mtrr_add_request() is not guaranteed to have its size to be exactly the power of 2. This causes reserved bits of the IA32_MTRR_PHYSMASK register to be written which generates #GP.
---
arch/x86/lib/fsp/fsp_dram.c | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-)
arch/x86/lib/fsp/fsp_dram.c +10 -25
@@ -11,7 +11,6 @@#include <asm/e820.h> #include <asm/global_data.h> #include <asm/mrccache.h> -#include <asm/mtrr.h> #include <asm/post.h> #include <dm/ofnode.h>
@@ -42,10 +41,8 @@ int fsp_scan_for_ram_size(void)int dram_init_banksize (void ) { -efi_guid_t fsp =FSP_HOB_RESOURCE_OWNER_FSP_GUID ;const struct hob_header *hdr;struct hob_res_desc *res_desc; -phys_addr_t mtrr_top;phys_addr_t low_end;uint bank;
@@ -53,47 +50,35 @@ int dram_init_banksize(void) gd->bd->bi_dram[0 ].start =0 ; gd->bd->bi_dram[0 ].size = gd->ram_size; -mtrr_add_request (MTRR_TYPE_WRBACK ,0 , gd->ram_size);return 0 ; } - low_end =0 ;/* top of low memory usable by U-Boot */ - mtrr_top =0 ;/* top of low memory (even if reserved) */ + low_end =0 ;for (bank =1 , hdr = gd->arch.hob_list; bank <CONFIG_NR_DRAM_BANKS && !end_of_hob (hdr); hdr =get_next_hob (hdr)) {if (hdr->type !=HOB_TYPE_RES_DESC )continue ; res_desc = (struct hob_res_desc *)hdr; -if (!guidcmp (&res_desc->owner, &fsp)) - low_end = res_desc->phys_start;if (res_desc->type !=RES_SYS_MEM && res_desc->type !=RES_MEM_RESERVED )continue ;if (res_desc->phys_start < (1ULL <<32 )) { - mtrr_top =max (mtrr_top, - res_desc->phys_start + res_desc->len); - }else { - gd->bd->bi_dram[bank].start = res_desc->phys_start; - gd->bd->bi_dram[bank].size = res_desc->len; -mtrr_add_request (MTRR_TYPE_WRBACK , res_desc->phys_start, - res_desc->len); -log_debug ("ram %llx %llx\n" , - gd->bd->bi_dram[bank].start, - gd->bd->bi_dram[bank].size); + low_end =max (low_end, + res_desc->phys_start + res_desc->len); +continue ; } + + gd->bd->bi_dram[bank].start = res_desc->phys_start; + gd->bd->bi_dram[bank].size = res_desc->len; +log_debug ("ram %llx %llx\n" , gd->bd->bi_dram[bank].start, + gd->bd->bi_dram[bank].size); }/* Add the memory below 4GB */ gd->bd->bi_dram[0 ].start =0 ; gd->bd->bi_dram[0 ].size = low_end; -/* -* Set up an MTRR to the top of low, reserved memory. This is necessary -* for graphics to run at full speed in U-Boot. -*/ -mtrr_add_request (MTRR_TYPE_WRBACK ,0 , mtrr_top); -return 0 ; }
@@ -166,7 +151,7 @@ unsigned int install_e820_map(unsigned int max_entries,#if CONFIG_IS_ENABLED (HANDOFF ) &&IS_ENABLED (CONFIG_USE_HOB )int handoff_arch_save (struct spl_handoff *ho) { - ho->arch.usable_ram_top = gd->bd->bi_dram[0 ].size; + ho->arch.usable_ram_top =fsp_get_usable_lowmem_top (gd->arch.hob_list); ho->arch.hob_list = gd->arch.hob_list;return 0 ;
Signature · 1 line
2.25.1
Re: [PATCH 1/7] x86: fsp: Don't program MTRR for DRAM
Hi Bin,
Quoted 18 lines · Bin Meng
This actually reverts the following 2 commits:
commit 427911001809 ("x86: Set up the MTRR for SDRAM")
commitd46c0932a9d4("x86: fsp: Adjust calculations for MTRR range and DRAM top")There are several outstanding issues as to why:
* For FSP1, the system memory and reserved memory used by FSP are already programmed in the MTRR by FSP.
* The 'mtrr_top' mistakenly includes TSEG memory range that has the sameRES_MEM_RESERVEDresource type. Its address is programmed and reported by FSP to be near the top of 4 GiB space, which is not what we want for SDRAM.
* The call tomtrr_add_request()is not guaranteed to have its size to be exactly the power of 2. This causes reserved bits of theIA32_MTRR_PHYSMASKregister to be written which generates #GP.
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
arch/x86/lib/fsp/fsp_dram.c | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-)
Unfortunately this makes coral (FSP2) go *very* slowly. Can you perhaps do this change just for FSP1?
Regards,
Simon
Re: [PATCH 1/7] x86: fsp: Don't program MTRR for DRAM
Hi Simon,
Quoted 22 lines · Simon Glass
Hi Bin,
Quoted 18 lines · Bin Meng
This actually reverts the following 2 commits:
commit 427911001809 ("x86: Set up the MTRR for SDRAM")
commitd46c0932a9d4("x86: fsp: Adjust calculations for MTRR range and DRAM top")There are several outstanding issues as to why:
* For FSP1, the system memory and reserved memory used by FSP are already programmed in the MTRR by FSP.
* The 'mtrr_top' mistakenly includes TSEG memory range that has the sameRES_MEM_RESERVEDresource type. Its address is programmed and reported by FSP to be near the top of 4 GiB space, which is not what we want for SDRAM.
* The call tomtrr_add_request()is not guaranteed to have its size to be exactly the power of 2. This causes reserved bits of theIA32_MTRR_PHYSMASKregister to be written which generates #GP.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
arch/x86/lib/fsp/fsp_dram.c | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-)Unfortunately this makes coral (FSP2) go *very* slowly. Can you perhaps do this change just for FSP1?
Sure will do that in v2.
Regards,
Bin
PATCH 2/7 x86: mtrr: Do not clear the unused ones in mtrr_commit()
In reply to Bin MengCurrent mtrr_commit() logic assumes that MTRR MSRs are programmed consecutively from index 0 to its maximum number, and whenever it detects an unused one, it clears all other MTRRs starting from that one. However this may not always be the case.
In fact, the clear is not much helpful because these MTRRs come out of reset as disabled already. Drop the clear codes.
---
arch/x86/cpu/mtrr.c | 4 ---- 1 file changed, 4 deletions(-)
arch/x86/cpu/mtrr.c +0 -4
@@ -157,10 +157,6 @@ int mtrr_commit(bool do_caches)for (i =0 ; i < gd->arch.mtrr_req_count; i++, req++)set_var_mtrr (i, req->type, req->start, req->size); -/* Clear the ones that are unused */ -debug ("clear\n" ); -for (; i <mtrr_get_var_count (); i++) -wrmsrl (MTRR_PHYS_MASK_MSR (i),0 );debug ("close\n" );mtrr_close (&state, do_caches);debug ("mtrr done\n" );
Signature · 1 line
2.25.1
Re: [PATCH 2/7] x86: mtrr: Do not clear the unused ones in mtrr_commit()
Quoted 6 lines · Bin Meng
Current
mtrr_commit()logic assumes that MTRR MSRs are programmed consecutively from index 0 to its maximum number, and whenever it detects an unused one, it clears all other MTRRs starting from that one. However this may not always be the case.
Quoted 8 lines
In fact, the clear is not much helpful because these MTRRs come out of reset as disabled already. Drop the clear codes.
Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/mtrr.c | 4 ---- 1 file changed, 4 deletions(-)
Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax
Re: [PATCH 2/7] x86: mtrr: Do not clear the unused ones in mtrr_commit()
Quoted 14 lines · Simon Glass
Quoted 12 lines · Bin Meng
Current
mtrr_commit()logic assumes that MTRR MSRs are programmed consecutively from index 0 to its maximum number, and whenever it detects an unused one, it clears all other MTRRs starting from that one. However this may not always be the case.In fact, the clear is not much helpful because these MTRRs come out of reset as disabled already. Drop the clear codes.
Signed-off-by Bin Meng <[email protected]>---
Quoted 6 lines
Quoted 2 lines
arch/x86/cpu/mtrr.c | 4 ---- 1 file changed, 4 deletions(-)Reviewed-by Simon Glass <[email protected]>Tested on
chromebook_coral,chromebook_samus,chromebook_link, minnowmaxTested-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 3/7 x86: mtrr: Skip MSRs that were already programmed in mtrr_commit()
In reply to Bin MengAt present mtrr_commit() programs the MTRR MSRs starting from index 0, which may overwrite MSRs that were already programmed by previous boot stage or FSP.
Switch to call mtrr_set_next_var() instead.
---
arch/x86/cpu/mtrr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/cpu/mtrr.c +1 -1
@@ -155,7 +155,7 @@ int mtrr_commit(bool do_caches)debug ("open done\n" );qsort (req, gd->arch.mtrr_req_count,sizeof (*req), h_comp_mtrr);for (i =0 ; i < gd->arch.mtrr_req_count; i++, req++) -set_var_mtrr (i, req->type, req->start, req->size); +mtrr_set_next_var (req->type, req->start, req->size);debug ("close\n" );mtrr_close (&state, do_caches);
Signature · 1 line
2.25.1
Re: [PATCH 3/7] x86: mtrr: Skip MSRs that were already programmed in mtrr_commit()
Quoted 5 lines · Bin Meng
At present
mtrr_commit()programs the MTRR MSRs starting from index 0, which may overwrite MSRs that were already programmed by previous boot stage or FSP.
Quoted 7 lines
Switch to call
mtrr_set_next_var()instead.Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/mtrr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax
Re: [PATCH 3/7] x86: mtrr: Skip MSRs that were already programmed in mtrr_commit()
Quoted 12 lines · Simon Glass
Quoted 10 lines · Bin Meng
At present
mtrr_commit()programs the MTRR MSRs starting from index 0, which may overwrite MSRs that were already programmed by previous boot stage or FSP.Switch to call
mtrr_set_next_var()instead.Signed-off-by Bin Meng <[email protected]>---
Quoted 6 lines
Quoted 2 lines
arch/x86/cpu/mtrr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Simon Glass <[email protected]>Tested on
chromebook_coral,chromebook_samus,chromebook_link, minnowmaxTested-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 4/7 x86: mtrr: Abort if requested size is not power of 2
In reply to Bin MengThe size parameter of mtrr_add_request() and mtrr_set_next_var() shall be power of 2, otherwise the logic creates a mask that does not meet the requirement of IA32_MTRR_PHYSMASK register.
Programming such a mask value to IA32_MTRR_PHYSMASK generates #GP.
---
arch/x86/cpu/mtrr.c | 7 +++++++ arch/x86/include/asm/mtrr.h | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-)
arch/x86/cpu/mtrr.c +7 -0
@@ -26,6 +26,7 @@#include <asm/mp.h> #include <asm/msr.h> #include <asm/mtrr.h> +#include <linux/log2.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -179,6 +180,9 @@ int mtrr_add_request(int type, uint64_t start, uint64_t size)if (!gd->arch.has_mtrr)return -ENOSYS ; +if (!is_power_of_2 (size)) +return -EINVAL ; +if (gd->arch.mtrr_req_count ==MAX_MTRR_REQUESTS )return -ENOSPC ; req = &gd->arch.mtrr_req[gd->arch.mtrr_req_count++];
@@ -223,6 +227,9 @@ int mtrr_set_next_var(uint type, uint64_t start, uint64_t size) {int mtrr; +if (!is_power_of_2 (size)) +return -EINVAL ; + mtrr =get_free_var_mtrr ();if (mtrr <0 )return mtrr;
arch/x86/include/asm/mtrr.h +4 -3
@@ -119,7 +119,7 @@ void mtrr_close(struct mtrr_state *state, bool do_caches);* * @type: Requested type (MTRR_TYPE_) * @start: Start address -* @size: Size +* @size: Size, must be power of 2 * * @return: 0 on success, non-zero on failure */
@@ -144,8 +144,9 @@ int mtrr_commit(bool do_caches);* * @type: Requested type (MTRR_TYPE_) * @start: Start address -* @size: Size -* @return 0 on success, -ENOSPC if there are no more MTRRs +* @size: Size, must be power of 2 +* @return 0 on success, -EINVAL if size is not power of 2, +* -ENOSPC if there are no more MTRRs */ int mtrr_set_next_var (uint type,uint64_t base,uint64_t size);
Signature · 1 line
2.25.1
Re: [PATCH 4/7] x86: mtrr: Abort if requested size is not power of 2
Quoted 5 lines · Bin Meng
The size parameter of
mtrr_add_request()andmtrr_set_next_var()shall be power of 2, otherwise the logic creates a mask that does not meet the requirement ofIA32_MTRR_PHYSMASKregister.
Quoted 8 lines
Programming such a mask value to
IA32_MTRR_PHYSMASKgenerates #GP.Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/mtrr.c | 7 +++++++ arch/x86/include/asm/mtrr.h | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-)
Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax
Re: [PATCH 4/7] x86: mtrr: Abort if requested size is not power of 2
Quoted 12 lines · Simon Glass
Quoted 10 lines · Bin Meng
The size parameter of
mtrr_add_request()andmtrr_set_next_var()shall be power of 2, otherwise the logic creates a mask that does not meet the requirement ofIA32_MTRR_PHYSMASKregister.Programming such a mask value to
IA32_MTRR_PHYSMASKgenerates #GP.Signed-off-by Bin Meng <[email protected]>---
Quoted 7 lines
Quoted 3 lines
arch/x86/cpu/mtrr.c | 7 +++++++ arch/x86/include/asm/mtrr.h | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-)Reviewed-by Simon Glass <[email protected]>Tested on
chromebook_coral,chromebook_samus,chromebook_link, minnowmaxTested-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 5/7 x86: cmd: hob: Fix the command usage and help messages
In reply to Bin MengAt present the hob command usage and help messages are messed up in a single line. They should be separated.
This was a regression introduced when [seq] and [-v] were added to the command.
---
cmd/x86/hob.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
cmd/x86/hob.c +3 -4
@@ -158,8 +158,7 @@ static int do_hob(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) }U_BOOT_CMD (hob,3 ,1 , do_hob, -"[-v] [seq] Print Hand-Off Block (HOB) information" -" -v - Show detailed HOB information where available" -" seq - Record # to show (all by default)" , -"" +"[-v] [seq] Print Hand-Off Block (HOB) information" , +" -v - Show detailed HOB information where available\n" +" seq - Record # to show (all by default)" );
Signature · 1 line
2.25.1
Re: [PATCH 5/7] x86: cmd: hob: Fix the command usage and help messages
Quoted 7 lines · Bin Meng
At present the hob command usage and help messages are messed up in a single line. They should be separated.
This was a regression introduced when [seq] and [-v] were added to the command.
Quoted 7 lines
Fixes d11544dfa9f4 ("x86: hob: Add way to show a single hob entry")Fixes 51af144eb7a0 ("x86: Allow showing details about a HOB entry")Signed-off-by Bin Meng <[email protected]>---
cmd/x86/hob.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax
Re: [PATCH 5/7] x86: cmd: hob: Fix the command usage and help messages
Quoted 14 lines · Simon Glass
Quoted 12 lines · Bin Meng
At present the hob command usage and help messages are messed up in a single line. They should be separated.
This was a regression introduced when [seq] and [-v] were added to the command.
Fixes d11544dfa9f4 ("x86: hob: Add way to show a single hob entry")Fixes 51af144eb7a0 ("x86: Allow showing details about a HOB entry")Signed-off-by Bin Meng <[email protected]>---
Quoted 6 lines
Quoted 2 lines
cmd/x86/hob.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)Reviewed-by Simon Glass <[email protected]>Tested on
chromebook_coral,chromebook_samus,chromebook_link, minnowmaxTested-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 6/7 x86: cmd: hob: Fix display of resource type for system memory
In reply to Bin MengThe resource type for system memory is currently displayed as "unknown", which is wrong.
---
cmd/x86/hob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/x86/hob.c +1 -1
@@ -78,7 +78,7 @@ static void show_hob_details(const struct hob_header *hdr)const struct hob_res_desc *res = ptr;const char *typename; - typename = res->type >0 && res->type <=RES_MAX_MEM_TYPE ? + typename = res->type >=RES_SYS_MEM && res->type <=RES_MAX_MEM_TYPE ? res_type[res->type] :"unknown" ; printf(" base = %08llx, len = %08llx, end = %08llx, type = %d (%s)\n\n",
Signature · 1 line
2.25.1
Re: [PATCH 6/7] x86: cmd: hob: Fix display of resource type for system memory
Quoted 10 lines · Bin Meng
The resource type for system memory is currently displayed as "unknown", which is wrong.
Fixes 51af144eb7a0 ("x86: Allow showing details about a HOB entry")Signed-off-by Bin Meng <[email protected]>---
cmd/x86/hob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax
Re: [PATCH 6/7] x86: cmd: hob: Fix display of resource type for system memory
Quoted 10 lines · Simon Glass
Quoted 8 lines · Bin Meng
The resource type for system memory is currently displayed as "unknown", which is wrong.
Fixes 51af144eb7a0 ("x86: Allow showing details about a HOB entry")Signed-off-by Bin Meng <[email protected]>---
Quoted 6 lines
Quoted 2 lines
cmd/x86/hob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Simon Glass <[email protected]>Tested on
chromebook_coral,chromebook_samus,chromebook_link, minnowmaxTested-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 7/7 x86: fsp: Only FSP2 has INIT_PHASE_END_FIRMWARE
In reply to Bin MengFor FSP1, there is no such INIT_PHASE_END_FIRMWARE.
---
arch/x86/lib/fsp/fsp_common.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
arch/x86/lib/fsp/fsp_common.c +9 -7
@@ -68,13 +68,15 @@ void board_final_cleanup(void)/* TODO([email protected]): This causes Linux to crash */ return ; -/* call into FspNotify */ -debug ("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): " ); - status =fsp_notify (NULL ,INIT_PHASE_END_FIRMWARE ); -if (status) -debug ("fail, error code %x\n" , status); -else -debug ("OK\n" ); +if (CONFIG_IS_ENABLED (FSP_VERSION2 )) { +/* call into FspNotify */ +debug ("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): " ); + status =fsp_notify (NULL ,INIT_PHASE_END_FIRMWARE ); +if (status) +debug ("fail, error code %x\n" , status); +else +debug ("OK\n" ); + } }int fsp_save_s3_stack (void )
Signature · 1 line
2.25.1
Re: [PATCH 7/7] x86: fsp: Only FSP2 has INIT_PHASE_END_FIRMWARE
Hi Bin,
Quoted 26 lines · Bin Meng
For FSP1, there is no such
INIT_PHASE_END_FIRMWARE.Fixes 7c73cea44290 ("x86: Notify the FSP of the 'end firmware' event")Signed-off-by Bin Meng <[email protected]>---
arch/x86/lib/fsp/fsp_common.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)arch/x86/lib/fsp/fsp_common.c +0
-7@@ -68,13 +68,15 @@ void board_final_cleanup(void)/* TODO([email protected]): This causes Linux to crash */ return ; -/* call into FspNotify */ -debug ("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): " ); - status =fsp_notify (NULL ,INIT_PHASE_END_FIRMWARE ); -if (status) -debug ("fail, error code %x\n" , status); -else -debug ("OK\n" );
arch/x86/lib/fsp/fsp_common.c void board_final_cleanup(void) · line 80
Quoted 10 lines
arch/x86/lib/fsp/fsp_common.c +9
-0+if (CONFIG_IS_ENABLED (FSP_VERSION2 )) { +/* call into FspNotify */ +debug ("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): " ); + status =fsp_notify (NULL ,INIT_PHASE_END_FIRMWARE ); +if (status) +debug ("fail, error code %x\n" , status); +else +debug ("OK\n" ); + } }
So shouldn't we move this whole function into fsp2?
Quoted 5 lines
arch/x86/lib/fsp/fsp_common.c +0
-1int fsp_save_s3_stack (void ) --2.25.1
Regards,
Simon
Re: [PATCH 7/7] x86: fsp: Only FSP2 has INIT_PHASE_END_FIRMWARE
Hi Simon,
Quoted 34 lines · Simon Glass
Hi Bin,
Quoted 30 lines · Bin Meng
For FSP1, there is no such
INIT_PHASE_END_FIRMWARE.Fixes 7c73cea44290 ("x86: Notify the FSP of the 'end firmware' event")Signed-off-by Bin Meng <[email protected]>---
arch/x86/lib/fsp/fsp_common.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)arch/x86/lib/fsp/fsp_common.c +4
-7@@ -68,13 +68,15 @@ void board_final_cleanup(void)/* TODO([email protected]): This causes Linux to crash */ return ; -/* call into FspNotify */ -debug ("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): " ); - status =fsp_notify (NULL ,INIT_PHASE_END_FIRMWARE ); -if (status) -debug ("fail, error code %x\n" , status); -else -debug ("OK\n" ); +if (CONFIG_IS_ENABLED (FSP_VERSION2 )) { +/* call into FspNotify */ +debug ("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): " ); + status =fsp_notify (NULL ,INIT_PHASE_END_FIRMWARE );
Quoted 8 lines
arch/x86/lib/fsp/fsp_common.c void board_final_cleanup(void) · line 80
Quoted 6 lines
arch/x86/lib/fsp/fsp_common.c +5
-0+if (status) +debug ("fail, error code %x\n" , status); +else +debug ("OK\n" ); + } }So shouldn't we move this whole function into fsp2?
Yes, I think so.
Regards,
Bin