Re: configure the mac address of an eth device

2020-06-02 Thread Sascha Hauer
On Tue, May 26, 2020 at 05:54:53PM +0200, Giorgio Dal Molin wrote: > Hi Sascha, > > thank you for your suggestion about the MAC, the code works now as expected. > > Just another quick question: is there a function like > of_eth_register_ethaddr() > also for a 'serial-number' value ? > > I also

Re: [PATCH] ARM: i.MX: enable Master Identifier Unlock

2020-06-02 Thread Sascha Hauer
On Thu, May 28, 2020 at 02:56:11PM +0200, Rouven Czerwinski wrote: > By default the HAB locks the Master Identifier (MID) to preconfigured > values. This is not a problem if Linux is running in the secure world, > however when running a secure world operating system such as OP-TEE, the > MID

Re: [RFC] inkscape 1.0 issue

2020-06-02 Thread Sascha Hauer
Hi Antony, On Tue, Jun 02, 2020 at 01:20:35AM +0300, Antony Pavlov wrote: > > diff --git a/lib/logo/Makefile b/lib/logo/Makefile > index eb7aee080e..8c81447df7 100644 > --- a/lib/logo/Makefile > +++ b/lib/logo/Makefile > @@ -1,17 +1,17 @@ > > -OPTS_barebox-logo-w64.bblogo="-w 64" >

[PATCH 1/3] common: restart: number unnamed restart handlers

2020-06-02 Thread Ahmad Fatoum
Follow-up commit allows referencing specific restart handler by name. Restart handlers default to "default" as name when none is given. Number them sequentially instead. Signed-off-by: Ahmad Fatoum --- common/restart.c | 4 +++- include/restart.h | 1 - 2 files changed, 3 insertions(+), 2

[PATCH 2/3] restart: give all restart handlers a descriptive name

2020-06-02 Thread Ahmad Fatoum
With incoming changes to choose a specific reset method, give all currently unnamed "default" reset handlers a name: - soc reset via SoC-specific means - soc-wdt reset via SoC watchdog timer - vector reset via jump to reset vector - efi reset via EFI firmware Signed-off-by:

[PATCH] fixup! blspec: Allow the "options" key to be given multiple times

2020-06-02 Thread Ahmad Fatoum
constness was erroneously cast away. Reinstate const safety. Signed-off-by: Ahmad Fatoum --- common/blspec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/blspec.c b/common/blspec.c index 3be26d0a7a14..9e1036c8342c 100644 --- a/common/blspec.c +++ b/common/blspec.c

[PATCH 3/3] commands: reset: allow specifying reset by name

2020-06-02 Thread Ahmad Fatoum
So far, we were fine by using the highest priority restart handler whenever more than one was available. There are reasons to want to configure this however: - When communicating with BootROM, e.g. to force boot from recovery mode: The reset chosen must not cause the reboot mode stored to

[PATCH 2/3] mci: remove now-duplicate dev->detect implementations in host drivers

2020-06-02 Thread Ahmad Fatoum
Previous commit introduced a fall-back MCI hw_dev->detect implementation. All drivers touched in this commit populate hw_dev, so lets drop their now-superfluous detect implementations. Signed-off-by: Ahmad Fatoum --- drivers/mci/bcm2835-sdhost.c | 10 -- drivers/mci/dove-sdhci.c |

[PATCH 1/3] mci: define fall-back hw_dev->detect for all MCIs

2020-06-02 Thread Ahmad Fatoum
A barebox environment oftree node may reference its storage by a phandle to a partition node under a MCI node. barebox will then call the device's detect method to detect the card if this hasn't happened before. Out of 17 MCI drivers, 8 host drivers already implement a detect method, which just

[PATCH 3/3] mci: reword MCI_STARTUP text

