[PATCH 4/6] rtc: pcf2127: provide ->read8_array method

2020-05-04 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. Signed-off-by: Rasmus Villemoes --- drivers/rtc/pcf2127.c | 7 --- 1 file changed, 4 insertions(+), 3

[PATCH 5/6] rtc: pcf2127: provide ->write8_array method

2020-05-04 Thread Rasmus Villemoes
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 b3f6de8496..227ab09880 100644 --- a/drivers/rtc/pcf2127.c +++ b/drivers/rtc/pcf2127.c @@ -43,6 +43,12 @@ static int

[PATCH 6/6] rtc: add rtc command

2020-05-04 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 read8/write8 methods or their _array variants). Signed-off-by: Rasmus Villemoes --- cmd/Kconfig | 6 ++ cmd/Makefile | 1 + cmd/rtc.c| 153

[PATCH] mpc83xx: remove redundant MPC83xx_RESET #define

2020-05-04 Thread Rasmus Villemoes
This macro is only used (tested for existence) in mpc83xx.c, which unconditionally includes mpc83xx.h where it is unconditionally defined. Removing it makes the remaining code easier to read. Signed-off-by: Rasmus Villemoes --- arch/powerpc/cpu/mpc83xx/cpu.c | 24

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

[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

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

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

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 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 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] 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 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 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 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 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 resend 0/5] spi: mpc8xxx_spi: bug fixes, real ->set_speed and a pseudo-gpio driver

2020-03-16 Thread Rasmus Villemoes
On 11/02/2020 16.20, Rasmus Villemoes wrote: > This is a combination of a single patch and a 4-part series sent > previously [1,2], this time with Jagan on Cc. > > Patch 1 is a convenient pseudo-gpio driver for controlling a single > output signal on mpc830x. Since it's (usu

fdtdec: what is the purpose of the compat_names array

2020-03-16 Thread Rasmus Villemoes
I was running strings(1) on my SPL to see if there was something obvious I could find and compile away. To my surprise, I found strings such as altr,socfpga-dw-mshc altr,socfpga-fpga2hps-bridge altr,socfpga-fpga2sdram0-bridge altr,socfpga-fpga2sdram1-bridge which are of course quickly tracked to

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

2020-03-17 Thread Rasmus Villemoes
On 17/03/2020 11.02, Wolfgang Denk wrote: > Dear Rasmus, > > In message <20200316212337.30204-1-rasmus.villem...@prevas.dk> you wrote: >> wait_ticks() is only used by the ppc-specific __udelay() >> function. Having the powerpc version of __udelay implicitly call >> WATCHDOG_RESET() is inconsistent

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

2020-03-17 Thread Rasmus Villemoes
On 17/03/2020 13.21, Wolfgang Denk wrote: > Dear Rasmus, > > In message <1b6c7efd-8264-6cb5-0b39-3223bae5f...@prevas.dk> you wrote: >> >> Or do you not agree that __udelay is supposed to be a raw primitive that >> does the delay and nothing else? > > I agree, and it does that - it converts the mi

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

2020-03-17 Thread Rasmus Villemoes
On 17/03/2020 14.21, Christophe Leroy wrote: > > > Le 17/03/2020 à 14:07, Rasmus Villemoes a écrit : >> >>> In any case it seems to me a board specific redefinition of the >>> WATCHDOG_RESET macro would be less intrusive and risky than changing >>> code

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

2020-03-17 Thread Rasmus Villemoes
On 17/03/2020 15.31, Wolfgang Denk wrote: > Dear Rasmus, > > In message <01193803-be8f-865d-5fce-2c7cee0fd...@prevas.dk> you wrote: >> >>> Are you aware that there is the PPC-global implementation of >>> wait_ticks() in arch/powerpc/lib/ticks.S , plus another MPC83xx >>> specific one in drivers/ti

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

2020-03-18 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 --- v2: add comment explaining the semantics of setting CONFIG_SYS_WATCHDOG_FREQ to 0. arch/powerpc/lib/interrupts.c | 7

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

2020-03-19 Thread Rasmus Villemoes
On 19/03/2020 12.25, Vignesh Raghavendra wrote: > Hi, > > On 17/03/20 1:48 am, 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 pe

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

2020-03-19 Thread Rasmus Villemoes
On 19/03/2020 13.28, Vignesh Raghavendra wrote: > > > On 19/03/20 5:09 pm, Rasmus Villemoes wrote: >> On 19/03/2020 12.25, Vignesh Raghavendra wrote: >>> Hi, > [...] >>>> @@ -399,6 +400,7 @@ static int spi_nor_ready(struct spi_nor *nor) >>>> {

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

2020-03-19 Thread Rasmus Villemoes
On 19/03/2020 14.23, Vignesh Raghavendra wrote: > >> For the read side, it seems that just replacing the UINT_MAX in the two >> copies of spi_nor_read_data with some smaller constant should suffice. >> But I don't know if I should make that smaller constant a CONFIG_* >> option or just pick somet

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

2020-03-19 Thread Rasmus Villemoes
On 19/03/2020 15.52, Kuldeep Singh wrote: > Hi Vignesh, > >> 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 s

[PATCH v2 2/2] spi: allow calling WATCHDOG_RESET during long reads

2020-03-20 Thread Rasmus Villemoes
nd/or memmove operations into chunks, doing a WATCHDOG_RESET for each, introduce a CONFIG_SPI_FLASH_READ_CHUNKSZ config knob. We keep the default of doing the whole read in one go, but the board config can set a suitable threshold. Signed-off-by: Rasmus Villemoes --- drivers/mtd/spi/Kconfig

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

2020-03-20 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 v3 1/2] timer: mpc83xx_timer: fix build with CONFIG_{HW_, }WATCHDOG

