Re: [U-Boot] Cellphones U-Boot and GPL
On Thu, Oct 7, 2010 at 8:31 AM, Wolfgang Denk w...@denx.de wrote: In message 6b3ede875ca549879d5f776404c05...@snavari01 you wrote: I've recently bought an Acer cellphone powerd by Android. Now my question: U-Boot is released under GPLv2 license; is Acer obliged to give source code if requested (paying the appropriate fee for the physical transfer) ? Short and simple answer: yes, of course they are. The Linux kernel source code for the Acer Liquid phone is available for download under the Document tab of their Service Support Downloads page. If I recall correctly, U-Boot isn't a common bootloader for Android devices so that Acer team may not have realized U-Boot also needed to be released. -- Ken ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings
On Fri, Sep 11, 2009 at 11:30 AM, Jerry Van Baren gerald.vanba...@ge.comwrote: Scott Wood wrote: On Thu, Sep 10, 2009 at 08:23:27PM -0400, Jerry Van Baren wrote: fdt set /ether...@f00 interrupts this is a string can now handle multiple strings (words) by concatenating them with spaces (quoted strings still work the same as before because of hush's argument parsing) fdt set /ether...@f00 interrupts this is a string How do you set a string list, then? The original code did not support string lists and this patch does not address string lists. I'm more concerned with the [] form because that really is a syntax change. The original syntax with a single quoted argument will no longer be parsed if I understand the change (I need to apply the patch and confirm this): Old: fdt set /ether...@f00 interrupts [33 2 34 2 36 2] becomes fdt set /ether...@f00 interrupts [ 33 2 34 2 36 2 ] Note that the *must* be a space between [ and 33 and between 2 and ] because the [ and ] now have to be separate arguments. This is what Andy did with and with no public outcry, so it is probably OK. -- Does anybody have a problem with this syntax change? -- There is no change in syntax as far as I can tell, it should parse byte strings the same as one argument with spaces or as multiple arguments. There remains a side effect (bug?) that if the the '[' and the next value are separate arguments, a 0x00 gets inserted into the data. The original code either didn't parse the complete byte list (incrementing stridx early) or hung in an endless loop. This patch fixes that case. The fix on strings is that in the original code if there were multiple arguments then only the last argument was stored, at least now it stores multiple arguments (collapsing inter-argument space, if any). I don't have Hush enabled right now and the non-Hush quoting rules are still a little fuzzy for me right now. The 'fdt set' wasn't working at all for me without this patch. -- Ken ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] cmd_fdt.c: fix parse of byte streams and strings
Commit 4abd844d8e extended the fdt command parser to handle property strings which are split across multiple arguments but it was broken for byte streams and strings. Byte stream parsing: * Fixes where it would terminate early or go into an endless loop. * Fixes a 0x00 being inserted into the data if there is a space after '[' or a separate argument. * Fixes dereferencing the argument pointer after the last argument. * Checks for bad characters. String parsing: * Treat multiple arguments as a string list. This fixes an issue where only the last argument was stored. Signed-off-by: Ken MacLeod k...@bitsko.slc.ut.us --- The previous version of this patch 1) only fixed the first byte stream issue above and 2) concatenated the string arguments rather than creating a list (pointed out by Scott Wood). common/cmd_fdt.c | 23 +++ 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 8683772..919a0bf 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -574,14 +574,18 @@ static int fdt_parse_prop(char **newval, int count, char *data, int *len) * Byte stream. Convert the values. */ newp++; - while ((*newp != ']') (stridx count)) { - tmp = simple_strtoul(newp, newp, 16); - *data++ = tmp 0xFF; - *len= *len + 1; + while ((stridx count) (*newp != ']')) { while (*newp == ' ') newp++; - if (*newp != '\0') + if (*newp == '\0') { newp = newval[++stridx]; + continue; + } + if (!isxdigit(*newp)) + break; + tmp = simple_strtoul(newp, newp, 16); + *data++ = tmp 0xFF; + *len= *len + 1; } if (*newp != ']') { printf(Unexpected character '%c'\n, *newp); @@ -589,12 +593,15 @@ static int fdt_parse_prop(char **newval, int count, char *data, int *len) } } else { /* -* Assume it is a string. Copy it into our data area for -* convenience (including the terminating '\0'). +* Assume it is one or more strings. Copy it into our +* data area for convenience (including the +* terminating '\0's). */ while (stridx count) { - *len = strlen(newp) + 1; + size_t length = strlen(newp) + 1; strcpy(data, newp); + data += length; + *len += length; newp = newval[++stridx]; } } -- 1.5.4.7 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings
Commit 4abd844d8e extended the fdt command parser to handle property strings which are split across multiple arguments but it was broken for byte streams and strings. This patch fixes those. Signed-off-by: Ken MacLeod k...@bitsko.slc.ut.us --- common/cmd_fdt.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 8683772..f0a8f0e 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -580,7 +580,7 @@ static int fdt_parse_prop(char **newval, int count, char *data, int *len) *len= *len + 1; while (*newp == ' ') newp++; - if (*newp != '\0') + if (*newp == '\0') newp = newval[++stridx]; } if (*newp != ']') { @@ -593,10 +593,17 @@ static int fdt_parse_prop(char **newval, int count, char *data, int *len) * convenience (including the terminating '\0'). */ while (stridx count) { - *len = strlen(newp) + 1; + size_t length = strlen(newp); strcpy(data, newp); + data += length; + *len += length; newp = newval[++stridx]; + if (stridx count) { + *data++ = ' '; + *len += 1; + } } + *len += 1; } return 0; } -- 1.5.4.7 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot