Re: [U-Boot-Users] Loading from NAND using 'nboot' Periodically Fails Where 'nand read' Succeeds

2008-06-06 Thread Marian Balakowicz

Hi Grant,

Grant Erickson wrote:
 On 6/5/08 3:30 PM, Grant Erickson wrote:
 I'm following up with you on this since 'git blame cmd_nand.c' seems to
 indicate you added the CONFIG_FIT support to this file.

 Based on stepping through with the debugger, my initial guess about hardware
 issues may have been incorrect. Is there an implicit assumption in the
 following snippet from nand_load_image() in cmd_nand.c:

 [ code omitted ]

 that casting 'addr' to 'fit_hdr' represents more than 512 bytes of valid data
 to be accessed by fit_check_format()? If so, should not 'cnt = 
 nand-oobblock'
 be explicitly set to match that assumption?

 I am guessing that my observation that NFS booting and nand read.i addressed
 the issue strictly had to do with the fact that the 8 MiB address to which
 those operate were not getting used or otherwise updated between resets after
 the boot of the kernel allowing subsequent runs of 'nboot' to leverage the
 stale data.
 
 The boot.itb image I have in NAND is 0x13CB98 bytes in size. Running a
 series of 'nand read.i ${bootaddr} 0 ...':

...
 
 So, it would appear that the answer, at least for this trivial boot.itb of a
 kernel and DTB, for how large must the initial value of 'cnt' be is as
 large as the image being nboot'ed is. That said, it looks like nboot and
 FIT images may not work together at present with today's code.
 
 Any thoughts?

Doing a FIT format check on a first sector data is obviously wrong.
This was a good spot for such check with the initial implementation of
the routine, but it should have been corrected after that changed,
stupid me. As you'll note fit_print_contents() call is deferred, and
that is for the same reason, it needs the whole image data to operate
on. Same, for format check, it cannot be done earlier than that.

I'll post a patch later today that fixes it, please give it a try on
your system.

Cheers,
m.

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] [FIT] Delay FIT format check on sector based devices

2008-06-06 Thread Marian Balakowicz
Global FIT image operations like format check cannot be performed on
a first sector data, defer them to the point when whole FIT image was
uploaded to a system RAM.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

Grant,

Please give this patch a try on your system and let me know if it helped to
solve the nand booting issue.

Thanks,
m.

 common/cmd_doc.c  |   19 ++-
 common/cmd_fdc.c  |   15 ---
 common/cmd_ide.c  |   19 ++-
 common/cmd_nand.c |   38 --
 common/cmd_scsi.c |   15 ---
 common/cmd_usb.c  |   15 ---
 6 files changed, 64 insertions(+), 57 deletions(-)


diff --git a/common/cmd_doc.c b/common/cmd_doc.c
index 83aba37..d7b2f53 100644
--- a/common/cmd_doc.c
+++ b/common/cmd_doc.c
@@ -206,7 +206,7 @@ int do_docboot (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
image_header_t *hdr;
int rcode = 0;
 #if defined(CONFIG_FIT)
-   const void *fit_hdr;
+   const void *fit_hdr = NULL;
 #endif
 
show_boot_progress (34);
@@ -275,12 +275,6 @@ int do_docboot (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 #if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
fit_hdr = (const void *)addr;
-   if (!fit_check_format (fit_hdr)) {
-   show_boot_progress (-130);
-   puts (** Bad FIT image format\n);
-   return 1;
-   }
-   show_boot_progress (131);
puts (Fit image detected...\n);
 
cnt = fit_get_size (fit_hdr);
@@ -304,8 +298,15 @@ int do_docboot (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 
 #if defined(CONFIG_FIT)
/* This cannot be done earlier, we need complete FIT image in RAM first 
*/
-   if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
-   fit_print_contents ((const void *)addr);
+   if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) {
+   if (!fit_check_format (fit_hdr)) {
+   show_boot_progress (-130);
+   puts (** Bad FIT image format\n);
+   return 1;
+   }
+   show_boot_progress (131);
+   fit_print_contents (fit_hdr);
+   }
 #endif
 
/* Loading ok, update default load address */
diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c
index 0293d18..e4fbf29 100644
--- a/common/cmd_fdc.c
+++ b/common/cmd_fdc.c
@@ -787,7 +787,7 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
char *ep;
int rcode = 0;
 #if defined(CONFIG_FIT)
-   const void *fit_hdr;
+   const void *fit_hdr = NULL;
 #endif
 
switch (argc) {
@@ -847,10 +847,6 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 #if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
fit_hdr = (const void *)addr;
-   if (!fit_check_format (fit_hdr)) {
-   puts (** Bad FIT image format\n);
-   return 1;
-   }
puts (Fit image detected...\n);
 
imsize = fit_get_size (fit_hdr);
@@ -879,8 +875,13 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 
 #if defined(CONFIG_FIT)
/* This cannot be done earlier, we need complete FIT image in RAM first 
*/
-   if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
-   fit_print_contents ((const void *)addr);
+   if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) {
+   if (!fit_check_format (fit_hdr)) {
+   puts (** Bad FIT image format\n);
+   return 1;
+   }
+   fit_print_contents (fit_hdr);
+   }
 #endif
 
/* Loading ok, update default load address */
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 6560702..97a873d 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -367,7 +367,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
image_header_t *hdr;
int rcode = 0;
 #if defined(CONFIG_FIT)
-   const void *fit_hdr;
+   const void *fit_hdr = NULL;
 #endif
 
show_boot_progress (41);
@@ -465,12 +465,6 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
 #if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
fit_hdr = (const void *)addr;
-   if (!fit_check_format (fit_hdr)) {
-   show_boot_progress (-140);
-   puts (** Bad FIT image format\n);
-   return 1;
-   }
-   show_boot_progress (141);
puts (Fit image detected...\n);
 
cnt = fit_get_size (fit_hdr);
@@ -496,8 +490,15 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
 
 #if defined(CONFIG_FIT)
/* This cannot be done earlier

[U-Boot-Users] [PATCH v2] [new uImage] Avoid initrd and logbuffer area overlaps

2008-05-13 Thread Marian Balakowicz
Add logbuffer to reserved LMB areas to prevent initrd allocation
from overlaping with it.

Make sure to use correct logbuffer base address.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

v2 fixes build errors for PPC targets without LOGBUFFER support.

 common/cmd_log.c  |8 +++-
 common/image.c|   10 ++
 include/logbuff.h |1 +
 lib_ppc/board.c   |7 +++
 4 files changed, 25 insertions(+), 1 deletions(-)


diff --git a/common/cmd_log.c b/common/cmd_log.c
index b9f9ba0..8e04941 100644
--- a/common/cmd_log.c
+++ b/common/cmd_log.c
@@ -66,6 +66,12 @@ static logbuff_t *log;
 #endif
 static char *lbuf;
 
+unsigned long __logbuffer_base(void)
+{
+   return CFG_SDRAM_BASE + gd-bd-bi_memsize - LOGBUFF_LEN;
+}
+unsigned long logbuffer_base (void) __attribute__((weak, 
alias(__logbuffer_base)));
+
 void logbuff_init_ptrs (void)
 {
unsigned long tag, post_word;
@@ -75,7 +81,7 @@ void logbuff_init_ptrs (void)
log = (logbuff_t *)CONFIG_ALT_LH_ADDR;
lbuf = (char *)CONFIG_ALT_LB_ADDR;
 #else
-   log = (logbuff_t *)(gd-bd-bi_memsize-LOGBUFF_LEN) - 1;
+   log = (logbuff_t *)(logbuffer_base ()) - 1;
lbuf = (char *)log-buf;
 #endif
 
diff --git a/common/image.c b/common/image.c
index 67e594d..9188024 100644
--- a/common/image.c
+++ b/common/image.c
@@ -35,6 +35,10 @@
 #include dataflash.h
 #endif
 
+#ifdef CONFIG_LOGBUFFER
+#include logbuff.h
+#endif
+
 #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
 #include rtc.h
 #endif
@@ -1013,6 +1017,12 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, 
ulong rd_len,
initrd_high = ~0;
}
 
+
+#ifdef CONFIG_LOGBUFFER
+   /* Prevent initrd from overwriting logbuffer */
+   lmb_reserve(lmb, logbuffer_base() - LOGBUFF_OVERHEAD, LOGBUFF_RESERVE);
+#endif
+
debug (## initrd_high = 0x%08lx, copy_to_ram = %d\n,
initrd_high, initrd_copy_to_ram);
 
diff --git a/include/logbuff.h b/include/logbuff.h
index d415729..f117c66 100644
--- a/include/logbuff.h
+++ b/include/logbuff.h
@@ -60,6 +60,7 @@ int drv_logbuff_init (void);
 void logbuff_init_ptrs (void);
 void logbuff_log(char *msg);
 void logbuff_reset (void);
+unsigned long logbuffer_base (void);
 
 #endif /* CONFIG_LOGBUFFER */
 
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 4956403..193a264 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -398,6 +398,13 @@ ulong get_effective_memsize(void)
  
  */
 
+#ifdef CONFIG_LOGBUFFER
+unsigned long logbuffer_base(void)
+{
+   return CFG_SDRAM_BASE + get_effective_memsize() - LOGBUFF_LEN;
+}
+#endif
+
 void board_init_f (ulong bootflag)
 {
bd_t *bd;


-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] [new uImage] Fix build errors when CONFIG_LOGBUFFER and CONFIG_FIT are enabled

2008-05-07 Thread Marian Balakowicz
Wolfgang Denk wrote:
 In message [EMAIL PROTECTED] you wrote:
 Recent modifcations to LOGBUFFER handling code were incorrecly
 introduced to fit_check_kernel() routine during
 Merge branch 'new-image' of git://www.denx.de/git/u-boot-testing,
 commit 27f33e9f45ef7f9685cbdc65066a1828e85dde4f.

 This patch cleans up this merge issue.
 
 Ummm... but don't you break logbuffer support that way?
 
 Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
 ---

  common/cmd_bootm.c |   11 ---
  common/image.c |4 
  2 files changed, 0 insertions(+), 15 deletions(-)


 diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
 index 44f6b9f..0d67132 100644
 --- a/common/cmd_bootm.c
 +++ b/common/cmd_bootm.c
 @@ -433,17 +433,6 @@ static int fit_check_kernel (const void *fit, int 
 os_noffset, int verify)
  }
  show_boot_progress (105);
  
 -#ifdef CONFIG_LOGBUFFER
 -#ifndef CONFIG_ALT_LB_ADDR
 -kbd=gd-bd;
 -/* Prevent initrd from overwriting logbuffer */
 -if (initrd_high  (kbd-bi_memsize-LOGBUFF_LEN-LOGBUFF_OVERHEAD))
 -initrd_high = kbd-bi_memsize-LOGBUFF_LEN-LOGBUFF_OVERHEAD;
 -debug (## Logbuffer at 0x%08lX , kbd-bi_memsize-LOGBUFF_LEN);
 -#else
 -debug (## Logbuffer at 0x%08lX , CONFIG_ALT_LB_ADDR);
 -#endif
 -#endif
 
 Well, it's easy to remove the code here, but if serves a purpose, so
 it cannot be simply removed without adding it somewhere else. Or am I
 missing something?

This piece of the code was removed earlier with one of the Kumar's
patches that added LMB support for booting allocations.

Then it got incorrectly merged back in a wrong place, which this patch
intends to fix.

As to the check itself:
- it seem bogus, it does not properly check for initrd and logbuffer
areas overlaps
- it does not take into account the recent effective memory size
limitation introduced for ppc

I'll post a separate, preliminary patch that will attempt to implement
the check in a proper way.

Cheers,
Marian


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [RFC] [PATCH 2/2] [new uImage] Avoid initrd and logbuffer area overlaps

2008-05-07 Thread Marian Balakowicz
Add logbuffer to reserved LMB areas to prevent initrd allocation
from overlaping with it.

Make sure to use correct logbuffer base address.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

This patch attempts to assure that initrd allocation made during OS booting
will not destroy logbuffer area.

Please review and comment.

Cheers,
m.

 common/cmd_log.c  |8 +++-
 common/image.c|7 +++
 include/logbuff.h |1 +
 lib_ppc/board.c   |5 +
 4 files changed, 20 insertions(+), 1 deletions(-)


diff --git a/common/cmd_log.c b/common/cmd_log.c
index b9f9ba0..8e04941 100644
--- a/common/cmd_log.c
+++ b/common/cmd_log.c
@@ -66,6 +66,12 @@ static logbuff_t *log;
 #endif
 static char *lbuf;
 
+unsigned long __logbuffer_base(void)
+{
+   return CFG_SDRAM_BASE + gd-bd-bi_memsize - LOGBUFF_LEN;
+}
+unsigned long logbuffer_base (void) __attribute__((weak, 
alias(__logbuffer_base)));
+
 void logbuff_init_ptrs (void)
 {
unsigned long tag, post_word;
@@ -75,7 +81,7 @@ void logbuff_init_ptrs (void)
log = (logbuff_t *)CONFIG_ALT_LH_ADDR;
lbuf = (char *)CONFIG_ALT_LB_ADDR;
 #else
-   log = (logbuff_t *)(gd-bd-bi_memsize-LOGBUFF_LEN) - 1;
+   log = (logbuff_t *)(logbuffer_base ()) - 1;
lbuf = (char *)log-buf;
 #endif
 
diff --git a/common/image.c b/common/image.c
index 0a78385..8afaccd 100644
--- a/common/image.c
+++ b/common/image.c
@@ -36,6 +36,10 @@
 #include dataflash.h
 #endif
 
+#ifdef CONFIG_LOGBUFFER
+#include logbuff.h
+#endif
+
 #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
 #include rtc.h
 #endif
@@ -1017,6 +1021,9 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, 
ulong rd_len,
initrd_high = ~0;
}
 
+   /* Prevent initrd from overwriting logbuffer */
+   lmb_reserve(lmb, logbuffer_base() - LOGBUFF_OVERHEAD, LOGBUFF_RESERVE);
+
debug (## initrd_high = 0x%08lx, copy_to_ram = %d\n,
initrd_high, initrd_copy_to_ram);
 
diff --git a/include/logbuff.h b/include/logbuff.h
index d415729..f117c66 100644
--- a/include/logbuff.h
+++ b/include/logbuff.h
@@ -60,6 +60,7 @@ int drv_logbuff_init (void);
 void logbuff_init_ptrs (void);
 void logbuff_log(char *msg);
 void logbuff_reset (void);
+unsigned long logbuffer_base (void);
 
 #endif /* CONFIG_LOGBUFFER */
 
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 4956403..bc49ea1 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -398,6 +398,11 @@ ulong get_effective_memsize(void)
  
  */
 
+unsigned long logbuffer_base(void)
+{
+   return CFG_SDRAM_BASE + get_effective_memsize() - LOGBUFF_LEN;
+}
+
 void board_init_f (ulong bootflag)
 {
bd_t *bd;


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 1/2] [new uImage] ppc: Fix ftd_blob variable init when processing raw blob

2008-04-11 Thread Marian Balakowicz
Set fdt_blob variable before its value is printed out.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 lib_ppc/bootm.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index 2901607..b24a064 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -626,9 +626,9 @@ static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int 
argc, char *argv[],
/*
 * FDT blob
 */
+   fdt_blob = (char *)fdt_addr;
debug (*  fdt: raw FDT blob\n);
printf (## Flattened Device Tree blob at 
%08lx\n, fdt_blob);
-   fdt_blob = (char *)fdt_addr;
}
break;
default:


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 2/2] [new uImage] Restore the ability to continue booting after legacy image overwrite

2008-04-11 Thread Marian Balakowicz
Before new uImage code was merged, bootm code allowed for the kernel image to
get overwritten during decompresion. new uImage introduced a check for image
overwrites and refused to boot the image that got overwritten. This patch
restores the old behavior. It also adds a warning when the image overwriten is
a multi-image file, because in such case accessing componentes other than the
first one will fail.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/cmd_bootm.c |   37 ++---
 common/image.c |2 +-
 include/image.h|3 ++-
 lib_arm/bootm.c|2 +-
 lib_avr32/bootm.c  |2 +-
 lib_blackfin/bootm.c   |2 +-
 lib_m68k/bootm.c   |2 +-
 lib_microblaze/bootm.c |2 +-
 lib_mips/bootm.c   |2 +-
 lib_nios2/bootm.c  |2 +-
 lib_ppc/bootm.c|4 ++--
 lib_sh/bootm.c |2 +-
 12 files changed, 39 insertions(+), 23 deletions(-)


diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 9e5ce4b..3a0c83d 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -286,9 +286,16 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
debug (image_start = 0x%lX, image_end = 0x%lx\n, image_start, 
image_end);
debug (load_start = 0x%lx, load_end = 0x%lx\n, load_start, 
load_end);
 
-   puts (ERROR: image overwritten - must RESET the board to 
recover.\n);
-   show_boot_progress (-113);
-   do_reset (cmdtp, flag, argc, argv);
+   if (images.legacy_hdr_valid) {
+   if (image_get_type (images.legacy_hdr_os_copy) == 
IH_TYPE_MULTI)
+   puts (WARNING: legacy format multi component 
+   image overwritten\n);
+   } else {
+   puts (ERROR: new format image overwritten - 
+   must RESET the board to recover\n);
+   show_boot_progress (-113);
+   do_reset (cmdtp, flag, argc, argv);
+   }
}
 
