[PATCH v4 03/11] rtc: fall back to ->{read, write} if ->{read, write}8 are not provided

2020-07-06 Thread Rasmus Villemoes
driver that provides ->read() would most likely just duplicate the logic here for implementing a ->read8() method in term of its ->read() method. The same remarks of course apply to the write case. Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Signed-off-by: Rasmus Villemoes ---

Re: [RFC PATCH 1/4] common/image.c: image_decomp: put IH_COMP_XXX cases inside ifndef USE_HOSTCC

2020-06-17 Thread Rasmus Villemoes
On 17/06/2020 05.11, Simon Glass wrote: > Hi Rasmus, > > On Fri, 12 Jun 2020 at 05:02, Rasmus Villemoes > wrote: >> >> When building host tools, the CONFIG_GZIP etc. symbols are not defined >> anyway, so this does not (should not) change anything [1]. However, >

Re: [PATCH] [RFC] tools: fitmount: fuse mount fit images

2020-06-24 Thread Rasmus Villemoes
On 24/06/2020 04.50, selvamuthukumar v wrote: > On Tue, Jun 23, 2020 at 11:47 PM Tom Rini wrote: >> >> For getting FIT image contents, the existing dumpimage tool handles >> this. >> > dumpimage extracts image contents into new files. Current firmware > upgrade process in our product is: > > 1.

Re: [PATCH] image: Add support for ZSTD decompression

2020-06-10 Thread Rasmus Villemoes
On 08/06/2020 21.01, Robert Marko wrote: > On Wed, May 20, 2020 at 2:35 PM Tom Rini wrote: >> >> On Wed, May 20, 2020 at 01:38:01PM +0200, Robert Marko wrote: >> >>> Tom, >>> I have tried various things but CONFIG_IS_ENABLED won't work inside of >>> switch case. >>> It works fine outside of if

Re: [RFC PATCH] watchdog: base rate-limiting on get_ticks() rather than get_timer()

2020-06-05 Thread Rasmus Villemoes
On 05/06/2020 16.34, Tom Rini wrote: > On Fri, Jun 05, 2020 at 04:23:21PM +0200, Stefan Roese wrote: >> On 05.06.20 16:18, Rasmus Villemoes wrote: >>> On 05/06/2020 15.37, Stefan Roese wrote: >>>> Could you please run a build test with this patch applied for

[PATCH v2] lz4: fix decompressor on big-endian powerpc

2020-06-07 Thread Rasmus Villemoes
cessors to what is most likely unaligned. Also update the comment to make it clear that it only refers to the lz4.c file, not the following code of lz4_wrapper.c. This has been tested partly, of course, by seeing that my lz4-compressed kernel now boots, partly by running the (de)compression test-

Re: [PATCH] lz4: fix decompressor on big-endian powerpc

2020-06-07 Thread Rasmus Villemoes
On 05/06/2020 22.37, Julius Werner wrote: >> I'm a bit puzzled about the github.com/Cyan4973/lz4 >> reference. Cyan4973 is Yann Collet, the author of lz4, and nowadays at >> least that github url redirects to the upstream repo, >> github.com/lz4/lz4. Grepping through all available tags and

[RFC PATCH] allow choosing -Os/-O2 separately for SPL and TPL

2020-06-05 Thread Rasmus Villemoes
-by: Rasmus Villemoes --- Kconfig | 20 Makefile | 6 -- config.mk | 6 ++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Kconfig b/Kconfig index f698e0a94f..0468bd0089 100644 --- a/Kconfig +++ b/Kconfig @@ -66,6 +66,26 @@ config CC_OPTIMIZE_FOR_SIZE

[PATCH] lz4: fix decompressor on big-endian powerpc

2020-06-05 Thread Rasmus Villemoes
n Number, only supported value */ } Do the same here, and while at it, be more careful to use unaligned accessors to what is most likely unaligned. This has been tested partly, of course, by seeing that my lz4-compressed kernel now boots, partly by runnin

Re: [RFC PATCH] watchdog: base rate-limiting on get_ticks() rather than get_timer()

2020-06-05 Thread Rasmus Villemoes
On 05/06/2020 13.48, Stefan Roese wrote: > On 05.06.20 13:16, Rasmus Villemoes wrote: >> This is what I had in mind. I also considered making it a config knob >> (possibly just auto-selected based on $ARCH) whether to use >> get_timer() or get_ticks(), but that becomes quite

[RFC PATCH] watchdog: base rate-limiting on get_ticks() rather than get_timer()

2020-06-05 Thread Rasmus Villemoes
are enabled. So this fixes the above problem for our board - but I don't know if get_ticks() can be assumed to always work. Signed-off-by: Rasmus Villemoes --- This is what I had in mind. I also considered making it a config knob (possibly just auto-selected based on $ARCH) whether to use get_timer

Re: [RFC PATCH] watchdog: base rate-limiting on get_ticks() rather than get_timer()

