Re: [PATCH v2 1/2] spi: call WATCHDOG_RESET() in spi_nor_wait_till_ready_with_timeout()

2020-09-22 Thread Rasmus Villemoes
On 20/05/2020 00.12, Rasmus Villemoes wrote: > On 20/03/2020 11.14, Rasmus Villemoes wrote: >> 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

Re: [PATCH v2 0/5] powerpc, mpc83xx: add DM_ETH support

2020-09-22 Thread Rasmus Villemoes
Hi Heiko I'm struggling somewhat with getting our mpc8309-derived board converted to DM_ETH. I just get Net: No ethernet found. where I used to get Net: UEC0, UEC1, UEC2 and there's no errors or other diagnostics printed (I've also tried adding #define DEBUG 1 to the .c files under drivers

Re: [PATCH v2 0/5] powerpc, mpc83xx: add DM_ETH support

2020-09-21 Thread Rasmus Villemoes
On 17/09/2020 06.24, Heiko Schocher wrote: > Hello Rasmus, > > Am 16.09.2020 um 21:35 schrieb Rasmus Villemoes: >> >> We have a mpc8309-based board, currently using a U-Boot based on >> v2020.04. If you have a git tree I can pull these patches from I'll try

[PATCH] gpio/mpc83xx_spisel_boot.c: include log.h

2020-09-21 Thread Rasmus Villemoes
Fix build failure, it used to get this implicitly through common.h until f7ae49fc4f (common: Drop log.h from common header). Signed-off-by: Rasmus Villemoes --- drivers/gpio/mpc83xx_spisel_boot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/mpc83xx_spisel_boot.c b/drivers

[PATCH] spi: mpc8xxx_spi.c: fix cs activate/deactivate

2020-09-18 Thread Rasmus Villemoes
with this change, and I have also tested that removing the GPIOD_ACTIVE_LOW from the request and updating our DT as - gpios = <&spisel 0 0>; + gpios = <&spisel 0 GPIO_ACTIVE_LOW>; still works. Signed-off-by: Rasmus Villemoes --- dr

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

2020-09-18 Thread Rasmus Villemoes
On 04/06/2020 12.31, Stefan Roese wrote: > On 04.06.20 11:30, Rasmus Villemoes wrote: >> Calling WATCHDOG_RESET for each and every cache line is overkill. >> >> In our case, the kernel image is a little over 7MB, and the almost >> 50 calls of WATCHDOG_RESET() a

Re: [PATCH 2/2] env: add CONFIG_ENV_SECT_SIZE_AUTO

2020-09-18 Thread Rasmus Villemoes
On 06/05/2020 10.47, Rasmus Villemoes wrote: > This is roughly the U-Boot side equivalent to commit > e282c422e0 (tools: fw_env: use erasesize from MEMGETINFO ioctl). The > motivation is the case where one has a board with several revisions, > where the SPI flashes have different

Re: [PATCH 1/2] env/sf.c: use a variable to hold the sector size

2020-09-18 Thread Rasmus Villemoes
On 06/05/2020 10.47, Rasmus Villemoes wrote: > As preparation for the next patch, use a local variable to represent > the sector size. No functional change. > ping > Signed-off-by: Rasmus Villemoes > --- > env/sf.c | 22 -- > 1 file changed, 12 insert

Re: [PATCH v2 0/5] powerpc, mpc83xx: add DM_ETH support

2020-09-16 Thread Rasmus Villemoes
On 16/09/2020 07.04, Heiko Schocher wrote: > Hello Mario, Tom, > > added Tom to cc ... > > Am 08.09.2020 um 07:59 schrieb Heiko Schocher: >> Hi Mario, >> >> Am 17.08.2020 um 07:23 schrieb Heiko Schocher: >>> Hello Mario, >>> >>> Am 27.05.2020 um 14:43 schrieb Heiko Schocher: This patch

Re: [RFC PATCH 0/1] Anti rollback protection for FIT Images

2020-09-15 Thread Rasmus Villemoes
On 15/09/2020 07.22, Thirupathaiah Annapureddy wrote: > Hi Rasmus, > >> >>> This RFC introduces a proposal to add anti-rollback protection for >>> FIT images. This protection feature prevents U-Boot from accepting >>> an image if it has ever successfully loaded an image with a larger >>> anti-roll

Re: [RFC PATCH 0/1] Anti rollback protection for FIT Images

2020-09-14 Thread Rasmus Villemoes
On 15/09/2020 08.20, Thirupathaiah Annapureddy wrote: > > On 9/7/2020 11:15 PM, Rasmus Villemoes wrote: >> On 02/09/2020 09.58, Rasmus Villemoes wrote: >>> On 01/09/2020 22.48, Thirupathaiah Annapureddy wrote: >>>> Anti rollback protection is required when there

Re: [RFC PATCH 0/1] Anti rollback protection for FIT Images

2020-09-07 Thread Rasmus Villemoes
On 02/09/2020 09.58, Rasmus Villemoes wrote: > On 01/09/2020 22.48, Thirupathaiah Annapureddy wrote: >> Anti rollback protection is required when there is a need to retire >> previous versions of FIT images due to security flaws in them. >> Currently U-Boot Verified boot d

Re: [RFC PATCH 0/1] Anti rollback protection for FIT Images

2020-09-02 Thread Rasmus Villemoes
On 01/09/2020 22.48, Thirupathaiah Annapureddy wrote: > Anti rollback protection is required when there is a need to retire > previous versions of FIT images due to security flaws in them. > Currently U-Boot Verified boot does not have rollback protection to > protect against known security flaws.

[PATCH v2] scripts/setlocalversion: sync with linux 5.8

2020-08-25 Thread Rasmus Villemoes
ntain the $(ARCH) string but instead the actual value of ARCH. So for now, use the linux version as-is; it should be fairly obvious if 81630a3b38c2 or something like it does need to be applied on top. Signed-off-by: Rasmus Villemoes --- scripts/setlocalversion | 45 +

Re: [PATCH U-Boot] scripts/setlocalversion: Improve -dirty check with git-status --no-optional-locks

2020-08-25 Thread Rasmus Villemoes
On 25/08/2020 14.56, Tom Rini wrote: > On Tue, Aug 25, 2020 at 01:29:50PM +0200, Rasmus Villemoes wrote: > >> From: Brian Norris >> >> [linux commit ff64dd4857303dd5550faed9fd598ac90f0f2238] >> >> scripts/setlocalversion | 12 ++-- >> 1 f

[PATCH U-Boot] scripts/setlocalversion: Improve -dirty check with git-status --no-optional-locks

2020-08-25 Thread Rasmus Villemoes
p and use a regex that's good enough for both the git-status and git-diff-index version. Cc: Christian Kujau Cc: Guenter Roeck Suggested-by: Alexander Kapshuk Signed-off-by: Brian Norris Tested-by: Genki Sky Signed-off-by: Masahiro Yamada Signed-off-by: Rasmus Villemoes --- This fixes

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

[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

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

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

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

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

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

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

[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] allow choosing -Os/-O2 separately for SPL and TPL

2020-06-05 Thread Rasmus Villemoes
ned-off-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_OPTIMIZ

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

2020-06-04 Thread Rasmus Villemoes
ng done, the hashing 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

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

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

[PATCH v3 10/10] test: dm: rtc: add tests of rtc shell command

2020-06-02 Thread Rasmus Villemoes
Add tests of the "list", "read" and "write" subcommands of the rtc shell command. Reviewed-by: Simon Glass Signed-off-by: Rasmus Villemoes --- test/dm/rtc.c | 58 +++ 1 file changed, 58 insertions(+) diff --git a

[PATCH v3 09/10] test: dm: rtc: add test of dm_rtc_read, dm_rtc_write

2020-06-02 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 Signed-off-by: Rasmus Villemoes --- arch/sandbox/include/asm/rtc.h | 5 test/dm/rtc.c

[PATCH v3 07/10] rtc: sandbox-rtc: fix set method

2020-06-02 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 Signed-off-by: Rasmus Villemoes --- drivers/rtc

[PATCH v3 04/10] rtc: pcf2127: provide ->read method

2020-06-02 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 Signed-off-by: Rasmus Villemoes --- drivers/rtc/pcf2127.c | 6 +++--- 1 file

[PATCH v3 05/10] rtc: pcf2127: provide ->write method

2020-06-02 Thread Rasmus Villemoes
Reviewed-by: Simon Glass 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/rtc/pcf2127.c @@ -43,6 +43,12

[PATCH v3 02/10] rtc: add dm_rtc_write() helper

2020-06-02 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 Signed-off-by: Rasmus Villemoes --- drivers/r

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

2020-06-02 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 Signed-off-by: Rasmus Villemoes --- drivers/rtc/i2c_rtc_emul.c | 3 ++- 1 file changed, 2 insertions(+), 1 del

[PATCH v3 06/10] rtc: add rtc command

2020-06-02 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). Signed-off-by: Rasmus Villemoes --- cmd/Kconfig | 6 ++ cmd/Makefile | 1

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

2020-06-02 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 Signed-off-by: Rasmus Villemoes --- drivers/rtc/rt

[PATCH v3 01/10] rtc: add dm_rtc_read helper and ->read method

2020-06-02 Thread Rasmus Villemoes
ned-off-by: Rasmus Villemoes --- drivers/rtc/rtc-uclass.c | 18 ++ include/rtc.h| 23 +++ 2 files changed, 41 insertions(+) diff --git a/drivers/rtc/rtc-uclass.c b/drivers/rtc/rtc-uclass.c index 926cca234e..92cc8c5664 100644 --- a/drivers/rtc/

[PATCH v3 00/10] new rtc methods, rtc command, and tests

2020-06-02 Thread Rasmus Villemoes
Simon. - 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 stum

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

2020-06-02 Thread Rasmus Villemoes
On 20/05/2020 00.01, Rasmus Villemoes wrote: > I need access to registers other than just the timekeeping ones of the > pcf2127, so I wanted to implement ->read8 and ->write8. But for > testing these it appeared there was no convenient way to invoke those > from the shell,

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

2020-06-02 Thread Rasmus Villemoes
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, Rasmus Villemoes wrote: >>> >>>>> Th

Re: [PATCH v2 06/10] rtc: add rtc command

2020-06-02 Thread Rasmus Villemoes
On 02/06/2020 15.22, Simon Glass wrote: > Hi Rasmus, > > On Tue, 2 Jun 2020 at 03:13, Rasmus Villemoes > wrote: >> >> On 31/05/2020 16.07, Simon Glass wrote: >>> Hi Rasmus, >>> >>> On Tue, 19 May 2020 at 16:01, Rasmus Villemoes >>> wro

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

2020-06-02 Thread Rasmus Villemoes
On 16/03/2020 16.52, Rasmus Villemoes wrote: > 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 >>

Re: [PATCH] env: Add option to only ever append environment

2020-06-02 Thread Rasmus Villemoes
On 02/06/2020 13.04, Marek Vasut wrote: > On 6/2/20 8:42 AM, Rasmus Villemoes wrote: >> On 29/05/2020 19.54, Marek Vasut wrote: >>> +config ENV_APPEND >>> + bool "Always append the environment with new data" >>> + default n >>> + help &

Re: [PATCH v2 10/10] test: dm: rtc: add tests of rtc shell command

2020-06-02 Thread Rasmus Villemoes
On 31/05/2020 16.07, Simon Glass wrote: > On Tue, 19 May 2020 at 16:01, Rasmus Villemoes > wrote: >> >> Signed-off-by: Rasmus Villemoes >> --- >> test/dm/rtc.c | 61 +++ >> 1 file changed, 61 insertions

Re: [PATCH v2 06/10] rtc: add rtc command

2020-06-02 Thread Rasmus Villemoes
On 31/05/2020 16.07, Simon Glass wrote: > Hi Rasmus, > > On Tue, 19 May 2020 at 16:01, Rasmus Villemoes > wrote: >> >> +static int do_rtc_read(struct udevice *dev, int argc, char * const argv[]) >> +{ >> + u8 buf[MAX_RTC_BYTES]; >> +

Re: [PATCH] env: Add option to only ever append environment

2020-06-01 Thread Rasmus Villemoes
On 29/05/2020 19.54, Marek Vasut wrote: > +config ENV_APPEND > + bool "Always append the environment with new data" > + default n > + help > + If defined, the environment hash table is only ever appended with new > + data, but the existing hash table can never be dropped and

Re: [PATCH v2 1/2] spi: call WATCHDOG_RESET() in spi_nor_wait_till_ready_with_timeout()

2020-05-19 Thread Rasmus Villemoes
On 20/03/2020 11.14, Rasmus Villemoes wrote: > 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 ar

[PATCH v2 10/10] test: dm: rtc: add tests of rtc shell command

2020-05-19 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- test/dm/rtc.c | 61 +++ 1 file changed, 61 insertions(+) diff --git a/test/dm/rtc.c b/test/dm/rtc.c index 5301805d19..d1d8ff0375 100644 --- a/test/dm/rtc.c +++ b/test/dm/rtc.c @@ -5,6 +5,7 @@ */ #include

[PATCH v2 07/10] rtc: sandbox-rtc: fix set method

2020-05-19 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". Signed-off-by: Rasmus Villemoes --- drivers/rtc/sandbox_rtc.c | 65 +++---

[PATCH v2 09/10] test: dm: rtc: add test of rtc_read, rtc_write

2020-05-19 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. Signed-off-by: Rasmus Villemoes --- arch/sandbox/include/asm/rtc.h | 5 test/dm/rtc.c | 45

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

2020-05-19 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. Signed-off-by: Rasmus Villemoes --- drivers/rtc/i2c_rtc_emul.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driver

[PATCH v2 01/10] rtc: add rtc_read helper and ->read method

2020-05-19 Thread Rasmus Villemoes
ned-off-by: Rasmus Villemoes --- drivers/rtc/rtc-uclass.c | 18 ++ include/rtc.h| 23 +++ 2 files changed, 41 insertions(+) diff --git a/drivers/rtc/rtc-uclass.c b/drivers/rtc/rtc-uclass.c index a0a238aedd..44d76bb70f 100644 --- a/drivers/rtc/rtc-uclas

[PATCH v2 05/10] rtc: pcf2127: provide ->write method

2020-05-19 Thread Rasmus Villemoes
Reviewed-by: Simon Glass 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 f48cd8cb18..a3faf62ee0 100644 --- a/drivers/rtc/pcf2127.c +++ b/drivers/rtc/pcf2127.c @@ -42,6 +42,12

[PATCH v2 06/10] rtc: add rtc command

2020-05-19 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). Signed-off-by: Rasmus Villemoes --- cmd/Kconfig | 6 ++ cmd/Makefile | 1

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

2020-05-19 Thread Rasmus Villemoes
ovides ->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 Signed-off-by: Rasmus Villemoes --- drivers/rtc/rtc-uclass.c | 24

[PATCH v2 02/10] rtc: add rtc_write() helper

2020-05-19 Thread Rasmus Villemoes
Similar to 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 Signed-off-by: Rasmus Villemoes --- drivers/r

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

2020-05-19 Thread Rasmus Villemoes
Simon. - 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 v2 04/10] rtc: pcf2127: provide ->read method

2020-05-19 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 Signed-off-by: Rasmus Villemoes --- drivers/rtc/pcf2127.c | 6 +++--- 1 file

Re: [PATCH 5/5] mtd: spi: Use IS_ENABLED to prevent ifdef

2020-05-15 Thread Rasmus Villemoes
On 15/05/2020 09.22, Rasmus Villemoes wrote: > That should make it obvious why one needs a variant that doesn't want > the CONFIG_ included in the argument; the CONFIG_IS_ENABLED macro needs > to do token-pasting with either CONFIG_SPL_ or just CONFIG_. On that note, I think all hi

Re: [PATCH 5/5] mtd: spi: Use IS_ENABLED to prevent ifdef

2020-05-15 Thread Rasmus Villemoes
On 15/05/2020 06.27, Stefan Roese wrote: > Hi Daniel, > > On 14.05.20 18:31, Daniel Schwierzeck wrote: >> >> >> Am 14.05.20 um 14:11 schrieb Jagan Teki: >>> Use IS_ENABLED to prevent ifdef in sf_probe.c >>> >>> Cc: Simon Glass >>> Cc: Vignesh R >>> Cc: Daniel Schwierzeck >>> Signed-off-by: Jaga

Re: [PATCH v2 2/2] env/sf.c: honour CONFIG_SPL_SAVEENV

