forked from Mirrors/opensbi
		
	lib: utils/reset: Use fdt_driver for initialization
The reset driver subsystem does not need any extra data, so it can use `struct fdt_driver` directly. The generic fdt_reset_init() performs a best-effort initialization of all matching DT nodes. Platform-specific logic expects exactly one DT node to match a single driver. This is accomplished by using fdt_driver_init_one() with a local list containing that one driver. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
		
				
					committed by
					
						
						Anup Patel
					
				
			
			
				
	
			
			
			
						parent
						
							1f8db2f18f
						
					
				
				
					commit
					6d9ad492db
				
			@@ -209,11 +209,16 @@ static const struct fdt_match da9063_reset_match[] = {
 | 
			
		||||
	{ },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct fdt_reset fdt_reset_da9063 = {
 | 
			
		||||
const struct fdt_driver fdt_reset_da9063 = {
 | 
			
		||||
	.match_table = da9063_reset_match,
 | 
			
		||||
	.init = da9063_reset_init,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const struct fdt_driver *const sifive_fu740_reset_drivers[] = {
 | 
			
		||||
	&fdt_reset_da9063,
 | 
			
		||||
	NULL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static u64 sifive_fu740_tlbr_flush_limit(const struct fdt_match *match)
 | 
			
		||||
{
 | 
			
		||||
	/*
 | 
			
		||||
@@ -232,7 +237,7 @@ static int sifive_fu740_final_init(bool cold_boot, void *fdt,
 | 
			
		||||
	int rc;
 | 
			
		||||
 | 
			
		||||
	if (cold_boot) {
 | 
			
		||||
		rc = fdt_reset_driver_init(fdt, &fdt_reset_da9063);
 | 
			
		||||
		rc = fdt_driver_init_one(fdt, sifive_fu740_reset_drivers);
 | 
			
		||||
		if (rc)
 | 
			
		||||
			sbi_printf("%s: failed to find da9063 for reset\n",
 | 
			
		||||
				   __func__);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user