[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 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 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 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

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

2021-07-02 Thread Rasmus Villemoes
: 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
dd a per-device "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 fi

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

2021-07-02 Thread Rasmus Villemoes
bnHkg4qry+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: S

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

2021-07-02 Thread Rasmus Villemoes
class+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 change

Re: [PATCH 1/2] vboot: add support for multiple required keys

2020-06-30 Thread Rasmus Villemoes
On 25/06/2020 17.51, Thirupathaiah Annapureddy wrote: > Currently Verified Boot fails if there is a signature verification failure > using required key in U-boot DTB. This patch adds support for multiple > required keys. This means if verified boot passes with one of the required > keys, u-boot wil

[PATCH v4 00/11] new rtc methods, rtc command, and tests

2020-07-06 Thread Rasmus Villemoes
- The rtc command's interface has been simplified a bit (no separate read/readm; the number of arguments determines whether the user wants the result on the console or to a memory address) - Add tests, both of rtc_{read,write}() and of the shell command, fixing a few things I stumbled on

[PATCH v4 01/11] rtc: add dm_rtc_read helper and ->read method

2020-07-06 Thread Rasmus Villemoes
ass Reviewed-by: Heiko Schocher Signed-off-by: Rasmus Villemoes --- drivers/rtc/rtc-uclass.c | 19 +++ include/rtc.h| 23 +++ 2 files changed, 42 insertions(+) diff --git a/drivers/rtc/rtc-uclass.c b/drivers/rtc/rtc-uclass.c index 926cca234e..4a0e3c5

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

2020-07-06 Thread Rasmus Villemoes
r 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 ---

[PATCH v4 04/11] rtc: pcf2127: provide ->read method

2020-07-06 Thread Rasmus Villemoes
This simply consists of renaming the existing pcf2127_read_reg() helper to follow the naming of the other methods (i.e. pcf2127_rtc_) and changing the type of its "len" parameter. Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Signed-off-by: Rasmus Villemoes --- drivers/rtc

[PATCH v4 06/11] rtc: add rtc command

2020-07-06 Thread Rasmus Villemoes
Mostly as an aid for debugging RTC drivers, provide a command that can be used to read/write arbitrary registers (assuming the driver provides the read/write methods or their single-register-at-a-time variants). Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Signed-off-by: Rasmus

[PATCH v4 02/11] rtc: add dm_rtc_write() helper

2020-07-06 Thread Rasmus Villemoes
Similar to dm_rtc_read(), introduce a helper that allows the caller to write multiple consecutive 8-bit registers with one call. If the driver provides the ->write method, use that, otherwise loop using ->write8. Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Signed-off-by:

[PATCH v4 05/11] rtc: pcf2127: provide ->write method

2020-07-06 Thread Rasmus Villemoes
Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Signed-off-by: Rasmus Villemoes --- drivers/rtc/pcf2127.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/rtc/pcf2127.c b/drivers/rtc/pcf2127.c index eea72ad522..88ff8c52c3 100644 --- a/drivers/rtc/pcf2127.c +++ b/drivers

[PATCH v4 10/11] sandbox: add rtc command to defconfigs

2020-07-06 Thread Rasmus Villemoes
In order to allow adding unit tests of the rtc command, add it to the various sandbox defconfigs. Signed-off-by: Rasmus Villemoes --- configs/sandbox64_defconfig| 1 + configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 1 + 3 files changed, 3 insertions

[PATCH v4 07/11] rtc: sandbox-rtc: fix set method

2020-07-06 Thread Rasmus Villemoes
ead(), so the 31 we just wrote to mday gets overwritten by a 1. Fix it by writing all registers at once, and for consistency, update the get method to retrieve them all with one "i2c transfer". Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Signed-off-by: Rasmus Villemoe

[PATCH v4 08/11] rtc: i2c_rtc_emul: catch any write to the "reset" register

2020-07-06 Thread Rasmus Villemoes
It's more natural that any write that happens to touch the reset register should cause a reset, rather than just a write that starts at that offset. Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Signed-off-by: Rasmus Villemoes --- drivers/rtc/i2c_rtc_emul.c | 3 ++- 1 file chang

[PATCH v4 11/11] test: dm: rtc: add tests of rtc shell command

2020-07-06 Thread Rasmus Villemoes
Add tests of the "list", "read" and "write" subcommands of the rtc shell command. Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Signed-off-by: Rasmus Villemoes --- test/dm/rtc.c | 58 +++ 1 file changed,

[PATCH v4 09/11] test: dm: rtc: add test of dm_rtc_read, dm_rtc_write

2020-07-06 Thread Rasmus Villemoes
Define a few aux registers and check that they can be read/written individually. Also check that one can access the time-keeping registers directly and get the expected results. Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Signed-off-by: Rasmus Villemoes --- arch/sandbox/include/asm

[PATCH] remove include/config_defaults.h

2020-07-07 Thread Rasmus Villemoes
s one less header file. Signed-off-by: Rasmus Villemoes --- include/config_defaults.h | 12 include/configs/kc1.h | 6 -- include/configs/sniper.h | 6 -- scripts/Makefile.autoconf | 1 - 4 files changed, 25 deletions(-) delete mode 100644 include/config_defaults.h

Re: [RFC 1/4] dtoc: add POC for dtb shrink

2020-07-07 Thread Rasmus Villemoes
On 19/06/2020 23.11, Walter Lozano wrote: > Some additional reduction could be possible by only keeping the nodes for > whose compatible string is supported by any enabled driver. However, > this requires to add extra logic to parse config files and map > configuration to compatible strings. If t

Re: [RFC 1/4] dtoc: add POC for dtb shrink

2020-07-07 Thread Rasmus Villemoes
On 07/07/2020 16.32, Walter Lozano wrote: > Hi Rasmus, > > On 7/7/20 11:15, Rasmus Villemoes wrote: >> On 19/06/2020 23.11, Walter Lozano wrote: >> >>> Some additional reduction could be possible by only keeping the nodes >>> for >>> whose comp

Re: [PATCH] rtc: pcf2127: fix uninitialized variable msg

2020-07-09 Thread Rasmus Villemoes
On 09/07/2020 12.58, Biwen Li wrote: > From: Biwen Li > > Fix uninitialized variable msg > > struct dm_i2c_chip *chip = dev_get_parent_platdata(dev); > - struct i2c_msg msg; > + struct i2c_msg msg = {0}; > int ret; > > /* Set the address of the start register to be re

Re: [EXT] Re: [PATCH] rtc: pcf2127: fix uninitialized variable msg

2020-07-09 Thread Rasmus Villemoes
On 09/07/2020 13.38, Biwen Li wrote: >> >> On 09/07/2020 12.58, Biwen Li wrote: >>> From: Biwen Li >>> >>> Fix uninitialized variable msg >>> >>> struct dm_i2c_chip *chip = dev_get_parent_platdata(dev); >>> - struct i2c_msg msg; >>> + struct i2c_msg msg = {0}; >>> int ret; >>>

Re: [PATCH 1/4] fs/squashfs: new filesystem

2020-07-09 Thread Rasmus Villemoes
On 09/07/2020 19.51, Joao Marcos Costa wrote: > Add support for SquashFS filesystem. Right now, it does not support > compression but support for zlib will be added in a follow-up commit. Cool, thanks for proposing this. While I'm not really in a position to review these, just one comment below.

Re: [PATCH 1/4] fs/squashfs: new filesystem

2020-07-10 Thread Rasmus Villemoes
On 10/07/2020 10.29, Thomas Petazzoni wrote: > Hello Rasmus, > > On Thu, 9 Jul 2020 21:50:03 +0200 > Rasmus Villemoes wrote: > >>> +config SPL_FS_SQUASHFS >>> + bool "Support SquashFS filesystems" >>> + select FS_SQUASHFS >> >

Re: [PATCH] RFC: nvedit: support doing one (extra) expansion of the value in "env set"

2020-02-13 Thread Rasmus Villemoes
On 12/02/2020 12.38, Wolfgang Denk wrote: > Dear Rasmus, > > In message you wrote: >> >>> HUSH does not support arrays anyway... >> >> Of course not, but they can be emulated by having variables foo0, foo1, >> foo2 and programmatically accessing the variable foo$index, if only >> there's a way to

[PATCH] sandbox: also restore terminal settings when killed by SIGINT

2020-02-14 Thread Rasmus Villemoes
./u-boot # hit Ctrl-C $ grep flags /proc/$$/fdinfo/1 flags: 0106002 After: $ grep flags /proc/$$/fdinfo/1 flags: 0102002 $ ./u-boot # hit Ctrl-C $ grep flags /proc/$$/fdinfo/1 flags: 0102002 Signed-off-by: Rasmus Villemoes --- arch/sandbox/cpu/os.c | 9 + 1 file changed, 9 insertions(

Re: [PATCH] RFC: nvedit: support doing one (extra) expansion of the value in "env set"

2020-02-14 Thread Rasmus Villemoes
On 13/02/2020 16.55, Wolfgang Denk wrote: > Dear Rasmus, > > In message you wrote: >> >> I'm sorry, I see I mistyped in my example above, it should have been >> >> if test $slot = "A" ; setenv result $BOOT_A_LEFT ... >> >> as should hopefully be clear from the original post and the eval >> exam

Re: [PATCH] RFC: nvedit: support doing one (extra) expansion of the value in "env set"

2020-02-14 Thread Rasmus Villemoes
On 14/02/2020 12.54, Rasmus Villemoes wrote: > Now we can work around the lack of break in the busybox shell by writing ^ > But we still can't translate this to busybox shell, because

Re: [PATCH] RFC: nvedit: support doing one (extra) expansion of the value in "env set"

2020-02-18 Thread Rasmus Villemoes
On 16/02/2020 18.25, Wolfgang Denk wrote: > Dear Rasmus, > > In message <20200216152427.e80c7240...@gemini.denx.de> I wrote: >> >> So lets change my little script to add setting "left": >> >> slot=none >> for i in $BOOT_ORDER ; do >> setenv tmp_cmd 'setexpr tmp_val sub '^' "" $'BOOT

[PATCH] include/eeprom.h: fix build errors

2020-02-18 Thread Rasmus Villemoes
/eeprom.c:37:8: error: void value not ignored as it ought to be rcode = eeprom_read(dev_addr, offset, buffer, cnt); Signed-off-by: Rasmus Villemoes --- include/eeprom.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/eeprom.h b/include/eeprom.h index 79118eb83d

[PATCH] env: make file-scope env_ptr variables static

2020-02-18 Thread Rasmus Villemoes
ld-testing it's nice to be able to enable most ENV_IS_IN_* at the same time, and since these env_ptr are not declared anywhere, they really have no reason to have external linkage. nand.c and flash.c similarly already define file-scope static env_ptr variables. Signed-off-by: Rasmus Vill

[PATCH 0/5] CMD_SAVEENV ifdef cleanup

2020-02-19 Thread Rasmus Villemoes
r U-Boot proper, but then the use of env_save_ptr() ends up with a build warning in case CONFIG_CMD_SAVEENV=n - fat.c doesn't have that proplem. Rasmus Villemoes (5): env: add SAVEENV as an alias of the CMD_SAVEENV symbol env_internal.h: add alternative ENV_SAVE_PTR macro env/fat.c: remove

[PATCH 5/5] env/sf.c: drop private CMD_SAVEENV logic

2020-02-19 Thread Rasmus Villemoes
CONFIG_SPL_SAVEENV, one obviously expects to actually be able to save the environment. Signed-off-by: Rasmus Villemoes --- env/sf.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/env/sf.c b/env/sf.c index 5ef4055219..22b70ad319 100644 --- a/env/sf.c +++ b/env/sf.c

[PATCH 3/5] env/fat.c: remove private CMD_SAVEENV logic

2020-02-19 Thread Rasmus Villemoes
Always compile the env_fat_save() function, and let CONFIG_IS_ENABLED(SAVEENV) (via the ENV_SAVE_PTR macro) decide whether it actually ends up being compiled in. Signed-off-by: Rasmus Villemoes --- env/fat.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/env/fat.c b

[PATCH 1/5] env: add SAVEENV as an alias of the CMD_SAVEENV symbol

2020-02-19 Thread Rasmus Villemoes
, introduce SAVEENV as an alias for the CMD_SAVEENV symbol. Then one can simply use CONFIG_IS_ENABLED(SAVEENV) Signed-off-by: Rasmus Villemoes --- env/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/env/Kconfig b/env/Kconfig index 0d6f559b39..969308fe6c 100644 --- a/env/Kconfig +++ b

[PATCH 2/5] env_internal.h: add alternative ENV_SAVE_PTR macro

2020-02-19 Thread Rasmus Villemoes
which for lack of a better name is simply uppercased, allowing one to update storage drivers piecemeal to both reduce their ifdeffery and honour CONFIG_SPL_SAVEENV. Signed-off-by: Rasmus Villemoes --- include/env_internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/env_intern

[PATCH 4/5] env/ext4.c: remove CONFIG_CMD_SAVEENV ifdef

2020-02-19 Thread Rasmus Villemoes
G_SPL_SAVEENV=y SPL_ENV_IS_IN_EXT4=y in which case env_ext4_save would erroneously not be compiled in. Signed-off-by: Rasmus Villemoes --- env/ext4.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/env/ext4.c b/env/ext4.c index 1f6b1b5bd8..911e19c6d3 100644 --- a/env/ext4.c +++ b/env/

Re: [PATCH 0/5] CMD_SAVEENV ifdef cleanup

2020-02-19 Thread Rasmus Villemoes
On 19/02/2020 14.25, Wolfgang Denk wrote: > Dear Rasmus, > > In message <20200219094726.26798-1-rasmus.villem...@prevas.dk> you wrote: >> >> [1] Here's the current conditions for which these three drivers >> provide .save: >> >> SPL U-Boot >> ext4.cCONFIG_CMD_SAVE

Re: [PATCH 1/4 v5] watchdog: Implement generic watchdog_reset() version

2020-02-19 Thread Rasmus Villemoes
On 20/02/2020 07.43, Stefan Roese wrote: > On 20.02.20 07:38, Christophe Leroy wrote: > > > > +void watchdog_reset(void) > +{ > +    static ulong next_reset; > +    ulong now; > + > +    /* Exit if GD is not ready or watchdog is not initialized yet */ > +    if (!gd |

Re: [PATCH 3/5] env/fat.c: remove private CMD_SAVEENV logic

2020-02-20 Thread Rasmus Villemoes
On 19/02/2020 14.27, Wolfgang Denk wrote: > Dear Rasmus, > > In message <20200219094726.26798-4-rasmus.villem...@prevas.dk> you wrote: >> Always compile the env_fat_save() function, and let >> CONFIG_IS_ENABLED(SAVEENV) (via the ENV_SAVE_PTR macro) decide whether >> it actually ends up being compi

Re: [PATCH] RFC: nvedit: support doing one (extra) expansion of the value in "env set"

2020-02-21 Thread Rasmus Villemoes
On 18/02/2020 09.11, Rasmus Villemoes wrote: > Thanks, Wolfgang. Consider both "env set -E" and the alternative "env > get" withdrawn. So, if I wanted to change the status of such a patch in patchwork, what would be the appropriate status? There's no &quo

Re: [PATCH 3/5] env/fat.c: remove private CMD_SAVEENV logic

2020-02-24 Thread Rasmus Villemoes
On 21/02/2020 17.19, Tom Rini wrote: > On Fri, Feb 21, 2020 at 05:14:14PM +0100, Wolfgang Denk wrote: >> Dear Rasmus, >> >> In message <5265fdd5-3992-4e5f-3235-5586b3b77...@prevas.dk> you wrote: >>> >>> So without the fat.c patch, CONFIG_SPL_SAVEENV is effectively ignored. >> >> OK, but what about

[PATCH] common/board_f.c: use #ifdefs a little more consistently

2020-02-27 Thread Rasmus Villemoes
mandatory "return 0", conditionally compiled. For the simple cases, switch to the former model, making it a bit more consistent. This also makes the U-Boot image very slightly smaller and avoids a few useless calls to no-op functions during board_init_f. Signed-off-by: Rasmus Villemoes -

[PATCH 3/4] lib/hashtable.c: don't test ->callback in SPL

2020-02-27 Thread Rasmus Villemoes
In SPL, environment callbacks are not supported, so e->callback is always NULL. Removing this makes the SPL a little smaller (about 400 bytes in my ppc build) with no functional change. Signed-off-by: Rasmus Villemoes --- lib/hashtable.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/

[PATCH 4/4] make env_entry::callback conditional on !CONFIG_SPL_BUILD

2020-02-27 Thread Rasmus Villemoes
of relying on an unused or deleted entry having NULL in ->callback. Signed-off-by: Rasmus Villemoes --- env/callback.c | 2 ++ env/flags.c | 1 - include/search.h | 2 ++ lib/hashtable.c | 1 - 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/env/callback.c b/env/

[PATCH 2/4] lib/hashtable.c: create helper for calling env_entry::callback

2020-02-27 Thread Rasmus Villemoes
This is preparation for compiling out the "call the callback" code and associated error handling for SPL, where ->callback is always NULL. Signed-off-by: Rasmus Villemoes --- lib/hashtable.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) dif

[PATCH 0/4] remove (more) env callback code for SPL

2020-02-27 Thread Rasmus Villemoes
llback_list with value, then do a hwalk_r(&env_htab, env_callback_init) - no need for either set_callback or clear_callback. Rasmus Villemoes (4): env: remove callback.o for an SPL build lib/hashtable.c: create helper for calling env_entry::callback lib/hashtable.c: don't test

[PATCH 1/4] env: remove callback.o for an SPL build

2020-02-27 Thread Rasmus Villemoes
. Drop callback.o entirely from the link and stub out the only public function defined in callback.o. This cuts about 600 bytes from the SPL on my ppc build. Signed-off-by: Rasmus Villemoes --- env/Makefile | 2 +- include/env_callback.h | 6 ++ 2 files changed, 7 insertions(+), 1

Re: [PATCH] common/board_f.c: use #ifdefs a little more consistently

2020-02-28 Thread Rasmus Villemoes
On 28/02/2020 00.40, Simon Glass wrote: > Hi Rasmus, > > On Thu, 27 Feb 2020 at 00:18, Rasmus Villemoes > wrote: >> >> Some init functions, e.g. print_resetinfo(), are conditionally defined >> depending on some config options, and are correspondingly &g

Re: [PATCH] common/board_f.c: use #ifdefs a little more consistently

2020-02-28 Thread Rasmus Villemoes
On 28/02/2020 16.46, Tom Rini wrote: > On Fri, Feb 28, 2020 at 08:42:21AM +0000, Rasmus Villemoes wrote: >> On 28/02/2020 00.40, Simon Glass wrote: >>> Using if() is preferable to #if if there is no cost. >> >> Completely agree, and I also prefer to have the linker

caching BLOBLISTT_SPL_HANDOFF (was Re: [PATCH] common/board_f.c: use #ifdefs a little more consistently)

2020-02-28 Thread Rasmus Villemoes
On 28/02/2020 18.35, Tom Rini wrote: > On Fri, Feb 28, 2020 at 05:24:58PM +0000, Rasmus Villemoes wrote: >> eliminated, and there's not an #ifdef in sight. > > That sounds pretty nice actually. If you're so inclined I'd like to see > it. > So I started lo

Re: caching BLOBLISTT_SPL_HANDOFF

2020-03-02 Thread Rasmus Villemoes
On 02/03/2020 20.47, Simon Glass wrote: > Hi Rasmus, > > On Fri, 28 Feb 2020 at 16:09, Rasmus Villemoes > wrote: >> >> Now that particular one seems a bit fishy: Why is it ok to cache the >> location of the BLOBLISTT_SPL_HANDOFF blob in gd->spl_handoff? Later

Re: [PATCH resend 0/2] gpio: mpc8xxx: honour shadow register when writing gpdat

2020-03-03 Thread Rasmus Villemoes
On 28/01/2020 13.04, Rasmus Villemoes wrote: > [resending with Mario's correct address, sorry for the double post] > > The driver correctly uses the shadow register when asked for the > current value of an output gpio. Unfortunately, it does RMW on the > gpdat register both wh

[PATCH] watchdog: allow overriding the rate-limiting logic

2020-03-12 Thread Rasmus Villemoes
xample, in my case I will implement the function in terms of get_ticks() (i.e. the time base registers on PPC) which do not depend on interrupts, and use a threshold of gd->bus_clk / (4*16) ticks (~62ms). Signed-off-by: Rasmus Villemoes --- This is on top of https://patchwork.ozlabs.org/patch/

Re: [PATCH] watchdog: allow overriding the rate-limiting logic

2020-03-12 Thread Rasmus Villemoes
On 12/03/2020 12.58, Stefan Roese wrote: > Hi Rasmus, > > (added Christophe to Cc) > > On 12.03.20 12:40, Rasmus Villemoes wrote: >> On the MPC8309-derived board I'm currently working on, the current >> rate-limiting logic in the generic watchdog_reset function po

[PATCH] spi: use is_power_of_2 instead of hweight32 in spi_nor_write()

2020-03-12 Thread Rasmus Villemoes
rite388 292 -96 Signed-off-by: Rasmus Villemoes --- drivers/mtd/spi/spi-nor-core.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index eb49a6c11c..4076646225 100644 --- a/drivers/mtd

Re: [PATCH] mkimage: fit_image: Make fit header and data align to 512

2020-03-13 Thread Rasmus Villemoes
On 13/03/2020 03.07, Heinrich Schuchardt wrote: > Am March 13, 2020 1:50:41 AM UTC schrieb Kever Yang > : >> The image is usually stored in block device like emmc, SD card, make >> the >> offset of image data aligned to block(512 byte) can avoid data copy >> during boot process. >> eg. SPL boot fr

[PATCH 2/3] watchdog: move initr_watchdog() to wdt-uclass.c

2020-03-13 Thread Rasmus Villemoes
local to wdt-uclass.c. The WATCHDOG_TIMEOUT_SECS define is not used elsewhere. Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 33 + include/wdt.h | 35 +-- 2 files changed, 34 insertions(+), 34

[PATCH 0/3] watchdog: honour hw_margin_ms property

2020-03-13 Thread Rasmus Villemoes
em in some other way. Rasmus Villemoes (3): watchdog: remove stale ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS from wdt.h watchdog: move initr_watchdog() to wdt-uclass.c watchdog: honour hw_margin_ms DT property drivers/watchdog/wdt-uclass.c | 43 ++- inc

[PATCH 3/3] watchdog: honour hw_margin_ms DT property

2020-03-13 Thread Rasmus Villemoes
ecifiy the maximum time allowed between resetting the device. Allow any watchdog device to specify such a property, and then use a reset period of one quarter of that. We keep the current default of resetting once every 1000ms. Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-ucl

[PATCH 1/3] watchdog: remove stale ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS from wdt.h

2020-03-13 Thread Rasmus Villemoes
Since WATCHDOG_TIMEOUT_MSECS was converted to Kconfig (commit ca51ef7c0c), CONFIG_WATCHDOG_TIMEOUT_MSECS has been guaranteed to be defined. So remove the dead fallback ifdeffery. Signed-off-by: Rasmus Villemoes --- include/wdt.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include

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

2020-03-16 Thread Rasmus Villemoes
On 14/03/2020 12.57, Stefan Roese wrote: > On 13.03.20 17:04, Rasmus Villemoes wrote: >>   int initr_watchdog(void) >>   { >>   u32 timeout = WATCHDOG_TIMEOUT_SECS; >> @@ -36,6 +42,8 @@ int initr_watchdog(void) >>   if (CONFIG_IS_ENABLED(OF

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

2020-03-16 Thread Rasmus Villemoes
On 14/03/2020 13.04, Stefan Roese wrote: > On 13.03.20 17:04, Rasmus Villemoes wrote: >> That at least solves half my problems and >> might be useful to others as well. Then I'll have to figure out the >> time-stands-still problem in some other way. > > If its

[PATCH] mtd: spi-nor-core: call WATCHDOG_RESET() in spi_nor_ready()

2020-03-16 Thread Rasmus Villemoes
I have a board for which doing "sf erase 0x10 0x8" consistently causes the external watchdog circuit to reset the board. Make sure to pet the watchdog during slow operations such as erasing or writing large areas of a spi nor flash. Signed-off-by: Rasmus Villemoes --- drive

[PATCH] powerpc: allow opting out of WATCHDOG_RESET() from timer interrupt

2020-03-16 Thread Rasmus Villemoes
this behaviour by setting CONFIG_SYS_WATCHDOG_FREQ to 0 - as that setting is currently nonsensical, it cannot affect any existing boards. Signed-off-by: Rasmus Villemoes --- arch/powerpc/lib/interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/lib

[PATCH] powerpc: remove WATCHDOG_RESET call from wait_ticks()

2020-03-16 Thread Rasmus Villemoes
does one WATCHDOG_RESET() per __udelay() call. Signed-off-by: Rasmus Villemoes --- arch/powerpc/lib/ticks.S | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/lib/ticks.S b/arch/powerpc/lib/ticks.S index c487f938fa..f4410bbc3a 100644 --- a/arch/powerpc/lib/ticks.S +++ b/arch/powerp

[PATCH] spi: mpc8xxx_spi: fix missing dev_err definition

2020-04-20 Thread Rasmus Villemoes
4856cc7a97 (mpc8xxx_spi: implement real ->set_speed) Fixes: 1a7b462dee (mpc8xxx_spi: put max_cs to use) Signed-off-by: Rasmus Villemoes --- Those patches got into -rc5, but I hadn't noticed commit 336d4615f8fa (dm: core: Create a new header file for 'compat' features) from -rc2. S

Re: [PATCH 0/3] mtd: spi-nor: add support for locking on Macronix nor flashes

2020-04-21 Thread Rasmus Villemoes
On 26/03/2020 12.42, Rasmus Villemoes wrote: > Here's an attempt at implementing locking support for Macronix > flashes. ping Rasmus

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

2020-06-05 Thread Rasmus Villemoes
_wrong); /* Version 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 kern

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

2020-06-05 Thread Rasmus Villemoes
rrupts 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

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

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

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

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 branches

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

2020-06-07 Thread Rasmus Villemoes
reful to use unaligned accessors 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

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 tho

[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

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

2020-06-12 Thread Rasmus Villemoes
er is 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 c

[RFC PATCH 0/4] CONFIG_IS_ENABLED magic

2020-06-12 Thread Rasmus Villemoes
much cluttering 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

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

2020-06-12 Thread Rasmus Villemoes
f 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 +--

[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

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] Convert CONFIG_SYS_MMC_ENV_DEV et al to Kconfig

2020-08-05 Thread Rasmus Villemoes
On 24/07/2020 23.14, Tom Rini wrote: > This converts the following to Kconfig: >CONFIG_SYS_MMC_ENV_DEV >CONFIG_SYS_MMC_ENV_PART Yes, please! That's the only thing preventing us from running a vanilla upstream U-Boot on a number of our boards where we have the defconfig out of tree - we cur

Re: [PATCH] env: introduce CONFIG_ENV_DOTVARS_TEMPORARY

2020-01-20 Thread Rasmus Villemoes
On 20/01/2020 17.44, Wolfgang Denk wrote: > Dear Rasmus Villemoes, > > In message <20200108134247.31443-1-rasmus.villem...@prevas.dk> you wrote: >> The printenv command already by default hides variables beginning with >> a dot. It can be useful to take that c

[PATCH 0/2] gpio: mpc8xxx: honour shadow register when writing gpdat

2020-01-28 Thread Rasmus Villemoes
preventing outputs from being read back - the bits corresponding to gpios 0-7 are always read as 0, while at least the value of gpio10 is correctly reflected when reading gpdat. Which is how I noticed these bugs - I couldn't understand why turning one LED on would turn off another. Rasmus Villemo

[PATCH 1/2] gpio: mpc8xxx: don't modify gpdat when setting gpio as input

2020-01-28 Thread Rasmus Villemoes
The extra indirection through mpc8xxx_gpio_set_in() does not help readability, so just fold the gpdir update into mpc8xxx_gpio_direction_input(). Signed-off-by: Rasmus Villemoes --- drivers/gpio/mpc8xxx_gpio.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/dr

[PATCH 2/2] gpio: mpc8xxx: don't do RMW on gpdat register when setting value

2020-01-28 Thread Rasmus Villemoes
- write the bitwise and of the shadow and new gpdir register to gpdat - write the new gpdir register Signed-off-by: Rasmus Villemoes --- drivers/gpio/mpc8xxx_gpio.c | 29 +++-- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/drivers/gpio/mpc8xxx_gpio.c b

[PATCH resend 1/2] gpio: mpc8xxx: don't modify gpdat when setting gpio as input

2020-01-28 Thread Rasmus Villemoes
The extra indirection through mpc8xxx_gpio_set_in() does not help readability, so just fold the gpdir update into mpc8xxx_gpio_direction_input(). Signed-off-by: Rasmus Villemoes --- drivers/gpio/mpc8xxx_gpio.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/dr

[PATCH resend 0/2] gpio: mpc8xxx: honour shadow register when writing gpdat

2020-01-28 Thread Rasmus Villemoes
understand why turning one LED on would turn off another. Rasmus Villemoes (2): gpio: mpc8xxx: don't modify gpdat when setting gpio as input gpio: mpc8xxx: don't do RMW on gpdat register when setting value drivers/gpio/mpc8xxx_gpio.c | 41 ++---

[PATCH resend 2/2] gpio: mpc8xxx: don't do RMW on gpdat register when setting value

2020-01-28 Thread Rasmus Villemoes
- write the bitwise and of the shadow and new gpdir register to gpdat - write the new gpdir register Signed-off-by: Rasmus Villemoes --- drivers/gpio/mpc8xxx_gpio.c | 29 +++-- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/drivers/gpio/mpc8xxx_gpio.c b

[PATCH] mmc: fsl_esdhc: actually enable cache snooping on mpc830x

2020-01-30 Thread Rasmus Villemoes
C8309, one also finds that the fields are bit-reversed, so the bit to set is 0x0200 rather than 0x0040 - this is also what board_mmc_init() uses in the two gdsys/mpc8308/ boards. Signed-off-by: Rasmus Villemoes --- drivers/mmc/fsl_esdhc.c | 15 +-- 1 file changed, 13 insertions(

Re: [U-Boot] [PATCH] fit: Do not automatically decompress ramdisk images

2020-02-03 Thread Rasmus Villemoes
On 08/08/2019 05.16, Tom Rini wrote: > On Fri, Aug 02, 2019 at 03:52:28PM -0700, Julius Werner wrote: > >> The Linux ramdisk should always be decompressed by the kernel itself, >> not by U-Boot. Therefore, the 'compression' node in the FIT image should >> always be set to "none" for ramdisk images

[PATCH] RFC: nvedit: support doing one (extra) expansion of the value in "env set"

2020-02-04 Thread Rasmus Villemoes
ugh I think cli_simple.o could be unconditionally built and then link-time GC should get rid of the excess functions). This has been lightly tested in the sandbox. I'll add some proper unit tests, update the help texts and try to handle the Kconfig issue if this is something that might be accept

[PATCH] net: convert NET_MAXDEFRAG to Kconfig

2020-02-07 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- net/Kconfig | 10 ++ net/net.c| 3 --- scripts/config_whitelist.txt | 1 - 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/net/Kconfig b/net/Kconfig index a07f6746c5..96bbce1778 100644 --- a/net

<    1   2   3   4   5   6   7   8   9   10   >