2020-06-05 Thread Rasmus Villemoes
On 05/06/2020 15.37, Stefan Roese wrote: > On 05.06.20 14:13, Stefan Roese wrote: >> On 05.06.20 14:11, Rasmus Villemoes wrote: >>> On 05/06/2020 13.48, Stefan Roese wrote: >>>> On 05.06.20 13:16, Rasmus Villemoes wrote: >>>>> This is what I had in mi

[RFC PATCH 3/4] linux/kconfig.h: remove unused helper macros

2020-06-12 Thread Rasmus Villemoes
of the CONFIG_IS_ENABLED extra logic, and deleting these makes the next patch much simpler, since I won't have to duplicate a lot of logic for no real gain (as there are no users). Signed-off-by: Rasmus Villemoes --- include/linux/kconfig.h | 40 +--- scripts

[RFC PATCH 4/4] linux/kconfig.h: create two- and three-argument versions of CONFIG_IS_ENABLED

2020-06-12 Thread Rasmus Villemoes
increase both readability and not least "git grep"ability. A third variant is also introduced, CONFIG_IS_ENABLED(FOO, (xxx), (yyy)) which corresponds to #if CONFIG_IS_ENABLED(FOO) xxx #else yyy #endif Signed-off-by: Rasmus Villemoes --- include/linux/kcon

[RFC PATCH 1/4] common/image.c: image_decomp: put IH_COMP_XXX cases inside ifndef USE_HOSTCC

2020-06-12 Thread Rasmus Villemoes
only included under !USE_HOSTCC, and removing the CONFIG_GZIP conditional hence both gives an "no declaration of gunzip" warning as well as breaks the link of the host tools, since the gunzip code is indeed not linked in. Signed-off-by: Rasmus Villemoes --- common/image.c | 2 ++ 1 file change

[RFC PATCH 0/4] CONFIG_IS_ENABLED magic

2020-06-12 Thread Rasmus Villemoes
of the source, others can disagree. Rasmus Villemoes (4): common/image.c: image_decomp: put IH_COMP_XXX cases inside ifndef USE_HOSTCC linux/kconfig.h: simplify logic for choosing CONFIG_{SPL_,TPL_,}* linux/kconfig.h: remove unused helper macros linux/kconfig.h: create two- and three

[RFC PATCH 2/4] linux/kconfig.h: simplify logic for choosing CONFIG_{SPL_, TPL_, }*

2020-06-12 Thread Rasmus Villemoes
up some of the ifdef HOSTCC mess in the sources shared between U-Boot and host tools.] Signed-off-by: Rasmus Villemoes --- include/linux/kconfig.h | 27 --- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h

Re: [PATCH v2 00/10] new rtc methods, rtc command, and tests

2020-06-02 Thread Rasmus Villemoes
On 02/06/2020 21.29, Simon Glass wrote: > Hi Rasmus, > > On Tue, 2 Jun 2020 at 12:40, Rasmus Villemoes > wrote: >> >> Urgh. The name rtc_read() is already used for a local helper by a number >> of rtc drivers (also rtc_write, for somewhat fewer drivers). So I can &g

Re: [PATCH 0/3] watchdog: honour hw_margin_ms property

2020-06-04 Thread Rasmus Villemoes
On 02/06/2020 17.38, Rasmus Villemoes wrote: > On 02/06/2020 16.53, Stefan Roese wrote: >> On 02.06.20 15:29, Rasmus Villemoes wrote: >>> On 16/03/2020 16.52, Rasmus Villemoes wrote: >>>> On 14/03/2020 13.04, Stefan Roese wrote: >>>>> On 13.03.20 17:04

[PATCH] powerpc: reduce number of WATCHDOG_RESET calls from flush_cache

2020-06-04 Thread Rasmus Villemoes
is also bounded by memory speed - so if 64K works for those cases, it should certainly also work when memory access is the only thing being done. Signed-off-by: Rasmus Villemoes --- arch/powerpc/lib/cache.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/powerpc

Re: [PATCH] string: Use memcpy() within memmove() when we can

2020-11-25 Thread Rasmus Villemoes
On 25/11/2020 12.26, Patrick Delaunay wrote: > A common use of memmove() can be handled by memcpy(). Also memcpy() > includes an optimization for large sizes: it copies a word at a time. So > we can get a speed-up by calling memcpy() to handle our move in this case. > > Update memmove() to call

[PATCH 2/5] fdtdec: introduce fdtdec_get_config_property

2020-11-10 Thread Rasmus Villemoes
Add a wrapper for retrieving a given property from the /config node as a (blob, length) pair. A later patch will need the length of the property and thus cannot just use fdtdec_get_config_string(). Rewrite that to use the new wrapper. Signed-off-by: Rasmus Villemoes --- include/fdtdec.h | 14

[PATCH 4/5] env: allow default environment to be amended from control dtb

2020-11-10 Thread Rasmus Villemoes
-enviroment property, whose value will be used to amend the default environment baked into the U-Boot binary itself. Signed-off-by: Rasmus Villemoes --- cmd/nvedit.c | 37 + env/Kconfig | 21 + env/common.c | 19 +++ 3 files changed

[PATCH 0/5] allow default environment to be amended from dtb

2020-11-10 Thread Rasmus Villemoes
or setting /config/bootdelay to 123, as the latter takes effect whether the environment is the default one or one loaded from storage.] It does not affect the case where an environment is loaded from a storage device, nor is there any change if the new CONFIG_ option is not selected. Rasmus Vi

[PATCH 1/5] fdtdec: make fdtdec_get_config_string() return const char*

2020-11-10 Thread Rasmus Villemoes
Nobody should modify the string returned by fdtdec_get_config_string(), so make it return a const pointer. Signed-off-by: Rasmus Villemoes --- arch/arm/mach-exynos/include/mach/mipi_dsim.h | 2 +- arch/arm/mach-rockchip/rk3188/rk3188.c| 2 +- board/dhelectronics/dh_stm32mp1/board.c

[PATCH 3/5] env: make env_set_default_vars() return void

2020-11-10 Thread Rasmus Villemoes
Unlike most other functions declared in env.h, the return value of this one also isn't documented. It only has a single caller, which ignores the return value. And the companion, env_set_default(), already has void as return type. Signed-off-by: Rasmus Villemoes --- env/common.c | 4

[PATCH 5/5] test: add tests for default environment

2020-11-10 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + include/configs/sandbox.h | 8 ++- test/env/Makefile | 1 + test/env/default.c | 102 5 files changed, 112 insertions(+), 1

Re: Antw: [EXT] [systemd-devel] [SPECIFICATION RFC] The firmware and bootloader log specification

2020-11-16 Thread Rasmus Villemoes
On 16/11/2020 08.02, Ulrich Windl wrote: Daniel Kiper schrieb am 14.11.2020 um 00:52 in > Nachricht <20201113235242.k6fzlwmwm2xqh...@tomti.i.net-space.pl>: > ... >> The members of struct bf_log_msg: >> ‑ size: total size of bf_log_msg struct, >> ‑ ts_nsec: timestamp expressed in

Re: RFC: Partition type GUID for U-Boot environment

2020-11-20 Thread Rasmus Villemoes
On 17/11/2020 19.27, Tom Rini wrote: > On Tue, Nov 17, 2020 at 11:05:36AM +0100, Rasmus Villemoes wrote: > >> Hi, >> >> Would it make sense to choose a canonical "Partition type GUID" [1] for >> partitions used to store a U-Boot environment? >>

Re: [PATCH 4/5] env: allow default environment to be amended from control dtb

2020-11-20 Thread Rasmus Villemoes
On 20/11/2020 11.13, Wolfgang Denk wrote: > Dear Rasmus, > > In message <76615995-6700-1b3e-b598-4913e9882...@prevas.dk> you wrote: >> >> Sure. So would you be ok with some /config/extra-environment node which >> gets appended after the normal environment has been loaded? Then if I > > In

[PATCH 2/3] doc/README.gpt: define partition type GUID for U-Boot environment

2020-11-20 Thread Rasmus Villemoes
d future type GUIDs be defined in the context of U-Boot, it's sensible to use that same namespace GUID. [1] https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs [2] https://en.wikipedia.org/wiki/Universally_unique_identifier#Versions_3_and_5_(namespace_name-based) [3] https://www.uuidtools

[PATCH 1/3] lib/uuid.c: change prototype of uuid_guid_get_str()

2020-11-20 Thread Rasmus Villemoes
in the header so that the compiler always sees a declaration and can thus do type-checking, whether or not PARTITION_TYPE_GUID is enabled or not. Signed-off-by: Rasmus Villemoes --- disk/part_efi.c | 9 + include/uuid.h | 4 +--- lib/uuid.c | 11 +-- 3 files changed, 11 insertions

[PATCH 3/3] doc/README.gpt: reflow partition type GUID table

2020-11-20 Thread Rasmus Villemoes
The previous patch made the table look bad. Fix it, and leave some space for a future element being a bit longer than the current maximum. Signed-off-by: Rasmus Villemoes --- doc/README.gpt | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git

[PATCH 0/3] add partition type GUID for U-Boot environment

2020-11-20 Thread Rasmus Villemoes
the value defined here. Rasmus Villemoes (3): lib/uuid.c: change prototype of uuid_guid_get_str() doc/README.gpt: define partition type GUID for U-Boot environment doc/README.gpt: reflow partition type GUID table disk/part_efi.c| 9 + doc/README.gp

RFC: Partition type GUID for U-Boot environment

2020-11-17 Thread Rasmus Villemoes
Hi, Would it make sense to choose a canonical "Partition type GUID" [1] for partitions used to store a U-Boot environment? The partition type is mostly informational, but I'm thinking it might make sense to have some canonical thing to put into an image definition rather than having the tool use

Re: [PATCH 4/5] env: allow default environment to be amended from control dtb