2020-05-10 Thread Rasmus Villemoes
On 09/05/2020 22.54, Tom Rini wrote: > On Sat, May 09, 2020 at 08:56:46PM +0200, Rasmus Villemoes wrote: >> On 09/05/2020 00.59, Tom Rini wrote: >>> On Fri, Mar 27, 2020 at 12:02:00AM +0100, Rasmus Villemoes wrote: >>> >>> >>> Applied to u-boot/master,

Re: [PATCH v2 2/2] env/sf.c: honour CONFIG_SPL_SAVEENV

2020-05-09 Thread Rasmus Villemoes
On 09/05/2020 00.59, Tom Rini wrote: > On Fri, Mar 27, 2020 at 12:02:00AM +0100, Rasmus Villemoes wrote: > > > Applied to u-boot/master, thanks! > Eh, thanks, but you already applied v1 consisting of 5 patches. v1 1/5 corresponded to v2 1/2, while v1 5/5 corresponded to v2 2/2 -

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

2020-05-07 Thread Rasmus Villemoes
On 07/05/2020 15.03, Tom Rini wrote: > On Tue, Feb 18, 2020 at 08:39:42AM +0000, Rasmus Villemoes wrote: > >> Signed-off-by: Rasmus Villemoes >> Reviewed-by: Tom Rini > > [I had asked for a follow-up cleanup, but this is still worth taking, > so...] Yeah, sorry, b

