forked from Mirrors/opensbi
		
	include: sbi_utils: Introduce an helper to get fdt base address
This simply adds an helper to get fdt address which is more explicit than sbi_scratch_thishart_arg1_ptr. Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
		
				
					committed by
					
						
						Anup Patel
					
				
			
			
				
	
			
			
			
						parent
						
							723aa88ff4
						
					
				
				
					commit
					c891acca17
				
			@@ -45,7 +45,7 @@ static int fdt_ipi_cold_init(void)
 | 
			
		||||
	int pos, noff, rc;
 | 
			
		||||
	struct fdt_ipi *drv;
 | 
			
		||||
	const struct fdt_match *match;
 | 
			
		||||
	void *fdt = sbi_scratch_thishart_arg1_ptr();
 | 
			
		||||
	void *fdt = fdt_get_address();
 | 
			
		||||
 | 
			
		||||
	for (pos = 0; pos < array_size(ipi_drivers); pos++) {
 | 
			
		||||
		drv = ipi_drivers[pos];
 | 
			
		||||
 
 | 
			
		||||
@@ -38,7 +38,7 @@ static int fdt_irqchip_cold_init(void)
 | 
			
		||||
	int pos, noff, rc;
 | 
			
		||||
	struct fdt_irqchip *drv;
 | 
			
		||||
	const struct fdt_match *match;
 | 
			
		||||
	void *fdt = sbi_scratch_thishart_arg1_ptr();
 | 
			
		||||
	void *fdt = fdt_get_address();
 | 
			
		||||
 | 
			
		||||
	for (pos = 0; pos < array_size(irqchip_drivers); pos++) {
 | 
			
		||||
		drv = irqchip_drivers[pos];
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ int fdt_reset_init(void)
 | 
			
		||||
	int pos, noff, rc;
 | 
			
		||||
	struct fdt_reset *drv;
 | 
			
		||||
	const struct fdt_match *match;
 | 
			
		||||
	void *fdt = sbi_scratch_thishart_arg1_ptr();
 | 
			
		||||
	void *fdt = fdt_get_address();
 | 
			
		||||
 | 
			
		||||
	for (pos = 0; pos < array_size(reset_drivers); pos++) {
 | 
			
		||||
		drv = reset_drivers[pos];
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ int fdt_serial_init(void)
 | 
			
		||||
	struct fdt_serial *drv;
 | 
			
		||||
	const struct fdt_match *match;
 | 
			
		||||
	int pos, noff = -1, len, coff, rc;
 | 
			
		||||
	void *fdt = sbi_scratch_thishart_arg1_ptr();
 | 
			
		||||
	void *fdt = fdt_get_address();
 | 
			
		||||
 | 
			
		||||
	/* Find offset of node pointed to by stdout-path */
 | 
			
		||||
	coff = fdt_path_offset(fdt, "/chosen");
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ static int fdt_timer_cold_init(void)
 | 
			
		||||
	int pos, noff, rc;
 | 
			
		||||
	struct fdt_timer *drv;
 | 
			
		||||
	const struct fdt_match *match;
 | 
			
		||||
	void *fdt = sbi_scratch_thishart_arg1_ptr();
 | 
			
		||||
	void *fdt = fdt_get_address();
 | 
			
		||||
 | 
			
		||||
	for (pos = 0; pos < array_size(timer_drivers); pos++) {
 | 
			
		||||
		drv = timer_drivers[pos];
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user