2020-11-17 Thread Rasmus Villemoes
On 17/11/2020 00.52, Simon Glass wrote: > Hi Rasmus, > > On Thu, 12 Nov 2020 at 12:59, Wolfgang Denk wrote: >> >> Dear Rasmus Villemoes, >> >> In message <20201110202603.20944-5-rasmus.villem...@prevas.dk> you wrote: >>> It can be useful to

Re: RFC: Partition type GUID for U-Boot environment

2020-11-17 Thread Rasmus Villemoes
On 17/11/2020 13.21, Marcin Juszkiewicz wrote: > W dniu 17.11.2020 o 11:05, Rasmus Villemoes pisze: > >> Would it make sense to choose a canonical "Partition type GUID" [1] for >> partitions used to store a U-Boot environment? >> >> The partition type i

Re: Uboot SPI uclass - question

2020-11-22 Thread Rasmus Villemoes
On 02/11/2020 19.14, Moshe, Yaniv wrote: > Hi Simon, > Hope you're doing good. > > My name is Yaniv, and I have a question regarding an old commit in U-boot: > commit 60e2809a848bccd3a8090d3f2237964670f2780c > Author: Simon Glass mailto:s...@chromium.org>> > Date: Tue Feb 17 15:29:35 2015 -0700

Re: [PATCH] env: env_sf: don't set .init op if not needed