show_boot_progress (8);
@@ -533,9 +540,17 @@ static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, 
int argc, char *argv[]
show_boot_progress (-5);
return NULL;
}
+
+   /*
+* copy image header to allow for image overwrites during kernel
+* decompression.
+*/
+   memmove (images-legacy_hdr_os_copy, hdr, 
sizeof(image_header_t));
+
+   /* save pointer to image header */
images-legacy_hdr_os = hdr;
-   images-legacy_hdr_valid = 1;
 
+   images-legacy_hdr_valid = 1;
show_boot_progress (6);
break;
 #if defined(CONFIG_FIT)
@@ -890,7 +905,7 @@ static void do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
 * address of the original image header.
 */
os_hdr = NULL;
-   if (image_check_type (hdr, IH_TYPE_MULTI)) {
+   if (image_check_type (images-legacy_hdr_os_copy, IH_TYPE_MULTI)) {
image_multi_getimg (hdr, 1, kernel_data, kernel_len);
if (kernel_len)
os_hdr = hdr;
@@ -947,7 +962,7 @@ static void do_bootm_lynxkdi (cmd_tbl_t *cmdtp, int flag,
 int argc, char *argv[],
 bootm_headers_t *images)
 {
-   image_header_t *hdr = images-legacy_hdr_os;
+   image_header_t *hdr = images-legacy_hdr_os_copy;
 
 #if defined(CONFIG_FIT)
if (!images-legacy_hdr_valid) {
@@ -964,7 +979,7 @@ static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag,
   int argc, char *argv[],
   bootm_headers_t *images)
 {
-   image_header_t *hdr = images-legacy_hdr_os;
+   image_header_t *hdr = images-legacy_hdr_os_copy;
void (*entry_point)(bd_t *);
 
 #if defined(CONFIG_FIT)
@@ -994,10 +1009,10 @@ static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag,
 bootm_headers_t *images)
 {
char str[80];
-   image_header_t *hdr = images-legacy_hdr_os;
+   image_header_t *hdr = images-legacy_hdr_os_copy;
 
 #if defined(CONFIG_FIT)
-   if (hdr == NULL) {
+   if (!images-legacy_hdr_valid) {
fit_unsupported_reset (VxWorks);
do_reset (cmdtp, flag, argc, argv);
}
@@ -1014,7 +1029,7 @@ static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag,
 {
char *local_args[2];
char str[16];
-   image_header_t *hdr = images-legacy_hdr_os;
+   image_header_t *hdr = images-legacy_hdr_os_copy;
 
 #if defined(CONFIG_FIT)
if (!images-legacy_hdr_valid) {
@@ -1041,7 +1056,7 @@ static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
int i, j, nxt, len, envno, envsz;
bd_t *kbd;
void (*entry)(bd_t *bd, char *cmdline

Re: [U-Boot-Users] [PATCH 5/8] [new uImage] Add libfdt support to mkimage

2008-03-03 Thread Marian Balakowicz
Jerry Van Baren wrote:
 Marian Balakowicz wrote:
 From: Bartlomiej Sieka [EMAIL PROTECTED]

 Signed-off-by: Bartlomiej Sieka [EMAIL PROTECTED]
 ---

  Makefile  |3 +++
  include/libfdt_env.h  |4 
  libfdt/fdt.c  |4 
  libfdt/fdt_ro.c   |4 
  libfdt/fdt_rw.c   |4 
  libfdt/fdt_strerror.c |4 
  libfdt/fdt_wip.c  |4 
  tools/.gitignore  |7 +++
  tools/Makefile|   51
 ++---
  tools/fdt_host.h  |   28 +++
  tools/mkimage.h   |1 +
  11 files changed, 111 insertions(+), 3 deletions(-)
  create mode 100644 tools/fdt_host.h
 
 A, I'm not wild about this, but I cannot suggest a better way. :-(
 
 All these (trivial) touches to libfdt/* are annoying and could cause
 patch tracking of the dtc/libfdt source to break.  I guess that is the
 risk we live with unless or until someone comes up with a better way.  :-(

Right, this is ugly, I don't like that solution either. I'd be glad to
have something cleaner but I spent a few moments on it and can't
figure out anything better and simple enough.

Cheers,
m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 2/9] [new uImage] ppc: Determine if we are booting an OF style

2008-02-29 Thread Marian Balakowicz
Kumar Gala wrote:
 If we are bootin OF style than we can skip setting up some things
 that are used for the old boot method.
 
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]

Acked-by: Marian Balakowicz [EMAIL PROTECTED]

m.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 4/9] [new uImage] rework error handling so common functions don't reset

2008-02-29 Thread Marian Balakowicz
Kumar Gala wrote:
 Changed image_get_ramdisk() to just return NULL on error and have
 get_ramdisk() propogate that error to the caller.  It's left to the
 caller to call do_reset() if it wants to.
 
 Also moved calling do_reset() in get_fdt() and fdt_relocate() on ppc
 to a common location.  In the future we will change get_fdt() and
 fdt_relocate() to return success/failure and not call do_reset() at all.
 
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]

Acked-by: Marian Balakowicz [EMAIL PROTECTED]

m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 9/9] [new uImage] Respect autostart setting in linux bootm

2008-02-29 Thread Marian Balakowicz
Kumar Gala wrote:
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]

Acked-by: Marian Balakowicz [EMAIL PROTECTED]

m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 0/8] [new uImage] patchset6 - new uImage format low level API

2008-02-29 Thread Marian Balakowicz
This patch series defines a API for new uImage format that will be used in the
following patchsets adding new uImage support to mkimage and U-boot.
The API changes are preceded by mkimage/U-boot common code refactoring and
mkimage build modifications adding SHA1 and libfdt support.

Included in the patchset are also fixes to the problems found in 
boot_relocate_fdt(),
image_multi_count() and image_multi_getimg().

Changes are based on the current TOT of u-boot-testing#new-image branch.
Please review and provide comments.

Bartlomiej Sieka (2):
  [new uImage] Add libfdt support to mkimage
  [new uImage] Add sha1.o object to mkimage binary build

David Gibson (1):
  libfdt: Add and use a node iteration helper function.

Marian Balakowicz (5):
  [new uImage] New uImage low-level API
  [new uImage] Fix FDT blob totalsize calculation in boot_relocate_fdt()
  [new uImage] Fix component handling for legacy multi component images
  [new uImage] Share common uImage code between mkimage and U-boot
  [new uImage] Update naming convention for bootm/uImage related code



Cheers,
m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 2/8] [new uImage] Share common uImage code between mkimage and U-boot

2008-02-29 Thread Marian Balakowicz
This patch adds the following common routines:

1) Dedicated mkimage print_header() is replaced with common
image_print_contents()
image_print_contents_noindent()

2) Common os/arch/type/comp fields name -- id translation routines
genimg_get_os_name()
genimg_get_arch_name()
genimg_get_type_name()
genimg_get_comp_name()
genimg_get_os_id()
genimg_get_arch_id()
genimg_get_type_id()
genimg_get_comp_id()

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/image.c  |  341 +++
 include/image.h |   21 ++-
 tools/mkimage.c |  244 ++-
 3 files changed, 267 insertions(+), 339 deletions(-)


diff --git a/common/image.c b/common/image.c
index 99ed3b8..421a474 100644
--- a/common/image.c
+++ b/common/image.c
@@ -62,11 +62,95 @@ static image_header_t* image_get_ramdisk (cmd_tbl_t *cmdtp, 
int flag,
ulong rd_addr, uint8_t arch, int verify);
 #else
 #include mkimage.h
-#endif /* USE_HOSTCC*/
+#endif /* !USE_HOSTCC*/
 
 #include image.h
 
+typedef struct table_entry {
+   int id; /* as defined in image.h*/
+   char*sname; /* short (input) name   */
+   char*lname; /* long (output) name   */
+} table_entry_t;
+
+static table_entry_t uimage_arch[] = {
+   {   IH_ARCH_INVALID,NULL,   Invalid ARCH, },
+   {   IH_ARCH_ALPHA,  alpha,Alpha,},
+   {   IH_ARCH_ARM,arm,  ARM,  },
+   {   IH_ARCH_I386,   x86,  Intel x86,},
+   {   IH_ARCH_IA64,   ia64, IA64, },
+   {   IH_ARCH_M68K,   m68k, M68K, },
+   {   IH_ARCH_MICROBLAZE, microblaze,   MicroBlaze,   },
+   {   IH_ARCH_MIPS,   mips, MIPS, },
+   {   IH_ARCH_MIPS64, mips64,   MIPS 64 Bit,  },
+   {   IH_ARCH_NIOS,   nios, NIOS, },
+   {   IH_ARCH_NIOS2,  nios2,NIOS II,  },
+   {   IH_ARCH_PPC,ppc,  PowerPC,  },
+   {   IH_ARCH_S390,   s390, IBM S390, },
+   {   IH_ARCH_SH, sh,   SuperH,   },
+   {   IH_ARCH_SPARC,  sparc,SPARC,},
+   {   IH_ARCH_SPARC64,sparc64,  SPARC 64 Bit, },
+   {   IH_ARCH_BLACKFIN,   blackfin, Blackfin, },
+   {   IH_ARCH_AVR32,  avr32,AVR32,},
+   {   -1, , , },
+};
+
+static table_entry_t uimage_os[] = {
+   {   IH_OS_INVALID,  NULL,   Invalid OS,   },
+#if defined(CONFIG_ARTOS) || defined(USE_HOSTCC)
+   {   IH_OS_ARTOS,artos,ARTOS,},
+#endif
+   {   IH_OS_LINUX,linux,Linux,},
+#if defined(CONFIG_LYNXKDI) || defined(USE_HOSTCC)
+   {   IH_OS_LYNXOS,   lynxos,   LynxOS,   },
+#endif
+   {   IH_OS_NETBSD,   netbsd,   NetBSD,   },
+   {   IH_OS_RTEMS,rtems,RTEMS,},
+   {   IH_OS_U_BOOT,   u-boot,   U-Boot,   },
+#if defined(CONFIG_CMD_ELF) || defined(USE_HOSTCC)
+   {   IH_OS_QNX,  qnx,  QNX,  },
+   {   IH_OS_VXWORKS,  vxworks,  VxWorks,  },
+#endif
+#ifdef USE_HOSTCC
+   {   IH_OS_4_4BSD,   4_4bsd,   4_4BSD,   },
+   {   IH_OS_DELL, dell, Dell, },
+   {   IH_OS_ESIX, esix, Esix, },
+   {   IH_OS_FREEBSD,  freebsd,  FreeBSD,  },
+   {   IH_OS_IRIX, irix, Irix, },
+   {   IH_OS_NCR,  ncr,  NCR,  },
+   {   IH_OS_OPENBSD,  openbsd,  OpenBSD,  },
+   {   IH_OS_PSOS, psos, pSOS, },
+   {   IH_OS_SCO,  sco,  SCO,  },
+   {   IH_OS_SOLARIS,  solaris,  Solaris,  },
+   {   IH_OS_SVR4, svr4, SVR4, },
+#endif
+   {   -1, , , },
+};
+
+static table_entry_t uimage_type[] = {
+   {   IH_TYPE_INVALID,NULL, Invalid Image,  },
+   {   IH_TYPE_FILESYSTEM, filesystem, Filesystem Image,   },
+   {   IH_TYPE_FIRMWARE,   firmware,   Firmware,   },
+   {   IH_TYPE_KERNEL, kernel, Kernel Image,   },
+   {   IH_TYPE_MULTI,  multi,  Multi-File Image,   },
+   {   IH_TYPE_RAMDISK,ramdisk,RAMDisk Image,  },
+   {   IH_TYPE_SCRIPT, script, Script

[U-Boot-Users] [PATCH 3/8] [new uImage] Fix component handling for legacy multi component images

2008-02-29 Thread Marian Balakowicz
Use uint32_t when accessing size table in image_multi_count() and
image_multi_getimg() for multi component images.

Add missing uimage_to_cpu() endianness conversion.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/image.c |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)


diff --git a/common/image.c b/common/image.c
index 421a474..3911b2f 100644
--- a/common/image.c
+++ b/common/image.c
@@ -224,11 +224,11 @@ int image_check_dcrc_wd (image_header_t *hdr, ulong 
chunksz)
 ulong image_multi_count (image_header_t *hdr)
 {
ulong i, count = 0;
-   ulong *size;
+   uint32_t *size;
 
/* get start of the image payload, which in case of multi
 * component images that points to a table of component sizes */
-   size = (ulong *)image_get_data (hdr);
+   size = (uint32_t *)image_get_data (hdr);
 
/* count non empty slots */
for (i = 0; size[i]; ++i)
@@ -258,7 +258,7 @@ void image_multi_getimg (image_header_t *hdr, ulong idx,
ulong *data, ulong *len)
 {
int i;
-   ulong *size;
+   uint32_t *size;
ulong offset, tail, count, img_data;
 
/* get number of component */
@@ -266,24 +266,24 @@ void image_multi_getimg (image_header_t *hdr, ulong idx,
 
/* get start of the image payload, which in case of multi
 * component images that points to a table of component sizes */
-   size = (ulong *)image_get_data (hdr);
+   size = (uint32_t *)image_get_data (hdr);
 
/* get address of the proper component data start, which means
 * skipping sizes table (add 1 for last, null entry) */
-   img_data = image_get_data (hdr) + (count + 1) * sizeof (ulong);
+   img_data = image_get_data (hdr) + (count + 1) * sizeof (uint32_t);
 
if (idx  count) {
-   *len = size[idx];
+   *len = uimage_to_cpu (size[idx]);
offset = 0;
tail = 0;
 
/* go over all indices preceding requested component idx */
for (i = 0; i  idx; i++) {
/* add up i-th component size */
-   offset += size[i];
+   offset += uimage_to_cpu (size[i]);
 
/* add up alignment for i-th component */
-   tail += (4 - size[i] % 4);
+   tail += (4 - uimage_to_cpu (size[i]) % 4);
}
 
/* calculate idx-th component data address */


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 4/8] [new uImage] Add sha1.o object to mkimage binary build

2008-02-29 Thread Marian Balakowicz
From: Bartlomiej Sieka [EMAIL PROTECTED]

Signed-off-by: Bartlomiej Sieka [EMAIL PROTECTED]
---

 tools/Makefile  |2 +-
 tools/mkimage.h |1 +
 2 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/tools/Makefile b/tools/Makefile
index cbfca6d..0cc4cc9 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -137,7 +137,7 @@ $(obj)img2srec$(SFX):   $(obj)img2srec.o
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
 
-$(obj)mkimage$(SFX):   $(obj)mkimage.o $(obj)crc32.o $(obj)image.o
+$(obj)mkimage$(SFX):   $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)sha1.o
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
 
diff --git a/tools/mkimage.h b/tools/mkimage.h
index 8b05bb1..a01977e 100644
--- a/tools/mkimage.h
+++ b/tools/mkimage.h
@@ -32,6 +32,7 @@
 #include sys/stat.h
 #include time.h
 #include unistd.h
+#include sha1.h
 
 #if defined(__BEOS__) || defined(__NetBSD__) || defined(__APPLE__)
 #include inttypes.h


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 5/8] [new uImage] Add libfdt support to mkimage

2008-02-29 Thread Marian Balakowicz
From: Bartlomiej Sieka [EMAIL PROTECTED]

Signed-off-by: Bartlomiej Sieka [EMAIL PROTECTED]
---

 Makefile  |3 +++
 include/libfdt_env.h  |4 
 libfdt/fdt.c  |4 
 libfdt/fdt_ro.c   |4 
 libfdt/fdt_rw.c   |4 
 libfdt/fdt_strerror.c |4 
 libfdt/fdt_wip.c  |4 
 tools/.gitignore  |7 +++
 tools/Makefile|   51 ++---
 tools/fdt_host.h  |   28 +++
 tools/mkimage.h   |1 +
 11 files changed, 111 insertions(+), 3 deletions(-)
 create mode 100644 tools/fdt_host.h


diff --git a/Makefile b/Makefile
index bacea3e..adfef9b 100644
--- a/Makefile
+++ b/Makefile
@@ -2927,6 +2927,9 @@ clobber:  clean
@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
@rm -f $(obj)tools/crc32.c $(obj)tools/environment.c 
$(obj)tools/env/crc32.c
@rm -f $(obj)tools/sha1.c $(obj)tools/image.c
+   @rm -f $(obj)tools/fdt.c $(obj)tools/fdt_ro.c $(obj)tools/fdt_rw.c
+   @rm -f $(obj)tools/fdt_strerror.c $(obj)tools/fdt_wip.c
+   @rm -f $(obj)tools/libfdt_internal.h
@rm -f $(obj)tools/inca-swap-bytes $(obj)cpu/mpc824x/bedbug_603e.c
@rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -lname * -print | 
xargs rm -f
diff --git a/include/libfdt_env.h b/include/libfdt_env.h
index 78f7258..98c522a 100644
--- a/include/libfdt_env.h
+++ b/include/libfdt_env.h
@@ -24,7 +24,11 @@
 #include stddef.h
 #include linux/types.h
 #include asm/byteorder.h
+#ifdef USE_HOSTCC
+#include string.h
+#else
 #include linux/string.h
+#endif /* USE_HOSTCC */
 
 extern struct fdt_header *fdt;  /* Pointer to the working fdt */
 
diff --git a/libfdt/fdt.c b/libfdt/fdt.c
index 586a361..071470d 100644
--- a/libfdt/fdt.c
+++ b/libfdt/fdt.c
@@ -50,8 +50,12 @@
  */
 #include libfdt_env.h
 
+#ifndef USE_HOSTCC
 #include fdt.h
 #include libfdt.h
+#else
+#include fdt_host.h
+#endif
 
 #include libfdt_internal.h
 
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 12a37d5..1ae3a55 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -50,8 +50,12 @@
  */
 #include libfdt_env.h
 
+#ifndef USE_HOSTCC
 #include fdt.h
 #include libfdt.h
+#else
+#include fdt_host.h
+#endif
 
 #include libfdt_internal.h
 
diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c
index 6673f8e..2fb81dd 100644
--- a/libfdt/fdt_rw.c
+++ b/libfdt/fdt_rw.c
@@ -50,8 +50,12 @@
  */
 #include libfdt_env.h
 
+#ifndef USE_HOSTCC
 #include fdt.h
 #include libfdt.h
+#else
+#include fdt_host.h
+#endif
 
 #include libfdt_internal.h
 
diff --git a/libfdt/fdt_strerror.c b/libfdt/fdt_strerror.c
index f9d32ef..abf792e 100644
--- a/libfdt/fdt_strerror.c
+++ b/libfdt/fdt_strerror.c
@@ -50,8 +50,12 @@
  */
 #include libfdt_env.h
 
+#ifndef USE_HOSTCC
 #include fdt.h
 #include libfdt.h
+#else
+#include fdt_host.h
+#endif
 
 #include libfdt_internal.h
 
diff --git a/libfdt/fdt_wip.c b/libfdt/fdt_wip.c
index 88e24b8..24e1724 100644
--- a/libfdt/fdt_wip.c
+++ b/libfdt/fdt_wip.c
@@ -50,8 +50,12 @@
  */
 #include libfdt_env.h
 
+#ifndef USE_HOSTCC
 #include fdt.h
 #include libfdt.h
+#else
+#include fdt_host.h
+#endif
 
 #include libfdt_internal.h
 
diff --git a/tools/.gitignore b/tools/.gitignore
index c33679a..0ce2e77 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -7,3 +7,10 @@
 /mkimage
 /sha1.c
 /ubsha1
+/image.c
+/fdt.c
+/fdt_ro.c
+/fdt_rw.c
+/fdt_strerror.c
+/fdt_wip.c
+/libfdt_internal.h
diff --git a/tools/Makefile b/tools/Makefile
index 0cc4cc9..aa4af18 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -37,6 +37,8 @@ endif
 #OBJ_FILES += mpc86x_clk.o
 #endif
 
+LIBFDT_OBJ_FILES   = fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_wip.o
+
 LOGO_H = $(OBJTREE)/include/bmp_logo.h
 
 ifeq ($(LOGO_BMP),)
@@ -120,6 +122,10 @@ CPPFLAGS   = -idirafter $(SRCTREE)/include \
-idirafter $(OBJTREE)/include \
-DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC
 CFLAGS = $(HOST_CFLAGS) $(CPPFLAGS) -O
+
+# No -pedantic switch to avoid libfdt compilation warnings
+FIT_CFLAGS = -Wall $(CPPFLAGS) -O
+
 AFLAGS= -D__ASSEMBLY__ $(CPPFLAGS)
 CC= $(HOSTCC)
 STRIP = $(HOSTSTRIP)
@@ -137,7 +143,7 @@ $(obj)img2srec$(SFX):   $(obj)img2srec.o
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
 
-$(obj)mkimage$(SFX):   $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)sha1.o
+$(obj)mkimage$(SFX):   $(obj)mkimage.o $(obj)crc32.o $(obj)image.o 
$(obj)sha1.o $(LIBFDT_OBJ_FILES)
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
 
@@ -174,10 +180,10 @@ $(obj)sha1.o: $(obj)sha1.c
$(CC) -g $(CFLAGS) -c -o $@ $
 
 $(obj)image.o: $(obj)image.c
-   $(CC) -g $(CFLAGS) -c -o $@ $
+   $(CC) -g $(FIT_CFLAGS) -c -o $@ $
 
 $(obj)mkimage.o:   $(src)mkimage.c
-   $(CC) -g $(CFLAGS) -c -o $@ 

[U-Boot-Users] [PATCH 6/8] libfdt: Add and use a node iteration helper function.

2008-02-29 Thread Marian Balakowicz
From: David Gibson [EMAIL PROTECTED]

This patch adds an fdt_next_node() function which can be used to
iterate through nodes of the tree while keeping track of depth.  This
function is used to simplify the iteration code in a lot of other
functions, and is also exported for use by library users.

Signed-off-by: David Gibson [EMAIL PROTECTED]
---

 include/libfdt.h |6 +
 libfdt/fdt.c |   41 +
 libfdt/fdt_ro.c  |  258 ++
 3 files changed, 131 insertions(+), 174 deletions(-)


diff --git a/include/libfdt.h b/include/libfdt.h
index 6c05236..3a64d0b 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -131,6 +131,12 @@ static inline void *fdt_offset_ptr_w(void *fdt, int 
offset, int checklen)
 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
 
 /**/
+/* Traversal functions*/
+/**/
+
+int fdt_next_node(const void *fdt, int offset, int *depth);
+
+/**/
 /* General functions  */
 /**/
 
diff --git a/libfdt/fdt.c b/libfdt/fdt.c
index 071470d..660e2c1 100644
--- a/libfdt/fdt.c
+++ b/libfdt/fdt.c
@@ -133,6 +133,47 @@ uint32_t fdt_next_tag(const void *fdt, int offset, int 
*nextoffset)
return tag;
 }
 
+int fdt_next_node(const void *fdt, int offset, int *depth)
+{
+   int nextoffset = 0;
+   uint32_t tag;
+
+   if (offset = 0) {
+   tag = fdt_next_tag(fdt, offset, nextoffset);
+   if (tag != FDT_BEGIN_NODE)
+   return -FDT_ERR_BADOFFSET;
+   }
+
+   do {
+   offset = nextoffset;
+   tag = fdt_next_tag(fdt, offset, nextoffset);
+
+   switch (tag) {
+   case FDT_PROP:
+   case FDT_NOP:
+   break;
+
+   case FDT_BEGIN_NODE:
+   if (depth)
+   (*depth)++;
+   break;
+
+   case FDT_END_NODE:
+   if (depth)
+   (*depth)--;
+   break;
+
+   case FDT_END:
+   return -FDT_ERR_NOTFOUND;
+
+   default:
+   return -FDT_ERR_BADSTRUCTURE;
+   }
+   } while (tag != FDT_BEGIN_NODE);
+
+   return offset;
+}
+
 const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
 {
int len = strlen(s) + 1;
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 1ae3a55..031a15f 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -69,7 +69,7 @@
 static int nodename_eq(const void *fdt, int offset,
   const char *s, int len)
 {
-   const char *p = fdt_offset_ptr(fdt, offset, len+1);
+   const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1);
 
if (! p)
/* short match */
@@ -108,50 +108,24 @@ int fdt_num_mem_rsv(const void *fdt)
return i;
 }
 
-int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
+int fdt_subnode_offset_namelen(const void *fdt, int offset,
   const char *name, int namelen)
 {
-   int level = 0;
-   uint32_t tag;
-   int offset, nextoffset;
+   int depth;
 
CHECK_HEADER(fdt);
 
-   tag = fdt_next_tag(fdt, parentoffset, nextoffset);
-   if (tag != FDT_BEGIN_NODE)
-   return -FDT_ERR_BADOFFSET;
-
-   do {
-   offset = nextoffset;
-   tag = fdt_next_tag(fdt, offset, nextoffset);
-
-   switch (tag) {
-   case FDT_END:
-   return -FDT_ERR_TRUNCATED;
-
-   case FDT_BEGIN_NODE:
-   level++;
-   if (level != 1)
-   continue;
-   if (nodename_eq(fdt, offset+FDT_TAGSIZE, name, namelen))
-   /* Found it! */
-   return offset;
-   break;
-
-   case FDT_END_NODE:
-   level--;
-   break;
-
-   case FDT_PROP:
-   case FDT_NOP:
-   break;
-
-   default:
-   return -FDT_ERR_BADSTRUCTURE;
-   }
-   } while (level = 0);
+   for (depth = 0;
+offset = 0;
+offset = fdt_next_node(fdt, offset, depth)) {
+   if (depth  0)
+   return -FDT_ERR_NOTFOUND;
+   else if ((depth == 1)
+ nodename_eq(fdt, offset, name, namelen))
+   return offset;
+  

[U-Boot-Users] [PATCH 1/8] [new uImage] Update naming convention for bootm/uImage related code

2008-02-29 Thread Marian Balakowicz
This patch introduces the following prefix convention for the
image format handling and bootm related code:

genimg_ - dual format shared code
image_  - legacy uImage format specific code
fit_- new uImage format specific code
boot_   - booting process related code

Related routines are renamed and a few pieces of code are moved around and
re-grouped.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 board/cray/L1/L1.c |2 
 board/esd/common/auto_update.c |6 -
 board/mcc200/auto_update.c |6 -
 board/mpl/common/common_util.c |4 
 board/siemens/common/fpga.c|4 
 board/trab/auto_update.c   |8 -
 common/cmd_autoscript.c|4 
 common/cmd_bootm.c |   36 ++-
 common/cmd_doc.c   |2 
 common/cmd_fdc.c   |2 
 common/cmd_fpga.c  |2 
 common/cmd_ide.c   |2 
 common/cmd_nand.c  |4 
 common/cmd_scsi.c  |2 
 common/cmd_usb.c   |2 
 common/cmd_ximg.c  |6 -
 common/image.c |  429 
 include/image.h|   72 ---
 lib_arm/bootm.c|2 
 lib_avr32/bootm.c  |2 
 lib_i386/bootm.c   |2 
 lib_m68k/bootm.c   |9 -
 lib_mips/bootm.c   |2 
 lib_ppc/bootm.c|   24 +-
 tools/mkimage.c|4 
 25 files changed, 326 insertions(+), 312 deletions(-)


diff --git a/board/cray/L1/L1.c b/board/cray/L1/L1.c
index c00acc8..77f7f48 100644
--- a/board/cray/L1/L1.c
+++ b/board/cray/L1/L1.c
@@ -141,7 +141,7 @@ int misc_init_r (void)
 
hdr = (image_header_t *) (CFG_MONITOR_BASE - image_get_header_size ());
 #if defined(CONFIG_FIT)
-   if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+   if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
puts (Non legacy image format not supported\n);
return -1;
}
diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c
index 976707d..1bf81c6 100644
--- a/board/esd/common/auto_update.c
+++ b/board/esd/common/auto_update.c
@@ -92,7 +92,7 @@ int au_check_cksum_valid(int i, long nbytes)
 
hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-   if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+   if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
puts (Non legacy image format not supported\n);
return -1;
}
@@ -125,7 +125,7 @@ int au_check_header_valid(int i, long nbytes)
 
hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-   if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+   if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
puts (Non legacy image format not supported\n);
return -1;
}
@@ -197,7 +197,7 @@ int au_do_update(int i, long sz)
 
hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-   if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+   if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
puts (Non legacy image format not supported\n);
return -1;
}
diff --git a/board/mcc200/auto_update.c b/board/mcc200/auto_update.c
index fcae35a..5580c11 100644
--- a/board/mcc200/auto_update.c
+++ b/board/mcc200/auto_update.c
@@ -144,7 +144,7 @@ int au_check_cksum_valid(int idx, long nbytes)
 
hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-   if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+   if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
puts (Non legacy image format not supported\n);
return -1;
}
@@ -169,7 +169,7 @@ int au_check_header_valid(int idx, long nbytes)
 
hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-   if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+   if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
puts (Non legacy image format not supported\n);
return -1;
}
@@ -247,7 +247,7 @@ int au_do_update(int idx, long sz)
 
hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-   if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+   if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
puts (Non legacy image format not supported\n);
return -1;
}
diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c
index fffd25c..785d204 100644
--- a/board/mpl/common/common_util.c
+++ b/board/mpl/common/common_util.c
@@ -74,7 +74,7 @@ mpl_prg(uchar *src, ulong size)
info = flash_info[0];
 
 #if defined(CONFIG_PIP405) || defined

[U-Boot-Users] [PATCH 8/8] [new uImage] New uImage low-level API

2008-02-29 Thread Marian Balakowicz
Add FDT-based functions for handling new format component images,
configurations, node operations, property get/set, etc.

fit_- routines handling global new format uImage operations
  like get/set top level property, process all nodes, etc.
fit_image_  - routines handling component images subnodes
fit_conf_   - routines handling configurations node

Signed-off-by: Bartlomiej Sieka [EMAIL PROTECTED]
Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/image.c  | 1181 +++
 include/image.h |  107 +
 tools/mkimage.h |8 
 3 files changed, 1291 insertions(+), 5 deletions(-)


diff --git a/common/image.c b/common/image.c
index 3911b2f..adf9fbc 100644
--- a/common/image.c
+++ b/common/image.c
@@ -45,10 +45,13 @@
 #include rtc.h
 #endif
 
+#include image.h
+
 #if defined(CONFIG_FIT)
 #include fdt.h
 #include libfdt.h
 #include fdt_support.h
+#include sha1.h
 #endif
 
 #ifdef CONFIG_CMD_BDI
@@ -62,9 +65,9 @@ static image_header_t* image_get_ramdisk (cmd_tbl_t *cmdtp, 
int flag,
ulong rd_addr, uint8_t arch, int verify);
 #else
 #include mkimage.h
-#endif /* !USE_HOSTCC*/
-
+#include time.h
 #include image.h
+#endif /* !USE_HOSTCC*/
 
 typedef struct table_entry {
int id; /* as defined in image.h*/
@@ -306,6 +309,18 @@ static void image_print_type (image_header_t *hdr)
printf (%s %s %s (%s)\n, arch, os, type, comp);
 }
 
+/**
+ * __image_print_contents - prints out the contents of the legacy format image
+ * @hdr: pointer to the legacy format image header
+ * @p: pointer to prefix string
+ *
+ * __image_print_contents() formats a multi line legacy image contents 
description.
+ * The routine prints out all header fields followed by the size/offset data
+ * for MULTI/SCRIPT images.
+ *
+ * returns:
+ * no returned results
+ */
 static void __image_print_contents (image_header_t *hdr, const char *p)
 {
printf (%sImage Name:   %.*s\n, p, IH_NMLEN, image_get_name (hdr));
@@ -1040,11 +1055,13 @@ int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong 
bootmap_base)
return 0;
 }
 #endif /* CONFIG_PPC || CONFIG_M68K */
+#endif /* !USE_HOSTCC */
 
 #if defined(CONFIG_FIT)
 /*/
 /* New uImage format routines */
 /*/
+#ifndef USE_HOSTCC
 static int fit_parse_spec (const char *spec, char sepc, ulong addr_curr,
ulong *addr, const char **name)
 {
@@ -1117,6 +1134,1164 @@ inline int fit_parse_subimage (const char *spec, ulong 
addr_curr,
 {
return fit_parse_spec (spec, ':', addr_curr, addr, image_name);
 }
+#endif /* !USE_HOSTCC */
+
+static void fit_get_debug (const void *fit, int noffset,
+   char *prop_name, int err)
+{
+   debug (Can't get '%s' property from FIT 0x%08lx, 
+   node: offset %d, name %s (%s)\n,
+   prop_name, (ulong)fit, noffset,
+   fdt_get_name (fit, noffset, NULL),
+   fdt_strerror (err));
+}
+
+/**
+ * __fit_print_contents - prints out the contents of the FIT format image
+ * @fit: pointer to the FIT format image header
+ * @p: pointer to prefix string
+ *
+ * __fit_print_contents() formats a multi line FIT image contents description.
+ * The routine prints out FIT image properties (root node level) follwed by
+ * the details of each component image.
+ *
+ * returns:
+ * no returned results
+ */
+static void __fit_print_contents (const void *fit, const char *p)
+{
+   char *desc;
+   char *uname;
+   int images_noffset;
+   int confs_noffset;
+   int noffset;
+   int ndepth;
+   int count = 0;
+   int ret;
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || 
defined(USE_HOSTCC)
+   time_t timestamp;
+#endif
+
+   /* Root node properties */
+   ret = fit_get_desc (fit, 0, desc);
+   printf (%sFIT description: , p);
+   if (ret)
+   printf (description unavailable\n);
+   else
+   printf (%s\n, desc);
+
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || 
defined(USE_HOSTCC)
+   ret = fit_get_timestamp (fit, 0, timestamp);
+   printf (%sCreated: , p);
+   if (ret)
+   printf (timestamp unavailable\n);
+   else
+   genimg_print_time (timestamp);
+#endif
+
+   /* Find images parent node offset */
+   images_noffset = fdt_path_offset (fit, FIT_IMAGES_PATH);
+   if (images_noffset  0) {
+   printf (Can't find images parent node '%s' (%s)\n,
+   FIT_IMAGES_PATH, fdt_strerror (images_noffset));
+   return;
+   }
+
+   /* Process its subnodes, print out component images details */
+   for (ndepth = 0, count = 0, noffset = fdt_next_node (fit, 
images_noffset, ndepth);
+(noffset = 0)  (ndepth  0

Re: [U-Boot-Users] update new-image branch of u-boot-testing

2008-02-27 Thread Marian Balakowicz
Kumar Gala wrote:
 
 On Feb 26, 2008, at 3:14 AM, Marian Balakowicz wrote:
 
 Kumar Gala wrote:
 Can we get 1.3.2-rc2 pulled into the 'new-image' branch of
 u-boot-testing.

 Will do this along with preparing new commits for
 u-boot-testing#new-image branch pull end of this week.
 
 Do you have a git tree w/the latest 8 patches in it?  I'd like to rebase
 my set of patches that adds lmb, etc against those.

No, nothing public yet. I think we'll have it merged to the
u-boot-testing end of this week.

m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH v2] [new uImage] ppc: Re-order ramdisk/fdt handling sequence

2008-02-26 Thread Marian Balakowicz
Kumar Gala wrote:
 
 On Feb 22, 2008, at 11:08 AM, Marian Balakowicz wrote:
...

 If we add LMB and rework bootm memory allocation, putting things
 (kernel, cmdline, kdb, initrd (optionally), fdt) in sequence starting
 from bootm_low then we may want to always relocate fdt to avoid
 overlapping. And, in case of new uImage FDT blob will be embedded in a
 new uImage shell which is a blob itself. So, in this case in-place
 resizing is not really a clean option, we would need to resize the
 embedding new uImage blob first, and this one may have significant size,
 so I suspect it may impact performance.
 
 I felt the sequence (on PPC) is either:
 kernel, cmdline, kdb, initrd
 
 or
 
 kernel, fdt, initrd
 
 The reason being is that initrd doesn't need to be constrained to
 BOOTMAPSZ but cmdline, kdb, and fdt would/should be.

That's right.

My point was just to have two steps:

1) Move all the stuff to the final locations (whatever the sequence)

- kernel

- fdt - *always* relocate to within BOOTMAPSZ, increase size dynamically.

fdt blob can be delivered using of the three different methods: (1)
raw fdt blob, (2) fdt blob embedded in legacy format uImage, (3) fdt
blob embedded in new uImage format. To simplify things always relocate
it to a allocated spot within BOOTMAPSZ.

- initrd - within or outside of the BOOTMAPSZ boundaries

2) Update fdt blob, knowing we have enough free blob space: set initrd
params, other fixups, etc.


With such approach we don't need special treatment for
initrd,start/initrd,end (and other fixups). We assure that there is
enough free space in fdt blob when we relocate it.

m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 2/8] [new uImage] POWERPC: Split get_fdt() into get and relocate routines

2008-02-25 Thread Marian Balakowicz
PPC specific FDT blob handling code is divided into two separate routines:

get_fdt()   - find and verify a FDT blob (either raw or image embedded)
fdt_relocate()  - move FDT blob to within BOOTMAP if needed

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 lib_ppc/bootm.c |   61 +++
 1 files changed, 43 insertions(+), 18 deletions(-)


diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index a1bbfc6..d5e019e 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -41,9 +41,11 @@
 #include fdt_support.h
 
 static void fdt_error (const char *msg);
-static ulong get_fdt (ulong alloc_current, cmd_tbl_t *cmdtp, int flag,
-   int argc, char *argv[],
-   bootm_headers_t *images, char **of_flat_tree);
+static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+   bootm_headers_t *images, char **of_flat_tree, ulong *of_size);
+static ulong fdt_relocate (ulong alloc_current,
+   cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+   char **of_flat_tree, ulong *of_size);
 #endif
 
 #ifdef CFG_INIT_RAM_LOCK
