MIPS: Fix CFG_NO_FLASH support

- Fix flash_init call when CFG_NO_FLASH is used
- Remove no more needed flash.c for qemu-mips

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2008-02-17 16:58:04 +01:00 committed by Wolfgang Denk
parent edfed1d91d
commit beeccf7a5d
3 changed files with 13 additions and 47 deletions

View File

@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
COBJS = $(BOARD).o flash.o COBJS = $(BOARD).o
SOBJS = lowlevel_init.o SOBJS = lowlevel_init.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)

View File

@ -1,40 +0,0 @@
/*
* (C) Copyright 2003
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
/*-----------------------------------------------------------------------
* flash_init()
*
* sets up flash_info and returns size of FLASH (bytes)
*/
unsigned long flash_init(void)
{
printf("Skipping flash_init\n");
return(0);
}
int write_buff(void *info, uchar *src, ulong addr, ulong cnt)
{
printf("write_buff not implemented\n");
return(-1);
}

View File

@ -121,12 +121,13 @@ static int display_banner(void)
return (0); return (0);
} }
#ifndef CFG_NO_FLASH
static void display_flash_config(ulong size) static void display_flash_config(ulong size)
{ {
puts ("Flash: "); puts ("Flash: ");
print_size (size, "\n"); print_size (size, "\n");
} }
#endif
static int init_baudrate (void) static int init_baudrate (void)
{ {
@ -247,7 +248,7 @@ void board_init_f(ulong bootflag)
debug ("Reserving %d Bytes for Global Data at: %08lx\n", debug ("Reserving %d Bytes for Global Data at: %08lx\n",
sizeof (gd_t), addr_sp); sizeof (gd_t), addr_sp);
/* Reserve memory for boot params. /* Reserve memory for boot params.
*/ */
addr_sp -= CFG_BOOTPARAMS_LEN; addr_sp -= CFG_BOOTPARAMS_LEN;
bd->bi_boot_params = addr_sp; bd->bi_boot_params = addr_sp;
@ -301,7 +302,9 @@ void board_init_f(ulong bootflag)
void board_init_r (gd_t *id, ulong dest_addr) void board_init_r (gd_t *id, ulong dest_addr)
{ {
cmd_tbl_t *cmdtp; cmd_tbl_t *cmdtp;
#ifndef CFG_NO_FLASH
ulong size; ulong size;
#endif
extern void malloc_bin_reloc (void); extern void malloc_bin_reloc (void);
#ifndef CFG_ENV_IS_NOWHERE #ifndef CFG_ENV_IS_NOWHERE
extern char * env_name_spec; extern char * env_name_spec;
@ -322,7 +325,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
/* /*
* We have to relocate the command table manually * We have to relocate the command table manually
*/ */
for (cmdtp = &__u_boot_cmd_start; cmdtp != &__u_boot_cmd_end; cmdtp++) { for (cmdtp = &__u_boot_cmd_start; cmdtp != &__u_boot_cmd_end; cmdtp++) {
ulong addr; ulong addr;
addr = (ulong) (cmdtp->cmd) + gd->reloc_off; addr = (ulong) (cmdtp->cmd) + gd->reloc_off;
@ -352,13 +355,16 @@ void board_init_r (gd_t *id, ulong dest_addr)
env_name_spec += gd->reloc_off; env_name_spec += gd->reloc_off;
#endif #endif
bd = gd->bd;
#ifndef CFG_NO_FLASH
/* configure available FLASH banks */ /* configure available FLASH banks */
size = flash_init(); size = flash_init();
display_flash_config (size); display_flash_config (size);
bd = gd->bd;
bd->bi_flashstart = CFG_FLASH_BASE;
bd->bi_flashsize = size; bd->bi_flashsize = size;
#endif
bd->bi_flashstart = CFG_FLASH_BASE;
#if CFG_MONITOR_BASE == CFG_FLASH_BASE #if CFG_MONITOR_BASE == CFG_FLASH_BASE
bd->bi_flashoffset = monitor_flash_len; /* reserved area for U-Boot */ bd->bi_flashoffset = monitor_flash_len; /* reserved area for U-Boot */
#else #else