2020-11-03 Thread Rasmus Villemoes
On 03/11/2020 08.52, Wolfgang Denk wrote: > Dear Heiko, > > In message you wrote: >> >>> Apparently the meaning of CONFIG_ENV_IS_NOWHERE is nowhere >>> documented :-( >> >> env/Kconfig says: > > Ah, I missed that. I was only checkng the README and the doc/ > files... > >> config

Re: [PATCH v2 0/3] allow positional arguments with "run"

2020-11-04 Thread Rasmus Villemoes
On 07/10/2020 09.20, Rasmus Villemoes wrote: > This enables one to use positional arguments $1..$9 in functions > defined in the environment, Tom, can I ask for a decision on these? I know Wolfgang is opposed, and if that counts as a veto, fine, I'd just like to know so these are at

Re: [PATCH] env: env_sf: don't set .init op if not needed

2020-11-05 Thread Rasmus Villemoes
On 05/11/2020 17.40, Wolfgang Denk wrote: > Dear Rasmus, > > In message <8ff3b8ad-8c4e-fe99-69c8-7c174e997...@prevas.dk> you wrote: >> Not in a none standard way! Instead you can define more than one environment storage devices and load them in a board specific order (defined

Re: [PATCH v2 00/10] handling all DM watchdogs in watchdog_reset()

2021-06-08 Thread Rasmus Villemoes
On 28/05/2021 00.00, Rasmus Villemoes wrote: > This series is an attempt at expanding the wdt-uclass provided > watchdog_reset() to handle all DM watchdogs, not just the first > one. As a sort of nice side effect, it turns out that doing that makes > wdt-uclass fit better into the

Re: [PATCH v1] arm: dts: ls1021a.dtsi: Fix invalid reg on gpio nodes

2021-06-09 Thread Rasmus Villemoes
de) Reviewed-by: Rasmus Villemoes

Re: [PATCH v2 07/10] watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()

2021-06-22 Thread Rasmus Villemoes
Hi Simon, Thanks for review. >> - if (!CONFIG_IS_ENABLED(WATCHDOG_AUTOSTART)) { >> - printf("WDT: Not starting %s\n", dev->name); >> - return; >> - } >> - >> - ret = wdt_start(dev, priv->timeout * 1000, 0); >> - if (ret != 0) { >> -

Re: [PATCH v2 10/10] sandbox: add test of wdt-uclass' watchdog_reset()

2021-06-22 Thread Rasmus Villemoes
On 22/06/2021 15.31, Simon Glass wrote: > On Thu, 27 May 2021 at 16:00, Rasmus Villemoes > wrote: >> >> Check that the watchdog_reset() implementation in wdt-uclass behaves >> as expected: >> >> - resets all activated watchdog devices >>

Re: [PATCH] drivers: watchdog: wdt-uclass: Use IS_ENABLED for WATCHDOG_AUTOSTART

2021-06-18 Thread Rasmus Villemoes
On 18/06/2021 13.14, Teresa Remmet wrote: > There is no separate SPL/TPL config for WATCHDOG_AUTOSTART. > So use IS_ENABLED instead of CONFIG_IS_ENABLED to make watchdog > working in spl again. I suppose it doesn't make sense to introduce SPL/TPL variants of that (if one wants to handle a

Re: [PATCH 1/2] watchdog: add gpio watchdog driver

2021-05-10 Thread Rasmus Villemoes
On 10/05/2021 21.19, Simon Glass wrote: > Hi Rasmus, > > On Mon, 10 May 2021 at 12:45, Rasmus Villemoes > wrote: >> >>>> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig >>>> index f0ff2612a6..2cf378db29 100644 >>>> ---

Re: [PATCH 1/2] watchdog: add gpio watchdog driver

2021-05-11 Thread Rasmus Villemoes
On 11/05/2021 07.55, Stefan Roese wrote: > On 10.05.21 17:47, Rasmus Villemoes wrote: >> A rather common kind of external watchdog circuit is one that is kept >> alive by toggling a gpio. Add a driver for handling such a watchdog. >> >> The compatible string is prob

[RFC PATCH 1/2] build_bug.h: add wrapper for _Static_assert

2021-05-18 Thread Rasmus Villemoes
: "sizeof(struct printf_spec) == 8" #define __static_assert(expr, msg, ...) _Static_assert(expr, "" msg "") godbolt.org suggests that _Static_assert() has been support by clang since at least 3.0.0. Signed-off-by: Rasmus Villemoes --- include/linux/build_bug.h |

[RFC PATCH 2/2] global-data.h: add build-time sanity check of sizeof(struct global_data)

2021-05-18 Thread Rasmus Villemoes
ert’ 470 | static_assert(sizeof(struct global_data) == GD_SIZE); | ^ make[1]: *** [scripts/Makefile.build:266: arch/powerpc/lib/traps.o] Error 1 make: *** [Makefile:1753: arch/powerpc/lib] Error 2 make: *** Waiting for unfinished jobs Signed-off-by: Rasmus Villemoes --- i

[RFC PATCH 0/2] sizeof(gd_t) sanity checking

2021-05-18 Thread Rasmus Villemoes
I haven't done a whole lot of testing of these, just enough to see that it normally works _and_ that it would catch the bug Matt reported. I don't have time or resources to find and fix the bugs this would reveal, hence just an RFC for people to consider. Rasmus Villemoes (2): build_bug.h: add

Re: [PATCH v2 01/50] lib: Add memdup()

2021-05-10 Thread Rasmus Villemoes
On 06/05/2021 19.41, Simon Glass wrote: > Hi Pratyush, > > On Thu, 6 May 2021 at 10:07, Pratyush Yadav wrote: >> >> On 06/05/21 08:23AM, Simon Glass wrote: >>> Add a function to duplicate a memory region, a little like strdup(). >>> >>> Signed-off-by: Simon Glass >>> --- >>> >>> Changes in v2:

[PATCH 2/2] sandbox: add test of wdt_gpio driver

2021-05-10 Thread Rasmus Villemoes
+index. Signed-off-by: Rasmus Villemoes --- arch/sandbox/dts/test.dts | 5 + configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + test/dm/wdt.c | 32 +++- 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/arch/sandbox

[PATCH 1/2] watchdog: add gpio watchdog driver

2021-05-10 Thread Rasmus Villemoes
ry+bhx2EDs=nsbvf_...@mail.gmail.com/ If someone feels strongly about this, I can certainly remove the "linux," part from the string - it probably wouldn't the only place where one can't reuse a DT snippet as-is between linux and U-Boot. Signed-off-by: Rasmus Villemoes --- .../w

Re: [PATCH 1/5] lib/vsprintf.c: make sure vsnprintf() never returns a negative value

2021-05-21 Thread Rasmus Villemoes
On 20/05/2021 19.51, Simon Glass wrote: > Hi Rasmus, > > On Thu, 20 May 2021 at 04:05, Rasmus Villemoes > wrote: >> >> Most callers (or callers of callers, etc.) of vsnprintf() are not >> prepared for it to return a negative value. >> >> The only c

Re: [PATCH 1/5] lib/vsprintf.c: make sure vsnprintf() never returns a negative value

2021-05-21 Thread Rasmus Villemoes
On 21/05/2021 16.15, Heinrich Schuchardt wrote: > On 21.05.21 14:53, Rasmus Villemoes wrote: >> On 20/05/2021 19.51, Simon Glass wrote: >>> Hi Rasmus, >>> >>> On Thu, 20 May 2021 at 04:05, Rasmus Villemoes >>> wrote: >>>> >

[PATCH] fixdep: remove leftover handling of IS_BUILTIN/IS_MODULE

2021-05-20 Thread Rasmus Villemoes
d helper macros") Signed-off-by: Rasmus Villemoes --- scripts/basic/fixdep.c | 4 1 file changed, 4 deletions(-) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 6d59cf8c07..5ced0f6b06 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -257,13 +

[PATCH 0/5] assorted printf-related patches

2021-05-20 Thread Rasmus Villemoes
-terminated string, which is not the case if we do an early "return -Esomething". The last fixes a bug I found while looking for impact of %pD returning a negative value. The second and fourth reduce the size of vsprintf.o a little. Rasmus Villemoes (5): lib/vsprintf.c: make sure vsnprin

[PATCH 5/5] common/log.c: use vscnprintf() in log_dispatch()

2021-05-20 Thread Rasmus Villemoes
We have to use the *printf variant which returns the strlen() of the resulting string, not the how-much-would-have-been-printed-given-enough-space, in order to use that value to inspect the last character in the string. Signed-off-by: Rasmus Villemoes --- common/log.c | 2 +- 1 file changed, 1

[PATCH 2/5] lib/vsprintf.c: implement printf() in terms of vprintf()

2021-05-20 Thread Rasmus Villemoes
This saves some code, both in terms of #LOC and .text size, and it is also the normal convention that foo(...) is implemented in terms of vfoo(). Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/vsprintf.c b/lib

[PATCH 3/5] lib/vsprintf.c: remove stale comment

2021-05-20 Thread Rasmus Villemoes
U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like lookups. Remove the comment. Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index e3bec7489b..65d985982d 100644 --- a/lib/vsprintf.c +++ b

[PATCH 1/5] lib/vsprintf.c: make sure vsnprintf() never returns a negative value

2021-05-20 Thread Rasmus Villemoes
of having the message completely ignored - or mishandled as for example log.c would currently do. Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 9dc96c81c6..0050110683 100644

[PATCH 4/5] lib/vsprintf.c: remove unused ip6_addr_string()

2021-05-20 Thread Rasmus Villemoes
which does if (ipv6) { ret = EFI_UNSUPPORTED; As indicated in the comment, it can easily be put back, but preferably under a config knob. Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/

Re: [PATCH] powerpc: fix regression in arch_initr_trap()

2021-05-18 Thread Rasmus Villemoes
On 18/05/2021 07.50, Stefan Roese wrote: > Hi Matt, > > On 17.05.21 19:32, Matt Merhar wrote: >> The assembly output of the arch_initr_trap() function differed by a >> single byte after common.h was removed from traps.c: >> >>   fff49a18 : >>   fff49a18:  94 21 ff f0 stwu    r1,-16(r1) >>

Re: [PATCH 1/2] watchdog: add gpio watchdog driver

2021-05-10 Thread Rasmus Villemoes
On 10/05/2021 18.28, Simon Glass wrote: > Hi Rasmus, > > On Mon, 10 May 2021 at 09:47, Rasmus Villemoes > wrote: >> >> A rather common kind of external watchdog circuit is one that is kept >> alive by toggling a gpio. Add a driver for handling such a watchdo

Re: mirroring u-boot mailing list on lore.kernel.org

2021-05-25 Thread Rasmus Villemoes
On 20/05/2021 15.53, Pratyush Yadav wrote: > On 20/05/21 09:16PM, Bin Meng wrote: >> On Thu, May 20, 2021 at 9:05 PM Rasmus Villemoes >> wrote: >>> >>> I don't know if the kernel.org folks would be willing to host an archive >>> of the u-boot mailing list

mirroring u-boot mailing list on lore.kernel.org

2021-05-20 Thread Rasmus Villemoes
Hi, When doing linux kernel work, the public-inbox archives at lore.kernel.org are really useful. - excellent search features - stable links of the form lore.kernel.org// - nice overview of threads - ability to, with the b4 tool, download patches or whole series by msg-id, and logic to compare

[PATCH v2 00/10] handling all DM watchdogs in watchdog_reset()

2021-05-27 Thread Rasmus Villemoes
, they are mostly cosmetic - functionally, the only change is that it now requires the always-running property in DT. Rasmus Villemoes (10): watchdog: wdt-uclass.c: use wdt_start() in wdt_expire_now() watchdog: wdt-uclass.c: introduce struct wdt_priv watchdog: wdt-uclass.c: neaten UCLASS_DRIVER

[PATCH v2 02/10] watchdog: wdt-uclass.c: introduce struct wdt_priv

2021-05-27 Thread Rasmus Villemoes
intended. Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 65 --- 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 634428fa24..3b6aa3d586 100644 --- a/drivers

[PATCH v2 07/10] watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()

2021-05-27 Thread Rasmus Villemoes
evice "u-boot,autostart" boolean property, so that one can do CONFIG_WATCHDOG_AUTOSTART per-device. Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 87 --- include/asm-generic/global_data.h | 6 --- 2 files changed, 46 insertions(+), 47 d

[PATCH v2 01/10] watchdog: wdt-uclass.c: use wdt_start() in wdt_expire_now()

2021-05-27 Thread Rasmus Villemoes
d is supposed to reset very soon. Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 2687135296..634428fa24 100644 --- a/drivers/watchdog/wdt-u

[PATCH v2 04/10] watchdog: wdt-uclass.c: refactor initr_watchdog()

2021-05-27 Thread Rasmus Villemoes
In preparation for handling all DM watchdogs in watchdog_reset(), pull out the code which handles starting (or not) the gd->watchdog_dev device. Include the device name in various printfs. Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c |

[PATCH v2 05/10] watchdog: wdt-uclass.c: keep track of each device's running state

2021-05-27 Thread Rasmus Villemoes
og_dev - incidentally, that is how it was used prior to commit 9c44ff1c5f3c. Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 5d5d

[PATCH v2 03/10] watchdog: wdt-uclass.c: neaten UCLASS_DRIVER definition

2021-05-27 Thread Rasmus Villemoes
The addition of .pre_probe and .per_device_auto made this look bad. Fix it. Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index

Re: [PATCH 1/5] lib/vsprintf.c: make sure vsnprintf() never returns a negative value

2021-05-27 Thread Rasmus Villemoes
On 21/05/2021 16.42, Heinrich Schuchardt wrote: > On 21.05.21 16:27, Tom Rini wrote: >> On Fri, May 21, 2021 at 04:15:39PM +0200, Heinrich Schuchardt wrote: >>> On 21.05.21 14:53, Rasmus Villemoes wrote: >>>> On 20/05/2021 19.51, Simon Glass wrote: >>>>&g

[PATCH v2 06/10] sandbox: disable CONFIG_WATCHDOG_AUTOSTART

2021-05-27 Thread Rasmus Villemoes
. Signed-off-by: Rasmus Villemoes --- configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 9a373bab6f..8b934698b5 100644 --- a/configs/sandbox64_defconfig +++ b/configs

[PATCH v2 08/10] watchdog: add gpio watchdog driver

2021-05-27 Thread Rasmus Villemoes
4qry+bhx2EDs=nsbvf_...@mail.gmail.com/ If someone feels strongly about this, I can certainly remove the "linux," part from the string - it probably wouldn't the only place where one can't reuse a DT snippet as-is between linux and U-Boot. Signed-off-by: Rasmus Villemoes --- .../watchdog/gpio-wdt

[PATCH v2 09/10] sandbox: add test of wdt_gpio driver

2021-05-27 Thread Rasmus Villemoes
+index. Signed-off-by: Rasmus Villemoes --- arch/sandbox/dts/test.dts | 6 ++ configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + test/dm/wdt.c | 36 +++- 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/arch

[PATCH v2 10/10] sandbox: add test of wdt-uclass' watchdog_reset()

2021-05-27 Thread Rasmus Villemoes
Check that the watchdog_reset() implementation in wdt-uclass behaves as expected: - resets all activated watchdog devices - leaves unactivated/stopped devices alone - that the rate-limiting works, with a per-device threshold Signed-off-by: Rasmus Villemoes --- arch/sandbox/dts/test.dts | 2

[PATCH v2 1/3] lib/vsprintf.c: implement printf() in terms of vprintf()

2021-05-27 Thread Rasmus Villemoes
This saves some code, both in terms of #LOC and .text size, and it is also the normal convention that foo(...) is implemented in terms of vfoo(). Reviewed-by: Simon Glass Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 13 + 1 file changed, 1 insertion(+), 12 deletions

[PATCH v2 3/3] lib/vsprintf.c: remove unused ip6_addr_string()

2021-05-27 Thread Rasmus Villemoes
which does if (ipv6) { ret = EFI_UNSUPPORTED; As indicated in the comment, it can easily be put back, but preferably under a config knob. Reviewed-by: Simon Glass Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff -

[PATCH v2 2/3] lib/vsprintf.c: remove stale comment

2021-05-27 Thread Rasmus Villemoes
U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like lookups. Remove the comment. Reviewed-by: Simon Glass Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index cf3982eb03..af0a6e1dcf 100644

[PATCH v2 0/3] trivial printf patches

2021-05-27 Thread Rasmus Villemoes
old new delta printf 220 152 -68 vsnprintf_internal 21241974-150 Total: Before=4878, After=4660, chg -4.47% but still worth it. Rasmus Villemoes (3): lib/vsprintf.c: implement

Re: [PATCH 3/4] socfpga64: Do not define CONFIG_SYS_MEM_RESERVE_SECURE to 0

2021-06-03 Thread Rasmus Villemoes
On 03/06/2021 15.39, Tom Rini wrote: > Based on the comment in socfpga_soc64_common.h, the intention is for > CONFIG_SYS_MEM_RESERVE_SECURE to be unused. However, in the code we do: > ... > > and that will evaluate to true. This leads to unwanted code being Some cleanup made lines beginning

Re: mirroring u-boot mailing list on lore.kernel.org

2021-05-25 Thread Rasmus Villemoes
On 25/05/2021 19.09, Simon Glass wrote: > Hi, > > On Tue, 25 May 2021 at 01:46, Rasmus Villemoes > wrote: >> >> >> It's alive: https://lore.kernel.org/u-boot/ >> >> Thanks to the folks at kernel.org for accepting this and making it >> happen s

Re: [PATCH 1/2] watchdog: add gpio watchdog driver

2021-05-22 Thread Rasmus Villemoes
On 22/05/2021 09.18, Stefan Roese wrote: > On 11.05.21 09:20, Stefan Roese wrote: >> On 11.05.21 08:40, Rasmus Villemoes wrote: >>> Will do. But I now see a much bigger problem due to some refactoring in >>> wdt-uclass that basically requires a ->start method or GD_

Re: [RFC PATCH 03/28] cli: lil: Replace strclone with strdup

2021-07-02 Thread Rasmus Villemoes
On 01/07/2021 08.15, Sean Anderson wrote: > Apparently strdup is not portable, so LIL used its own. Use strdup. You could reduce the churn by just making strclone "#define strclone(x) strdup(x)", but I suppose you end up modifying the upstream code so much that there's not really anything gained

Re: [RFC PATCH 13/28] cli: lil: Wire up LIL to the rest of U-Boot

2021-07-02 Thread Rasmus Villemoes
On 01/07/2021 08.15, Sean Anderson wrote: > This sets the shell to LIL when CONFIG_LIL is enabled. Repeated commands > are not supporteed. Neither are partial commands a la Hush's secondary > prompt. Setting and getting environmental variables is done through > callbacks to assist with testing.

[PATCH v3 02/10] watchdog: wdt-uclass.c: introduce struct wdt_priv

2021-07-02 Thread Rasmus Villemoes
intended. Reviewed-by: Simon Glass Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 74 +-- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 634428fa24..d0c1630cd4

[PATCH v3 00/10] handling all DM watchdogs in watchdog_reset()

2021-07-02 Thread Rasmus Villemoes
comment before uclass_foreach_dev() loop in watchdog_reset(), and furthermore include a device_active() check inside the loop. - Drop unneeded include in patch 8. - Use timer_test_add_offset() instead of mdelay() in patch 10. Rasmus Villemoes (10): watchdog: wdt-uclass.c: use wdt_start

[PATCH v3 01/10] watchdog: wdt-uclass.c: use wdt_start() in wdt_expire_now()

2021-07-02 Thread Rasmus Villemoes
d is supposed to reset very soon. Reviewed-by: Simon Glass Reviewed-by: Stefan Roese Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 268713529

[PATCH v3 08/10] watchdog: add gpio watchdog driver

2021-07-02 Thread Rasmus Villemoes
4qry+bhx2EDs=nsbvf_...@mail.gmail.com/ If someone feels strongly about this, I can certainly remove the "linux," part from the string - it probably wouldn't the only place where one can't reuse a DT snippet as-is between linux and U-Boot. Reviewed-by: Simon Glass Reviewed-by: Stefan Roese Si

[PATCH v3 09/10] sandbox: add test of wdt_gpio driver

2021-07-02 Thread Rasmus Villemoes
+index. Reviewed-by: Simon Glass Reviewed-by: Stefan Roese Signed-off-by: Rasmus Villemoes --- arch/sandbox/dts/test.dts | 6 ++ configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + test/dm/wdt.c | 36 +++- 4 files changed, 43

[PATCH v3 05/10] watchdog: wdt-uclass.c: keep track of each device's running state

2021-07-02 Thread Rasmus Villemoes
og_dev - incidentally, that is how it was used prior to commit 9c44ff1c5f3c. Reviewed-by: Simon Glass Reviewed-by: Stefan Roese Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/wdt-uc

[PATCH v3 10/10] sandbox: add test of wdt-uclass' watchdog_reset()

2021-07-02 Thread Rasmus Villemoes
-by: Rasmus Villemoes --- arch/sandbox/dts/test.dts | 2 ++ test/dm/wdt.c | 54 +++ 2 files changed, 56 insertions(+) diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index f0be050759..78efd3bc10 100644 --- a/arch/sandbox/dts/test.dts

[PATCH v3 07/10] watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()

2021-07-02 Thread Rasmus Villemoes
evice "u-boot,autostart" boolean property, so that one can do CONFIG_WATCHDOG_AUTOSTART per-device. Reviewed-by: Stefan Roese Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 96 ++- include/asm-generic/global_data.h | 6 -- 2 files change

[PATCH v3 03/10] watchdog: wdt-uclass.c: neaten UCLASS_DRIVER definition

2021-07-02 Thread Rasmus Villemoes
The addition of .pre_probe and .per_device_auto made this look bad. Fix it. Reviewed-by: Simon Glass Reviewed-by: Stefan Roese Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/wdt

[PATCH v3 04/10] watchdog: wdt-uclass.c: refactor initr_watchdog()

2021-07-02 Thread Rasmus Villemoes
In preparation for handling all DM watchdogs in watchdog_reset(), pull out the code which handles starting (or not) the gd->watchdog_dev device. Include the device name in various printfs. Reviewed-by: Simon Glass Reviewed-by: Stefan Roese Signed-off-by: Rasmus Villemoes --- drivers/watch

[PATCH v3 06/10] sandbox: disable CONFIG_WATCHDOG_AUTOSTART

2021-07-02 Thread Rasmus Villemoes
. Reviewed-by: Simon Glass Reviewed-by: Stefan Roese Signed-off-by: Rasmus Villemoes --- configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index fafa85a5c0..bf436963ec

Re: [PATCH 1/3] cmd: setexpr: add fmt format string operation

2021-06-28 Thread Rasmus Villemoes
On 28/06/2021 17.17, Roland Gaudig wrote: > From: Roland Gaudig > > Add format string "fmt" operation to the setexpr command > which converts the input value according the format string > specification and stores the result into the variable named name. > > Signed-off-by: Roland Gaudig > --- >

<    1   2   3   4   5   6   7   8   9   >