forked from Mirrors/opensbi
		
	platform: andes: Factor out is_andes() helper
We will need is_andes(45) in the following patch, so factor out the code that parses marchid to make it reusable for checking any Andes CPU variants. Also improves the comment in ae350_hart_start(). Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
		
				
					committed by
					
						
						Anup Patel
					
				
			
			
				
	
			
			
			
						parent
						
							0b3262efc6
						
					
				
				
					commit
					009ae4e602
				
			@@ -43,6 +43,12 @@
 | 
			
		||||
 | 
			
		||||
#ifndef __ASSEMBLER__
 | 
			
		||||
 | 
			
		||||
#define is_andes(series)				\
 | 
			
		||||
({							\
 | 
			
		||||
	char value = csr_read(CSR_MARCHID) & 0xff;	\
 | 
			
		||||
	(series) == (value >> 4) * 10 + (value & 0x0f);	\
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
#define has_andes_pmu()					\
 | 
			
		||||
({							\
 | 
			
		||||
	(((csr_read(CSR_MMSC_CFG) &			\
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user