Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] fis: sort output of fis list
@ 2010-05-12 18:17 H Hartley Sweeten
  2012-02-02 11:45 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: H Hartley Sweeten @ 2010-05-12 18:17 UTC (permalink / raw)
  To: buildroot

This sorts the output of 'fis list' using the flash_base address
similar to the output from RedBoot.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

---

diff --git a/package/fis/fis-004-sorted_list.patch b/package/fis/fis-004-sorted_list.patch
new file mode 100644
index 0000000..6854977
--- /dev/null
+++ b/package/fis/fis-004-sorted_list.patch
@@ -0,0 +1,30 @@
+--- fis.orig/fis.c	2010-05-12 11:09:22.000000000 -0700
++++ fis/fis.c	2010-05-12 11:05:45.000000000 -0700
+@@ -401,9 +401,24 @@
+   dir_t dir;
+   load_dir(fd,offset,&size,swap_endianness,&dir);
+   fprintf(stdout,"Name              FLASH addr  Mem addr    Length      Entry point Checksum\n");
+-  FOR_EACH_DIR_ENTRY(dir,i) {
+-    dump_desc(stdout,get(i));
+-  }
++  uint32_t last_addr = 0;
++  bool image_found;
++  do {
++    uint32_t lowest_addr = 0xffffffff;
++    iter_t index;
++    image_found = false;
++    FOR_EACH_DIR_ENTRY(dir,i) {
++      const struct fis_image_desc *d = get(i);
++      if ((d->flash_base >= last_addr) && (d->flash_base < lowest_addr)) {
++        lowest_addr = d->flash_base;
++        image_found = true;
++        index = i;
++      }
++    }
++    if (image_found)
++      dump_desc(stdout,get(index));
++    last_addr = lowest_addr + 1;
++  } while (image_found == true);
+ }
+ 
+ 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] fis: sort output of fis list
  2010-05-12 18:17 [Buildroot] [PATCH] fis: sort output of fis list H Hartley Sweeten
@ 2012-02-02 11:45 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2012-02-02 11:45 UTC (permalink / raw)
  To: buildroot

>>>>> "H" == H Hartley Sweeten <hartleys@visionengravers.com> writes:

 H> This sorts the output of 'fis list' using the flash_base address
 H> similar to the output from RedBoot.

 H> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-02 11:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12 18:17 [Buildroot] [PATCH] fis: sort output of fis list H Hartley Sweeten
2012-02-02 11:45 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox