[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

[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/drivers/rtc

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

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.

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

2020-09-08 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-15 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-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 >>>

[PATCH v2 1/3] cli_hush.c: refactor handle_dollar() to prepare for "run with arguments"

2020-10-07 Thread Rasmus Villemoes
. No functional change. Signed-off-by: Rasmus Villemoes --- common/cli_hush.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/common/cli_hush.c b/common/cli_hush.c index 5b1f119074..072b871f1e 100644 --- a/common/cli_hush.c +++ b/common/cli_hush.c

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

2020-10-07 Thread Rasmus Villemoes
-- arg1 arg2 arg3 and use $1... up to $9 in the definition of foo. $# is set so foo can make decisions based on that, and ${3:-default} works as expected. In v2, at Heinrich's suggestion, make this available as an extension of the existing run command rather than being a separate 'call' command. Rasmus

[PATCH v2 3/3] ut: add small hush tests

2020-10-07 Thread Rasmus Villemoes
This is primarily to add a test of the new "call" command, but we might as well add some very basic tests as well. Signed-off-by: Rasmus Villemoes --- configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + include/test/suites.h | 1 + test/cmd/Makefile

[PATCH] cli_hush.c: remove broken sanity check

2020-10-07 Thread Rasmus Villemoes
l variable, then doing 'env set abc xyz'. Signed-off-by: Rasmus Villemoes --- common/cli_hush.c | 8 1 file changed, 8 deletions(-) diff --git a/common/cli_hush.c b/common/cli_hush.c index 5b1f119074..66995c255b 100644 --- a/common/cli_hush.c +++ b/common/cli_hush.c @@ -2170,14 +217

[PATCH v2 2/3] allow positional arguments with "run" command

2020-10-07 Thread Rasmus Villemoes
uff $1 $2' run f -- arg1 arg2 Everything except - b_addchr(dest, '?'); + b_addchr(dest, ch); is under CONFIG_CMD_RUN_ARGS, and when CONFIG_CMD_RUN_ARGS=n, the ch there can only be '?'. So no functional change when CONFIG_CMD_RUN_ARGS is not selected. Signed-off-

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

2020-10-15 Thread Rasmus Villemoes
On 15/10/2020 17.05, Simon Glass wrote: > Hi Rasmus, > > On Mon, 12 Oct 2020 at 01:06, Rasmus Villemoes > wrote: >> >> On 12/10/2020 05.34, Simon Glass wrote: >>> On Wed, 7 Oct 2020 at 01:21, Rasmus Villemoes >>> wrote: >>>> >>>>

Re: [PATCH 3/5] bloblist: Tidy up the data alignment

2020-10-05 Thread Rasmus Villemoes
On 20/09/2020 02.49, Simon Glass wrote: > The intention which bloblists is that each blob's data is aligned in > memory. At present it is only the headers that are aligned. > > Update the code to correct this and add a little more documentation. Hi Simon I haven't read this patch in detail, but

Re: [PATCH 1/3] mdio-uclass.c: support fixed-link subnodes

2020-10-06 Thread Rasmus Villemoes
On 06/10/2020 08.02, Heiko Schocher wrote: > Hello Rasmus, > > Am 05.10.2020 um 15:15 schrieb Rasmus Villemoes: >> When trying to port our mpc8309-based board to DM_ETH, on top of >> Heiko's patches, I found that nothing in mdio-uclass.c seems to >> support the

[PATCH 0/1] fix verified boot on BE hosts

2020-10-06 Thread Rasmus Villemoes
On 05/10/2020 16.10, Rasmus Villemoes wrote: > I wanted to try using tools/fit_check_sign as a quick way to bisect > this, unfortunately the v2020.10-rc4 version (also) says that the kernel > image is correctly signed. > > Does anyone have a crystal ball that says what mig

[PATCH 1/1] rsa: fix retrieving public exponent on big-endian systems

2020-10-06 Thread Rasmus Villemoes
accesses, add a little helper that first memcpy's the bytes to a local fdt64_t, then applies fdt64_to_cpu(). [The name is chosen based on the [bl]eXX_to_cpup in linux/byteorder/generic.h]. Fixes: fdf0819afb ("rsa: fix alignment issue when getting public exponent") Signed-off-by: Rasmus

Re: [PATCH 1/1] rsa: fix retrieving public exponent on big-endian systems

2020-10-12 Thread Rasmus Villemoes
On 09/10/2020 15.08, Tom Rini wrote: > On Wed, Oct 07, 2020 at 12:17:56AM +0200, Rasmus Villemoes wrote: >> On 07/10/2020 00.02, Simon Glass wrote: >>> >>> Reviewed-by: Simon Glass >>> >>> Is there a way to add a test for this? >> >>

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

2020-10-12 Thread Rasmus Villemoes
On 12/10/2020 05.34, Simon Glass wrote: > On Wed, 7 Oct 2020 at 01:21, Rasmus Villemoes > wrote: >> >> cmd/Kconfig| 10 ++ >> cmd/nvedit.c | 7 ++- >> common/cli.c | 44 ++

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

2020-10-19 Thread Rasmus Villemoes
On 19/10/2020 09.31, Wolfgang Denk wrote: > Dear Rasmus, > > In message <2284dd1d-f20c-6246-805e-55454a581...@prevas.dk> you wrote: >> >>> Yes that's good, but is the plan now to take these patches rather than >>> update to the latest hush? I was wondering is Buzybox has any tests >>> for hush.

Re: [PATCH 11/11] bootm: Support string substitution in bootargs

2020-10-19 Thread Rasmus Villemoes
On 19/10/2020 15.56, Simon Glass wrote: > In some cases it is necessary to pass parameters to Linux so that it will > boot correctly. For example, the rootdev parameter is often used to > specify the root device. However the root device may change depending on > whence U-Boot loads the kernel. At

[PATCH 0/3] DM_ETH v mpc83xx fixups

2020-10-05 Thread Rasmus Villemoes
/.remove. It's mostly mechanical using coccinelle, but WDYT? Rasmus Villemoes (3): mdio-uclass.c: support fixed-link subnodes dm_qe_uec.c: fix indentation in uec_set_mac_if_mode() uec.h: fix COFIG_DM typo drivers/net/qe/dm_qe_uec.c | 4 ++-- drivers/net/qe/uec.h | 2 +- net/mdio

[PATCH 1/3] mdio-uclass.c: support fixed-link subnodes

2020-10-05 Thread Rasmus Villemoes
); ... } phy = of_phy_connect(dev, phy_np, hndlr, 0, iface); And U-Boot's phy_connect() does have support for fixed-link subnodes. Calling phy_connect() directly with NULL bus and a dummy address does seem to make the ethernet work. Signed-off-by: Rasmus Villemoes --- net/mdio-u

