mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-10-31 20:18:18 +00:00 
			
		
		
		
	Part of the mini Blackfin ABI with operating systems is that they can use 0x4f0-0x4f8 to pass log buffers to/from bootloaders. So add support to U-Boot for reading the log buffer. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
		
			
				
	
	
		
			31 lines
		
	
	
		
			539 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			539 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * functions for handling OS log buffer
 | |
|  *
 | |
|  * Copyright (c) 2009 Analog Devices Inc.
 | |
|  *
 | |
|  * Licensed under the 2-clause BSD.
 | |
|  */
 | |
| 
 | |
| #include <common.h>
 | |
| 
 | |
| #define OS_LOG_MAGIC       0xDEADBEEF
 | |
| #define OS_LOG_MAGIC_ADDR  ((unsigned long *)0x4f0)
 | |
| #define OS_LOG_PTR_ADDR    ((char **)0x4f4)
 | |
| 
 | |
| bool bfin_os_log_check(void)
 | |
| {
 | |
| 	if (*OS_LOG_MAGIC_ADDR != OS_LOG_MAGIC)
 | |
| 		return false;
 | |
| 	*OS_LOG_MAGIC_ADDR = 0;
 | |
| 	return true;
 | |
| }
 | |
| 
 | |
| void bfin_os_log_dump(void)
 | |
| {
 | |
| 	char *log = *OS_LOG_PTR_ADDR;
 | |
| 	while (*log) {
 | |
| 		puts(log);
 | |
| 		log += strlen(log) + 1;
 | |
| 	}
 | |
| }
 |