* [U-Boot] Build breakage in qemu-mips
@ 2009-12-18 6:58 Himanshu Chauhan
2009-12-18 10:32 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
0 siblings, 1 reply; 24+ messages in thread
From: Himanshu Chauhan @ 2009-12-18 6:58 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 6:58 [U-Boot] Build breakage in qemu-mips Himanshu Chauhan
@ 2009-12-18 10:32 ` Shinya Kuribayashi
2009-12-18 11:50 ` Himanshu Chauhan
` (4 more replies)
0 siblings, 5 replies; 24+ messages in thread
From: Shinya Kuribayashi @ 2009-12-18 10:32 UTC (permalink / raw)
To: u-boot
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 at 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 */
--
1.6.5.7
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 10:32 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
@ 2009-12-18 11:50 ` Himanshu Chauhan
2009-12-18 12:01 ` Stefan Roese
` (3 subsequent siblings)
4 siblings, 0 replies; 24+ messages in thread
From: Himanshu Chauhan @ 2009-12-18 11:50 UTC (permalink / raw)
To: u-boot
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 at 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
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 10:32 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
2009-12-18 11:50 ` Himanshu Chauhan
@ 2009-12-18 12:01 ` Stefan Roese
2009-12-18 12:04 ` Himanshu Chauhan
2009-12-18 13:03 ` [U-Boot] [PATCH]: U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips Himanshu Chauhan
` (2 subsequent siblings)
4 siblings, 1 reply; 24+ messages in thread
From: Stefan Roese @ 2009-12-18 12:01 UTC (permalink / raw)
To: u-boot
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 at denx.de
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 12:01 ` Stefan Roese
@ 2009-12-18 12:04 ` Himanshu Chauhan
2009-12-18 12:20 ` Stefan Roese
0 siblings, 1 reply; 24+ messages in thread
From: Himanshu Chauhan @ 2009-12-18 12:04 UTC (permalink / raw)
To: u-boot
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 at denx.de
>
I think thats what it is. Both are same.
-Himanshu
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 12:04 ` Himanshu Chauhan
@ 2009-12-18 12:20 ` Stefan Roese
2009-12-18 12:27 ` Stefan Roese
2009-12-18 13:02 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
0 siblings, 2 replies; 24+ messages in thread
From: Stefan Roese @ 2009-12-18 12:20 UTC (permalink / raw)
To: u-boot
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 at 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 at denx.de
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 12:20 ` Stefan Roese
@ 2009-12-18 12:27 ` Stefan Roese
2009-12-18 12:46 ` Himanshu Chauhan
2009-12-18 13:02 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
1 sibling, 1 reply; 24+ messages in thread
From: Stefan Roese @ 2009-12-18 12:27 UTC (permalink / raw)
To: u-boot
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 */
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 12:27 ` Stefan Roese
@ 2009-12-18 12:46 ` Himanshu Chauhan
2009-12-19 0:04 ` Wolfgang Denk
0 siblings, 1 reply; 24+ messages in thread
From: Himanshu Chauhan @ 2009-12-18 12:46 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 12:20 ` Stefan Roese
2009-12-18 12:27 ` Stefan Roese
@ 2009-12-18 13:02 ` Shinya Kuribayashi
2009-12-18 13:06 ` Stefan Roese
1 sibling, 1 reply; 24+ messages in thread
From: Shinya Kuribayashi @ 2009-12-18 13:02 UTC (permalink / raw)
To: u-boot
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/include/asm/unaligned.h;h=42f66c311473abb98fe7a845e360e365ccfed837;hb=master
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?
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH]: U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips.
2009-12-18 10:32 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
2009-12-18 11:50 ` Himanshu Chauhan
2009-12-18 12:01 ` Stefan Roese
@ 2009-12-18 13:03 ` Himanshu Chauhan
2009-12-18 13:09 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Himanshu Chauhan
2009-12-19 6:57 ` [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips Himanshu Chauhan
4 siblings, 0 replies; 24+ messages in thread
From: Himanshu Chauhan @ 2009-12-18 13:03 UTC (permalink / raw)
To: u-boot
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__ */
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 13:02 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
@ 2009-12-18 13:06 ` Stefan Roese
2009-12-20 3:59 ` Shinya Kuribayashi
0 siblings, 1 reply; 24+ messages in thread
From: Stefan Roese @ 2009-12-18 13:06 UTC (permalink / raw)
To: u-boot
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 at denx.de
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 10:32 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
` (2 preceding siblings ...)
2009-12-18 13:03 ` [U-Boot] [PATCH]: U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips Himanshu Chauhan
@ 2009-12-18 13:09 ` Himanshu Chauhan
2009-12-18 13:18 ` Shinya Kuribayashi
2009-12-19 6:57 ` [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips Himanshu Chauhan
4 siblings, 1 reply; 24+ messages in thread
From: Himanshu Chauhan @ 2009-12-18 13:09 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 13:09 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Himanshu Chauhan
@ 2009-12-18 13:18 ` Shinya Kuribayashi
0 siblings, 0 replies; 24+ messages in thread
From: Shinya Kuribayashi @ 2009-12-18 13:18 UTC (permalink / raw)
To: u-boot
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.
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 12:46 ` Himanshu Chauhan
@ 2009-12-19 0:04 ` Wolfgang Denk
2009-12-19 6:56 ` Himanshu Chauhan
2009-12-19 12:52 ` [U-Boot] [OT] List for sending patches Himanshu Chauhan
0 siblings, 2 replies; 24+ messages in thread
From: Wolfgang Denk @ 2009-12-19 0:04 UTC (permalink / raw)
To: u-boot
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
--
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
"Beware of bugs in the above code; I have only proved it correct, not
tried it." - Donald Knuth
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-19 0:04 ` Wolfgang Denk
@ 2009-12-19 6:56 ` Himanshu Chauhan
2009-12-19 12:52 ` [U-Boot] [OT] List for sending patches Himanshu Chauhan
1 sibling, 0 replies; 24+ messages in thread
From: Himanshu Chauhan @ 2009-12-19 6:56 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips.
2009-12-18 10:32 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
` (3 preceding siblings ...)
2009-12-18 13:09 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Himanshu Chauhan
@ 2009-12-19 6:57 ` Himanshu Chauhan
2009-12-20 3:53 ` Shinya Kuribayashi
2010-03-20 22:58 ` Wolfgang Denk
4 siblings, 2 replies; 24+ messages in thread
From: Himanshu Chauhan @ 2009-12-19 6:57 UTC (permalink / raw)
To: u-boot
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__ */
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [U-Boot] [OT] List for sending patches
2009-12-19 0:04 ` Wolfgang Denk
2009-12-19 6:56 ` Himanshu Chauhan
@ 2009-12-19 12:52 ` Himanshu Chauhan
2009-12-19 13:54 ` Mike Frysinger
2009-12-19 19:04 ` Wolfgang Denk
1 sibling, 2 replies; 24+ messages in thread
From: Himanshu Chauhan @ 2009-12-19 12:52 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [OT] List for sending patches
2009-12-19 12:52 ` [U-Boot] [OT] List for sending patches Himanshu Chauhan
@ 2009-12-19 13:54 ` Mike Frysinger
2009-12-19 19:04 ` Wolfgang Denk
1 sibling, 0 replies; 24+ messages in thread
From: Mike Frysinger @ 2009-12-19 13:54 UTC (permalink / raw)
To: u-boot
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091219/08e6f81c/attachment.pgp
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [OT] List for sending patches
2009-12-19 12:52 ` [U-Boot] [OT] List for sending patches Himanshu Chauhan
2009-12-19 13:54 ` Mike Frysinger
@ 2009-12-19 19:04 ` Wolfgang Denk
1 sibling, 0 replies; 24+ messages in thread
From: Wolfgang Denk @ 2009-12-19 19:04 UTC (permalink / raw)
To: u-boot
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
--
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
You are in a maze of UUCP connections, all alike.
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips.
2009-12-19 6:57 ` [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips Himanshu Chauhan
@ 2009-12-20 3:53 ` Shinya Kuribayashi
2009-12-20 6:43 ` Himanshu Chauhan
2010-03-20 22:58 ` Wolfgang Denk
1 sibling, 1 reply; 24+ messages in thread
From: Shinya Kuribayashi @ 2009-12-20 3:53 UTC (permalink / raw)
To: u-boot
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 Chauhan<himanshu@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
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h>
2009-12-18 13:06 ` Stefan Roese
@ 2009-12-20 3:59 ` Shinya Kuribayashi
0 siblings, 0 replies; 24+ messages in thread
From: Shinya Kuribayashi @ 2009-12-20 3:59 UTC (permalink / raw)
To: u-boot
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.
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips.
2009-12-20 3:53 ` Shinya Kuribayashi
@ 2009-12-20 6:43 ` Himanshu Chauhan
2009-12-21 4:40 ` Shinya Kuribayashi
0 siblings, 1 reply; 24+ messages in thread
From: Himanshu Chauhan @ 2009-12-20 6:43 UTC (permalink / raw)
To: u-boot
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 Chauhan<himanshu@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 at 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
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips.
2009-12-20 6:43 ` Himanshu Chauhan
@ 2009-12-21 4:40 ` Shinya Kuribayashi
0 siblings, 0 replies; 24+ messages in thread
From: Shinya Kuribayashi @ 2009-12-21 4:40 UTC (permalink / raw)
To: u-boot
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 at 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.
--
Shinya Kuribayashi
NEC Electronics
^ permalink raw reply [flat|nested] 24+ messages in thread
* [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips.
2009-12-19 6:57 ` [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips Himanshu Chauhan
2009-12-20 3:53 ` Shinya Kuribayashi
@ 2010-03-20 22:58 ` Wolfgang Denk
1 sibling, 0 replies; 24+ messages in thread
From: Wolfgang Denk @ 2010-03-20 22:58 UTC (permalink / raw)
To: u-boot
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
--
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
PROGRAM - n. A magic spell cast over a computer allowing it to turn
one's input into error messages.
v. tr. - To engage in a pastime similar to banging one's head against
a wall, but with fewer opportunities for reward.
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2010-03-20 22:58 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-18 6:58 [U-Boot] Build breakage in qemu-mips Himanshu Chauhan
2009-12-18 10:32 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
2009-12-18 11:50 ` Himanshu Chauhan
2009-12-18 12:01 ` Stefan Roese
2009-12-18 12:04 ` Himanshu Chauhan
2009-12-18 12:20 ` Stefan Roese
2009-12-18 12:27 ` Stefan Roese
2009-12-18 12:46 ` Himanshu Chauhan
2009-12-19 0:04 ` Wolfgang Denk
2009-12-19 6:56 ` Himanshu Chauhan
2009-12-19 12:52 ` [U-Boot] [OT] List for sending patches Himanshu Chauhan
2009-12-19 13:54 ` Mike Frysinger
2009-12-19 19:04 ` Wolfgang Denk
2009-12-18 13:02 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Shinya Kuribayashi
2009-12-18 13:06 ` Stefan Roese
2009-12-20 3:59 ` Shinya Kuribayashi
2009-12-18 13:03 ` [U-Boot] [PATCH]: U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips Himanshu Chauhan
2009-12-18 13:09 ` [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing <asm/unaligned.h> Himanshu Chauhan
2009-12-18 13:18 ` Shinya Kuribayashi
2009-12-19 6:57 ` [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips Himanshu Chauhan
2009-12-20 3:53 ` Shinya Kuribayashi
2009-12-20 6:43 ` Himanshu Chauhan
2009-12-21 4:40 ` Shinya Kuribayashi
2010-03-20 22:58 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox