Re: [PATCH] libfile: null-terminate buffer as expected

2019-09-16 Thread Ahmad Fatoum
On 9/16/19 8:38 PM, Ahmad Fatoum wrote: > strim calls strlen on buf internally which is undefined because buf > is not null-terminated. Fix this. Please dismiss... read_file_2 has its buffer allocated with calloc, thus nothing to see here... > > Accessing buf+size is safe, because read_file_2

[PATCH] libfile: null-terminate buffer as expected

2019-09-16 Thread Ahmad Fatoum
strim calls strlen on buf internally which is undefined because buf is not null-terminated. Fix this. Accessing buf+size is safe, because read_file_2 always allocates a 1 byte bigger buffer than the required (non-null-terminated) size. This leading to errors can be observed by increasing the

[PATCH 4/6] usb: dwc3: add support for gadget mode

2019-09-16 Thread Steffen Trumtrar
Expand the DWC3 usb core with gadget support. Patches imported and adopted from Linux v5.2. Signed-off-by: Steffen Trumtrar --- drivers/usb/dwc3/Kconfig | 29 +- drivers/usb/dwc3/Makefile |7 +- drivers/usb/dwc3/core.c | 450 - drivers/usb/dwc3/core.h

[PATCH 6/6] ARM: Layerscape: LS1046a: configure USB ports

2019-09-16 Thread Steffen Trumtrar
The LS1046a has three USB ports: - 2 USB Host ports - 1 USB Device port Signed-off-by: Steffen Trumtrar --- arch/arm/dts/fsl-ls1046a-rdb.dts | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/arm/dts/fsl-ls1046a-rdb.dts b/arch/arm/dts/fsl-ls1046a-rdb.dts index

[PATCH 3/6] usb/ch9.h: add USB 3.1 isoc endpoint define

2019-09-16 Thread Steffen Trumtrar
Add a new define for USB 3.1 endpoints Signed-off-by: Steffen Trumtrar --- include/usb/ch9.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/usb/ch9.h b/include/usb/ch9.h index 89d83e0d09be..85f3e64cac2b 100644 --- a/include/usb/ch9.h +++ b/include/usb/ch9.h @@ -234,6 +234,8 @@

[PATCH 5/6] usb: gadget: composite: conditionally dequeue setup requests

2019-09-16 Thread Steffen Trumtrar
From: Sascha Hauer This is an adoption of Kernel commit a7c12eaf2 ("usb: gadget: composite: conditionally dequeue os_desc and setup requests"). Basically we only want to dequeue ep0 requests when they are actually queued. Drivers like dwc3 warn when unqueued requests are being tried to unqueued.

[PATCH 2/6] usb: gadget: add usb_gadget_udc_reset function

2019-09-16 Thread Steffen Trumtrar
Add a function to notify the udc core, that a bus reset occured. Signed-off-by: Steffen Trumtrar --- drivers/usb/gadget/udc-core.c | 15 +++ include/usb/gadget.h | 4 2 files changed, 19 insertions(+) diff --git a/drivers/usb/gadget/udc-core.c

[PATCH 1/6] barebox-wrapper: add IRQ_WAKE_THREAD

2019-09-16 Thread Steffen Trumtrar
Add a new irqreturn_t IRQ_WAKE_THREAD. Signed-off-by: Steffen Trumtrar --- include/linux/barebox-wrapper.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/barebox-wrapper.h b/include/linux/barebox-wrapper.h index e998932d1201..fee02d052d94 100644 ---

[PATCH] imd: fix memory leak

2019-09-16 Thread Ulrich Ölmann
Each invocation of 'imd' ate up to 1MB of RAM. Signed-off-by: Ulrich Ölmann --- common/imd.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/common/imd.c b/common/imd.c index 05e118e77361..913a01de87bf 100644 --- a/common/imd.c +++ b/common/imd.c @@

Re: [PATCH v2 1/2] ARM: imx6: add Embest MarSBoard support

2019-09-16 Thread Ahmad Fatoum
Hello Stefan, On 9/15/19 10:01 PM, Stefan Lengfeld wrote: > Hi Ahmad, > > On Thu, Sep 12, 2019 at 08:54:11AM +0200, Ahmad Fatoum wrote: >> This board is produced by Embest/Element 14 and is based on i.MX6 Dual. >> >> For more informations on this board : >>

[PATCH] squash! ARM: imx6: add Embest MarSBoard support

2019-09-16 Thread Ahmad Fatoum
Fix some typos that made it into the documentation. Tested-by: Stefan Lengfeld Can be added to the original commit's message as well. --- Documentation/boards/imx/embest-marsboard.rst | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git

Re: [PATCH] net: dsa: mv88e6xxx: Wait for EEPROM done after HW reset

2019-09-16 Thread Sascha Hauer
On Fri, Sep 13, 2019 at 11:24:24PM -0700, Andrey Smirnov wrote: > Based on a unpublished patch from Andrew Lunn: > > The the switch is hardware reset, it reads the contents of the > EEPROM. Could you correct this sentence to make its meaning clear? > This can contain instructions

Re: [PATCH 1/8] ARM: zii-imx8mq-dev: Drop extra relocation code

2019-09-16 Thread Sascha Hauer
On Fri, Sep 13, 2019 at 11:19:36PM -0700, Andrey Smirnov wrote: > Since commit 3ce6447849 ("ARM: zii-imx8mq-dev: Do setup_c() before > accessing global variables") appropriate relocation will be done > unconditionally, so we don't need to do it again in this corner case. > > Signed-off-by: Andrey

[PATCH 5/6] ARM: remove now unused PBL code

2019-09-16 Thread Sascha Hauer
Single PBL is now built as part of the multi PBL images, so drop the now unused single PBL code. Signed-off-by: Sascha Hauer --- arch/arm/Makefile | 8 - arch/arm/pbl/.gitignore| 9 - arch/arm/pbl/Makefile | 61 --

[PATCH 0/6] ARM: Merge single PBL code into multi PBL code

2019-09-16 Thread Sascha Hauer
Hi All, This series merges the single PBL code into the multi PBL code. Some preparations are needed, but in the end the single PBL code just vanishes leaving a simpler startup path. The last patch is a rebased version of Andreys patch he recently sent. Sascha Andrey Smirnov (1): ARM:

[PATCH 2/6] ARM: Compile dtbs for lowlevel code

2019-09-16 Thread Sascha Hauer
When no PBL is used then the DTB is used in the real barebox binary. We already have lwl-y for code which needs to be in PBL when existing and in the real barebox binary otherwise. Do the same for the DTBs and compile them with lwl-dtb-y. Signed-off-by: Sascha Hauer --- arch/arm/dts/Makefile |

[PATCH 1/6] ARM: remove PBL_FORCE_PIGGYDATA_COPY

2019-09-16 Thread Sascha Hauer
This option is unused in the tree, remove it for now. If you need this option, let me know, we'll find another solution. Signed-off-by: Sascha Hauer --- arch/arm/cpu/start-pbl.c | 13 - pbl/Kconfig | 8 2 files changed, 21 deletions(-) diff --git

[PATCH 3/6] ARM: drop bultin DTB

2019-09-16 Thread Sascha Hauer
We can build multiple DTBs into the binary and board code can select which one to use. Drop the single builtin DTB and let the boards using it pass the correct one. Signed-off-by: Sascha Hauer --- arch/arm/Kconfig | 14 --

[PATCH 4/6] ARM: Merge single pbl with multi pbl

2019-09-16 Thread Sascha Hauer
So far we have two different implementations for PBL: One for a single PBL and one for multiple images. This patch implements the single PBL case as a special case of the multi PBL case. With this the single PBL becomes a multi PBL image with the entry point start_pbl. Signed-off-by: Sascha Hauer

[PATCH 6/6] ARM: aarch64: Re-implement most of barebox_arm_entry() in assembly

2019-09-16 Thread Sascha Hauer
From: Andrey Smirnov GCC9 now produces the following warning: common.h:51:2: warning: listing the stack pointer register ‘sp’ in a clobber list is deprecated [-Wdeprecated] 51 | __asm__ __volatile__("mov sp, %0" | ^~~ common.h:51:2: note: the value of the stack pointer after an

Re: [PATCH 1/2] i.MX: Introduce imx_ocotp_read_uid()

2019-09-16 Thread Sascha Hauer
On Fri, Sep 13, 2019 at 11:02:46PM -0700, Andrey Smirnov wrote: > UID information in OCOTP is located in the same place on at least > i.MX6, i.MX7 and i.MX8MQ. Create an SoC-agnostic helper to do all the > work and convert i.MX6 to use it. > > Signed-off-by: Andrey Smirnov > Cc: Chris Healy >

Re: [PATCH v3 0/8] Device Tree Overlay Support

2019-09-16 Thread Sascha Hauer
On Fri, Sep 13, 2019 at 03:14:38PM +0200, Michael Tretter wrote: > Hello, > > This is the v3 for adding device tree overlay support to barebox. > > I added a new config item for building the build-in device tree with > __symbols__. As __symbols__ increases the size of the dtb and you don't need