Re: [PATCH 2/2] env: add CONFIG_ENV_SECT_SIZE_AUTO

2020-05-06 Thread Rasmus Villemoes
On 06/05/2020 12.18, Joakim Tjernlund wrote: > On Wed, 2020-05-06 at 12:00 +0200, Joakim Tjernlund wrote: >> On Wed, 2020-05-06 at 11:37 +0200, Rasmus Villemoes wrote: >>> CAUTION: This email originated from outside of the organization. Do not >>> click links or

Re: [PATCH 2/2] env: add CONFIG_ENV_SECT_SIZE_AUTO

2020-05-06 Thread Rasmus Villemoes
On 06/05/2020 12.00, Joakim Tjernlund wrote: > On Wed, 2020-05-06 at 11:37 +0200, Rasmus Villemoes wrote: >> >> On 06/05/2020 11.21, Joakim Tjernlund wrote: >> >>> I can test NOR Flash ,I am on an older u-boot ATM but fw_setenv stuff >>> should be simple to

Re: [PATCH 2/2] env: add CONFIG_ENV_SECT_SIZE_AUTO

2020-05-06 Thread Rasmus Villemoes
On 06/05/2020 11.21, Joakim Tjernlund wrote: > I can test NOR Flash ,I am on an older u-boot ATM but fw_setenv stuff should > be simple to backport > How would fw_env.config be dealt with? Just ignored when auto size? AFAIK, the U-Boot configuration doesn't affect the userspace fw_env tools, so

