forked from Mirrors/opensbi
		
	platform: Allow platforms to specify the size of tlb fifo
For some platforms with a particularly high number of harts, if the tlb fifo is too small, it case harts to wait. Platforms should be allowed to specify the size of the tlb fifo. Signed-off-by: Xiang W <wxjstz@126.com> Signed-off-by: Xing Xiaoguang <xiaoguang.xing@sophgo.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
		@@ -18,6 +18,7 @@ struct platform_override {
 | 
			
		||||
	const struct fdt_match *match_table;
 | 
			
		||||
	u64 (*features)(const struct fdt_match *match);
 | 
			
		||||
	u64 (*tlbr_flush_limit)(const struct fdt_match *match);
 | 
			
		||||
	u32 (*tlb_num_entries)(const struct fdt_match *match);
 | 
			
		||||
	bool (*cold_boot_allowed)(u32 hartid, const struct fdt_match *match);
 | 
			
		||||
	int (*early_init)(bool cold_boot, const struct fdt_match *match);
 | 
			
		||||
	int (*final_init)(bool cold_boot, const struct fdt_match *match);
 | 
			
		||||
 
 | 
			
		||||
@@ -256,6 +256,13 @@ static u64 generic_tlbr_flush_limit(void)
 | 
			
		||||
	return SBI_PLATFORM_TLB_RANGE_FLUSH_LIMIT_DEFAULT;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static u32 generic_tlb_num_entries(void)
 | 
			
		||||
{
 | 
			
		||||
	if (generic_plat && generic_plat->tlb_num_entries)
 | 
			
		||||
		return generic_plat->tlb_num_entries(generic_plat_match);
 | 
			
		||||
	return SBI_PLATFORM_TLB_FIFO_NUM_ENTRIES;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int generic_pmu_init(void)
 | 
			
		||||
{
 | 
			
		||||
	return fdt_pmu_setup(fdt_get_address());
 | 
			
		||||
@@ -308,6 +315,7 @@ const struct sbi_platform_operations platform_ops = {
 | 
			
		||||
	.pmu_init		= generic_pmu_init,
 | 
			
		||||
	.pmu_xlate_to_mhpmevent = generic_pmu_xlate_to_mhpmevent,
 | 
			
		||||
	.get_tlbr_flush_limit	= generic_tlbr_flush_limit,
 | 
			
		||||
	.get_tlb_num_entries	= generic_tlb_num_entries,
 | 
			
		||||
	.timer_init		= fdt_timer_init,
 | 
			
		||||
	.timer_exit		= fdt_timer_exit,
 | 
			
		||||
	.vendor_ext_check	= generic_vendor_ext_check,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user