[PATCH 3/3] uec.h: fix COFIG_DM typo

2020-10-05 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/net/qe/uec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/qe/uec.h b/drivers/net/qe/uec.h index 7cd4b8737a..32b7d3e561 100644 --- a/drivers/net/qe/uec.h +++ b/drivers/net/qe/uec.h @@ -678,7 +678,7 @@ struct uec_priv

[PATCH 2/3] dm_qe_uec.c: fix indentation in uec_set_mac_if_mode()

2020-10-05 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/net/qe/dm_qe_uec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/qe/dm_qe_uec.c b/drivers/net/qe/dm_qe_uec.c index 3482b3ff17..e2b8bf02f9 100644 --- a/drivers/net/qe/dm_qe_uec.c +++ b/drivers/net/qe/dm_qe_uec.c

verified boot changes since 2020.04

2020-10-05 Thread Rasmus Villemoes
Hi, I'm trying to keep our board in sync with upstream, but when trying to port it to v2020.10-rc4, the kernel verification fails: ## Loading kernel from FIT Image at 0300 ... Using 'conf-def.dtb' configuration Verifying Hash Integrity ... sha1,rsa2048:dev- error! Verification failed

Re: [PATCH 1/1] rsa: fix retrieving public exponent on big-endian systems

2020-10-06 Thread Rasmus Villemoes
On 07/10/2020 00.02, Simon Glass wrote: > Hi Rasmus, > > On Tue, 6 Oct 2020 at 04:10, Rasmus Villemoes > wrote: >> >> Commit fdf0819afb (rsa: fix alignment issue when getting public >> exponent) changed the logic to avoid doing an 8-byte access to a >>

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

2020-08-25 Thread Rasmus Villemoes
at'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 real problems when buildi

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 v2] scripts/setlocalversion: sync with linux 5.8

2020-08-25 Thread Rasmus Villemoes
) 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 2/2] env: add CONFIG_ENV_SECT_SIZE_AUTO

2020-09-24 Thread Rasmus Villemoes
On 24/09/2020 13.35, Mike Looijmans wrote: >>> Automatically writing the environment on every boot is always a >>> really bad idea. Never ever do that. >> >> Well, there's really no other place on this piece of hardware to >> implement a boot counter/slot selection. Sure, we could use another

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

2020-09-24 Thread Rasmus Villemoes
On 24/09/2020 12.54, Wolfgang Denk wrote: > Dear Rasmus, > > In message <125344f4-2b69-1c7a-0f5a-6d27ab312...@prevas.dk> you wrote: >>> >>> On our newer boards with the 4K erase size, saving the environment now >>> takes 0.080 seconds instead of 0.53 seconds, which directly translates >>> to that

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

2020-09-24 Thread Rasmus Villemoes
On 23/09/2020 07.02, Heiko Schocher wrote: > Hi Rasmus, > > Am 22.09.2020 um 16:34 schrieb Rasmus Villemoes: >> The board already used OF_CONTROL, so I've tried extending the >> device-tree based partly on you changes for the km boards, partly from >> our linux device

[PATCH 3/3] ut: add small hush tests

2020-09-25 Thread Rasmus Villemoes
This is primarily to add a test of the new "call" command, but we might as well add some very basic tests as well. Signed-off-by: Rasmus Villemoes --- configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + include/test/suites.h | 1 + test/cmd/Makefile

[PATCH 2/3] cli_hush.c: add "call" command