@@ -73,7 +75,8 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag,
void(*kernel)(bd_t *, ulong, ulong, ulong, ulong);
 
 #if defined(CONFIG_OF_LIBFDT)
-   char*of_flat_tree;
+   char*of_flat_tree = NULL;
+   ulong   of_size = 0;
 #endif
 
/*
@@ -124,14 +127,16 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag,
 
 #if defined(CONFIG_OF_LIBFDT)
/* find flattened device tree */
-   alloc_current = get_fdt (alloc_current,
-   cmdtp, flag, argc, argv, images, of_flat_tree);
+   get_fdt (cmdtp, flag, argc, argv, images, of_flat_tree, of_size);
+
+   alloc_current = fdt_relocate (alloc_current,
+   cmdtp, flag, argc, argv, of_flat_tree, of_size);
 
/*
 * Add the chosen node if it doesn't exist, add the env and bd_t
 * if the user wants it (the logic is in the subroutines).
 */
-   if (of_flat_tree) {
+   if (of_size) {
if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0)  0) {
fdt_error (/chosen node create failed);
do_reset (cmdtp, flag, argc, argv);
@@ -234,16 +239,12 @@ static void fdt_error (const char *msg)
puts ( - must RESET the board to recover.\n);
 }
 
-static ulong get_fdt (ulong alloc_current,
-   cmd_tbl_t *cmdtp, int flag,
-   int argc, char *argv[],
-   bootm_headers_t *images, char **of_flat_tree)
+static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+   bootm_headers_t *images, char **of_flat_tree, ulong *of_size)
 {
ulong   fdt_addr;
image_header_t  *fdt_hdr;
char*fdt_blob = NULL;
-   ulong   fdt_relocate = 0;
-   ulong   new_alloc_current;
ulong   image_start, image_end;
ulong   load_start, load_end;
 #if defined(CONFIG_FIT)
@@ -410,13 +411,37 @@ static ulong get_fdt (ulong alloc_current,
} else {
debug (## No Flattened Device Tree\n);
*of_flat_tree = NULL;
+   *of_size = 0;
+   return;
+   }
+
+   *of_flat_tree = fdt_blob;
+   *of_size = be32_to_cpu (fdt_totalsize (fdt_blob));
+   debug (   of_flat_tree at 0x%08lx size 0x%08lx\n,
+   *of_flat_tree, *of_size);
+}
+
+static ulong fdt_relocate (ulong alloc_current,
+   cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+   char **of_flat_tree, ulong *of_size)
+{
+   char*fdt_blob = *of_flat_tree;
+   ulong   relocate = 0;
+   ulong   new_alloc_current;
+
+   /* nothing to do */
+   if (*of_size == 0)
return alloc_current;
+
+   if (fdt_check_header (fdt_blob) != 0) {
+   fdt_error (image is not a fdt);
+   do_reset (cmdtp, flag, argc, argv);
}
 
 #ifndef CFG_NO_FLASH
-   /* move the blob if it is in flash (set fdt_relocate) */
+   /* move the blob if it is in flash (set relocate) */
if (addr2info ((ulong)fdt_blob) != NULL)
-   fdt_relocate = 1;
+   relocate = 1;
 #endif
 
 #ifdef CFG_BOOTMAPSZ
@@ -425,15 +450,15 @@ static ulong get_fdt (ulong alloc_current,
 * so we flag it to be copied if it is not.
 */
if (fdt_blob = (char *)CFG_BOOTMAPSZ)
-   fdt_relocate = 1;
+   relocate = 1;
 #endif
 
/* move flattend device tree if needed */
-   if (fdt_relocate) {
+   if (relocate) {
int err;
ulong of_start, of_len;
 
-   of_len = be32_to_cpu (fdt_totalsize (fdt_blob));
+   of_len = *of_size;
 
/* position on a 4K boundary before the alloc_current */
of_start  = alloc_current

[U-Boot-Users] [PATCH 3/8] [new uImage] Optimize gen_get_image() flow control

2008-02-25 Thread Marian Balakowicz
When CONFIG_HAS_DATAFLASH is not defined gen_get_image() routine has nothing
to do, update its control flow to better reflect that simple case.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/image.c |   64 +---
 1 files changed, 33 insertions(+), 31 deletions(-)


diff --git a/common/image.c b/common/image.c
index ea27b0b..dd55264 100644
--- a/common/image.c
+++ b/common/image.c
@@ -408,55 +408,57 @@ int gen_image_get_format (void *img_addr)
  */
 ulong gen_get_image (ulong img_addr)
 {
-   ulong ram_addr, h_size, d_size;
-
-   h_size = image_get_header_size ();
-#if defined(CONFIG_FIT)
-   if (sizeof(struct fdt_header)  h_size)
-   h_size = sizeof(struct fdt_header);
-#endif
+   ulong ram_addr = img_addr;
 
 #ifdef CONFIG_HAS_DATAFLASH
+   ulong h_size, d_size;
+
if (addr_dataflash (img_addr)){
+   /* ger RAM address */
ram_addr = CFG_LOAD_ADDR;
+
+   /* get header size */
+   h_size = image_get_header_size ();
+#if defined(CONFIG_FIT)
+   if (sizeof(struct fdt_header)  h_size)
+   h_size = sizeof(struct fdt_header);
+#endif
+
+   /* read in header */
debug (   Reading image header from dataflash address 
%08lx to RAM address %08lx\n, img_addr, ram_addr);
-   read_dataflash (img_addr, h_size, (char *)ram_addr);
-   } else
-#endif
-   return img_addr;
 
-   ram_addr = img_addr;
+   read_dataflash (img_addr, h_size, (char *)ram_addr);
 
-   switch (gen_image_get_format ((void *)ram_addr)) {
-   case IMAGE_FORMAT_LEGACY:
-   d_size = image_get_data_size ((image_header_t *)ram_addr);
-   debug (   Legacy format image found at 0x%08lx, size 
0x%08lx\n,
-   ram_addr, d_size);
-   break;
+   /* get data size */
+   switch (gen_image_get_format ((void *)ram_addr)) {
+   case IMAGE_FORMAT_LEGACY:
+   d_size = image_get_data_size ((image_header_t 
*)ram_addr);
+   debug (   Legacy format image found at 0x%08lx, size 
0x%08lx\n,
+   ram_addr, d_size);
+   break;
 #if defined(CONFIG_FIT)
-   case IMAGE_FORMAT_FIT:
-   d_size = fdt_totalsize((void *)ram_addr) - h_size;
-   debug (   FIT/FDT format image found at 0x%08lx, size 
0x%08lx\n,
-   ram_addr, d_size);
-
-   break;
+   case IMAGE_FORMAT_FIT:
+   d_size = fdt_totalsize((void *)ram_addr) - h_size;
+   debug (   FIT/FDT format image found at 0x%08lx, size 
0x%08lx\n,
+   ram_addr, d_size);
+   break;
 #endif
-   default:
-   printf (   No valid image found at 0x%08lx\n, img_addr);
-   return ram_addr;
-   }
+   default:
+   printf (   No valid image found at 0x%08lx\n, 
img_addr);
+   return ram_addr;
+   }
 
-#ifdef CONFIG_HAS_DATAFLASH
-   if (addr_dataflash (img_addr)) {
+   /* read in image data */
debug (   Reading image remaining data from dataflash address 
%08lx to RAM address %08lx\n, img_addr + h_size,
ram_addr + h_size);
 
read_dataflash (img_addr + h_size, d_size,
(char *)(ram_addr + h_size));
+
}
-#endif
+#endif /* CONFIG_HAS_DATAFLASH */
 
return ram_addr;
 }


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 4/8] [Makefile] Sort COBJS in lib_arch Makefiles

2008-02-25 Thread Marian Balakowicz
Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 lib_avr32/Makefile  |2 +-
 lib_blackfin/Makefile   |4 ++--
 lib_i386/Makefile   |4 ++--
 lib_m68k/Makefile   |2 +-
 lib_microblaze/Makefile |2 +-
 lib_mips/Makefile   |2 +-
 lib_nios/Makefile   |2 +-
 lib_nios2/Makefile  |2 +-
 lib_ppc/Makefile|5 ++---
 9 files changed, 12 insertions(+), 13 deletions(-)


diff --git a/lib_avr32/Makefile b/lib_avr32/Makefile
index ebe237b..afbce45 100644
--- a/lib_avr32/Makefile
+++ b/lib_avr32/Makefile
@@ -29,7 +29,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  = memset.o
 
-COBJS  = board.o interrupts.o bootm.o
+COBJS  = board.o bootm.o interrupts.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_blackfin/Makefile b/lib_blackfin/Makefile
index ac3fb28..4a262fc 100644
--- a/lib_blackfin/Makefile
+++ b/lib_blackfin/Makefile
@@ -29,9 +29,9 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(ARCH).a
 
-SOBJS  = memcpy.o memcmp.o memset.o memmove.o
+SOBJS  = memcmp.o memcpy.o memmove.o memset.o
 
-COBJS  = post.o tests.o board.o bootm.o bf533_string.o cache.o muldi3.o
+COBJS  = bf533_string.o board.o bootm.o cache.o muldi3.o post.o tests.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_i386/Makefile b/lib_i386/Makefile
index ef0ba54..004278f 100644
--- a/lib_i386/Makefile
+++ b/lib_i386/Makefile
@@ -27,8 +27,8 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  = bios.o bios_pci.o realmode_switch.o
 
-COBJS  = board.o bios_setup.o bootm.o zimage.o realmode.o \
- pci_type1.o pci.o video_bios.o video.o
+COBJS  = bios_setup.o board.o bootm.o pci.o pci_type1.o \
+ realmode.o video_bios.o video.o zimage.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_m68k/Makefile b/lib_m68k/Makefile
index d515223..efde75d 100644
--- a/lib_m68k/Makefile
+++ b/lib_m68k/Makefile
@@ -27,7 +27,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  =
 
-COBJS  = cache.o traps.o time.o interrupts.o board.o bootm.o
+COBJS  = board.o bootm.o cache.o interrupts.o time.o traps.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_microblaze/Makefile b/lib_microblaze/Makefile
index 9b317a2..9c3b519 100644
--- a/lib_microblaze/Makefile
+++ b/lib_microblaze/Makefile
@@ -27,7 +27,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  =
 
-COBJS  = board.o bootm.o time.o cache.o
+COBJS  = board.o bootm.o cache.o time.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_mips/Makefile b/lib_mips/Makefile
index 93cca7a..bfcf463 100644
--- a/lib_mips/Makefile
+++ b/lib_mips/Makefile
@@ -27,7 +27,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  =
 
-COBJS  = board.o time.o bootm.o
+COBJS  = board.o bootm.o time.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_nios/Makefile b/lib_nios/Makefile
index d8ae7bd..b81a3d4 100644
--- a/lib_nios/Makefile
+++ b/lib_nios/Makefile
@@ -27,7 +27,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  =
 
-COBJS  = board.o cache.o divmod.o bootm.o mult.o time.o
+COBJS  = board.o bootm.o cache.o divmod.o mult.o time.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_nios2/Makefile b/lib_nios2/Makefile
index 5f996d3..c69cdd7 100644
--- a/lib_nios2/Makefile
+++ b/lib_nios2/Makefile
@@ -27,7 +27,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  = cache.o
 
-COBJS  = board.o divmod.o bootm.o mult.o time.o
+COBJS  = board.o bootm.o divmod.o mult.o time.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_ppc/Makefile b/lib_ppc/Makefile
index 61507b0..21f644e 100644
--- a/lib_ppc/Makefile
+++ b/lib_ppc/Makefile
@@ -27,9 +27,8 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  = ppccache.o ppcstring.o ticks.o
 
-COBJS  = board.o \
- bat_rw.o cache.o extable.o kgdb.o time.o interrupts.o \
- bootm.o
+COBJS  = bat_rw.o board.o bootm.o cache.o extable.o \
+ interrupts.o kgdb.o time.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 7/8] [new uImage] POWERPC: Add image_get_fdt() routine

2008-02-25 Thread Marian Balakowicz
FDT blob may be passed either: (1) raw (2) or embedded in the legacy uImage
(3) or embedded in the new uImage. For the (2) case embedding image must be
verified before we get FDT from it. This patch factors out legacy image
specific verification routine to the separate helper routine.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 lib_ppc/bootm.c |   76 ---
 1 files changed, 44 insertions(+), 32 deletions(-)


diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index 319d4ba..ad05bc5 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -237,6 +237,39 @@ static void fdt_error (const char *msg)
puts ( - must RESET the board to recover.\n);
 }
 
+static image_header_t *image_get_fdt (ulong fdt_addr)
+{
+   image_header_t *fdt_hdr = (image_header_t *)fdt_addr;
+
+   image_print_contents (fdt_hdr);
+
+   puts (   Verifying Checksum ... );
+   if (!image_check_hcrc (fdt_hdr)) {
+   fdt_error (fdt header checksum invalid);
+   return NULL;
+   }
+
+   if (!image_check_dcrc (fdt_hdr)) {
+   fdt_error (fdt checksum invalid);
+   return NULL;
+   }
+   puts (OK\n);
+
+   if (!image_check_type (fdt_hdr, IH_TYPE_FLATDT)) {
+   fdt_error (uImage is not a fdt);
+   return NULL;
+   }
+   if (image_get_comp (fdt_hdr) != IH_COMP_NONE) {
+   fdt_error (uImage is compressed);
+   return NULL;
+   }
+   if (fdt_check_header ((char *)image_get_data (fdt_hdr)) != 0) {
+   fdt_error (uImage data is not a fdt);
+   return NULL;
+   }
+   return fdt_hdr;
+}
+
 static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
bootm_headers_t *images, char **of_flat_tree, ulong *of_size)
 {
@@ -297,12 +330,17 @@ static void get_fdt (cmd_tbl_t *cmdtp, int flag, int 
argc, char *argv[],
case IMAGE_FORMAT_LEGACY:
debug (*  fdt: legacy format image\n);
 
-   fdt_hdr = (image_header_t *)fdt_addr;
+   /* verify fdt_addr points to a valid image header */
printf (## Flattened Device Tree Legacy Image at 
%08lx\n,
-   fdt_hdr);
-
-   image_print_contents (fdt_hdr);
+   fdt_addr);
+   fdt_hdr = image_get_fdt (fdt_addr);
+   if (!fdt_hdr)
+   do_reset (cmdtp, flag, argc, argv);
 
+   /*
+* move image data to the load address,
+* make sure we don't overwrite initial image
+*/
image_start = (ulong)fdt_hdr;
image_end = image_get_image_end (fdt_hdr);
 
@@ -313,35 +351,9 @@ static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[],
fdt_error (fdt overwritten);
do_reset (cmdtp, flag, argc, argv);
}
-
-   puts (   Verifying Checksum ... );
-   if (!image_check_hcrc (fdt_hdr)) {
-   fdt_error (fdt header checksum invalid);
-   do_reset (cmdtp, flag, argc, argv);
-   }
-
-   if (!image_check_dcrc (fdt_hdr)) {
-   fdt_error (fdt checksum invalid);
-   do_reset (cmdtp, flag, argc, argv);
-   }
-   puts (OK\n);
-
-   if (!image_check_type (fdt_hdr, IH_TYPE_FLATDT)) {
-   fdt_error (uImage is not a fdt);
-   do_reset (cmdtp, flag, argc, argv);
-   }
-   if (image_get_comp (fdt_hdr) != IH_COMP_NONE) {
-   fdt_error (uImage is compressed);
-   do_reset (cmdtp, flag, argc, argv);
-   }
-   if (fdt_check_header ((char *)image_get_data (fdt_hdr)) 
!= 0) {
-   fdt_error (uImage data is not a fdt);
-   do_reset (cmdtp, flag, argc, argv);
-   }
-
memmove ((void *)image_get_load (fdt_hdr),
-   (void *)image_get_data (fdt_hdr),
-   image_get_data_size (fdt_hdr));
+   (void *)image_get_data (fdt_hdr),
+   image_get_data_size (fdt_hdr));
 
