arch/riscv: hls_init: Initialize time{,cmp} with dummy pointers
In current versions of spike, the config string is not available
anymore, because RISC-V is moving toward OpenFirmware-derived device
trees (either in FDT or text format). Using query_config_string leads to
a crash in these versions of spike.
With this commit and If0bea4bf52d ("riscv: Update register address"),
coreboot reaches the romstage again, on spike.
Change-Id: Ib1e6565145f0b2252deb1f4658221a4f816e2af4
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/21657
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
			
			
This commit is contained in:
		
				
					committed by
					
						
						Martin Roth
					
				
			
			
				
	
			
			
			
						parent
						
							69a143d682
						
					
				
				
					commit
					3b2712d757
				
			@@ -92,16 +92,13 @@ uintptr_t mcall_set_timer(uint64_t when)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void hls_init(uint32_t hart_id)
 | 
					void hls_init(uint32_t hart_id)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	query_result res;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	printk(BIOS_SPEW, "hart %d: HLS is %p\n", hart_id, HLS());
 | 
						printk(BIOS_SPEW, "hart %d: HLS is %p\n", hart_id, HLS());
 | 
				
			||||||
	memset(HLS(), 0, sizeof(*HLS()));
 | 
						memset(HLS(), 0, sizeof(*HLS()));
 | 
				
			||||||
	HLS()->hart_id = hart_id;
 | 
						HLS()->hart_id = hart_id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	res = query_config_string(configstring(), "rtc{addr");
 | 
						/* Initialize these pointers with dummy values, for now */
 | 
				
			||||||
	HLS()->time = (void *)get_uint(res);
 | 
						HLS()->time = NULL;
 | 
				
			||||||
	res = query_config_string(configstring(), "core{0{0{timecmp");
 | 
						HLS()->timecmp = NULL;
 | 
				
			||||||
	HLS()->timecmp = (void *)get_uint(res);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	printk(BIOS_SPEW, "Time is %p and timecmp is %p\n",
 | 
						printk(BIOS_SPEW, "Time is %p and timecmp is %p\n",
 | 
				
			||||||
	       HLS()->time, HLS()->timecmp);
 | 
						       HLS()->time, HLS()->timecmp);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user