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

2020-02-11 Thread Rasmus Villemoes
On 11/02/2020 22.20, Rasmus Villemoes wrote: > On 11/02/2020 17.30, Wolfgang Denk wrote: >>> This forces some scripts to needlessly duplicate logic and hardcode >>> assumptions. For example, in an A/B scheme with three variables >>> >>> BOOT_ORDER # Either

Re: [PATCH] env: another attempt at fixing SPL build failures

2020-01-11 Thread Rasmus Villemoes
On 10/01/2020 15.34, Tom Rini wrote: > On Fri, Jan 10, 2020 at 02:28:54PM +0000, Rasmus Villemoes wrote: >> On 15/12/2019 23.29, Rasmus Villemoes wrote: >>> I'm also seeing the build failure that commit >>> >>> 7d4776545b env: solve compilation

verified boot: semantics of multiple required keys

2020-01-16 Thread Rasmus Villemoes
Hi I'm wondering a bit about the semantics of having multiple keys with the 'required = "conf"' property. Currently, the fit image (or rather the chosen configuration) must be signed by all such keys. I assume this is for the case where multiple parties (vendor, subvendor, customer?) all have to

[PATCH] env: introduce CONFIG_ENV_DOTVARS_TEMPORARY

2020-01-08 Thread Rasmus Villemoes
eir output in an environment variable, not a shell variable. Signed-off-by: Rasmus Villemoes --- env/Kconfig | 10 ++ env/common.c| 6 -- lib/hashtable.c | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/env/Kconfig b/env/Kconfig index 4661082f0e..69fd2ca

Re: [PATCH] env: another attempt at fixing SPL build failures

2020-01-10 Thread Rasmus Villemoes
On 15/12/2019 23.29, Rasmus Villemoes wrote: > I'm also seeing the build failure that commit > > 7d4776545b env: solve compilation error in SPL > > tried to fix, namely that the reference to env_flags_validate from > env_htab cannot be satisfied when flags.o is not

Re: [PATCH] env: another attempt at fixing SPL build failures

2020-01-12 Thread Rasmus Villemoes
On 11/01/2020 23.44, Rasmus Villemoes wrote: > On 10/01/2020 15.34, Tom Rini wrote: >> On Fri, Jan 10, 2020 at 02:28:54PM +0000, Rasmus Villemoes wrote: >>> On 15/12/2019 23.29, Rasmus Villemoes wrote: >>>> I'm also seeing the build failure that commit >>>&

Re: [PATCH 0/4] arm: mxs: mxs_set_gpmiclk

2020-01-04 Thread Rasmus Villemoes
On 03/01/2020 13.42, Stefano Babic wrote: > Hi Rasmus, > > On 27/09/19 10:33, Rasmus Villemoes wrote: >> On 12/09/2019 11.17, Rasmus Villemoes wrote: >>> While trying to implement an mxs_set_gpmiclk() I stumbled on a few minor >>> things. >>> >

Re: commit "dm: spi: Avoid setting the speed with every transfer"

2020-01-04 Thread Rasmus Villemoes
On 28/12/2019 03.27, Simon Glass wrote: > Hi Rasmus, > > On Sat, 14 Dec 2019 at 16:27, Rasmus Villemoes > wrote: >> >> Hi >> >> I'm wondering how commit 60e2809a84 (dm: spi: Avoid setting the speed >> with every transfer) works. AFAIU, the currently

[PATCH] scripts/get_default_envs.sh: preserve order of multiple entries for same variable

2020-01-06 Thread Rasmus Villemoes
there's some value in seeing that certain variables are defined multiple times. Signed-off-by: Rasmus Villemoes --- scripts/get_default_envs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/get_default_envs.sh b/scripts/get_default_envs.sh index da86a9d69c..d1f2ce4d5c

Re: [PATCH] spl_fit.c: enable loading compressed u-boot from fit image

2020-01-06 Thread Rasmus Villemoes
On 30/12/2019 02.21, Simon Glass wrote: > Hi Rasmus, > > On Wed, 11 Dec 2019 at 04:03, Rasmus Villemoes > wrote: >> >> From: "Klaus H. Sorensen" >> >> Allow reading compressed content from fit image, even if >> CONFIG_SPL_OS_BOOT is not set.

[PATCH 2/4] mpc8xxx_spi: put max_cs to use

2020-01-06 Thread Rasmus Villemoes
ice tree used "cs-gpios" rather than "gpios", so gpio_request_list_by_name() had returned 0. That would have been a lot easier to figure out if the chip select index was sanity checked, so rename max_cs to cs_count, and reject a xfer with a too large cs index. Signed-off-by: R

[PATCH 0/4] spi: mpc8xxx_spi: bug fixes and real ->set_speed

2020-01-06 Thread Rasmus Villemoes
to the gazerbeam board can test that this doesn't break that - in particular, the "only do transfers that are multiple of 8 bits" part. Rasmus Villemoes (4): gazerbeam: add clocks property to SPI node mpc8xxx_spi: put max_cs to use mpc8xxx_spi: always use 8-bit characters, don't rea

[PATCH 1/4] gazerbeam: add clocks property to SPI node

2020-01-06 Thread Rasmus Villemoes
Prepare for supporting setting different speeds in mpc8xxx_spi.c. Signed-off-by: Rasmus Villemoes --- arch/powerpc/dts/gdsys/mpc8308.dtsi | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/dts/gdsys/mpc8308.dtsi b/arch/powerpc/dts/gdsys/mpc8308.dtsi index 23e7403d91

[PATCH 3/4] mpc8xxx_spi: always use 8-bit characters, don't read or write garbage

2020-01-06 Thread Rasmus Villemoes
ends being more work for the CPU, we're mostly bounded by the speed of the SPI bus, and we avoid writing to the mode register in every loop. Based on work by Klaus H. Sørensen. Cc: Klaus H. Sorensen Signed-off-by: Rasmus Villemoes --- drivers/spi/mpc8xxx_spi.c | 80 +-

[PATCH 4/4] mpc8xxx_spi: implement real ->set_speed

2020-01-06 Thread Rasmus Villemoes
off-by: Rasmus Villemoes --- drivers/spi/mpc8xxx_spi.c | 64 --- 1 file changed, 53 insertions(+), 11 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 8ef2451411..1bde31ad34 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/

[PATCH] gpio/mpc83xx_spisel_boot.c: gpio driver for SPISEL_BOOT signal

2020-01-08 Thread Rasmus Villemoes
convenient to present it to the spi driver that way. The alternative it to teach mpc8xxx_spi to handle the SPISEL_BOOT signal itself (that is how it's done in the linux kernel, see commit 69b921acae8a) Signed-off-by: Klaus H. Sorensen Signed-off-by: Rasmus Villemoes --- .../gpio/fsl,mpc83xx-spise

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

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

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

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

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

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

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

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

[PATCH] spi: mpc8xxx_spi: fix missing dev_err definition

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

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

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

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

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

[PATCH 0/3] watchdog: honour hw_margin_ms property

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

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

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

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

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

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

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

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

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

Re: [PATCH 0/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(),

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

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

2020-03-26 Thread Rasmus Villemoes
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 symbol env/sf.c: honour CONFIG_SPL_SAVEENV env/Kconfig |

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

2020-03-26 Thread Rasmus Villemoes
pattern: 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

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 ;

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

[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
e 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_LOCK for Macronix mx25l3205d drivers/mtd/spi/

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

2020-03-26 Thread Rasmus Villemoes
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/spi/spi

[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(-) diff

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

Re: reset on mpc83xx

2020-04-30 Thread Rasmus Villemoes
On 30/04/2020 17.03, Christophe Leroy wrote: > > > Le 30/04/2020 à 16:44, Rasmus Villemoes a écrit : >> Hi, >> >> I'm wondering why the sysreset_mpc83xx driver (as well as the similar >> code in arch/powerpc/cpu/mpc83xx/cpu.c) removes the MSR_IR and

[PATCH] rtc: pcf2127: don't add/subtract 1 to tm_mon

2020-05-01 Thread Rasmus Villemoes
As noted in rtc_def.h, the tm_mon field in struct rtc_time is 1-12, unlike in struct tm where it is 0-11. Currently, running "date" prints the wrong Date: 2020-04-01 (Friday)Time: 13:05:30 and setting the RTC via the date command is also broken. Signed-off-by: Rasmus Villemoes --

getting battery status from RTC driver

2020-05-01 Thread Rasmus Villemoes
Hi, I have an application where I need to retrieve the battery status from a pcf2129 (the pcf2127 driver works fine for that chip as well). Currently, the various drivers seem to handle low battery quite inconsistently: pcf2127 just prints a warning, still populates tm, and returns 0. pcf8563

[PATCH 2/5] sysreset: mpc83xx: shuffle newline logic in mpc83xx_sysreset_get_status

2020-05-01 Thread Rasmus Villemoes
miss a newline before the print_83xx_arb_event() output. That latter always includes a newline in its output, so just pull up the scnprintf("\n") a bit. Signed-off-by: Rasmus Villemoes --- drivers/sysreset/sysreset_mpc83xx.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletion

[PATCH 1/5] sysreset: mpc83xx: use scnprintf instead of snprintf

2020-05-01 Thread Rasmus Villemoes
become negative (since scnprintf(), when given a non-zero size, has the property that the return value is strictly less than the given size). Signed-off-by: Rasmus Villemoes --- drivers/sysreset/sysreset_mpc83xx.c | 54 ++--- 1 file changed, 19 insertions(+), 35 deletions

[PATCH 0/5] some sysreset patches (mostly for mpc83xx)

2020-05-01 Thread Rasmus Villemoes
reset cause; in U-Boot proper, gd->arch.reset_status is always clear. Rasmus Villemoes (5): sysreset: mpc83xx: use scnprintf instead of snprintf sysreset: mpc83xx: shuffle newline logic in mpc83xx_sysreset_get_status sysreset: mpc83xx: fix CONFIG_IS_ENABLED logic sysreset: mpc83xx:

[PATCH 5/5] sysreset: move print_resetinfo() to sysreset-uclass.c

2020-05-01 Thread Rasmus Villemoes
Moving this out of board_f.c allows board-specific SPL code to call this rather than duplicating its implementation. Signed-off-by: Rasmus Villemoes --- common/board_f.c | 24 drivers/sysreset/sysreset-uclass.c | 22 ++ include

[PATCH 4/5] sysreset: mpc83xx: add output in case of cold boot

2020-05-01 Thread Rasmus Villemoes
For a powercycle/cold boot, none of the RSR_* bits in the reset status register are set, so one gets an empty Reset Status: line. Print an indication that this was likely a cold boot. Signed-off-by: Rasmus Villemoes --- drivers/sysreset/sysreset_mpc83xx.c | 26 +- 1

[PATCH 3/5] sysreset: mpc83xx: fix CONFIG_IS_ENABLED logic

2020-05-01 Thread Rasmus Villemoes
Unlike IS_ENABLED, one should not include the CONFIG_ part in the argument to CONFIG_IS_ENABLED - currently, the first of these tests for whether CONFIG_CONFIG_AER_FULL or CONFIG_SPL_CONFIG_AER_FULL are defined (depending on SPL or not), similarly for the other one. Signed-off-by: Rasmus

reset on mpc83xx

2020-04-30 Thread Rasmus Villemoes
Hi, I'm wondering why the sysreset_mpc83xx driver (as well as the similar code in arch/powerpc/cpu/mpc83xx/cpu.c) removes the MSR_IR and MSR_DR bits from MSR. On my mpc8309, that seems to simply make the board hang right after writing the new MSR value - i.e., it never gets to write the magic

[PATCH 2/6] rtc: add rtc_write8_array() helper

2020-05-04 Thread Rasmus Villemoes
Similar to the rtc_read8_array(), introduce a helper that allows the caller to write multiple consecutive 8-bit registers with one call. If the driver provides the ->write8_array method, use that, otherwise loop using ->write8. Signed-off-by: Rasmus Villemoes --- drivers/rtc/rtc-uclass.

[PATCH 3/6] rtc: fall back to ->{read, write}8_array if ->{read, write}8 are not provided

2020-05-04 Thread Rasmus Villemoes
ithout this, a driver that provides rtc_read8_array() would most likely just duplicate the logic here for implementing a ->read8() method in term of its ->read8_array() method. The same remarks of course apply to the write case. Signed-off-by: Rasmus Villemoes --- drivers/rtc/rtc-u

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

2020-05-04 Thread Rasmus Villemoes
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. Also, allow a driver to provide a read8_array method, which can be more efficient than reading one register at a time. Signed-off-by: Rasmus

[PATCH 0/6] rtc: add rtc_{read,write}8_array and rtc command

2020-05-04 Thread Rasmus Villemoes
re rather obvious subsommands to add at some point. Also, rtc_{read,write}{16,32} can be simplified a bit, along the lines of __le16 v; int ret = rtc_read8_array(dev, reg, , 2); if (ret) return ret; *valuep = __le16_to_cpu(v); return 0; Rasmus Villemoes (6): rtc: add rtc_read8_array helper

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

[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

Re: [PATCH v3 1/2] timer: mpc83xx_timer: fix build with CONFIG_{HW_,}WATCHDOG

2020-05-04 Thread Rasmus Villemoes
refers to >> a non-existing timestamp variable - obviously priv->timestamp is >> meant. >> >> Signed-off-by: Rasmus Villemoes >> --- >> drivers/timer/mpc83xx_timer.c | 6 +- >> 1 file changed, 5 insertions(+), 1 deletion(-) > > Could you

Re: [PATCH] scripts/get_default_envs.sh: preserve order of multiple entries for same variable

2020-04-29 Thread Rasmus Villemoes
the same default environment as one >>> currently has, we need to preserve the order. So only sort by the >>> variable name, and disable the last-resort comparison. >>> >>> We could pipe the result through uniq to remove duplicate lines, but I >

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

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

2020-05-11 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:

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

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

[PATCH 0/2] add CONFIG_ENV_SECT_SIZE_AUTO

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

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

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

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

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

2020-03-18 Thread Rasmus Villemoes
of 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

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

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

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

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

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

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

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

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

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

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

2020-03-20 Thread Rasmus Villemoes
of 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 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 v2 2/2] spi: allow calling WATCHDOG_RESET during long reads

2020-03-20 Thread Rasmus Villemoes
and/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| 12

[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

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

2020-03-20 Thread Rasmus Villemoes
ld 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 3817

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

2020-03-20 Thread Rasmus Villemoes
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/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

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

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

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
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 --- v2: Also require

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

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

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 (usually)

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

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

<    1   2   3   4   5   6   7   8   9   >