fdt_blob = (char *)image_get_load (fdt_hdr);
break;


-
This SF.net email is sponsored

[U-Boot-Users] [PATCH 5/8] [new uImage] Move image verify flag to bootm_headers structure

2008-02-25 Thread Marian Balakowicz
Do not pass image verification flag directly to related routines.
Simplify argument passing and move it to the bootm_header structure which
contains curently processed image specific data and is already being passed
on the argument list.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/cmd_bootm.c |   47 +--
 common/image.c |   13 -
 include/image.h|7 ++-
 lib_arm/bootm.c|4 ++--
 lib_avr32/bootm.c  |4 ++--
 lib_blackfin/bootm.c   |2 +-
 lib_i386/bootm.c   |4 ++--
 lib_m68k/bootm.c   |4 ++--
 lib_microblaze/bootm.c |2 +-
 lib_mips/bootm.c   |4 ++--
 lib_nios/bootm.c   |2 +-
 lib_nios2/bootm.c  |2 +-
 lib_ppc/bootm.c|8 +++-
 lib_sh/bootm.c |2 +-
 14 files changed, 49 insertions(+), 56 deletions(-)


diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 3f09988..ce2de2e 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -65,10 +65,8 @@ static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[]);
 static void fixup_silent_linux (void);
 #endif
 
