* [U-Boot-Users] [PATCH] MIPS: Fix CFG_NO_FLASH support
@ 2008-02-17 15:58 Jean-Christophe PLAGNIOL-VILLARD
2008-02-18 14:30 ` Shinya Kuribayashi
2008-02-22 11:09 ` Wolfgang Denk
0 siblings, 2 replies; 3+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-02-17 15:58 UTC (permalink / raw)
To: u-boot
- 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>
diff --git a/board/qemu-mips/Makefile b/board/qemu-mips/Makefile
index 23be447..837b6b9 100644
--- a/board/qemu-mips/Makefile
+++ b/board/qemu-mips/Makefile
@@ -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)
diff --git a/board/qemu-mips/flash.c b/board/qemu-mips/flash.c
deleted file mode 100644
index e988272..0000000
--- a/board/qemu-mips/flash.c
+++ /dev/null
@@ -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);
-}
diff --git a/lib_mips/board.c b/lib_mips/board.c
index c1a0acf..1645f2c 100644
--- a/lib_mips/board.c
+++ b/lib_mips/board.c
@@ -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
--
1.5.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot-Users] [PATCH] MIPS: Fix CFG_NO_FLASH support
2008-02-17 15:58 [U-Boot-Users] [PATCH] MIPS: Fix CFG_NO_FLASH support Jean-Christophe PLAGNIOL-VILLARD
@ 2008-02-18 14:30 ` Shinya Kuribayashi
2008-02-22 11:09 ` Wolfgang Denk
1 sibling, 0 replies; 3+ messages in thread
From: Shinya Kuribayashi @ 2008-02-18 14:30 UTC (permalink / raw)
To: u-boot
Jean-Christophe PLAGNIOL-VILLARD wrote:
> @@ -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
Hm, could we clean up further more?
diff --git a/lib_mips/board.c b/lib_mips/board.c
index 1645f2c..b9606e4 100644
--- a/lib_mips/board.c
+++ b/lib_mips/board.c
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot-Users] [PATCH] MIPS: Fix CFG_NO_FLASH support
2008-02-17 15:58 [U-Boot-Users] [PATCH] MIPS: Fix CFG_NO_FLASH support Jean-Christophe PLAGNIOL-VILLARD
2008-02-18 14:30 ` Shinya Kuribayashi
@ 2008-02-22 11:09 ` Wolfgang Denk
1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2008-02-22 11:09 UTC (permalink / raw)
To: u-boot
In message <1203263884-1282-1-git-send-email-plagnioj@jcrosoft.com> you wrote:
> - 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>
Applied, thanks.
Best regards,
Wolfgang Denk
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-02-22 11:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-17 15:58 [U-Boot-Users] [PATCH] MIPS: Fix CFG_NO_FLASH support Jean-Christophe PLAGNIOL-VILLARD
2008-02-18 14:30 ` Shinya Kuribayashi
2008-02-22 11:09 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox