* [PATCH v4 0/19] Allow images to work on sandbox
@ 2013-05-07 16:11 Simon Glass
[not found] ` <1367943123-16013-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-05-15 12:48 ` Tom Rini
0 siblings, 2 replies; 6+ messages in thread
From: Simon Glass @ 2013-05-07 16:11 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: u-boot-review-hpIqsD4AKlfQT0dZR+AlfA, Joe Hershberger,
Marek Vasut, Tom Rini, Devicetree Discuss
This series adjusts the image code to work with sandbox and prepares it for
verified boot to come later.
The primary goal here is to get image loading to work on sandbox, which is
mostly a set of fairly minor changes such as using map_sysmem() instead of
just a cast when converting from a U-Boot address to a pointer. Since
common/image.c runs to over 3000 lines and half of it is FIT-related code
behind an #ifdef, this code is moved into a new image-fit.c file.
Changes in v4:
- Bring in upstream version of fdt_first/next_subnode()
- Use new upstream fdt_first/next_subnode()
Changes in v3:
- Split out image improvements into a separate series
- Update notes to note that generic board support has now landed
Changes in v2:
- Add IMAGE_ENABLE_IGNORE to avoid #ifdef around ignore property handling
- Change hash_block() to use an unsigned int len
- Clarify use of output_size parameter to hash_block()
- Fix checkpatch checks about parenthesis alignment
- Fix line continuation problem
- Put err_msgp strings on a single line
- Put params before description in fit_conf_get_prop_node() comment
- Rebase on previous patches
- Rename commit message to say "function" instead of "function"
Simon Glass (19):
env: Fix minor comment typos in cmd_nvedit
Add minor updates to README.fdt-control
hash: Add a way to calculate a hash for any algortihm
bootstage: Don't build for HOSTCC
mkimage: Move ARRAY_SIZE to header file
libfdt: Add fdt_next_subnode() to permit easy subnode iteration
image: Move timestamp #ifdefs to header file
image: Export fit_check_ramdisk()
image: Split FIT code into new image-fit.c
image: Move HOSTCC image code to tools/
image: Split hash node processing into its own function
image: Convert fit_image_hash_set_value() to static, and rename
image: Rename fit_image_check_hashes() to fit_image_verify()
image: Move hash checking into its own function
image: Move error! string to common place
image: Export fit_conf_get_prop_node()
image: Rename fit_add_hashes() to fit_add_verification_data()
image: Rename hash printing to fit_image_print_verification_data()
sandbox: image: Add support for booting images in sandbox
common/Makefile | 1 +
common/cmd_bootm.c | 25 +-
common/cmd_fpga.c | 2 +-
common/cmd_nvedit.c | 4 +-
common/cmd_source.c | 2 +-
common/cmd_ximg.c | 2 +-
common/hash.c | 23 +
common/image-fit.c | 1495 ++++++++++++++++++++++++++++++++++++++++++
common/image.c | 1679 ++----------------------------------------------
common/update.c | 2 +-
doc/README.fdt-control | 9 +-
include/bootstage.h | 5 +-
include/hash.h | 22 +
include/image.h | 55 +-
include/libfdt.h | 22 +
lib/libfdt/fdt.c | 28 +
tools/Makefile | 4 +
tools/aisimage.c | 1 -
tools/fit_image.c | 2 +-
tools/image-host.c | 208 ++++++
tools/mkimage.h | 2 +
21 files changed, 1917 insertions(+), 1676 deletions(-)
create mode 100644 common/image-fit.c
create mode 100644 tools/image-host.c
--
1.8.2.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v4 06/19] libfdt: Add fdt_next_subnode() to permit easy subnode iteration
[not found] ` <1367943123-16013-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2013-05-07 16:11 ` Simon Glass
[not found] ` <1367943123-16013-7-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-05-09 19:36 ` [U-Boot] [PATCH v4 0/19] Allow images to work on sandbox Tom Rini
1 sibling, 1 reply; 6+ messages in thread
From: Simon Glass @ 2013-05-07 16:11 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Rini, u-boot-review-hpIqsD4AKlfQT0dZR+AlfA,
Devicetree Discuss
Iterating through subnodes with libfdt is a little painful to write as we
need something like this:
for (depth = 0, count = 0,
offset = fdt_next_node(fdt, parent_offset, &depth);
(offset >= 0) && (depth > 0);
offset = fdt_next_node(fdt, offset, &depth)) {
if (depth == 1) {
/* code body */
}
}
Using fdt_next_subnode() we can instead write this, which is shorter and
easier to get right:
for (offset = fdt_first_subnode(fdt, parent_offset);
offset >= 0;
offset = fdt_next_subnode(fdt, offset)) {
/* code body */
}
Also, it doesn't require two levels of indentation for the loop body.
Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
(Cherry-picked from dtc commit 4e76ec79)
---
Changes in v4:
- Bring in upstream version of fdt_first/next_subnode()
Changes in v3: None
Changes in v2: None
include/libfdt.h | 22 ++++++++++++++++++++++
lib/libfdt/fdt.c | 28 ++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
diff --git a/include/libfdt.h b/include/libfdt.h
index fc7f75b..3721a90 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -136,6 +136,28 @@ uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
int fdt_next_node(const void *fdt, int offset, int *depth);
+/**
+ * fdt_first_subnode() - get offset of first direct subnode
+ *
+ * @fdt: FDT blob
+ * @offset: Offset of node to check
+ * @return offset of first subnode, or -FDT_ERR_NOTFOUND if there is none
+ */
+int fdt_first_subnode(const void *fdt, int offset);
+
+/**
+ * fdt_next_subnode() - get offset of next direct subnode
+ *
+ * After first calling fdt_first_subnode(), call this function repeatedly to
+ * get direct subnodes of a parent node.
+ *
+ * @fdt: FDT blob
+ * @offset: Offset of previous subnode
+ * @return offset of next subnode, or -FDT_ERR_NOTFOUND if there are no more
+ * subnodes
+ */
+int fdt_next_subnode(const void *fdt, int offset);
+
/**********************************************************************/
/* General functions */
/**********************************************************************/
diff --git a/lib/libfdt/fdt.c b/lib/libfdt/fdt.c
index 387e354..154e9a4 100644
--- a/lib/libfdt/fdt.c
+++ b/lib/libfdt/fdt.c
@@ -202,6 +202,34 @@ int fdt_next_node(const void *fdt, int offset, int *depth)
return offset;
}
+int fdt_first_subnode(const void *fdt, int offset)
+{
+ int depth = 0;
+
+ offset = fdt_next_node(fdt, offset, &depth);
+ if (offset < 0 || depth != 1)
+ return -FDT_ERR_NOTFOUND;
+
+ return offset;
+}
+
+int fdt_next_subnode(const void *fdt, int offset)
+{
+ int depth = 1;
+
+ /*
+ * With respect to the parent, the depth of the next subnode will be
+ * the same as the last.
+ */
+ do {
+ offset = fdt_next_node(fdt, offset, &depth);
+ if (offset < 0 || depth < 1)
+ return -FDT_ERR_NOTFOUND;
+ } while (depth > 1);
+
+ return offset;
+}
+
const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
{
int len = strlen(s) + 1;
--
1.8.2.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [U-Boot] [PATCH v4 06/19] libfdt: Add fdt_next_subnode() to permit easy subnode iteration
[not found] ` <1367943123-16013-7-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2013-05-07 21:48 ` Jerry Van Baren
0 siblings, 0 replies; 6+ messages in thread
From: Jerry Van Baren @ 2013-05-07 21:48 UTC (permalink / raw)
To: Simon Glass
Cc: Tom Rini, U-Boot Mailing List, Devicetree Discuss,
u-boot-review-hpIqsD4AKlfQT0dZR+AlfA
Hi Simon,
On 05/07/2013 12:11 PM, Simon Glass wrote:
> Iterating through subnodes with libfdt is a little painful to write as we
> need something like this:
[snip]
> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> (Cherry-picked from dtc commit 4e76ec79)
Acked-by: Gerald Van Baren <vanbaren-He//nVnquyzQT0dZR+AlfA@public.gmane.org>
Unless I hear otherwise, I'll drop this patch from my u-boot-fdt repo
and let you (Tom?) apply it with the "sandbox" patch series since that
is where it came from and where it logically belongs.
> ---
> Changes in v4:
> - Bring in upstream version of fdt_first/next_subnode()
>
> Changes in v3: None
> Changes in v2: None
>
> include/libfdt.h | 22 ++++++++++++++++++++++
> lib/libfdt/fdt.c | 28 ++++++++++++++++++++++++++++
> 2 files changed, 50 insertions(+)
Thanks,
gvb
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [U-Boot] [PATCH v4 0/19] Allow images to work on sandbox
[not found] ` <1367943123-16013-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-05-07 16:11 ` [PATCH v4 06/19] libfdt: Add fdt_next_subnode() to permit easy subnode iteration Simon Glass
@ 2013-05-09 19:36 ` Tom Rini
2013-05-10 0:17 ` Simon Glass
1 sibling, 1 reply; 6+ messages in thread
From: Tom Rini @ 2013-05-09 19:36 UTC (permalink / raw)
To: Simon Glass
Cc: U-Boot Mailing List, Devicetree Discuss,
u-boot-review-hpIqsD4AKlfQT0dZR+AlfA, Joe Hershberger
[-- Attachment #1.1: Type: text/plain, Size: 791 bytes --]
On Tue, May 07, 2013 at 09:11:44AM -0700, Simon Glass wrote:
> This series adjusts the image code to work with sandbox and prepares it for
> verified boot to come later.
>
> The primary goal here is to get image loading to work on sandbox, which is
> mostly a set of fairly minor changes such as using map_sysmem() instead of
> just a cast when converting from a U-Boot address to a pointer. Since
> common/image.c runs to over 3000 lines and half of it is FIT-related code
> behind an #ifdef, this code is moved into a new image-fit.c file.
>
> Changes in v4:
> - Bring in upstream version of fdt_first/next_subnode()
> - Use new upstream fdt_first/next_subnode()
Everything looks fine to me, barring further comments I'll pick this up
around next Tuesday.
--
Tom
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 192 bytes --]
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [U-Boot] [PATCH v4 0/19] Allow images to work on sandbox
2013-05-09 19:36 ` [U-Boot] [PATCH v4 0/19] Allow images to work on sandbox Tom Rini
@ 2013-05-10 0:17 ` Simon Glass
0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2013-05-10 0:17 UTC (permalink / raw)
To: Tom Rini
Cc: U-Boot Mailing List, Devicetree Discuss, u-boot-review,
Joe Hershberger
Hi Tom,
On Thu, May 9, 2013 at 12:36 PM, Tom Rini <trini-l0cyMroinI0@public.gmane.org> wrote:
> On Tue, May 07, 2013 at 09:11:44AM -0700, Simon Glass wrote:
>
>> This series adjusts the image code to work with sandbox and prepares it for
>> verified boot to come later.
>>
>> The primary goal here is to get image loading to work on sandbox, which is
>> mostly a set of fairly minor changes such as using map_sysmem() instead of
>> just a cast when converting from a U-Boot address to a pointer. Since
>> common/image.c runs to over 3000 lines and half of it is FIT-related code
>> behind an #ifdef, this code is moved into a new image-fit.c file.
>>
>> Changes in v4:
>> - Bring in upstream version of fdt_first/next_subnode()
>> - Use new upstream fdt_first/next_subnode()
>
> Everything looks fine to me, barring further comments I'll pick this up
> around next Tuesday.
Thanks, The next series to hopefully improve image support is queued
up, and I will get the final one done also.
Regards,
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v4 0/19] Allow images to work on sandbox
2013-05-07 16:11 [PATCH v4 0/19] Allow images to work on sandbox Simon Glass
[not found] ` <1367943123-16013-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2013-05-15 12:48 ` Tom Rini
1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2013-05-15 12:48 UTC (permalink / raw)
To: Simon Glass
Cc: U-Boot Mailing List, Devicetree Discuss, u-boot-review,
Joe Hershberger
[-- Attachment #1.1: Type: text/plain, Size: 731 bytes --]
On Tue, May 07, 2013 at 09:11:44AM -0700, Simon Glass wrote:
> This series adjusts the image code to work with sandbox and prepares it for
> verified boot to come later.
>
> The primary goal here is to get image loading to work on sandbox, which is
> mostly a set of fairly minor changes such as using map_sysmem() instead of
> just a cast when converting from a U-Boot address to a pointer. Since
> common/image.c runs to over 3000 lines and half of it is FIT-related code
> behind an #ifdef, this code is moved into a new image-fit.c file.
>
> Changes in v4:
> - Bring in upstream version of fdt_first/next_subnode()
> - Use new upstream fdt_first/next_subnode()
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 134 bytes --]
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-05-15 12:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-07 16:11 [PATCH v4 0/19] Allow images to work on sandbox Simon Glass
[not found] ` <1367943123-16013-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-05-07 16:11 ` [PATCH v4 06/19] libfdt: Add fdt_next_subnode() to permit easy subnode iteration Simon Glass
[not found] ` <1367943123-16013-7-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-05-07 21:48 ` [U-Boot] " Jerry Van Baren
2013-05-09 19:36 ` [U-Boot] [PATCH v4 0/19] Allow images to work on sandbox Tom Rini
2013-05-10 0:17 ` Simon Glass
2013-05-15 12:48 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).