MIPS: Fix CFG_NO_FLASH support
PATCH 1/1 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 <[email protected]>
board/qemu-mips/Makefile +1 -1
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a -COBJS = $(BOARD).o flash.o +COBJS = $(BOARD).o SOBJS = lowlevel_init.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
board/qemu-mips/flash.c deleted +0 -40
@@ -1,40 +0,0 @@ -/* -* (C) Copyright 2003 -* Wolfgang Denk, DENX Software Engineering, wd at 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 ); -}
lib_mips/board.c +11 -5
@@ -121,12 +121,13 @@ static int display_banner(void)return (0 ); } +#ifndef CFG_NO_FLASH static void display_flash_config (ulong size) {puts ("Flash: " );print_size (size,"\n" ); } - +#endif 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" ,sizeof (gd_t), addr_sp); -/* Reserve memory for boot params. +/* Reserve memory for boot params. */ addr_sp -=CFG_BOOTPARAMS_LEN ; 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) {cmd_tbl_t *cmdtp; +#ifndef CFG_NO_FLASH ulong size; +#endif extern void malloc_bin_reloc (void );#ifndef CFG_ENV_IS_NOWHERE 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 */ -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; 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;#endif + bd = gd->bd; + +#ifndef CFG_NO_FLASH /* configure available FLASH banks */ size =flash_init ();display_flash_config (size); + bd->bi_flashsize = size; +#endif - bd = gd->bd; bd->bi_flashstart =CFG_FLASH_BASE ; - bd->bi_flashsize = size;#if CFG_MONITOR_BASE ==CFG_FLASH_BASE bd->bi_flashoffset = monitor_flash_len;/* reserved area for U-Boot */ #else
Signature · 1 line
1.5.4.1
PATCH 1/1 MIPS: Fix CFG_NO_FLASH support
Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
(quoted diff) +3
-0@@ -352,13 +355,16 @@ void board_init_r (gd_t *id, ulong dest_addr) env_name_spec += gd->reloc_off; #endif + bd = gd->bd; + +#ifndef CFG_NO_FLASH /* configure available FLASH banks */ size = flash_init();
Review void board_init_r (gd_t *id, ulong dest_addr) · line 370
Quoted 10 lines
(quoted diff) +2
-2display_flash_config (size); + bd->bi_flashsize = size; +#endif - bd = gd->bd; bd->bi_flashstart = CFG_FLASH_BASE; - bd->bi_flashsize = size; #if CFG_MONITOR_BASE == CFG_FLASH_BASE bd->bi_flashoffset = monitor_flash_len; /* reserved area for U-Boot */ #else
Hm, could we clean up further more?
lib_mips/board.c +2 -2
@@ -361,15 +361,15 @@ void board_init_r (gd_t *id, ulong dest_addr)/* configure available FLASH banks */ size =flash_init ();display_flash_config (size); + bd->bi_flashstart =CFG_FLASH_BASE ; bd->bi_flashsize = size; -#endif - bd->bi_flashstart =CFG_FLASH_BASE ;#if CFG_MONITOR_BASE ==CFG_FLASH_BASE bd->bi_flashoffset = monitor_flash_len;/* reserved area for U-Boot */ #else bd->bi_flashoffset =0 ;#endif +#endif /* CFG_NO_FLASH */ /* initialize malloc() area */ mem_malloc_init ();
_
And if possible, please split the patch into two; one is for board.c, the other for qemu-mips.
Shinya
Wolfgang Denk
AppliedPATCH 1/1 MIPS: Fix CFG_NO_FLASH support
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 4 lines · In message <[email protected]> you wrote:
- Fix
flash_initcall whenCFG_NO_FLASHis used
- Remove no more neededflash.cfor qemu-mipsSigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts." - Bertrand Russell