2020-03-20 Thread Rasmus Villemoes
The code, which is likely copied from arch/powerpc/lib/interrupts.c, lacks a fallback definition of CONFIG_SYS_WATCHDOG_FREQ and refers to a non-existing timestamp variable - obviously priv->timestamp is meant. Signed-off-by: Rasmus Villemoes --- drivers/timer/mpc83xx_timer.c | 6 +- 1 f

[PATCH v3 2/2] allow opting out of WATCHDOG_RESET() from timer interrupt

2020-03-20 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. Add documentation for both the existing and extended meaning of CONFIG_SYS_WATCHDOG_FREQ. Signed-off-by: Rasmus Villemoes --- README

[PATCH] tools: fw_env: use erasesize from MEMGETINFO ioctl

2020-03-20 Thread Rasmus Villemoes
at case, though I think it should be possible for the other types as well. Signed-off-by: Rasmus Villemoes --- tools/env/fw_env.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 381739d28d..87c3504315 100644 --- a/tools/env/fw_env.c +++ b/too

Re: [PATCH] tools: fw_env: use erasesize from MEMGETINFO ioctl

2020-03-20 Thread Rasmus Villemoes
it should be possible for the other >> types as well. >> >> Signed-off-by: Rasmus Villemoes >> --- >> tools/env/fw_env.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c >>

Re: [PATCH] tools: fw_env: use erasesize from MEMGETINFO ioctl

2020-03-20 Thread Rasmus Villemoes
On 20/03/2020 15.27, Rasmus Villemoes wrote: > On 20/03/2020 15.11, Wolfgang Denk wrote: >> Dear Rasmus, >> >> In message <20200320140414.19689-1-rasmus.villem...@prevas.dk> you wrote: >>> >>> Having different fw_env.config files for the different

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

2020-03-22 Thread Rasmus Villemoes
On 03/03/2020 13.19, Rasmus Villemoes wrote: > 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

adding support for locking on macronix flashes

2020-03-23 Thread Rasmus Villemoes
I need to add support for locking on macronix flashes. They don't quite fit into the existing stm_*() functions, so I suppose I will have to create a new family (mx_*lock*). They do have the same SR_BP{0,1,2} bits, but also a fourth SR_BP3. Moreover, they also support bottom protect, but the bit f

Re: [PATCH v2] cmd: ubi: add a command to rename volume

2020-03-23 Thread Rasmus Villemoes
On 23/03/2020 18.16, Philippe REYNES wrote: >>> +#ifdef CONFIG_CMD_UBI_RENAME >> >> Can you use IS_ENABLED(CONFIG_...) and drop the #ifdef way above? > > I've sent a v3 where I use IS_ENABLED instead of #ifdef. > But I've kept a #if IS_ENABLED(...) around the function ubi_rename_vol. > Otherwise

[PATCH v2] tools: fw_env: use erasesize from MEMGETINFO ioctl

2020-03-24 Thread Rasmus Villemoes
ed to use the environment size as erase size (and consequently computed ENVSECTORS(dev) as 1). As I'm only testing this on a NOR flash, I'm only changing the logic for that case, though I think it should be possible for the other types as well. Signed-off-by: Rasmus Villemoes --- v

Re: [PATCH 0/5] CMD_SAVEENV ifdef cleanup

2020-03-24 Thread Rasmus Villemoes
On 19/02/2020 10.47, Rasmus Villemoes wrote: > The various env storage drivers almost all have their own logic [1] > for deciding whether to compile and provide the .save method, many of > which fail to honour CONFIG_SPL_SAVEENV. For example, fat.c and sf.c > define a CMD_SAVEENV ma

Re: [PATCH 0/5] CMD_SAVEENV ifdef cleanup

2020-03-25 Thread Rasmus Villemoes
On 25/03/2020 08.50, Wolfgang Denk wrote: > Dear Rasmus Villemoes, > > In message <9c03710e-5eec-da6e-6c15-2f8a14cfc...@prevas.dk> you wrote: >> >> Can I ask whether you request changes to this patch series or if my >> answers to your various comments have been s

[PATCH 1/3] mtd: spi-nor: don't guard stm_*lock* family by preprocessor conditionals

2020-03-26 Thread Rasmus Villemoes
capabable of compiling if (expression with no side effects) { if (0) { } } to nothing at all. Signed-off-by: Rasmus Villemoes --- drivers/mtd/spi/spi-nor-core.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers

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

2020-03-26 Thread Rasmus Villemoes
d, we will use bottom protect, so we can't really shoot ourselves in the foot). Rasmus Villemoes (3): mtd: spi-nor: don't guard stm_*lock* family by preprocessor conditionals mtd: spi-nor: add support for locking on Macronix nor flashes mtd: spi-nor: set SPI_NOR_HAS_LO

[PATCH 3/3] mtd: spi-nor: set SPI_NOR_HAS_LOCK for Macronix mx25l3205d

2020-03-26 Thread Rasmus Villemoes
on. Signed-off-by: Rasmus Villemoes --- drivers/mtd/spi/spi-nor-ids.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c index 973b6f86c9..5beb3cb3ad 100644 --- a/drivers/mtd/spi/spi-nor-ids.c +++ b/drivers/mtd/sp

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

2020-03-26 Thread Rasmus Villemoes
- it will get eliminated as dead code if neither of those or CONFIG_SPI_FLASH_MACRONIX are set. Signed-off-by: Rasmus Villemoes --- drivers/mtd/spi/spi-nor-core.c | 258 + include/linux/mtd/spi-nor.h| 3 + 2 files changed, 231 insertions(+), 30 deletions(-)

Re: [PATCH 0/5] CMD_SAVEENV ifdef cleanup

2020-03-26 Thread Rasmus Villemoes
On 26/03/2020 15.31, Wolfgang Denk wrote: > Dear Rasmus, > >>> >>> I can see where the increase in text size is coming from - your >>> removal of #ifdef's now unconditionally includes some code that was >>> omitted before, for example functions env_fat_save(), >>> env_ext4_save(), env_sf_save(), p

[PATCH v2 0/2] allow CONFIG_SPL_SAVEENV to work with ENV_IS_IN_SPI_FLASH

2020-03-26 Thread Rasmus Villemoes
-- 1 ravi ravi 0 Mar 26 23:20 pengwyn_defconfig.u-boot-spl.diff [the sed -e '/file format/d' is of course just to avoid a false positive from the u-boot.master: file format elf32-littlearm header line] Rasmus Villemoes (2): env: add SAVEENV as an alias of the CMD_SAVEENV sy

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

2020-03-26 Thread Rasmus Villemoes
n: FOO for U-Boot proper, SPL_FOO for SPL. This patch introduces CONFIG_SAVEENV as an alias for CONFIG_CMD_SAVEENV. That way, the above can simply be written #if CONFIG_IS_ENABLED(SAVEENV) and moreover, CONFIG_IS_ENABLED(SAVEENV) can also be used in C code, avoiding ifdeffery and providing more c

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

2020-03-26 Thread Rasmus Villemoes
eprocessor conditionals. This has been run-time tested on a mpc8309-derived board to verify that saving the environment does indeed work in SPL with these patches applied. Signed-off-by: Rasmus Villemoes --- v2: Use 'CONFIG_IS_ENABLED(SAVEENV) ? env_sf_save : NULL' directly instead of the

Re: [PATCH v2 0/2] allow CONFIG_SPL_SAVEENV to work with ENV_IS_IN_SPI_FLASH

2020-03-27 Thread Rasmus Villemoes
On 27/03/2020 17.31, Wolfgang Denk wrote: > Dear Rasmus, > >> >> # avoid differences due to different git commit or wallclock time >> $ export SOURCE_DATE_EPOCH=1585252702 >> $ echo 'test' > .scmversion >> $ export ARCH=arm >> $ export CROSS_COMPILE=arm-linux-gnueabi- >> $ git checkout master ; ma

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

2020-03-31 Thread Rasmus Villemoes
On 23/03/2020 21.45, Tom Rini wrote: > On Mon, Mar 23, 2020 at 01:13:01AM +0100, Rasmus Villemoes wrote: >> On 03/03/2020 13.19, Rasmus Villemoes wrote: >>> On 28/01/2020 13.04, Rasmus Villemoes wrote: >>>> [resending with Mario's correct address, sorry for th

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[PATCH] remove struct uclass_driver::ops

2021-05-19 Thread Rasmus Villemoes
sensibly be assigned; it would have to be some "struct uclass_ops *" providing a set of methods for the core to call on that particular uclass, but should the need for that ever arise, it would be better to have a member of that particular type instead of void*. Signed-off-by: Rasmus Vi

[PATCH 0/5] assorted printf-related patches

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[PATCH v2 06/10] sandbox: disable CONFIG_WATCHDOG_AUTOSTART

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

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

2021-05-27 Thread Rasmus Villemoes
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. Signed-off-by: Rasmus Villemoes --- .../wa

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

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

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

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

[PATCH v2 0/3] trivial printf patches

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2021-06-28 Thread Rasmus Villemoes
On 26/06/2021 20.32, Simon Glass wrote: > Hi Rasmus, > > On Tue, 22 Jun 2021 at 14:28, Rasmus Villemoes > wrote: >> >>> I don't think it is good to start it in the post-probe. Can you do it >>> separately, afterwards? >> >> Eh, yes, of

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

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

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

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

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

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

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

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

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

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

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