Re: [PATCH 2/2] env: add CONFIG_ENV_SECT_SIZE_AUTO

2020-05-06 Thread Rasmus Villemoes
On 06/05/2020 10.59, Joakim Tjernlund wrote: > On Wed, 2020-05-06 at 10:47 +0200, Rasmus Villemoes wrote: >> At first, I wanted to allow setting CONFIG_ENV_SECT_SIZE to 0 to mean >> "use the erase size the chip reports", but that config >> option is used in a numb

[PATCH 2/2] env: add CONFIG_ENV_SECT_SIZE_AUTO

2020-05-06 Thread Rasmus Villemoes
aster boot time since our logic always causes the environment to be written during boot. Signed-off-by: Rasmus Villemoes --- env/Kconfig | 14 ++ env/sf.c| 10 -- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/env/Kconfig b/env/Kconfig index 969308fe6c..c90

[PATCH 1/2] env/sf.c: use a variable to hold the sector size

2020-05-06 Thread Rasmus Villemoes
As preparation for the next patch, use a local variable to represent the sector size. No functional change. Signed-off-by: Rasmus Villemoes --- env/sf.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/env/sf.c b/env/sf.c index 22b70ad319..cd5339578b

[PATCH 0/2] add CONFIG_ENV_SECT_SIZE_AUTO

2020-05-06 Thread Rasmus Villemoes
ms to generate identical binary code. The motivation is to cut about half a second off boottime on our newer revisions, while still having the same U-Boot binary work on both. Rasmus Villemoes (2): env/sf.c: use a variable to hold the sector size env: add CONFIG_ENV_SECT_SIZE_AUTO env/Kconfig

Re: [PATCH 1/6] rtc: add rtc_read8_array helper and ->read8_array method

2020-05-06 Thread Rasmus Villemoes
On 06/05/2020 05.42, Simon Glass wrote: > On Mon, 4 May 2020 at 15:20, Rasmus Villemoes > wrote: >> >> Some users may want to read multiple consecutive 8-bit >> registers. Instead of each caller having to implement the loop, >> provide a rtc_read8_array() helper. Als

<    2   3   4   5   6   7   8   9   >