diff --git a/cpu/blackfin/Makefile b/cpu/blackfin/Makefile index 1378fd12bbe9b9292ee22a250070aaf49542c3af..5eef6a3063aa99d271be1a34414c90d13a4b26db 100644 --- a/cpu/blackfin/Makefile +++ b/cpu/blackfin/Makefile @@ -17,8 +17,14 @@ EXTRA := CEXTRA := initcode.o SEXTRA := start.o SOBJS := interrupt.o cache.o -COBJS-y := cpu.o traps.o interrupts.o reset.o serial.o watchdog.o +COBJS-y += cpu.o +COBJS-y += interrupts.o COBJS-$(CONFIG_JTAG_CONSOLE) += jtag-console.o +COBJS-y += os_log.o +COBJS-y += reset.o +COBJS-y += serial.o +COBJS-y += traps.o +COBJS-y += watchdog.o ifeq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS) COBJS-y += initcode.o diff --git a/cpu/blackfin/os_log.c b/cpu/blackfin/os_log.c new file mode 100644 index 0000000000000000000000000000000000000000..e1c8e2948dede6feeb6c7dd7cc73f5e46a1ac808 --- /dev/null +++ b/cpu/blackfin/os_log.c @@ -0,0 +1,30 @@ +/* + * 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; + } +} diff --git a/include/asm-blackfin/blackfin_local.h b/include/asm-blackfin/blackfin_local.h index e17d8a2003b2c3cb351248a3d8bec5e108be7185..8ec79289456782c1d213e70027043dd71eb11feb 100644 --- a/include/asm-blackfin/blackfin_local.h +++ b/include/asm-blackfin/blackfin_local.h @@ -61,6 +61,9 @@ extern u_long get_sclk(void); # define bfin_revid() (*pCHIPID >> 28) +extern bool bfin_os_log_check(void); +extern void bfin_os_log_dump(void); + extern void blackfin_icache_flush_range(const void *, const void *); extern void blackfin_dcache_flush_range(const void *, const void *); extern void blackfin_icache_dcache_flush_range(const void *, const void *); diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h index c03561cef14a8edc84ed6f932c3832ec35799974..4be2a5cfb8cf156d5620363a5fa7c7356e3425d5 100644 --- a/include/configs/bf533-stamp.h +++ b/include/configs/bf533-stamp.h @@ -36,7 +36,7 @@ #define CONFIG_CCLK_DIV 1 /* SCLK_DIV controls the system clock divider */ /* Values can range from 1-15 */ -#define CONFIG_SCLK_DIV 5 +#define CONFIG_SCLK_DIV 6 /* note: 1.2 boards can go faster */ /* diff --git a/include/configs/bf537-minotaur.h b/include/configs/bf537-minotaur.h index 23c2d33bc0be53186fa68b152112563f68d861ee..463b7d08ccdfda5a2168baea672c705950203035 100644 --- a/include/configs/bf537-minotaur.h +++ b/include/configs/bf537-minotaur.h @@ -87,9 +87,8 @@ #define CONFIG_SYS_AUTOLOAD "no" #define CONFIG_ROOTPATH /romfs -/* Use a fixed MAC address for booting up. Firstboot linux - * must fetch a valid MAC from the production server. */ -#define CONFIG_ETHADDR 02:80:ad:20:31:42 +/* Uncomment next line to use fixed MAC address */ +/* #define CONFIG_ETHADDR 02:80:ad:20:31:42 */ /* diff --git a/include/configs/bf537-srv1.h b/include/configs/bf537-srv1.h index 727b7e70e64b9fe4982c05eb1049c1d51828cfa0..7368629981d037132bdcb5dc9e29ee75e72dbcec 100644 --- a/include/configs/bf537-srv1.h +++ b/include/configs/bf537-srv1.h @@ -87,9 +87,8 @@ #define CONFIG_SYS_AUTOLOAD "no" #define CONFIG_ROOTPATH /romfs -/* Use a fixed MAC address for booting up. Firstboot linux - * must fetch a valid MAC from the production server. */ -#define CONFIG_ETHADDR 02:80:ad:20:31:42 +/* Uncomment next line to use fixed MAC address */ +/* #define CONFIG_ETHADDR 02:80:ad:20:31:42 */ /* diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c index 28de372b78f3305509b0fb7de9242bc6fb5b7790..b957a9d8b9a62bf8bb94b13e77207d481aed62a6 100644 --- a/lib_blackfin/board.c +++ b/lib_blackfin/board.c @@ -384,6 +384,12 @@ void board_init_r(gd_t * id, ulong dest_addr) post_run(NULL, POST_RAM | post_bootmode_get(0)); #endif + if (bfin_os_log_check()) { + puts("\nLog buffer from operating system:\n"); + bfin_os_log_dump(); + puts("\n"); + } + /* main_loop() can return to retry autoboot, if so just run it again. */ for (;;) main_loop();