-static void *get_kernel (cmd_tbl_t *cmdtp, int flag,
-   int argc, char *argv[], int verify,
-   bootm_headers_t *images,
-   ulong *os_data, ulong *os_len);
+static void *get_kernel (cmd_tbl_t *cmdtp, int flag,int argc, char *argv[],
+   bootm_headers_t *images, ulong *os_data, ulong *os_len);
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
 /*
@@ -81,8 +79,7 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[]);
  */
 typedef void boot_os_fn (cmd_tbl_t *cmdtp, int flag,
int argc, char *argv[],
-   bootm_headers_t *images,/* pointers to os/initrd/fdt */
-   int verify);/* getenv(verify)[0] != 'n' */
+   bootm_headers_t *images); /* pointers to os/initrd/fdt 
*/
 
 extern boot_os_fn do_bootm_linux;
 static boot_os_fn do_bootm_netbsd;
@@ -114,7 +111,6 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
ulong   iflag;
const char  *type_name;
uintunc_len = CFG_BOOTM_LEN;
-   int verify = getenv_verify();
uint8_t comp, type, os;
 
void*os_hdr;
@@ -123,9 +119,10 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
ulong   load_start, load_end;
 
memset ((void *)images, 0, sizeof (images));
+   images.verify = getenv_verify();
 
/* get kernel image header, start address and length */
-   os_hdr = get_kernel (cmdtp, flag, argc, argv, verify,
+   os_hdr = get_kernel (cmdtp, flag, argc, argv,
images, os_data, os_len);
if (os_len == 0)
return 1;
@@ -246,36 +243,36 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 #ifdef CONFIG_SILENT_CONSOLE
fixup_silent_linux();
 #endif
-   do_bootm_linux (cmdtp, flag, argc, argv, images, verify);
+   do_bootm_linux (cmdtp, flag, argc, argv, images);
break;
 
case IH_OS_NETBSD:
-   do_bootm_netbsd (cmdtp, flag, argc, argv, images, verify);
+   do_bootm_netbsd (cmdtp, flag, argc, argv, images);
break;
 
 #ifdef CONFIG_LYNXKDI
case IH_OS_LYNXOS:
-   do_bootm_lynxkdi (cmdtp, flag, argc, argv, images, verify);
+   do_bootm_lynxkdi (cmdtp, flag, argc, argv, images);
break;
 #endif
 
case IH_OS_RTEMS:
-   do_bootm_rtems (cmdtp, flag, argc, argv, images, verify);
+   do_bootm_rtems (cmdtp, flag, argc, argv, images);
break;
 
 #if defined(CONFIG_CMD_ELF)
case IH_OS_VXWORKS:
-   do_bootm_vxworks (cmdtp, flag, argc, argv, images, verify);
+   do_bootm_vxworks (cmdtp, flag, argc, argv, images);
break;
 
case IH_OS_QNX:
-   do_bootm_qnxelf (cmdtp, flag, argc, argv, images, verify);
+   do_bootm_qnxelf (cmdtp, flag, argc, argv, images);
break;
 #endif
 
 #ifdef CONFIG_ARTOS
case IH_OS_ARTOS:
-   do_bootm_artos (cmdtp, flag, argc, argv, images, verify);
+   do_bootm_artos (cmdtp, flag, argc, argv, images);
break;
 #endif
}
@@ -300,10 +297,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
  * pointer to image header if valid image was found, plus kernel start
  * address and length, otherwise NULL
  */
