FIT support: node syntax

2016-01-06 Thread Yegor Yefremov
Hi Marc, I've looked at U-Boot source code to get the idea, how to pass configuration id. See this definition: kernel@1 { description = "Vanilla Linux kernel"; data = /incbin/("zImage"); type = "kernel"; arch = "arm"; os = "linux"; compression = "none"; load = <0x8020>; entry = <0x8020>;

Re: [PATCH 1/3] crypto: add enum

2016-01-06 Thread Marc Kleine-Budde
On 01/05/2016 05:54 PM, Sam Ravnborg wrote: > On Tue, Jan 05, 2016 at 09:11:01AM +0100, Marc Kleine-Budde wrote: >> From: Sascha Hauer >> >> Signed-off-by: Sascha Hauer >> Signed-off-by: Marc Kleine-Budde > > The subject and the patch description could use some > more love and care. Good idea.

Re: [PATCH 3/3] bootm: add initial FIT support

2016-01-06 Thread Marc Kleine-Budde
On 01/05/2016 09:28 PM, Trent Piepho wrote: Thanks for the review. Comments inline. > On Tue, 2016-01-05 at 09:11 +0100, Marc Kleine-Budde wrote: >> +static int do_bootm_arm_fit(struct image_data *data) >> +{ >> +struct fit_handle *handle; >> +int ret; >> +unsigned long mem_free; >> +

Re: [PATCH 1/3] crypto: add enum

2016-01-06 Thread Sam Ravnborg
> >> > >> +struct digest *digest_alloc_by_algo(enum hash_algo hash_algo) > >> +{ > >> + struct digest *d; > >> + struct digest_algo *algo; > >> + > >> + algo = digest_algo_get_by_algo(hash_algo); > >> + if (!algo) > >> + return NULL; > >> + > >> + d = xzalloc(sizeof(*d)); > >> + d-

[PATCH v2 1/3] crypto: add digest_alloc_by_algo()

2016-01-06 Thread Marc Kleine-Budde
From: Sascha Hauer In barebox the function digest_alloc() allocates a digest based on a string. When a subsystem already uses an integer value to identify a digest it makes no sense to create a string and pass it to digest_alloc(), where it is parsed again. This patch adds the possibility to get

[PATCH v2 0/3] FIT Support

2016-01-06 Thread Marc Kleine-Budde
Hello, taking over Jan's work. This is the current state of the FIT support patches, which are used in production on a custom mx6 board. The FIT loading code has basically been rewritten from scratch, as the original U-Boot code uses libfdt and barebox's DT support works on an in-memory tree. The

[PATCH v2 3/3] bootm: add initial FIT support

2016-01-06 Thread Marc Kleine-Budde
From: Jan Luebbe This implementation is inspired by U-Boot's FIT support. Instead of using libfdt (which does not exist in barebox), configuration signatures are verified by using a simplified DT parser based on barebox's own code. Currently, only signed configurations with hashed images are sup

[PATCH v2 2/3] crypto: add RSA support

2016-01-06 Thread Marc Kleine-Budde
From: Sascha Hauer Signed-off-by: Sascha Hauer Signed-off-by: Marc Kleine-Budde --- crypto/Kconfig | 3 + crypto/Makefile | 1 + crypto/rsa.c| 420 include/asm-generic/errno.h | 5 + include/rsa.h

[PATCH 5/6] common/date.c: Fix off-by-one error

2016-01-06 Thread Andrey Smirnov
As per http://pubs.opengroup.org/onlinepubs/007908775/xsh/time.h.html 'tm_wday' is zero indexed with zero representing Sunday, this is also corroborated by the code in rtc_time_to_tm() which used 4 to represent Thursday. Signed-off-by: Andrey Smirnov --- common/date.c | 4 ++-- 1 file changed, 2

[PATCH 6/6] commands/hwclock: Check return value of rtc_read_time()

2016-01-06 Thread Andrey Smirnov
It is possible for rtc_read_time() to fill struct rtc_time it returns with invalid values, so we have to check for its return value before using returned time. Signed-off-by: Andrey Smirnov --- commands/hwclock.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/commands

[PATCH 2/6] rtc: ds1307: Fix a memory leak

2016-01-06 Thread Andrey Smirnov
Several failure paths would result in control being transfered to 'exit' label, so instead of just returning error codes in those cases we also need to free the memory allocated for 'ds1307' Signed-off-by: Andrey Smirnov --- drivers/rtc/rtc-ds1307.c | 3 +++ 1 file changed, 3 insertions(+) diff

Re: [PATCH 1/6] rtc: ds1307: Add code to support ds1337/1341

2016-01-06 Thread Antony Pavlov
On Wed, 6 Jan 2016 22:17:30 -0800 Andrey Smirnov wrote: > Port DS1337 specific bits from corresponding Linux driver and add > small changes needed for DS1341. > > Signed-off-by: Andrey Smirnov > --- > drivers/rtc/rtc-ds1307.c | 91 > > 1 file

Re: [PATCH 3/6] rtc-lib: Check tm_wday for validity in rtc_valid_tm()

2016-01-06 Thread Antony Pavlov
On Wed, 6 Jan 2016 22:17:32 -0800 Andrey Smirnov wrote: > RTC drivers rely on rtc_valid_tm() in order to make sure that no bogus > values from uninitialized HW registers get passed to the uppper layers. > > A somewhat contrived way to reproduce this problem with DS1307 RTC > would be to do the

Re: [PATCH 1/2] of: Add for_each_compatible_node_from iterator

2016-01-06 Thread Sascha Hauer
On Tue, Jan 05, 2016 at 06:58:01PM +, Trent Piepho wrote: > On Tue, 2016-01-05 at 08:58 +0100, Sascha Hauer wrote: > > On Mon, Jan 04, 2016 at 07:07:27PM +, Trent Piepho wrote: > > > Couldn't one also use the of fixup system to modify the barebox DT? In > > > order to support multiple boa

Re: [PATCH 5/6] common/date.c: Fix off-by-one error

2016-01-06 Thread Sascha Hauer
On Wed, Jan 06, 2016 at 10:17:34PM -0800, Andrey Smirnov wrote: > As per http://pubs.opengroup.org/onlinepubs/007908775/xsh/time.h.html > 'tm_wday' is zero indexed with zero representing Sunday, this is also > corroborated by the code in rtc_time_to_tm() which used 4 to represent > Thursday. > > S