From b828dda657dd26b5580c4a85e5680a5d16352a4c Mon Sep 17 00:00:00 2001 From: stroese Date: Tue, 9 Dec 2003 14:54:43 +0000 Subject: BUBINGA405EP port fixed. --- board/bubinga405ep/bubinga405ep.c | 18 +++++------------- board/bubinga405ep/flash.c | 37 ++++++++++++++++++++++++++----------- 2 files changed, 31 insertions(+), 24 deletions(-) (limited to 'board/bubinga405ep') diff --git a/board/bubinga405ep/bubinga405ep.c b/board/bubinga405ep/bubinga405ep.c index eb9baf4a3..8694ebe90 100644 --- a/board/bubinga405ep/bubinga405ep.c +++ b/board/bubinga405ep/bubinga405ep.c @@ -23,7 +23,6 @@ long int spd_sdram (void); #include -#include "bubinga405ep.h" #include @@ -82,18 +81,11 @@ int checkboard (void) unsigned char *s = getenv ("serial#"); unsigned char *e; - puts ("Board: "); - - if (!s || strncmp (s, "BUBINGA405EP", 9)) { - puts ("### No HW ID - assuming WALNUT405"); - } else { - for (e = s; *e; ++e) { - if (*e == ' ') - break; - } - for (; s < e; ++s) { - putc (*s); - } + puts ("Board: IBM 405EP Eval Board"); + + if (s != NULL) { + puts (", serial# "); + puts (s); } putc ('\n'); diff --git a/board/bubinga405ep/flash.c b/board/bubinga405ep/flash.c index 6a9907c01..d4bd7eef7 100644 --- a/board/bubinga405ep/flash.c +++ b/board/bubinga405ep/flash.c @@ -101,6 +101,11 @@ unsigned long flash_init (void) FLASH_BASE0_PRELIM, FLASH_BASE0_PRELIM+CFG_MONITOR_LEN-1, &flash_info[0]); + /* Also protect sector containing initial power-up instruction */ + (void)flash_protect(FLAG_PROTECT_SET, + 0xFFFFFFFC, + 0xFFFFFFFF, + &flash_info[0]); size_b1 = 0 ; flash_info[0].size = size_b0; } @@ -143,6 +148,16 @@ unsigned long flash_init (void) base_b0+size_b0-CFG_MONITOR_LEN, base_b0+size_b0-1, &flash_info[0]); + /* Also protect sector containing initial power-up instruction */ + /* (flash_protect() checks address range - other call ignored) */ + (void)flash_protect(FLAG_PROTECT_SET, + 0xFFFFFFFC, + 0xFFFFFFFF, + &flash_info[0]); + (void)flash_protect(FLAG_PROTECT_SET, + 0xFFFFFFFC, + 0xFFFFFFFF, + &flash_info[1]); if (size_b1) { /* Re-do sizing to get full correct info */ @@ -493,18 +508,18 @@ int wait_for_DQ7(flash_info_t *info, int sect) volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[sect]); start = get_timer (0); - last = start; - while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) { - if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) { - printf ("Timeout\n"); - return -1; - } - /* show that we're waiting */ - if ((now - last) > 1000) { /* every second */ - putc ('.'); - last = now; + last = 0; + while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) { + if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) { + printf ("Timeout\n"); + return -1; + } + /* show that we're waiting */ + if ((now - last) > 1000) { /* every second */ + putc ('.'); + last = now; + } } - } return 0; } -- cgit v1.2.3