
Hi All,
I cloned the git tree of Wolfgang and tried compilation of qemu_mips_config. But the build breaks with following error: zlib.c:31:27: error: asm/unaligned.h: No such file or directory zlib.c: In function ‘inflate_fast’: zlib.c:641: warning: implicit declaration of function ‘get_unaligned’ make[1]: *** [zlib.o] Error 1 make[1]: Leaving directory `/home/hschauhan/Development/u-boot/lib_generic' make: *** [lib_generic/libgeneric.a] Error 2
I see that in include directory asm points to asm-mips. Inside asm-mips there is another link arch->arch-mips which is a dead link. THere is no directory named arch-mips there.
Whats the problem here? Should I pull only the MIPS custodian tree?
Thanks
Best Regards Himanshu

make -C lib_generic/ zlib.c:31:27: error: asm/unaligned.h: No such file or directory zlib.c: In function 'inflate_fast': zlib.c:641: warning: implicit declaration of function 'get_unaligned' make[1]: *** [zlib.o] Error 1 make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic' make: *** [lib_generic/libgeneric.a] Error 2
Import relevant header file from LMO tree (slightly modified to U-Boot).
Reported-by: Himanshu Chauhan himanshu@symmetricore.com Signed-off-by: Shinya Kuribayashi shinya.kuribayashi@necel.com ---
Himanshu Chauhan wrote:
I see that in include directory asm points to asm-mips. Inside asm-mips there is another link arch->arch-mips which is a dead link. THere is no directory named arch-mips there.
This is another topic, let's ignore here.
Whats the problem here? Should I pull only the MIPS custodian tree?
I confirmed that this patch fixes the build error, but not sure it works or not. Just build tested. And note that there there's nothing interesting in the u-boot-mips tree, sorry.
include/asm-mips/unaligned.h | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 include/asm-mips/unaligned.h
diff --git a/include/asm-mips/unaligned.h b/include/asm-mips/unaligned.h new file mode 100644 index 0000000..da6a347 --- /dev/null +++ b/include/asm-mips/unaligned.h @@ -0,0 +1,26 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org) + */ +#ifndef _ASM_MIPS_UNALIGNED_H +#define _ASM_MIPS_UNALIGNED_H + +#include <compiler.h> +#if defined(__MIPSEB__) +# define get_unaligned __get_unaligned_be +# define put_unaligned __put_unaligned_be +#elif defined(__MIPSEL__) +# define get_unaligned __get_unaligned_le +# define put_unaligned __put_unaligned_le +#else +# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" +#endif + +# include <linux/unaligned/le_byteshift.h> +# include <linux/unaligned/be_byteshift.h> +# include <linux/unaligned/generic.h> + +#endif /* _ASM_MIPS_UNALIGNED_H */

Shinya Kuribayashi wrote:
make -C lib_generic/ zlib.c:31:27: error: asm/unaligned.h: No such file or directory zlib.c: In function 'inflate_fast': zlib.c:641: warning: implicit declaration of function 'get_unaligned' make[1]: *** [zlib.o] Error 1 make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic' make: *** [lib_generic/libgeneric.a] Error 2
Import relevant header file from LMO tree (slightly modified to U-Boot).
Reported-by: Himanshu Chauhan himanshu@symmetricore.com Signed-off-by: Shinya Kuribayashi shinya.kuribayashi@necel.com
Himanshu Chauhan wrote:
I see that in include directory asm points to asm-mips. Inside asm-mips there is another link arch->arch-mips which is a dead link. THere is no directory named arch-mips there.
This is another topic, let's ignore here.
Whats the problem here? Should I pull only the MIPS custodian tree?
I confirmed that this patch fixes the build error, but not sure it works or not. Just build tested. And note that there there's nothing interesting in the u-boot-mips tree, sorry.
include/asm-mips/unaligned.h | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 include/asm-mips/unaligned.h
diff --git a/include/asm-mips/unaligned.h b/include/asm-mips/unaligned.h new file mode 100644 index 0000000..da6a347 --- /dev/null +++ b/include/asm-mips/unaligned.h @@ -0,0 +1,26 @@ +/*
- This file is subject to the terms and conditions of the GNU General
Public
- License. See the file "COPYING" in the main directory of this archive
- for more details.
- Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
- */
+#ifndef _ASM_MIPS_UNALIGNED_H +#define _ASM_MIPS_UNALIGNED_H
+#include <compiler.h> +#if defined(__MIPSEB__) +# define get_unaligned __get_unaligned_be +# define put_unaligned __put_unaligned_be +#elif defined(__MIPSEL__) +# define get_unaligned __get_unaligned_le +# define put_unaligned __put_unaligned_le +#else +# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" +#endif
+# include <linux/unaligned/le_byteshift.h> +# include <linux/unaligned/be_byteshift.h> +# include <linux/unaligned/generic.h>
+#endif /* _ASM_MIPS_UNALIGNED_H */
Thanks for sending this patch across. I will try this.
- Himanshu

On Friday 18 December 2009 11:32:13 Shinya Kuribayashi wrote:
make -C lib_generic/ zlib.c:31:27: error: asm/unaligned.h: No such file or directory zlib.c: In function 'inflate_fast': zlib.c:641: warning: implicit declaration of function 'get_unaligned' make[1]: *** [zlib.o] Error 1 make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic' make: *** [lib_generic/libgeneric.a] Error 2
Import relevant header file from LMO tree (slightly modified to U-Boot).
Why don't you import this file from the Linux tree? This should work without modifications. And that's what we've done for PPC and ARM as well.
Cheers, Stefan
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de

Stefan Roese wrote:
On Friday 18 December 2009 11:32:13 Shinya Kuribayashi wrote:
make -C lib_generic/ zlib.c:31:27: error: asm/unaligned.h: No such file or directory zlib.c: In function 'inflate_fast': zlib.c:641: warning: implicit declaration of function 'get_unaligned' make[1]: *** [zlib.o] Error 1 make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic' make: *** [lib_generic/libgeneric.a] Error 2
Import relevant header file from LMO tree (slightly modified to U-Boot).
Why don't you import this file from the Linux tree? This should work without modifications. And that's what we've done for PPC and ARM as well.
Cheers, Stefan
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de
I think thats what it is. Both are same.
-Himanshu

On Friday 18 December 2009 13:04:59 Himanshu Chauhan wrote:
Import relevant header file from LMO tree (slightly modified to U-Boot).
Why don't you import this file from the Linux tree? This should work without modifications. And that's what we've done for PPC and ARM as well.
Cheers, Stefan
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de
I think thats what it is. Both are same.
No, not exactly. They're nearly identical. But there are differences. Not sure if these differences are important though.
Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that it's different from the Linux version.
Cheers, Stefan
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de

On Friday 18 December 2009 13:20:56 Stefan Roese wrote:
I think thats what it is. Both are same.
No, not exactly. They're nearly identical. But there are differences. Not sure if these differences are important though.
Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that it's different from the Linux version.
Just to make it clear. Here a diff between both versions:
--- u-boot/include/asm-mips/unaligned.h +++ linux-2.6/linus/arch/mips/include/asm/unaligned.h @@ -8,19 +8,21 @@ #ifndef _ASM_MIPS_UNALIGNED_H #define _ASM_MIPS_UNALIGNED_H
-#include <compiler.h> +#include <linux/compiler.h> #if defined(__MIPSEB__) +# include <linux/unaligned/be_struct.h> +# include <linux/unaligned/le_byteshift.h> # define get_unaligned __get_unaligned_be # define put_unaligned __put_unaligned_be #elif defined(__MIPSEL__) +# include <linux/unaligned/le_struct.h> +# include <linux/unaligned/be_byteshift.h> # define get_unaligned __get_unaligned_le # define put_unaligned __put_unaligned_le #else # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" #endif
-# include <linux/unaligned/le_byteshift.h> -# include <linux/unaligned/be_byteshift.h> # include <linux/unaligned/generic.h>
#endif /* _ASM_MIPS_UNALIGNED_H */

Stefan Roese wrote:
On Friday 18 December 2009 13:20:56 Stefan Roese wrote:
I think thats what it is. Both are same.
No, not exactly. They're nearly identical. But there are differences. Not sure if these differences are important though.
Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that it's different from the Linux version.
Just to make it clear. Here a diff between both versions:
--- u-boot/include/asm-mips/unaligned.h +++ linux-2.6/linus/arch/mips/include/asm/unaligned.h @@ -8,19 +8,21 @@ #ifndef _ASM_MIPS_UNALIGNED_H #define _ASM_MIPS_UNALIGNED_H
-#include <compiler.h> +#include <linux/compiler.h> #if defined(__MIPSEB__) +# include <linux/unaligned/be_struct.h> +# include <linux/unaligned/le_byteshift.h> # define get_unaligned __get_unaligned_be # define put_unaligned __put_unaligned_be #elif defined(__MIPSEL__) +# include <linux/unaligned/le_struct.h> +# include <linux/unaligned/be_byteshift.h> # define get_unaligned __get_unaligned_le # define put_unaligned __put_unaligned_le #else # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" #endif
-# include <linux/unaligned/le_byteshift.h> -# include <linux/unaligned/be_byteshift.h> # include <linux/unaligned/generic.h>
#endif /* _ASM_MIPS_UNALIGNED_H */
I think whatever Shinya sent was modified version of linux's unaligned.h and its working.
- Himanshu

Dear Himanshu Chauhan,
In message 4B2B79A9.1000106@symmetricore.com you wrote:
Stefan Roese wrote:
On Friday 18 December 2009 13:20:56 Stefan Roese wrote:
I think thats what it is. Both are same.
No, not exactly. They're nearly identical. But there are differences. Not sure if these differences are important though.
Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that it's different from the Linux version.
Just to make it clear. Here a diff between both versions:
--- u-boot/include/asm-mips/unaligned.h +++ linux-2.6/linus/arch/mips/include/asm/unaligned.h @@ -8,19 +8,21 @@ #ifndef _ASM_MIPS_UNALIGNED_H #define _ASM_MIPS_UNALIGNED_H
-#include <compiler.h> +#include <linux/compiler.h> #if defined(__MIPSEB__) +# include <linux/unaligned/be_struct.h> +# include <linux/unaligned/le_byteshift.h> # define get_unaligned __get_unaligned_be # define put_unaligned __put_unaligned_be #elif defined(__MIPSEL__) +# include <linux/unaligned/le_struct.h> +# include <linux/unaligned/be_byteshift.h> # define get_unaligned __get_unaligned_le # define put_unaligned __put_unaligned_le #else # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" #endif
-# include <linux/unaligned/le_byteshift.h> -# include <linux/unaligned/be_byteshift.h> # include <linux/unaligned/generic.h>
#endif /* _ASM_MIPS_UNALIGNED_H */
I think whatever Shinya sent was modified version of linux's unaligned.h and its working.
Hm... has this really been tested on both big endian and on little endian MIPS systems?
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
Dear Himanshu Chauhan,
In message 4B2B79A9.1000106@symmetricore.com you wrote:
Stefan Roese wrote:
On Friday 18 December 2009 13:20:56 Stefan Roese wrote:
I think thats what it is. Both are same.
No, not exactly. They're nearly identical. But there are differences. Not sure if these differences are important though.
Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that it's different from the Linux version.
Just to make it clear. Here a diff between both versions:
--- u-boot/include/asm-mips/unaligned.h +++ linux-2.6/linus/arch/mips/include/asm/unaligned.h
I think whatever Shinya sent was modified version of linux's unaligned.h and its working.
Hm... has this really been tested on both big endian and on little endian MIPS systems?
Best regards,
Wolfgang Denk
Dear Wolfgang,
I am using MIPS emulation on QEMU for my U-Boot. This patch works on big-endian emulation. I haven't tested it on little endian emulation. My statement of "its working" was for the build fix. So I won't say its ready for commit before being *actually* tested thoroughly.
Best Regards Himanshu

Hi
Do the patches have to be sent at different list than this? I am wondering this because I sent a patch (good or bad is different story :D) for which I didn't hear back. Was it delivered?
Thanks & Regards Himanshu

On Saturday 19 December 2009 07:52:01 Himanshu Chauhan wrote:
Do the patches have to be sent at different list than this? I am wondering this because I sent a patch (good or bad is different story :D) for which I didn't hear back.
there is only one list for questions/patches/etc...
Was it delivered?
check the archives to find out -mike

Dear Himanshu Chauhan,
In message 4B2CCC71.3070708@symmetricore.com you wrote:
Do the patches have to be sent at different list than this? I am wondering this because I sent a patch (good or bad is different story :D) for which I didn't hear back. Was it delivered?
When did you send it? More than a week or two ago?
Or just yesterday? If you expect response times of a premium support contract I have to ask you 1) to sign a premium support contract and 2) to pay premium rates.
Please see http://www.catb.org/~esr/faqs/smart-questions.html#urgent
Best regards,
Wolfgang Denk

Stefan Roese wrote:
On Friday 18 December 2009 13:04:59 Himanshu Chauhan wrote:
Import relevant header file from LMO tree (slightly modified to U-Boot).
Why don't you import this file from the Linux tree? This should work without modifications. And that's what we've done for PPC and ARM as well.
[...]
I think thats what it is. Both are same.
No, not exactly. They're nearly identical. But there are differences. Not sure if these differences are important though.
Hm, the original header is (lmo = linux-mips.org): http://git.kernel.org/?p=linux/kernel/git/ralf/linux.git;a=blob;f=arch/mips/...
Are you referring to another one?
Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that it's different from the Linux version.
I'm afraid 'LMO' needlessly makes you confused. Or am I missing something?

On Friday 18 December 2009 14:02:01 Shinya Kuribayashi wrote:
I think thats what it is. Both are same.
No, not exactly. They're nearly identical. But there are differences. Not sure if these differences are important though.
Hm, the original header is (lmo = linux-mips.org): http://git.kernel.org/?p=linux/kernel/git/ralf/linux.git;a=blob;f=arch/mips /include/asm/unaligned.h;h=42f66c311473abb98fe7a845e360e365ccfed837;hb=mast er
Are you referring to another one?
I just took the one from the latest Linux tree (Linus from today).
Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that it's different from the Linux version.
I'm afraid 'LMO' needlessly makes you confused. Or am I missing something?
Yes, "LMO" was confusing me.
Cheers, Stefan
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de

On 12/18/09 10:06 PM, Stefan Roese wrote:
Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that it's different from the Linux version.
I'm afraid 'LMO' needlessly makes you confused. Or am I missing something?
Yes, "LMO" was confusing me.
Sorry for that, and thanks for trying to check the diff. I'll respin the patch during the merge window, with proper words.

U-Boot hangs with qemu-system-mips with ##unknown flash error. Disabling flash using CONFIG_SYS_NO_FLASH breaks the build. This patch fixes the issue. Don't know if its okay.
Signed-off-by: Himanshu Chauhan himanshu@symmetricore.com
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index efd6aec..5bd3af0 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -76,7 +76,7 @@ extern void bz_internal_error(int); static int image_info (unsigned long addr); #endif
-#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH) && defined(CONFIG_CMD_IMLS) #include <flash.h> extern flash_info_t flash_info[]; /* info for FLASH chips */ static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -1153,7 +1153,7 @@ U_BOOT_CMD( /*******************************************************************/ /* imls - list all images found in flash */ /*******************************************************************/ -#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH) && defined(CONFIG_CMD_IMLS) int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { flash_info_t *info; diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 24eb33f..06c7271 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -41,6 +41,7 @@ #include <environment.h> #include <mtd/cfi_flash.h>
+#ifndef CONFIG_SYS_NO_FLASH /* * This file implements a Common Flash Interface (CFI) driver for * U-Boot. @@ -2020,3 +2021,5 @@ unsigned long flash_init (void)
return (size); } + +#endif diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index cbacdf9..49a1a1c 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h :q @@ -142,6 +142,7 @@ #define CONFIG_SYS_INIT_SP_OFFSET 0x400000
/* We boot from this flash, selected with dip switch */ +#define CONFIG_SYS_NO_FLASH #define CONFIG_SYS_FLASH_BASE 0xbfc00000 #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 128 @@ -149,7 +150,8 @@ #define CONFIG_FLASH_CFI_DRIVER 1 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1
-#define CONFIG_ENV_IS_IN_FLASH 1 +#define CONFIG_ENV_IS_IN_FLASH 0 +#define CONFIG_ENV_IS_NOWHERE #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
/* Address and size of Primary Environment Sector */ diff --git a/include/mtd/cfi_flash.h b/include/mtd/cfi_flash.h index 2aa6911..2229ddf 100644 --- a/include/mtd/cfi_flash.h +++ b/include/mtd/cfi_flash.h @@ -151,7 +151,8 @@ struct cfi_pri_hdr { u8 minor_version; } __attribute__((packed));
-void flash_write_cmd(flash_info_t * info, flash_sect_t sect, - uint offset, u32 cmd); +#ifndef CONFIG_SYS_NO_FLASH +void flash_write_cmd(flash_info_t * info, flash_sect_t sect, uint offset, u32 cmd); +#endif
#endif /* __CFI_FLASH_H__ */

Shinya Kuribayashi wrote:
make -C lib_generic/ zlib.c:31:27: error: asm/unaligned.h: No such file or directory zlib.c: In function 'inflate_fast': zlib.c:641: warning: implicit declaration of function 'get_unaligned' make[1]: *** [zlib.o] Error 1 make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic' make: *** [lib_generic/libgeneric.a] Error 2
Import relevant header file from LMO tree (slightly modified to U-Boot).
Reported-by: Himanshu Chauhan himanshu@symmetricore.com Signed-off-by: Shinya Kuribayashi shinya.kuribayashi@necel.com
Himanshu Chauhan wrote:
I see that in include directory asm points to asm-mips. Inside asm-mips there is another link arch->arch-mips which is a dead link. THere is no directory named arch-mips there.
This is another topic, let's ignore here.
Is arch-mips scheduled to be added?
Himanshu

Himanshu Chauhan wrote:
Himanshu Chauhan wrote:
I see that in include directory asm points to asm-mips. Inside asm-mips there is another link arch->arch-mips which is a dead link. THere is no directory named arch-mips there.
This is another topic, let's ignore here.
Is arch-mips scheduled to be added?
Not at the moment. I'm not sure how it works, in the first place.

U-Boot hangs with qemu-system-mips with ##unknown flash error. Disabling flash using CONFIG_SYS_NO_FLASH breaks the build. This patch fixes the issue. Don't know if its okay.
Signed-off-by: Himanshu Chauhan himanshu@symmetricore.com
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index efd6aec..5bd3af0 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -76,7 +76,7 @@ extern void bz_internal_error(int); static int image_info (unsigned long addr); #endif
-#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH) && defined(CONFIG_CMD_IMLS) #include <flash.h> extern flash_info_t flash_info[]; /* info for FLASH chips */ static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -1153,7 +1153,7 @@ U_BOOT_CMD( /*******************************************************************/ /* imls - list all images found in flash */ /*******************************************************************/ -#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH) && defined(CONFIG_CMD_IMLS) int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { flash_info_t *info; diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 24eb33f..06c7271 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -41,6 +41,7 @@ #include <environment.h> #include <mtd/cfi_flash.h>
+#ifndef CONFIG_SYS_NO_FLASH /* * This file implements a Common Flash Interface (CFI) driver for * U-Boot. @@ -2020,3 +2021,5 @@ unsigned long flash_init (void)
return (size); } + +#endif diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index cbacdf9..49a1a1c 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h :q @@ -142,6 +142,7 @@ #define CONFIG_SYS_INIT_SP_OFFSET 0x400000
/* We boot from this flash, selected with dip switch */ +#define CONFIG_SYS_NO_FLASH #define CONFIG_SYS_FLASH_BASE 0xbfc00000 #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 128 @@ -149,7 +150,8 @@ #define CONFIG_FLASH_CFI_DRIVER 1 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1
-#define CONFIG_ENV_IS_IN_FLASH 1 +#define CONFIG_ENV_IS_IN_FLASH 0 +#define CONFIG_ENV_IS_NOWHERE #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
/* Address and size of Primary Environment Sector */ diff --git a/include/mtd/cfi_flash.h b/include/mtd/cfi_flash.h index 2aa6911..2229ddf 100644 --- a/include/mtd/cfi_flash.h +++ b/include/mtd/cfi_flash.h @@ -151,7 +151,8 @@ struct cfi_pri_hdr { u8 minor_version; } __attribute__((packed));
-void flash_write_cmd(flash_info_t * info, flash_sect_t sect, - uint offset, u32 cmd); +#ifndef CONFIG_SYS_NO_FLASH +void flash_write_cmd(flash_info_t * info, flash_sect_t sect, uint offset, u32 cmd); +#endif
#endif /* __CFI_FLASH_H__ */

Hi,
On 12/19/09 3:57 PM, Himanshu Chauhan wrote:
U-Boot hangs with qemu-system-mips with ##unknown flash error.
Do you have any idea what's the root cause of that unknown flash error? Is this U-Boot CFI driver issue, or Qemu-side problem?
Using CONFIG_SYS_NO_FLASH is a quick, enough workaround for your trial, but does not fix anything. Could you sort out the issue? I don't think I can help regarding debugging Qemu (sorry!), but u-boot/doc/README.qemu_mips and U-Boot/Qemu community will help.
Disabling flash using CONFIG_SYS_NO_FLASH breaks the build. This patch fixes the issue. Don't know if its okay.
Signed-off-by: Himanshu Chauhanhimanshu@symmetricore.com
Heh, let's use git-format-patch when preparing patches.
$ git format-patch HEAD^.. $ git format-patch --no-thread HEAD^^.. $ mkdir foo && git format-patch -o foo/ HEAD~3.. and so on.
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index efd6aec..5bd3af0 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -76,7 +76,7 @@ extern void bz_internal_error(int); static int image_info (unsigned long addr); #endif
-#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH)&& defined(CONFIG_CMD_IMLS) #include<flash.h> extern flash_info_t flash_info[]; /* info for FLASH chips */ static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -1153,7 +1153,7 @@ U_BOOT_CMD( /*******************************************************************/ /* imls - list all images found in flash */ /*******************************************************************/ -#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH)&& defined(CONFIG_CMD_IMLS) int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { flash_info_t *info;
Disabling IMLS command in configs/qemu_mips.h?
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 24eb33f..06c7271 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -41,6 +41,7 @@ #include<environment.h> #include<mtd/cfi_flash.h>
+#ifndef CONFIG_SYS_NO_FLASH /*
- This file implements a Common Flash Interface (CFI) driver for
- U-Boot.
@@ -2020,3 +2021,5 @@ unsigned long flash_init (void)
return (size); }
+#endif
Removing CONFIG_CFI_DRIVER from configs/qemu_mips.h?
diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index cbacdf9..49a1a1c 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h :q @@ -142,6 +142,7 @@ #define CONFIG_SYS_INIT_SP_OFFSET 0x400000
/* We boot from this flash, selected with dip switch */ +#define CONFIG_SYS_NO_FLASH #define CONFIG_SYS_FLASH_BASE 0xbfc00000 #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 128 @@ -149,7 +150,8 @@ #define CONFIG_FLASH_CFI_DRIVER 1 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1
-#define CONFIG_ENV_IS_IN_FLASH 1 +#define CONFIG_ENV_IS_IN_FLASH 0 +#define CONFIG_ENV_IS_NOWHERE #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
/* Address and size of Primary Environment Sector */
[...]
diff --git a/include/mtd/cfi_flash.h b/include/mtd/cfi_flash.h index 2aa6911..2229ddf 100644 --- a/include/mtd/cfi_flash.h +++ b/include/mtd/cfi_flash.h @@ -151,7 +151,8 @@ struct cfi_pri_hdr { u8 minor_version; } __attribute__((packed));
-void flash_write_cmd(flash_info_t * info, flash_sect_t sect,
uint offset, u32 cmd);
+#ifndef CONFIG_SYS_NO_FLASH +void flash_write_cmd(flash_info_t * info, flash_sect_t sect, uint offset, u32 cmd); +#endif
#endif /* __CFI_FLASH_H__ */
Removing CONFIG_CFI_DRIVER from configs/qemu_mips.h?
Anyway, I'd like to leave this issue as-is for now, and look forward to the read bug fix.
Shinya

Shinya Kuribayashi wrote:
Hi,
On 12/19/09 3:57 PM, Himanshu Chauhan wrote:
U-Boot hangs with qemu-system-mips with ##unknown flash error.
Do you have any idea what's the root cause of that unknown flash error? Is this U-Boot CFI driver issue, or Qemu-side problem?
Using CONFIG_SYS_NO_FLASH is a quick, enough workaround for your trial, but does not fix anything. Could you sort out the issue? I don't think I can help regarding debugging Qemu (sorry!), but u-boot/doc/README.qemu_mips and U-Boot/Qemu community will help.
May be I really want that CONFIG_SYS_NO_FLASH defined then build should at least not break. Isn't it?
Disabling flash using CONFIG_SYS_NO_FLASH breaks the build. This patch fixes the issue. Don't know if its okay.
Signed-off-by: Himanshu Chauhanhimanshu@symmetricore.com
Heh, let's use git-format-patch when preparing patches.
$ git format-patch HEAD^.. $ git format-patch --no-thread HEAD^^.. $ mkdir foo && git format-patch -o foo/ HEAD~3.. and so on.
Thanks, I will take care of that next time.
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index efd6aec..5bd3af0 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -76,7 +76,7 @@ extern void bz_internal_error(int); static int image_info (unsigned long addr); #endif
-#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH)&& defined(CONFIG_CMD_IMLS) #include<flash.h> extern flash_info_t flash_info[]; /* info for FLASH chips */ static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -1153,7 +1153,7 @@ U_BOOT_CMD( /*******************************************************************/ /* imls - list all images found in flash */ /*******************************************************************/ -#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH)&& defined(CONFIG_CMD_IMLS) int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { flash_info_t *info;
Disabling IMLS command in configs/qemu_mips.h?
This should have been disabled anyways if this patch was applied: http://www.mail-archive.com/u-boot@lists.denx.de/msg07407.html
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 24eb33f..06c7271 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -41,6 +41,7 @@ #include<environment.h> #include<mtd/cfi_flash.h>
+#ifndef CONFIG_SYS_NO_FLASH /*
- This file implements a Common Flash Interface (CFI) driver for
- U-Boot.
@@ -2020,3 +2021,5 @@ unsigned long flash_init (void)
return (size);
}
+#endif
Removing CONFIG_CFI_DRIVER from configs/qemu_mips.h?
If CONFIG_SYS_NO_FLASH is defined should it be compiled?
Regards Himanshu

Himanshu Chauhan wrote:
May be I really want that CONFIG_SYS_NO_FLASH defined then build should at least not break. Isn't it?
Correct, it should build even with CONFIG_SYS_NO_FLASH.
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index efd6aec..5bd3af0 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -76,7 +76,7 @@ extern void bz_internal_error(int); static int image_info (unsigned long addr); #endif
-#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH)&& defined(CONFIG_CMD_IMLS) #include<flash.h> extern flash_info_t flash_info[]; /* info for FLASH chips */ static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -1153,7 +1153,7 @@ U_BOOT_CMD( /*******************************************************************/ /* imls - list all images found in flash */ /*******************************************************************/ -#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH)&& defined(CONFIG_CMD_IMLS) int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { flash_info_t *info;
Disabling IMLS command in configs/qemu_mips.h?
This should have been disabled anyways if this patch was applied: http://www.mail-archive.com/u-boot@lists.denx.de/msg07407.html
The patch is applied.
|diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h |index cbacdf9..49a1a1c 100644 |--- a/include/configs/qemu-mips.h |+++ b/include/configs/qemu-mips.h |:q |@@ -142,6 +142,7 @@ | #define CONFIG_SYS_INIT_SP_OFFSET 0x400000 | | /* We boot from this flash, selected with dip switch */ |+#define CONFIG_SYS_NO_FLASH | #define CONFIG_SYS_FLASH_BASE 0xbfc00000 | #define CONFIG_SYS_MAX_FLASH_BANKS 1 | #define CONFIG_SYS_MAX_FLASH_SECT 128
FWIW, how about putting CONFIG_SYS_NO_FLASH prior to <config_cmd_ default.h>?
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 24eb33f..06c7271 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -41,6 +41,7 @@ #include<environment.h> #include<mtd/cfi_flash.h>
+#ifndef CONFIG_SYS_NO_FLASH /*
- This file implements a Common Flash Interface (CFI) driver for
- U-Boot.
@@ -2020,3 +2021,5 @@ unsigned long flash_init (void)
return (size);
}
+#endif
Removing CONFIG_CFI_DRIVER from configs/qemu_mips.h?
If CONFIG_SYS_NO_FLASH is defined should it be compiled?
No. In U-Boot, in general, drivers should be predefined through configs/<boardname>.h. If we don't use CFI driver, just disable it in top-level board config file. This is to avoid #ifdef mess, and prevent the drivers from being clobbered.

Dear Himanshu Chauhan,
I apologize for the long delay (I could try and claim I was waiting for anybody else to comment first, but it seems noodu feels addessed).
In message 4B2C7961.3070008@symmetricore.com you wrote:
U-Boot hangs with qemu-system-mips with ##unknown flash error. Disabling flash using CONFIG_SYS_NO_FLASH breaks the build. This patch fixes the issue. Don't know if its okay.
Signed-off-by: Himanshu Chauhan himanshu@symmetricore.com
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index efd6aec..5bd3af0 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -76,7 +76,7 @@ extern void bz_internal_error(int); static int image_info (unsigned long addr); #endif
-#if defined(CONFIG_CMD_IMLS) +#if !defined(CONFIG_SYS_NO_FLASH) && defined(CONFIG_CMD_IMLS)
I don't like this approach - CONFIG_CMD_IMLS and CONFIG_SYS_NO_FLASH should not be combined like that. Assume somebody wants to extend the functionality of the "imls" command to check for images in NAND flash (or other similar storage devices) as well.
Disabling NOR flash on a system should be just a matter of system configuration. If you have no NOR flash on your board (so you select CONFIG_SYS_NO_FLASH), then why do you select CONFIG_CMD_IMLS which obviously attempts to access NOR flash?
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 24eb33f..06c7271 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -41,6 +41,7 @@ #include <environment.h> #include <mtd/cfi_flash.h>
+#ifndef CONFIG_SYS_NO_FLASH
Same here. Why do you enable the CFI driver at all when you don't have NOR flash on your system?
--- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h :q @@ -142,6 +142,7 @@ #define CONFIG_SYS_INIT_SP_OFFSET 0x400000
/* We boot from this flash, selected with dip switch */ +#define CONFIG_SYS_NO_FLASH #define CONFIG_SYS_FLASH_BASE 0xbfc00000 #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 128 @@ -149,7 +150,8 @@ #define CONFIG_FLASH_CFI_DRIVER 1 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1
-#define CONFIG_ENV_IS_IN_FLASH 1 +#define CONFIG_ENV_IS_IN_FLASH 0 +#define CONFIG_ENV_IS_NOWHERE #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
Here you should disable NOR related features - like the CFI driver or the imls command.
Sorry, but I reject this patch.
Best regards,
Wolfgang Denk
participants (6)
-
Himanshu Chauhan
-
Mike Frysinger
-
Shinya Kuribayashi
-
Shinya Kuribayashi
-
Stefan Roese
-
Wolfgang Denk