-static void *get_kernel (cmd_tbl_t *cmdtp, int flag,
-   int argc, char *argv[], int verify,
-   bootm_headers_t *images,
-   ulong *os_data, ulong *os_len)
+static void *get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+   bootm_headers_t *images, ulong

[U-Boot-Users] [PATCH 8/8] [new uImage] Correct raw FDT blob handlig when CONFIG_FIT is disabled

2008-02-25 Thread Marian Balakowicz
Dual format image code must properly handle all three FDT passing methods:
- raw FDT blob passed
- FDT blob embedded in the legacy uImage
- FDT blob embedded in the new uImage

This patch enables proper raw FDT handling when no FIT imaeg support
is compiled in. This is a bit tricky as we must dected FIT format even
when FIT uImage handling is not enabled as both FIT uImages and raw FDT
blobs use tha same low level format (libfdt).

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/image.c  |8 ++--
 include/image.h |5 +++--
 lib_ppc/bootm.c |   18 --
 3 files changed, 21 insertions(+), 10 deletions(-)


diff --git a/common/image.c b/common/image.c
index 5ca77b9..c689b0e 100644
--- a/common/image.c
+++ b/common/image.c
@@ -375,6 +375,10 @@ void image_print_contents (image_header_t *hdr)
  * gen_image_get_format() checks whether provided address points to a valid
  * legacy or FIT image.
  *
+ * New uImage format and FDT blob are based on a libfdt. FDT blob
+ * may be passed directly or embedded in a FIT image. In both situations
+ * gen_image_get_format() must be able to dectect libfdt header.
+ *
  * returns:
  * image format type or IMAGE_FORMAT_INVALID if no image is present
  */
@@ -382,14 +386,14 @@ int gen_image_get_format (void *img_addr)
 {
ulong   format = IMAGE_FORMAT_INVALID;
image_header_t  *hdr;
-#if defined(CONFIG_FIT)
+#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT)
char*fit_hdr;
 #endif
 
hdr = (image_header_t *)img_addr;
if (image_check_magic(hdr))
format = IMAGE_FORMAT_LEGACY;
-#if defined(CONFIG_FIT)
+#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT)
else {
fit_hdr = (char *)img_addr;
if (fdt_check_header (fit_hdr) == 0)
diff --git a/include/image.h b/include/image.h
index 1bc090a..08566ea 100644
--- a/include/image.h
+++ b/include/image.h
@@ -376,8 +376,9 @@ const char* image_get_comp_name (uint8_t comp);
 void image_print_contents (image_header_t *hdr);
 
 #define IMAGE_FORMAT_INVALID   0x00
-#define IMAGE_FORMAT_LEGACY0x01
-#define IMAGE_FORMAT_FIT   0x02
+#define IMAGE_FORMAT_LEGACY0x01/* legacy image_header based format */
+#define IMAGE_FORMAT_FIT   0x02/* new, libfdt based format */
+
 int gen_image_get_format (void *img_addr);
 ulong gen_get_image (ulong img_addr);
 
diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index ad05bc5..d80d69a 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -357,11 +357,15 @@ static void get_fdt (cmd_tbl_t *cmdtp, int flag, int 
argc, char *argv[],
 
fdt_blob = (char *)image_get_load (fdt_hdr);
break;
-#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
-
-   /* check FDT blob vs FIT hdr */
-   if (fit_uname_config || fit_uname_fdt) {
+   /*
+* This case will catch both: new uImage format
+* (libfdt based) and raw FDT blob (also libfdt
+* based).
+*/
+#if defined(CONFIG_FIT)
+   /* check FDT blob vs FIT blob */
+   if (0) { /* FIXME: call FIT format verification */
/*
 * FIT image
 */
@@ -369,15 +373,17 @@ static void get_fdt (cmd_tbl_t *cmdtp, int flag, int 
argc, char *argv[],
debug (*  fdt: FIT format image\n);
fit_unsupported_reset (PPC fdt);
do_reset (cmdtp, flag, argc, argv);
-   } else {
+   } else
+#endif
+   {
/*
 * FDT blob
 */
+   debug (*  fdt: raw FDT blob\n);
printf (## Flattened Device Tree blob at 
%08lx\n, fdt_blob);
fdt_blob = (char *)fdt_addr;
}
break;
-#endif
default:
fdt_error (Did not find a cmdline Flattened Device 
Tree);
do_reset (cmdtp, flag, argc, argv);


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH v2] [new uImage] ppc: Re-order ramdisk/fdt handling sequence

2008-02-22 Thread Marian Balakowicz
Kumar Gala wrote:
 On Feb 18, 2008, at 1:46 PM, Jerry Van Baren wrote:
 
 Kumar Gala wrote:
 On Feb 18, 2008, at 1:15 PM, Jerry Van Baren wrote:
 Kumar Gala wrote:
 On Feb 18, 2008, at 11:51 AM, Jerry Van Baren wrote:
 Kumar Gala wrote:
 snip

 The patch is creating dummy initrd entries in the reserved map and  
 in /chosen, only to work hard to delete and re-create the reserved  
 map entries and rewrite the /chosen entries.

 My counter-proposal is to not bother with dummy values.  Simply  
 pass in 0,0 which will prevent the creation of the initrd entries  
 by fdt_chosen().  By not creating dummy entries, you can simply  
 create the proper entries once you know what the the correct  
 values are, rather than the more complicated rsvmap search   
 delete + rsvmap creation + /chosen modifications.
 Ahh, the reason I wanted them created was to ensure we have enough  
 size for them up front rather than figuring that out later.  By  
 creating them and replacing them I will not being changing the size  
 at all.
 - k
 OK, I see.

 Currently this isn't an issue because our blob has a fixed size that  
 has free space inside it, so creating the rsvmap and /chosen entries  
 eat at the internal free space and don't change the total blob size.

 People are advocating dynamically increasing the blob size, which  
 simplifies things for blob generation (don't have to guess how big  
 to make the blob when running the dtc to create it), but that would  
 cause problems with my counter-proposal.
 
 And the whole point of my patch was to enable the ability to  
 dynamically grow the blob before we do anything w/the ramdisk.

But we don't really grow the blob, we are just allocating the space for
the initrd properties - *if* the blob already has enough free space. If
the blob does not have enough free space we'll hit the bottom anyway,
whether in fdt_chosen() or ft_board_setup(), so it seem that it doesn't
matter whether we pre-allocate space for initrd or not. Or am I missing
something?

I was rather thinking of increasing the total blob size when relocating
it. Currently relocation happens only when the blob is not within
BOOTMAPSZ region, so we would need to always relocate the blob and
figure out the size delta: (1) get it from env variable, if set (2) or
use some default delta. What do you think?

Cheers,
m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH v2] [new uImage] ppc: Re-order ramdisk/fdt handling sequence

2008-02-22 Thread Marian Balakowicz
Marian Balakowicz wrote:
 Kumar Gala wrote:
 On Feb 18, 2008, at 1:46 PM, Jerry Van Baren wrote:

 Kumar Gala wrote:
 On Feb 18, 2008, at 1:15 PM, Jerry Van Baren wrote:
 Kumar Gala wrote:
 On Feb 18, 2008, at 11:51 AM, Jerry Van Baren wrote:
 Kumar Gala wrote:
 snip

 The patch is creating dummy initrd entries in the reserved map and  
 in /chosen, only to work hard to delete and re-create the reserved  
 map entries and rewrite the /chosen entries.

 My counter-proposal is to not bother with dummy values.  Simply  
 pass in 0,0 which will prevent the creation of the initrd entries  
 by fdt_chosen().  By not creating dummy entries, you can simply  
 create the proper entries once you know what the the correct  
 values are, rather than the more complicated rsvmap search   
 delete + rsvmap creation + /chosen modifications.
 Ahh, the reason I wanted them created was to ensure we have enough  
 size for them up front rather than figuring that out later.  By  
 creating them and replacing them I will not being changing the size  
 at all.
 - k
 OK, I see.

 Currently this isn't an issue because our blob has a fixed size that  
 has free space inside it, so creating the rsvmap and /chosen entries  
 eat at the internal free space and don't change the total blob size.

 People are advocating dynamically increasing the blob size, which  
 simplifies things for blob generation (don't have to guess how big  
 to make the blob when running the dtc to create it), but that would  
 cause problems with my counter-proposal.
 And the whole point of my patch was to enable the ability to  
 dynamically grow the blob before we do anything w/the ramdisk.
 
 But we don't really grow the blob, we are just allocating the space for
 the initrd properties - *if* the blob already has enough free space. If
 the blob does not have enough free space we'll hit the bottom anyway,
 whether in fdt_chosen() or ft_board_setup(), so it seem that it doesn't
 matter whether we pre-allocate space for initrd or not. Or am I missing
 something?
 
 I was rather thinking of increasing the total blob size when relocating
 it. Currently relocation happens only when the blob is not within
 BOOTMAPSZ region, so we would need to always relocate the blob and
 figure out the size delta: (1) get it from env variable, if set (2) or
 use some default delta. What do you think?

Also, for the blob growing changes it would be nice to first merge your
LMB patches to sort out the memory allocation. I didn't have a time to
review your changes in detail but it's definitely step in the right
direction. Current bootm allocation is pretty messy, I cleaned it a bit
but didn't want to touch too many pieces at the same time. For the same
reason I would like to finish the current patch I am working on that
adds dual format framework before we add LMB and dynamic blob growing.

m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH v2] [new uImage] ppc: Re-order ramdisk/fdt handling sequence

2008-02-22 Thread Marian Balakowicz
Jerry Van Baren wrote:
 Marian Balakowicz wrote:
 Kumar Gala wrote:
 On Feb 18, 2008, at 1:46 PM, Jerry Van Baren wrote:

 Kumar Gala wrote:
 On Feb 18, 2008, at 1:15 PM, Jerry Van Baren wrote:
 Kumar Gala wrote:
 On Feb 18, 2008, at 11:51 AM, Jerry Van Baren wrote:
 Kumar Gala wrote:
 snip

 The patch is creating dummy initrd entries in the reserved map
 and  in /chosen, only to work hard to delete and re-create the
 reserved  map entries and rewrite the /chosen entries.

 My counter-proposal is to not bother with dummy values.  Simply 
 pass in 0,0 which will prevent the creation of the initrd entries 
 by fdt_chosen().  By not creating dummy entries, you can simply 
 create the proper entries once you know what the the correct 
 values are, rather than the more complicated rsvmap search  
 delete + rsvmap creation + /chosen modifications.
 Ahh, the reason I wanted them created was to ensure we have enough 
 size for them up front rather than figuring that out later.  By 
 creating them and replacing them I will not being changing the
 size  at all.
 - k
 OK, I see.

 Currently this isn't an issue because our blob has a fixed size
 that  has free space inside it, so creating the rsvmap and /chosen
 entries  eat at the internal free space and don't change the total
 blob size.

 People are advocating dynamically increasing the blob size, which 
 simplifies things for blob generation (don't have to guess how big 
 to make the blob when running the dtc to create it), but that would 
 cause problems with my counter-proposal.
 And the whole point of my patch was to enable the ability to 
 dynamically grow the blob before we do anything w/the ramdisk.

 But we don't really grow the blob, we are just allocating the space for
 the initrd properties - *if* the blob already has enough free space. If
 the blob does not have enough free space we'll hit the bottom anyway,
 whether in fdt_chosen() or ft_board_setup(), so it seem that it doesn't
 matter whether we pre-allocate space for initrd or not. Or am I missing
 something?

 I was rather thinking of increasing the total blob size when relocating
 it. Currently relocation happens only when the blob is not within
 BOOTMAPSZ region, so we would need to always relocate the blob and
 figure out the size delta: (1) get it from env variable, if set (2) or
 use some default delta. What do you think?


 The missing part is libfdt doesn't exactly support dynamic resizing and
 our current code doesn't do in-place resizing (which it could do by
 doing a move to the same location, but with a larger/smaller length).
 
 Kumar is lining up the pieces to get there, but we aren't there yet...

I see, but how about resizing to a new location:

-   err = fdt_open_into (fdt_blob, (void *)of_start, of_len);
+   err = fdt_open_into (fdt_blob, (void *)of_start, of_len + delta);

Should that work?

If we add LMB and rework bootm memory allocation, putting things
(kernel, cmdline, kdb, initrd (optionally), fdt) in sequence starting
from bootm_low then we may want to always relocate fdt to avoid
overlapping. And, in case of new uImage FDT blob will be embedded in a
new uImage shell which is a blob itself. So, in this case in-place
resizing is not really a clean option, we would need to resize the
embedding new uImage blob first, and this one may have significant size,
so I suspect it may impact performance.

m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [rfc] warning about overlapping regions whenbooting with bootm

2008-02-22 Thread Marian Balakowicz
Wolfgang Denk wrote:
 In message [EMAIL PROTECTED] you wrote:
 I always thought that when decompressing a uImage, that the entry point was 
 stored in the header, (at the beginning of the file) and was read after the 
 decompression took place - is that wrong?
 
 I'm not sure what all the different architectures do,  but  at  least
 for PowerPC, ARM and MIPS I know that one of the very first things we
 do in the bootm code is to create a local copy of the image header.

The image header copy is created but its not always properly used,
do_bootm_netbsd() and do_bootm_linux() for AVR32 and I386 are the
examples where we access image location directly instead of the header
copy. This might be fixed, but other, serious problem is concerning
MULTI images, where we need to access second or third component. If the
original image gets overwritten with the uncompressed kernel u-boot will
not be able read len_ptr[] table and access components.

New uImage format is even more demanding. As there is no such thing as
image header (data is spread across the new uImage blob as a various
properties) we are unable to create a header copy, thus we may not
accept image overwrites.

I have already posted a patch that adds overwrite checks, see:
http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-testing.git;a=commit;h=7582438c285bf0cef82909d0f232de64ec567a8a

Overwrite checking is done in bootm code as we may be using gunzip,
bunzip or no compression and need to handle all the cases.

Cheers,
m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 0/6] [new uImage] patchset3 - legacy code refactoring

2008-02-01 Thread Marian Balakowicz

This is the third patch-set of the new uImage format work. It concludes the
phase of clean-up and reorganization of the old format code, preparing the
ground for adding the code implementing the new format.

All the new uImage patches sent to the list so far, as well as updates
resulting from the feedback received, will be soon available from the new-image
branch of the u-boot-testing repository (there will be a separate
announcement).

The completion of the clean-up phase is a good moment to review the patches
posted to date, and help with testing. This work affects all architectures and
operating systems, so it would be much appreciated if people could give
u-boot-testing#new-image a try and report back. So far, the changes were tested
on a lite5200b board and successfully built for ppc, arm, mips and coldfire
targets.

