blob: 2092d9e3b6efa559f0af463b29f0ce78f4e760ad [file] [log] [blame]
Mike Frysinger08975892009-07-09 01:15:05 -04001/*
2 * functions for handling OS log buffer
3 *
4 * Copyright (c) 2009 Analog Devices Inc.
5 *
6 * Licensed under the 2-clause BSD.
7 */
8
9#include <common.h>
10
11#define OS_LOG_MAGIC 0xDEADBEEF
12#define OS_LOG_MAGIC_ADDR ((unsigned long *)0x4f0)
13#define OS_LOG_PTR_ADDR ((char **)0x4f4)
14
Wolfgang Denk9655c932013-11-19 08:01:44 +010015int bfin_os_log_check(void)
Mike Frysinger08975892009-07-09 01:15:05 -040016{
17 if (*OS_LOG_MAGIC_ADDR != OS_LOG_MAGIC)
Wolfgang Denk9655c932013-11-19 08:01:44 +010018 return 0;
Mike Frysinger08975892009-07-09 01:15:05 -040019 *OS_LOG_MAGIC_ADDR = 0;
Wolfgang Denk9655c932013-11-19 08:01:44 +010020 return 1;
Mike Frysinger08975892009-07-09 01:15:05 -040021}
22
23void bfin_os_log_dump(void)
24{
25 char *log = *OS_LOG_PTR_ADDR;
26 while (*log) {
27 puts(log);
28 log += strlen(log) + 1;
29 }
30}