2020-06-02 Thread Ahmad Fatoum
With the recent addition of a generic device_detect for MCI devices, the MCI_STARTUP help text is no longer accurate. Reword it, but leave the option as-is as some boards may be broken if we drop the option (e.g. because they still depend on a probe order or call default_environment_path_set, but

[PATCH] scripts: .gitignore: ignore mvebuimg binary

2020-06-02 Thread Ahmad Fatoum
If selected, we generate a mvebuimg binary that should be ignored by version control. Add .gitignore entry to do so. Signed-off-by: Ahmad Fatoum --- scripts/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/.gitignore b/scripts/.gitignore index c3ac0b570283..7c9a3f55715f

[PATCH v2 12/25] net: macb: depend on HAS_DMA

2020-06-02 Thread Ahmad Fatoum
The driver makes use of dma_alloc_coherent and brethren. Depend on HAS_DMA to be sure, we don't run into link errors when compile-testing. Signed-off-by: Ahmad Fatoum --- drivers/net/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index

[PATCH v2 09/25] mtd: nand: orion: depend on ARM

2020-06-02 Thread Ahmad Fatoum
We have inline assembly in the driver, so we can't compile-test it unmodified on non-ARM. Indicate so in the Kconfig. Signed-off-by: Ahmad Fatoum --- drivers/mtd/nand/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig

[PATCH v2 25/25] mtd: nand: base: fix use of uninitialized struct member

2020-06-02 Thread Ahmad Fatoum
ooblen is read in nand_do_read_ops, despite never having been assigned a value. Because ooblen is used to indicate how many bytes of oobbuf are usable and oobbuf is NULL, use 0 as initial value. Found on ARCH=sandbox using clang-analyzer. Signed-off-by: Ahmad Fatoum ---

[PATCH v2 17/25] include: : remove stub IRQ save/restore

2020-06-02 Thread Ahmad Fatoum
For an architecture to use , it must define local_irq_save() and local_irq_restore(). Instead of having every platform define duplicate their stub definition, just drop them altogether, so can be used freestanding. Signed-off-by: Ahmad Fatoum --- include/asm-generic/atomic.h | 26

[PATCH v2 15/25] sandbox: select HAS_DMA

2020-06-02 Thread Ahmad Fatoum
With the DMA stubs in place, we can indicate HAS_DMA in good conscience. Do so. Signed-off-by: Ahmad Fatoum --- arch/sandbox/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index 789938941dcd..3f10709021a7 100644 --- a/arch/sandbox/Kconfig

[PATCH v2 24/25] sandbox: os: add_image: fix memory leak

2020-06-02 Thread Ahmad Fatoum
devname is strdup'd few lines later, so remove the earlier strdup. The pointer isn't stored anywhere persistent in between. Signed-off-by: Ahmad Fatoum --- arch/sandbox/os/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sandbox/os/common.c

[PATCH v2 08/25] clocksource: arm_global_timer.c: remove unused asm/ header

2020-06-02 Thread Ahmad Fatoum
We don't use the header and dropping it allows us to compile-test the driver under non-ARM architectures. Do so. Signed-off-by: Ahmad Fatoum --- drivers/clocksource/arm_global_timer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/clocksource/arm_global_timer.c

[PATCH v2 13/25] sandbox: implement stub physical virtual translation

2020-06-02 Thread Ahmad Fatoum
For compile-testing drivers that use DMA operations under sandbox, we want stub implementations of these. Provide them. Signed-off-by: Ahmad Fatoum --- arch/sandbox/include/asm/io.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/sandbox/include/asm/io.h

[PATCH v2 10/25] ddr: fsl: depend on ARM

2020-06-02 Thread Ahmad Fatoum
We have inline assembly in the driver, so we can't compile-test it unmodified on non-ARM. Indicate so in the Kconfig. Signed-off-by: Ahmad Fatoum --- drivers/ddr/fsl/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ddr/fsl/Kconfig b/drivers/ddr/fsl/Kconfig index

[PATCH v2 22/25] commands: tftp: drop unused variable

2020-06-02 Thread Ahmad Fatoum
The flags variables is not used. Drop it. Signed-off-by: Ahmad Fatoum --- commands/tftp.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/commands/tftp.c b/commands/tftp.c index 1569819844bf..48ff00c6217c 100644 --- a/commands/tftp.c +++ b/commands/tftp.c @@ -20,7

[PATCH v2 18/25] sandbox: asm: implement

2020-06-02 Thread Ahmad Fatoum
For easier code-sharing, the UBIFS code still uses the Kernel's atomic accessors. Provide a sandbox header, so we can compile-test UBI under sandbox. Signed-off-by: Ahmad Fatoum --- arch/sandbox/include/asm/atomic.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644

[PATCH v2 00/25] sandbox: support COMPILE_TESTing drivers

2020-06-02 Thread Ahmad Fatoum
This series adds the last few bells and whistles to COMPILE_TEST these drivers under sandbox as well. The five last patches address the first few issues found by clang-analyzer. There are still hundreds more in need of triage: http://a3f.at/up/barebox-clang-analyzer/ (Check it out; control flow

[PATCH v2 04/25] sandbox: support forcing 32-bit x86

2020-06-02 Thread Ahmad Fatoum
If gcc supports multiple architectures, barebox uses only the default when compiling for ARCH=sandbox, this is e.g. the case with compilers that generate both 32- and 64-bit x86 executables. There can be good reasons to force 32-bit though, e.g. to reduce memory consumption while fuzzing or to

[PATCH v2 01/25] scripts: import Linux Kconfig.include

2020-06-02 Thread Ahmad Fatoum
With this include, we can have goodies like $(cc-option ...) and $(success ...) inside our Kconfig files. gcc-version also now becomes available. While unused for now, it can allow us to selectively turn on warnings on new GCC versions, which were previously disabled because of their too high

[PATCH v2 03/25] sandbox: asm: bitsperlong.h: detect bitness according to 64BIT symbol

2020-06-02 Thread Ahmad Fatoum
Now that we have an accurate CONFIG_64BIT describing sandbox bitness, we don't need to assume everything except __x86_64__ as 32-bit. This assumes that sizeof(long) == sizeof(void *), which is assumed anyway throughout the code base. Signed-off-by: Ahmad Fatoum ---

[PATCH v2 02/25] sandbox: define CONFIG_64BIT as appropriate

2020-06-02 Thread Ahmad Fatoum
All 64-bit architectures are supposed to define CONFIG_64BIT to support the relevant 64-bit MMIO accessors. The sandbox architecture is a bit of a special case, because barebox uses the toolchain default and doesn't force a bitness. Add 64BIT as promptless symbol, which reflects the pointer size

[PATCH v2 07/25] sandbox: : include bitio accessors

2020-06-02 Thread Ahmad Fatoum
ARM defines the U-Boot style setbits/clrbits helpers. Have sandbox follow suit to allow more drivers to be compile tested there. Signed-off-by: Ahmad Fatoum --- arch/sandbox/include/asm/io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sandbox/include/asm/io.h

[PATCH v2 05/25] include: asm-generic: provide (in|out)_(le|be)(16|32) helpers for all archs

2020-06-02 Thread Ahmad Fatoum
These U-Boot style bitwise operations macros will be needed for COMPILE_TEST-compiled drivers on platforms except for ARM. Add fallback definitions there, based on the ARM ones. Signed-off-by: Ahmad Fatoum --- include/asm-generic/bitio.h | 145 1 file

[PATCH v2 06/25] ARM: asm/io.h: fall back to out_be32 and friends

2020-06-02 Thread Ahmad Fatoum
With the generic implementations in place in , we can drop the now-duplicate ARM definitions. Signed-off-by: Ahmad Fatoum --- arch/arm/include/asm/io.h | 58 +-- 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/arch/arm/include/asm/io.h

[PATCH v2 16/25] ARM: atomic.h: move generic implementation to asm-generic

2020-06-02 Thread Ahmad Fatoum
For easier code-sharing, the UBIFS code still uses the Linux atomic accessors. Make porting it to sandbox easier, by providing these functions for all platforms. Signed-off-by: Ahmad Fatoum --- arch/arm/include/asm/atomic.h | 108 +- include/asm-generic/atomic.h

[PATCH v2 19/25] usb: xhci-hcd: remove unused #include

2020-06-02 Thread Ahmad Fatoum
We don't use anything defined within, so drop it. Signed-off-by: Ahmad Fatoum --- drivers/usb/host/xhci.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 886cbef14c3a..1a3f7e7642bc 100644 --- a/drivers/usb/host/xhci.h +++

[PATCH v2 11/25] net: fec_imx: depend on HAS_DMA

2020-06-02 Thread Ahmad Fatoum
The driver makes use of dma_alloc_coherent and brethren. Depend on HAS_DMA to be sure, we don't run into link errors when compile-testing. Signed-off-by: Ahmad Fatoum --- drivers/net/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index

[PATCH v2 23/25] commands: test: drop dead assignment

2020-06-02 Thread Ahmad Fatoum
last_expr is set to a different value few lines later. Drop the dead assignment. Signed-off-by: Ahmad Fatoum --- commands/test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/commands/test.c b/commands/test.c index 505b7c56b1a4..c845cec01789 100644 --- a/commands/test.c +++

[PATCH v2 21/25] include: bitops: fix dead increment in fls() and ffs()

2020-06-02 Thread Ahmad Fatoum
Static analyzers trip over this dead increment. It arguably doesn't improve readability, so just drop the dead code. Signed-off-by: Ahmad Fatoum --- include/asm-generic/bitops/ffs.h | 4 +--- include/asm-generic/bitops/fls.h | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git

[PATCH v2 20/25] usb: xhci-hcd: replace opencoded non-atomic 64-bit MMIO with lo_hi helper

2020-06-02 Thread Ahmad Fatoum
Commit 3c5317e9046 ("usb: xhci-hcd: Make use of lo_hi_readq/writeq()") had made use of lo_hi_readq/writeq() to implement xhci_read/write_64(), like Linux does, but this was removed in commit fddd1c7c51a8 ("usb: host: remove xhci driver"). Reinstate it to make code clearer. No functional change.

[PATCH v2 14/25] sandbox: asm: implement stub DMA functions

2020-06-02 Thread Ahmad Fatoum
For compile-testing drivers that use DMA operations under sandbox, we want stub implementations of these. Provide them. Signed-off-by: Ahmad Fatoum --- arch/sandbox/include/asm/dma.h | 53 +- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git

Mini UART support for Raspberry Pi CM3 ?

2020-06-02 Thread j...@mobius-embedded-systems.co.uk
Hi I have been trying to get the mini UART (UART1) to work in Barebox on the RPI Compute Module 3+. I already have the changes made in config.txt and this works fine when I boot into the main Linux code. However, in Barebox, the output always comes out on the main UART (UART0) and that is wired

Re: [PATCH] ARM: MXS: duckbill: set duart to serial0

2020-06-02 Thread Michael Grzeschik
On Fri, May 29, 2020 at 03:56:53PM +0200, Lucas Stach wrote: Am Freitag, den 29.05.2020, 14:51 +0200 schrieb Michael Grzeschik: In the imx28.dtsi the serial0 is set to auart0 which is not the one used on the duckbill. We set duart to serial0 so the console will be properly set. If the aliases

Re: Mini UART support for Raspberry Pi CM3 ?

2020-06-02 Thread Ahmad Fatoum
On 6/2/20 11:57 AM, j...@mobius-embedded-systems.co.uk wrote: > Hi Ahmad > > I have been using v2020.05 but I believe I had enabled all consoles so I'll > try setting it to none and see how that goes. This will only fix the use of UART0 as output. To use UART1, you'll need to set stdout-path =

Re: [RFC] inkscape 1.0 issue

2020-06-02 Thread Antony Pavlov
On Tue, 2 Jun 2020 09:51:28 +0200 Sascha Hauer wrote: > Hi Antony, > > On Tue, Jun 02, 2020 at 01:20:35AM +0300, Antony Pavlov wrote: > > > > diff --git a/lib/logo/Makefile b/lib/logo/Makefile > > index eb7aee080e..8c81447df7 100644 > > --- a/lib/logo/Makefile > > +++ b/lib/logo/Makefile > >

RE: Mini UART support for Raspberry Pi CM3 ?

2020-06-02 Thread j...@mobius-embedded-systems.co.uk
Hi Ahmad I have been using v2020.05 but I believe I had enabled all consoles so I'll try setting it to none and see how that goes. Thanks John -Original Message- From: barebox On Behalf Of Ahmad Fatoum Sent: 02 June 2020 10:55 To: j...@mobius-embedded-systems.co.uk ;

Re: Mini UART support for Raspberry Pi CM3 ?

2020-06-02 Thread Ahmad Fatoum
On 6/2/20 11:14 AM, j...@mobius-embedded-systems.co.uk wrote: > Hi > > I have been trying to get the mini UART (UART1) to work in Barebox on the > RPI Compute Module 3+. I already have the changes made in config.txt and > this works fine when I boot into the main Linux code. However, in

Re: Mini UART support for Raspberry Pi CM3 ?

2020-06-02 Thread Ahmad Fatoum
On 6/2/20 11:43 AM, Ahmad Fatoum wrote: > On 6/2/20 11:14 AM, j...@mobius-embedded-systems.co.uk wrote: >> Hi >> >> I have been trying to get the mini UART (UART1) to work in Barebox on the >> RPI Compute Module 3+. I already have the changes made in config.txt and >> this works fine when I boot