Work is now ongoing on adding support for the new format, results will be
posted to the list, and also available from u-boot-testing#new-image. Once the
implementation is complete, and the code is reviewed and tested, it will be
merged to the master. 

Marian Balakowicz (6):
  [new uImage] Move kernel data find code to get_kernel() routine
  [new uImage] Cleanup FDT handling in PPC do_boot_linux()
  [new uImage] Cleanup PPC and M68K do_bootm_linux() boot allocations
  [new uImage] Move PPC and M68K ramdisk loading to a common routine
  [new uImage] Removed dead ramdisk code on microblaze architecture
  [new uImage] Factor out common image_get_ramdisk() routine



Cheers,
m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 2/6] [new uImage] Removed dead ramdisk code on microblaze architecture

2008-02-01 Thread Marian Balakowicz
Microblaze do_bootm_linux() includes ramdisk processing code but
the ramdisk does not get used anywhere later on.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 lib_microblaze/bootm.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)


diff --git a/lib_microblaze/bootm.c b/lib_microblaze/bootm.c
index 1f3e777..bccfbe1 100644
--- a/lib_microblaze/bootm.c
+++ b/lib_microblaze/bootm.c
@@ -35,17 +35,12 @@ DECLARE_GLOBAL_DATA_PTR;
 void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
 image_header_t *hdr, int verify)
 {
-   ulong initrd_start, initrd_end;
-
/* First parameter is mapped to $r5 for kernel boot args */
void (*theKernel) (char *);
char *commandline = getenv (bootargs);
 
theKernel = (void (*)(char *))image_get_ep (hdr);
 
-   get_ramdisk (cmdtp, flag, argc, argv, hdr, verify,
-   IH_ARCH_MICROBLAZE, initrd_start, initrd_end);
-
show_boot_progress (15);
 
 #ifdef DEBUG


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 3/6] [new uImage] Move PPC and M68K ramdisk loading to a common routine

2008-02-01 Thread Marian Balakowicz
Ramdisk loading code, including initrd_high variable handling,
was duplicated for PPC and M68K platforms. This patch creates
common helper routine that is being called from both platforms'
do_bootm_linux() routines.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/image.c   |  113 ++
 include/image.h  |7 +++
 lib_m68k/bootm.c |  114 --
 lib_ppc/bootm.c  |  112 -
 4 files changed, 171 insertions(+), 175 deletions(-)


diff --git a/common/image.c b/common/image.c
index e4be4ca..56d6b52 100644
--- a/common/image.c
+++ b/common/image.c
@@ -22,6 +22,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
+
+#define DEBUG
+
 #ifndef USE_HOSTCC
 #include common.h
 #include watchdog.h
@@ -34,6 +37,10 @@
 #include dataflash.h
 #endif
 
+#ifdef CONFIG_LOGBUFFER
+#include logbuff.h
+#endif
+
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 #else
 #include mkimage.h
@@ -476,5 +483,111 @@ void get_ramdisk (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[],
debug (   ramdisk start = 0x%08lx, ramdisk end = 0x%08lx\n,
*rd_start, *rd_end);
 }
