forked from Mirrors/opensbi
		
	lib: Initialize TLB management directly from coldboot/warmboot path
Currently, the remote TLB management is initialized via IPI init which is counter intuitive. This patch initializes remote TLB management directly from init_coldboot() and init_warmboot() after IPI init is done. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
		@@ -16,6 +16,7 @@
 | 
			
		||||
#include <sbi/sbi_platform.h>
 | 
			
		||||
#include <sbi/sbi_system.h>
 | 
			
		||||
#include <sbi/sbi_timer.h>
 | 
			
		||||
#include <sbi/sbi_tlb.h>
 | 
			
		||||
#include <sbi/sbi_version.h>
 | 
			
		||||
 | 
			
		||||
#define BANNER                                              \
 | 
			
		||||
@@ -103,6 +104,10 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 | 
			
		||||
	if (rc)
 | 
			
		||||
		sbi_hart_hang();
 | 
			
		||||
 | 
			
		||||
	rc = sbi_tlb_init(scratch, TRUE);
 | 
			
		||||
	if (rc)
 | 
			
		||||
		sbi_hart_hang();
 | 
			
		||||
 | 
			
		||||
	rc = sbi_timer_init(scratch, TRUE);
 | 
			
		||||
	if (rc)
 | 
			
		||||
		sbi_hart_hang();
 | 
			
		||||
@@ -152,6 +157,10 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)
 | 
			
		||||
	if (rc)
 | 
			
		||||
		sbi_hart_hang();
 | 
			
		||||
 | 
			
		||||
	rc = sbi_tlb_init(scratch, FALSE);
 | 
			
		||||
	if (rc)
 | 
			
		||||
		sbi_hart_hang();
 | 
			
		||||
 | 
			
		||||
	rc = sbi_timer_init(scratch, FALSE);
 | 
			
		||||
	if (rc)
 | 
			
		||||
		sbi_hart_hang();
 | 
			
		||||
 
 | 
			
		||||
@@ -17,8 +17,6 @@
 | 
			
		||||
#include <sbi/sbi_init.h>
 | 
			
		||||
#include <sbi/sbi_ipi.h>
 | 
			
		||||
#include <sbi/sbi_platform.h>
 | 
			
		||||
#include <sbi/sbi_tlb.h>
 | 
			
		||||
#include <sbi/sbi_trap.h>
 | 
			
		||||
 | 
			
		||||
struct sbi_ipi_data {
 | 
			
		||||
	unsigned long ipi_type;
 | 
			
		||||
@@ -232,10 +230,6 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot)
 | 
			
		||||
	ipi_data = sbi_scratch_offset_ptr(scratch, ipi_data_off);
 | 
			
		||||
	ipi_data->ipi_type = 0x00;
 | 
			
		||||
 | 
			
		||||
	ret = sbi_tlb_init(scratch, cold_boot);
 | 
			
		||||
	if (ret)
 | 
			
		||||
		return ret;
 | 
			
		||||
 | 
			
		||||
	/* Platform init */
 | 
			
		||||
	ret = sbi_platform_ipi_init(sbi_platform_ptr(scratch), cold_boot);
 | 
			
		||||
	if (ret)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user