2020-09-25 Thread Rasmus Villemoes
ver, that behaviour should be controlled by a separate config knob, and can be added later if anyone actually wants it. Signed-off-by: Rasmus Villemoes --- cmd/Kconfig | 8 + common/cli_hush.c | 75 ++- 2 files changed, 82 insertions(+), 1 delet

[PATCH 1/3] cli_hush.c: refactor handle_dollar() to prepare for cmd_call

2020-09-25 Thread Rasmus Villemoes
. No functional change. Signed-off-by: Rasmus Villemoes --- common/cli_hush.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/common/cli_hush.c b/common/cli_hush.c index 5b1f119074..072b871f1e 100644 --- a/common/cli_hush.c +++ b/common/cli_hush.c

[PATCH 0/3] add "call" command

2020-09-25 Thread Rasmus Villemoes
by that name and do it as "call". But that change of behaviour, I think, requires a separate opt-in config knob, and can be done later if someone actually wants that. Rasmus Villemoes (3): cli_hush.c: refactor handle_dollar() to prepare for cmd_call cli_hush.c: add "call"

Re: [PATCH 0/3] add "call" command

2020-09-25 Thread Rasmus Villemoes
On 25/09/2020 15.09, Wolfgang Denk wrote: > Dear Heinrich Schuchardt, > > In message <4b00225d-d960-4a14-9aec-110f7...@gmx.de> you wrote: >> >> Further we cannot first introduce a command call and then eliminate it >> due to backward compatibility. We should decide on the final version >>

Re: [PATCH 0/3] add "call" command

2020-09-25 Thread Rasmus Villemoes
On 25/09/2020 13.52, Heinrich Schuchardt wrote: > On 25.09.20 13:19, Rasmus Villemoes wrote: >> This adds a way to call a "function" defined in the environment with >> arguments. I.e., whereas >> >> run foo >> >> requires one to set the (shell

Re: [PATCH 2/3] cli_hush.c: add "call" command

2020-09-25 Thread Rasmus Villemoes
On 25/09/2020 13.19, Rasmus Villemoes wrote: > Currently, the only way to emulate functions with arguments in the > busybox shell is by doing "foo=arg1; bar=arg2; run func" and having I have no idea why I always end up writing "busybox shell" when I mean "U-Boot sh

Re: [PATCH 0/3] add "call" command

2020-09-25 Thread Rasmus Villemoes
On 25/09/2020 15.38, Heinrich Schuchardt wrote: > On 25.09.20 15:09, Wolfgang Denk wrote: >> Dear Heinrich Schuchardt, >> >> In message <4b00225d-d960-4a14-9aec-110f7...@gmx.de> you wrote: >>> >>> Further we cannot first introduce a command call and then eliminate it >>> due to backward

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

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

2020-09-23 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

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

2020-06-02 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

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

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

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

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

[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 03/10] rtc: fall back to ->{read, write} if ->{read, write}8 are not provided

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

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

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

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

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

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

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

2020-09-18 Thread Rasmus Villemoes
change, and I have also tested that removing the GPIOD_ACTIVE_LOW from the request and updating our DT as - gpios = < 0 0>; + gpios = < 0 GPIO_ACTIVE_LOW>; still works. Signed-off-by: Rasmus Villemoes --- drivers/spi/mpc8xxx_spi.c | 6 ++

Re: [PATCH 4/5] sandbox: implement reset

2020-10-27 Thread Rasmus Villemoes
On 27/10/2020 14.33, Heinrich Schuchardt wrote: > On 27.10.20 13:12, Rasmus Villemoes wrote: >> On 25/10/2020 07.04, Heinrich Schuchardt wrote: >>> Up to now the sandbox would shutdown upon a cold reset request. Instead it >>> should be reset. >>> >&

Re: [PATCH v2 5/8] sandbox: implement reset

2020-10-27 Thread Rasmus Villemoes
On 27/10/2020 19.47, Heinrich Schuchardt wrote: > Up to now the sandbox would shutdown upon a cold reset request. Instead it > should be reset. > > In our coding we use static variables like LIST_HEAD(efi_obj_list). A reset > can occur at any time, e.g. via an UEFI binary calling the reset

Re: [PATCH 4/5] sandbox: implement reset

2020-10-27 Thread Rasmus Villemoes
On 25/10/2020 07.04, Heinrich Schuchardt wrote: > Up to now the sandbox would shutdown upon a cold reset request. Instead it > should be reset. > > In our coding we use static variables. The only safe way to return to an > initial state is to relaunch the U-Boot binary. > > The reset

[RFC PATCH] scripts/setlocalversion: avoid keeping double-quotes in UBOOTRELEASE

2020-10-27 Thread Rasmus Villemoes
in $() constructs, grep for the few lines we're interested in and eval those. Signed-off-by: Rasmus Villemoes --- This is not really meant for applying, hence RFC. I hope to be able to get U-Boot's and linux' copies completely in sync (since the last sync a few weeks ago, 548b8b51 has landed in

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

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

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

[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

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

[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 changed, 2

[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 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 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 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 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 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
ied 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. Rasmus Villemoes (11): rtc: add dm_rtc_read helper

<    1   2   3   4   5   6   7   8   9   >