+
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+/**
+ * ramdisk_high - relocate init ramdisk
+ * @rd_data: ramdisk data start address
+ * @rd_len: ramdisk data length
+ * @kbd: kernel board info copy (within BOOTMAPSZ boundary)
+ * @sp_limit: stack pointer limit (including BOOTMAPSZ)
+ * @sp: current stack pointer
+ * @initrd_start: pointer to a ulong variable, will hold final init ramdisk
+ *  start address (after possible relocation)
+ * @initrd_end: pointer to a ulong variable, will hold final init ramdisk
+ *  end address (after possible relocation)
+ *
+ * ramdisk_high() takes a relocation hint from initrd_high environement
+ * variable and if requested ramdisk data is moved to a specified location.
+ *
+ * returns:
+ * initrd_start and initrd_end are set to final (after relocation) ramdisk
+ * start/end addresses if ramdisk image start and len were provided
+ * otherwise set initrd_start and initrd_end to zeros
+ *
+ */
+void ramdisk_high (ulong rd_data, ulong rd_len, bd_t *kbd, ulong sp_limit,
+   ulong sp, ulong *initrd_start, ulong *initrd_end)
+{
+   char*s;
+   ulong   initrd_high;
+   int initrd_copy_to_ram = 1;
+
+   if ((s = getenv (initrd_high)) != NULL) {
+   /* a value of no or a similar string will act like 0,
+* turning the load high feature off. This is intentional.
+*/
+   initrd_high = simple_strtoul (s, NULL, 16);
+   if (initrd_high == ~0)
+   initrd_copy_to_ram = 0;
+   } else {
+   /* not set, no restrictions to load high */
+   initrd_high = ~0;
+   }
+
+#ifdef CONFIG_LOGBUFFER
+   /* Prevent initrd from overwriting logbuffer */
+   if (initrd_high  (kbd-bi_memsize - LOGBUFF_LEN - LOGBUFF_OVERHEAD))
+   initrd_high = kbd-bi_memsize - LOGBUFF_LEN - LOGBUFF_OVERHEAD;
+   debug (## Logbuffer at 0x%08lx , kbd-bi_memsize - LOGBUFF_LEN);
+#endif
+   debug (## initrd_high = 0x%08lx, copy_to_ram = %d\n,
+   initrd_high, initrd_copy_to_ram);
+
+   if (rd_data) {
+   if (!initrd_copy_to_ram) {  /* zero-copy ramdisk support */
+   debug (   in-place initrd\n);
+   *initrd_start = rd_data;
+   *initrd_end = rd_data + rd_len;
+   } else {
+   *initrd_start  = (ulong)kbd - rd_len;
+   *initrd_start = ~(4096 - 1);   /* align on page */
+
+   if (initrd_high) {
+   ulong nsp;
+
+   /*
+* the inital ramdisk does not need to be within
+* CFG_BOOTMAPSZ as it is not accessed until 
after
+* the mm system is initialised.
+*
+* do the stack bottom calculation again and 
see if
+* the initrd will fit just below the monitor 
stack
+* bottom without overwriting the area allocated
+* for command line args and board info.
+*/
+   nsp = sp;
+   nsp -= 2048;/* just to be sure */
+   nsp = ~0xF;
+
+   if (nsp  initrd_high)  /* limit as specified */
+   nsp = initrd_high;
+
+   nsp -= rd_len;
+   nsp

[U-Boot-Users] [PATCH 4/6] [new uImage] Cleanup PPC and M68K do_bootm_linux() boot allocations

2008-02-01 Thread Marian Balakowicz
This patch moves common pre-boot allocation steps shared between PPC
and M68K to a helper routines:

common:
- get_boot_sp_limit()
- get_boot_cmline()
- get_boot_kbd()

platform:
- set_clocks_in_mhz()

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/image.c   |  118 ++
 include/image.h  |   10 -
 lib_m68k/bootm.c |   72 +
 lib_ppc/bootm.c  |  106 -
 4 files changed, 189 insertions(+), 117 deletions(-)


diff --git a/common/image.c b/common/image.c
index 56d6b52..39e5f23 100644
--- a/common/image.c
+++ b/common/image.c
@@ -42,9 +42,15 @@
 #endif
 
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+
+#ifdef CONFIG_CMD_BDI
+extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
 #else
 #include mkimage.h
-#endif
+#endif /* USE_HOSTCC*/
 
 #include image.h
 
@@ -501,17 +507,19 @@ void get_ramdisk (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[],
  * variable and if requested ramdisk data is moved to a specified location.
  *
  * returns:
- * initrd_start and initrd_end are set to final (after relocation) ramdisk
+ * - initrd_start and initrd_end are set to final (after relocation) 
ramdisk
  * start/end addresses if ramdisk image start and len were provided
- * otherwise set initrd_start and initrd_end to zeros
- *
+ * otherwise set initrd_start and initrd_end set to zeros
+ * - returns new allc_current, next free address below BOOTMAPSZ
  */
-void ramdisk_high (ulong rd_data, ulong rd_len, bd_t *kbd, ulong sp_limit,
-   ulong sp, ulong *initrd_start, ulong *initrd_end)
+ulong ramdisk_high (ulong alloc_current, ulong rd_data, ulong rd_len,
+   bd_t *kbd, ulong sp_limit, ulong sp,
+   ulong *initrd_start, ulong *initrd_end)
 {
char*s;
ulong   initrd_high;
int initrd_copy_to_ram = 1;
+   ulong   new_alloc_current = alloc_current;
 
if ((s = getenv (initrd_high)) != NULL) {
/* a value of no or a similar string will act like 0,
@@ -540,7 +548,8 @@ void ramdisk_high (ulong rd_data, ulong rd_len, bd_t *kbd, 
ulong sp_limit,
*initrd_start = rd_data;
*initrd_end = rd_data + rd_len;
} else {
-   *initrd_start  = (ulong)kbd - rd_len;
+   new_alloc_current = alloc_current - rd_len;
+   *initrd_start  = new_alloc_current;
*initrd_start = ~(4096 - 1);   /* align on page */
 
if (initrd_high) {
@@ -566,8 +575,10 @@ void ramdisk_high (ulong rd_data, ulong rd_len, bd_t *kbd, 
ulong sp_limit,
nsp -= rd_len;
nsp = ~(4096 - 1); /* align on page */
 
-   if (nsp = sp_limit)
+   if (nsp = sp_limit) {
*initrd_start = nsp;
+   new_alloc_current = alloc_current;
+   }
}
 
show_boot_progress (12);
@@ -587,7 +598,96 @@ void ramdisk_high (ulong rd_data, ulong rd_len, bd_t *kbd, 
ulong sp_limit,
}
debug (   ramdisk load start = 0x%08lx, ramdisk load end = 0x%08lx\n,
*initrd_start, *initrd_end);
+
+   return new_alloc_current;
+}
+
+/**
+ * get_boot_sp_limit - calculate stack pointer limit
+ * @sp: current stack pointer
+ *
+ * get_boot_sp_limit() takes current stack pointer adrress and calculates
+ * stack pointer limit, below which kernel boot data (cmdline, board info,
+ * etc.) will be allocated.
+ *
+ * returns:
+ * stack pointer limit
+ */
+ulong get_boot_sp_limit(ulong sp)
+{
+   ulong sp_limit = sp;
+
+   sp_limit -= 2048;   /* just to be sure */
+
+   /* make sure sp_limit is within kernel mapped space */
+   if (sp_limit  CFG_BOOTMAPSZ)
+   sp_limit = CFG_BOOTMAPSZ;
+   sp_limit = ~0xF;
+
+   return sp_limit;
+}
+
+/**
+ * get_boot_cmdline - allocate and initialize kernel cmdline
+ * @alloc_current: current boot allocation address (counting down
+ *  from sp_limit)
+ * @cmd_start: pointer to a ulong variable, will hold cmdline start
+ * @cmd_end: pointer to a ulong variable, will hold cmdline end
+ *
+ * get_boot_cmdline() allocates space for kernel command line below
+ * provided alloc_current address. If bootargs U-boot environemnt
+ * variable is present its contents is copied to allocated kernel
+ * command line.
+ *
+ * returns:
+ * alloc_current after cmdline allocation
+ */
+ulong get_boot_cmdline (ulong alloc_current, ulong *cmd_start, ulong *cmd_end)
+{
+   char *cmdline;
+   char *s;
+
+   cmdline = (char *)((alloc_current

Re: [U-Boot-Users] [PATCH 0/6] [new uImage] patchset2 - cleanup cont.

2008-01-31 Thread Marian Balakowicz
Kumar Gala wrote:

 This is a second patchset for new uImage, it includes architecture file
 renames, removals of OF_FLAT_TREE and standalone application support and
 further code refactoring.

 This patchset is based on patchset1. MAKEALL was run for
 ppc/arm/mips/coldfire,
 architestures, plus regression tests on lite5200b.

 [new uImage] Move FDT error printing to common fdt_error() routine
 [new uImage] Factor out common routines for getting os/arch/type/comp
 names
 [new uImage] Remove standalone applications handling from boootm
 [new uImage] Remove OF_FLAT_TREE support from PPC bootm code
 [new uImage] Use image API in SH do_bootm_linux() routine
 [new uImage] Rename architecture specific bootm code files
 
 I haven't looked through these, but is it possible to make it so if you
 are using a flat device tree blob on PPC that we can grow the size
 dynamically as we handle some of the board fixups as part of the bootm
 processing?

That should be possible. It'll require to always move the blob to the
new location (with the new size) - currently we move it only if needed.
And, we would need to figure out what the grow delta should be, reading
it from env variable (with the fallback default) should be flexible
enough. But I would prefer to get back to this feature when new uImage
is in place.

Cheers,
m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 1/6] [new uImage] Rename architecture specific bootm code files

2008-01-23 Thread Marian Balakowicz
Implementation of the do_bootm_linux() and other bootm helper routines is
architecture specific code. As such it resides in lib_arch directories
in files named arch_linux.c

This patch renames those files to a more clear and accurate
lib_arch/bootm.c form.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---
 lib_arm/Makefile   |2 +-
 lib_arm/{armlinux.c = bootm.c}|0 
 lib_avr32/Makefile |2 +-
 lib_avr32/{avr32_linux.c = bootm.c}   |0 
 lib_blackfin/Makefile  |2 +-
 lib_blackfin/{bf533_linux.c = bootm.c}|0 
 lib_i386/Makefile  |2 +-
 lib_i386/{i386_linux.c = bootm.c} |0 
 lib_m68k/Makefile  |2 +-
 lib_m68k/{m68k_linux.c = bootm.c} |0 
 lib_microblaze/Makefile|2 +-
 lib_microblaze/{microblaze_linux.c = bootm.c} |0 
 lib_mips/Makefile  |2 +-
 lib_mips/{mips_linux.c = bootm.c} |0 
 lib_nios/Makefile  |2 +-
 lib_nios/{nios_linux.c = bootm.c} |0 
 lib_nios2/Makefile |2 +-
 lib_nios2/{nios_linux.c = bootm.c}|0 
 lib_ppc/Makefile   |2 +-
 lib_ppc/{ppc_linux.c = bootm.c}   |0 
 lib_sh/Makefile|2 +-
 lib_sh/{sh_linux.c = bootm.c} |0 
 22 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib_arm/Makefile b/lib_arm/Makefile
index 037c475..aa9bee7 100644
--- a/lib_arm/Makefile
+++ b/lib_arm/Makefile
@@ -27,7 +27,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  = _ashldi3.o _ashrdi3.o _divsi3.o _modsi3.o _udivsi3.o _umodsi3.o
 
-COBJS  = armlinux.o board.o \
+COBJS  = bootm.o board.o \
  cache.o div0.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/lib_arm/armlinux.c b/lib_arm/bootm.c
similarity index 100%
rename from lib_arm/armlinux.c
rename to lib_arm/bootm.c
diff --git a/lib_avr32/Makefile b/lib_avr32/Makefile
index bb2938f..ebe237b 100644
--- a/lib_avr32/Makefile
+++ b/lib_avr32/Makefile
@@ -29,7 +29,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  = memset.o
 
-COBJS  = board.o interrupts.o avr32_linux.o
+COBJS  = board.o interrupts.o bootm.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_avr32/avr32_linux.c b/lib_avr32/bootm.c
similarity index 100%
rename from lib_avr32/avr32_linux.c
rename to lib_avr32/bootm.c
diff --git a/lib_blackfin/Makefile b/lib_blackfin/Makefile
index a7aaef7..ac3fb28 100644
--- a/lib_blackfin/Makefile
+++ b/lib_blackfin/Makefile
@@ -31,7 +31,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  = memcpy.o memcmp.o memset.o memmove.o
 
-COBJS  = post.o tests.o board.o bf533_linux.o bf533_string.o cache.o muldi3.o
+COBJS  = post.o tests.o board.o bootm.o bf533_string.o cache.o muldi3.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_blackfin/bf533_linux.c b/lib_blackfin/bootm.c
similarity index 100%
rename from lib_blackfin/bf533_linux.c
rename to lib_blackfin/bootm.c
diff --git a/lib_i386/Makefile b/lib_i386/Makefile
index e344da5..ef0ba54 100644
--- a/lib_i386/Makefile
+++ b/lib_i386/Makefile
@@ -27,7 +27,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  = bios.o bios_pci.o realmode_switch.o
 
-COBJS  = board.o bios_setup.o i386_linux.o zimage.o realmode.o \
+COBJS  = board.o bios_setup.o bootm.o zimage.o realmode.o \
  pci_type1.o pci.o video_bios.o video.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/lib_i386/i386_linux.c b/lib_i386/bootm.c
similarity index 100%
rename from lib_i386/i386_linux.c
rename to lib_i386/bootm.c
diff --git a/lib_m68k/Makefile b/lib_m68k/Makefile
index 03784fd..d515223 100644
--- a/lib_m68k/Makefile
+++ b/lib_m68k/Makefile
@@ -27,7 +27,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  =
 
-COBJS  = cache.o traps.o time.o interrupts.o board.o m68k_linux.o
+COBJS  = cache.o traps.o time.o interrupts.o board.o bootm.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_m68k/m68k_linux.c b/lib_m68k/bootm.c
similarity index 100%
rename from lib_m68k/m68k_linux.c
rename to lib_m68k/bootm.c
diff --git a/lib_microblaze/Makefile b/lib_microblaze/Makefile
index 82b7bea..9b317a2 100644
--- a/lib_microblaze/Makefile
+++ b/lib_microblaze/Makefile
@@ -27,7 +27,7 @@ LIB   = $(obj)lib$(ARCH).a
 
 SOBJS  =
 
-COBJS  = board.o microblaze_linux.o time.o cache.o
+COBJS  = board.o bootm.o time.o cache.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/lib_microblaze/microblaze_linux.c b/lib_microblaze/bootm.c
similarity index 100%
rename from lib_microblaze/microblaze_linux.c
rename to lib_microblaze/bootm.c
diff --git a/lib_mips

[U-Boot-Users] [PATCH 3/6] [new uImage] Remove OF_FLAT_TREE support from PPC bootm code

2008-01-23 Thread Marian Balakowicz
Support for OF_FLAT_TREE is to be obsoleted in the near future,
remove related code from the bootm routines.

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/cmd_bootm.c |   10 +---
 lib_ppc/bootm.c|   65 +---
 2 files changed, 7 insertions(+), 68 deletions(-)


diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index f441e0e..3390be7 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -36,14 +36,6 @@
 #include environment.h
 #include asm/byteorder.h
 
-#if defined(CONFIG_OF_LIBFDT)
-#include fdt.h
-#include libfdt.h
-#include fdt_support.h
-#elif defined(CONFIG_OF_FLAT_TREE)
-#include ft_build.h
-#endif
-
 #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
 #include rtc.h
 #endif
@@ -390,7 +382,7 @@ U_BOOT_CMD(
[addr [arg ...]]\n- boot application image stored in memory\n
\tpassing arguments 'arg ...'; when booting a Linux kernel,\n
\t'arg' can be the address of an initrd image\n
-#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
+#if defined(CONFIG_OF_LIBFDT)
\tWhen booting a Linux kernel which requires a flat device-tree\n
\ta third argument is required which is the address of the\n
\tdevice-tree blob. To boot that kernel without an initrd image,\n
diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index 3911687..16b2f38 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -39,8 +39,6 @@
 #include fdt.h
 #include libfdt.h
 #include fdt_support.h
-#elif defined(CONFIG_OF_FLAT_TREE)
-#include ft_build.h
 #endif
 
 #ifdef CONFIG_LOGBUFFER
@@ -79,7 +77,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag,
bd_t*kbd;
void(*kernel)(bd_t *, ulong, ulong, ulong, ulong);
 
-#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
+#if defined(CONFIG_OF_LIBFDT)
image_header_t *fdt_hdr;
char*of_flat_tree = NULL;
ulong   of_data = 0;
@@ -175,7 +173,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag,
 * Check if there is an initrd image
 */
 
-#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
+#if defined(CONFIG_OF_LIBFDT)
/* Look for a '-' which indicates to ignore the ramdisk argument */
if (argc = 3  strcmp(argv[2], -) ==  0) {
debug (Skipping initrd\n);
@@ -247,15 +245,12 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag,
rd_len = rd_data = 0;
}
 
-#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
+#if defined(CONFIG_OF_LIBFDT)
if(argc  3) {
of_flat_tree = (char *) simple_strtoul(argv[3], NULL, 16);
fdt_hdr = (image_header_t *)of_flat_tree;
-#if defined(CONFIG_OF_FLAT_TREE)
-   if (*((ulong *)(of_flat_tree)) == OF_DT_HEADER) {
-#elif defined(CONFIG_OF_LIBFDT)
+
if (fdt_check_header (of_flat_tree) == 0) {
-#endif
 #ifndef CFG_NO_FLASH
if (addr2info((ulong)of_flat_tree) != NULL)
of_data = (ulong)of_flat_tree;
@@ -303,11 +298,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag,
must RESET the board to recover.\n);
do_reset (cmdtp, flag, argc, argv);
}
-#if defined(CONFIG_OF_FLAT_TREE)
-   if (*((ulong *)(of_flat_tree + image_get_header_size 
())) != OF_DT_HEADER) {
-#elif defined(CONFIG_OF_LIBFDT)
if (fdt_check_header (of_flat_tree + 
image_get_header_size ()) != 0) {
-#endif
puts (ERROR: uImage data is not a fdt - 
must RESET the board to recover.\n);
do_reset (cmdtp, flag, argc, argv);
@@ -339,21 +330,13 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag,
of_data = (ulong)of_flat_tree;
 #endif
 
-#if defined(CONFIG_OF_FLAT_TREE)
-   if (*((ulong *)(of_flat_tree)) != OF_DT_HEADER) {
-#elif defined(CONFIG_OF_LIBFDT)
if (fdt_check_header (of_flat_tree) != 0) {
-#endif
puts (ERROR: image is not a fdt - 
must RESET the board to recover.\n);
do_reset (cmdtp, flag, argc, argv);
}
 
-#if defined(CONFIG_OF_FLAT_TREE)
-   if (((struct boot_param_header 
*)of_flat_tree)-totalsize != fdt_len) {
-#elif defined(CONFIG_OF_LIBFDT)
if (be32_to_cpu (fdt_totalsize (of_flat_tree)) != 
fdt_len) {
-#endif
puts (ERROR: fdt size != image size - 
must RESET the board to recover.\n);
do_reset (cmdtp, flag, argc, argv);
@@ -480,43 +463,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag,
ft_board_setup(of_flat_tree, gd-bd);
 #endif

[U-Boot-Users] [PATCH 4/6] [new uImage] Remove standalone applications handling from boootm

2008-01-23 Thread Marian Balakowicz
Standalone applications are supposed to be run using the go command.
This patch removes standalone images handling from the do_bootm().

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/cmd_bootm.c |   26 +-
 1 files changed, 1 insertions(+), 25 deletions(-)


diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 3390be7..9fccb32 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -116,8 +116,7 @@ ulong load_addr = CFG_LOAD_ADDR;/* Default Load Address 
*/
 int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
ulong   iflag;
-   char*name, *s;
-   int (*appl)(int, char *[]);
+   char*name;
uintunc_len = CFG_BOOTM_LEN;
int verify = getenv_verify();
 
@@ -189,13 +188,6 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
show_boot_progress (5);
 
switch (image_get_type (hdr)) {
-   case IH_TYPE_STANDALONE:
-   name = Standalone Application;
-   /* A second argument overwrites the load address */
-   if (argc  2) {
-   image_set_load (hdr, simple_strtoul (argv[2], NULL, 
16));
-   }
-   break;
case IH_TYPE_KERNEL:
name = Kernel Image;
os_data = image_get_data (hdr);
@@ -299,22 +291,6 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
}
 
switch (image_get_type (hdr)) {
-   case IH_TYPE_STANDALONE:
-   if (iflag)
-   enable_interrupts();
-
-   /* load (and uncompress), but don't start if autostart
-* is set to no
-*/
-   if (((s = getenv(autostart)) != NULL)  (strcmp(s,no) == 
0)) {
-   char buf[32];
-   sprintf(buf, %lX, image_get_data_size(hdr));
-   setenv(filesize, buf);
-   return 0;
-   }
-   appl = (int (*)(int, char *[]))image_get_ep (hdr);
-   (*appl)(argc-1, argv[1]);
-   return 0;
case IH_TYPE_KERNEL:
case IH_TYPE_MULTI:
/* handled below */


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 5/6] [new uImage] Factor out common routines for getting os/arch/type/comp names

2008-01-23 Thread Marian Balakowicz
Move numeric-id to name translation for image os/arch/type/comp header
fields to a helper routines: image_get_os_name(), image_get_arch_name(),
image_get_type_name(), image_get_comp_name().

Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
---

 common/cmd_bootm.c |   77 +++
 common/image.c |   86 
 include/image.h|5 +++
 3 files changed, 103 insertions(+), 65 deletions(-)


diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 9fccb32..356c8b3 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -116,7 +116,7 @@ ulong load_addr = CFG_LOAD_ADDR;/* Default Load Address 
*/
 int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
ulong   iflag;
-   char*name;
+   const char  *type_name;
uintunc_len = CFG_BOOTM_LEN;
int verify = getenv_verify();
 
@@ -189,12 +189,10 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 
switch (image_get_type (hdr)) {
case IH_TYPE_KERNEL:
-   name = Kernel Image;
os_data = image_get_data (hdr);
os_len = image_get_data_size (hdr);
break;
case IH_TYPE_MULTI:
-   name = Multi-File Image;
image_multi_getimg (hdr, 0, os_data, os_len);
break;
default:
@@ -222,6 +220,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
dcache_disable();
 #endif
 
+   type_name = image_get_type_name (image_get_type (hdr));
+
image_start = (ulong)hdr;
image_end = image_get_image_end (hdr);
load_start = image_get_load (hdr);
@@ -230,9 +230,9 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
switch (image_get_comp (hdr)) {
case IH_COMP_NONE:
if (image_get_load (hdr) == img_addr) {
-   printf (   XIP %s ... , name);
+   printf (   XIP %s ... , type_name);
} else {
-   printf (   Loading %s ... , name);
+   printf (   Loading %s ... , type_name);
 
memmove_wd ((void *)image_get_load (hdr),
   (void *)os_data, os_len, CHUNKSZ);
@@ -242,7 +242,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
}
break;
case IH_COMP_GZIP:
-   printf (   Uncompressing %s ... , name);
+   printf (   Uncompressing %s ... , type_name);
if (gunzip ((void *)image_get_load (hdr), unc_len,
(uchar *)os_data, os_len) != 0) {
puts (GUNZIP ERROR - must RESET board to recover\n);
@@ -254,7 +254,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
break;
 #ifdef CONFIG_BZIP2
case IH_COMP_BZIP2:
-   printf (   Uncompressing %s ... , name);
+   printf (   Uncompressing %s ... , type_name);
/*
 * If we've got less than 4 MB of malloc() space,
 * use slower decompression algorithm which requires
@@ -556,65 +556,12 @@ void print_image_hdr (image_header_t *hdr)
 
 static void print_type (image_header_t *hdr)
 {
-   char *os, *arch, *type, *comp;
-
-   switch (image_get_os (hdr)) {
-   case IH_OS_INVALID: os = Invalid OS;  break;
-   case IH_OS_NETBSD:  os = NetBSD;  break;
-   case IH_OS_LINUX:   os = Linux;   break;
-   case IH_OS_VXWORKS: os = VxWorks; break;
-   case IH_OS_QNX: os = QNX; break;
-   case IH_OS_U_BOOT:  os = U-Boot;  break;
-   case IH_OS_RTEMS:   os = RTEMS;   break;
-#ifdef CONFIG_ARTOS
-   case IH_OS_ARTOS:   os = ARTOS;   break;
-#endif
-#ifdef CONFIG_LYNXKDI
-   case IH_OS_LYNXOS:  os = LynxOS;  break;
-#endif
-   default:os = Unknown OS;  break;
-   }
+   const char *os, *arch, *type, *comp;
 
-   switch (image_get_arch (hdr)) {
-   case IH_ARCH_INVALID:   arch = Invalid CPU;   break;
-   case IH_ARCH_ALPHA: arch = Alpha; break;
-   case IH_ARCH_ARM:   arch = ARM;   break;
-   case IH_ARCH_AVR32: arch = AVR32; break;
-   case IH_ARCH_BLACKFIN:  arch = Blackfin;  break;
-   case IH_ARCH_I386:  arch = Intel x86; break;
-   case IH_ARCH_IA64:  arch = IA64;  break;
-   case IH_ARCH_M68K:  arch = M68K;  break;
-   case IH_ARCH_MICROBLAZE:arch = Microblaze;break;
-   case

Re: [U-Boot-Users] [PATCH 11/13] [new uImage] Coding style cleanup - part 1

2008-01-15 Thread Marian Balakowicz
Wolfgang Denk wrote:
 In message [EMAIL PROTECTED] you wrote:
 common/cmd_autoscript.c
 common/cmd_bootm.c
 common/lynxkdi.c

 - sort and cleanup headers, declarations, etc.
 - group related routines
 - cleanup indentation, white spaces
 
 Be careful!
 
[snip]

 This is not a cleanup, this makes it (IMO) worse. Please undo.
 
[snip]
 
 Do you really think the new code is better or cleaner? It's just
 uglier.

Thanks for pointing this out, will fix this.

Cheers,
m.

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 03/13] [new uImage] Move PPC do_bootm_linux() to lib_ppc/ppc_linux.c

2008-01-15 Thread Marian Balakowicz
Wolfgang Denk wrote:
 In message [EMAIL PROTECTED] you wrote:
 PPC implementation of do_bootm_linux() routine is moved to
 a dedicated file lib_ppc/ppc_linux.c
 
 This is a bad name. bootm is more than just booting Linux images.
 
 The ARM port did this wrong, and many others copied  the  error.  Now
 let's  take  the  opportunity  and clean this up instead of making it
 worse.
 
 Please neame this lib_ppc/bootm.c or similar (ditto for the other
 architectures).

I see, naming seemed arbitrary, but I did not know the full story.

I'll rename all related files.

Cheers,
m.

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users