MIPS: relocation issue

2020-01-27 Thread Antony Pavlov
Hi! Since 28ed10d6a6 ("MIPS: relocation: add relocation support") iomem output on memory regions is invalid, all the code that rely on registered sdram memory regions after relocation can fail. E.g. the memtest commands fails on barebox. How to reproduce the problem ov v2020.01.0: $ wget

Re: [PATCH v3 1/5] optee: move optee_verify_header() to common

2020-01-27 Thread Ahmad Fatoum
Hello Rouven, On 1/28/20 6:38 AM, Rouven Czerwinski wrote: > Subsequent patches will use this to verify the header in the PBL, move > it to common to make it potentially available for both. > > Signed-off-by: Rouven Czerwinski > --- > arch/arm/lib32/bootm.c | 12 +++- > common/Makefile

[PATCH v3 2/5] ARM: import setjmp implementation from U-Boot

2020-01-27 Thread Rouven Czerwinski
Signed-off-by: Rouven Czerwinski --- arch/arm/include/asm/setjmp.h | 29 + arch/arm/lib32/Makefile | 2 ++ arch/arm/lib32/setjmp.S | 36 ++ arch/arm/lib64/Makefile | 1 + arch/arm/lib64/setjmp.S | 41

[PATCH v3 1/5] optee: move optee_verify_header() to common

2020-01-27 Thread Rouven Czerwinski
Subsequent patches will use this to verify the header in the PBL, move it to common to make it potentially available for both. Signed-off-by: Rouven Czerwinski --- arch/arm/lib32/bootm.c | 12 +++- common/Makefile| 1 + common/optee.c | 19 +++

[PATCH v3 3/5] ARM: add optee early loading function

2020-01-27 Thread Rouven Czerwinski
Add a OP-TEE early loading function which expects a pointer to a valid tee binary and the device tree. OP-TEE will then be started and barebox will continue to run in normal mode. The function start_optee_early should be used in a boards lowlevel.c file. Ensure that barebox has been relocated and

[PATCH v3 4/5] ARM: mach-imx: test PL310 write access

2020-01-27 Thread Rouven Czerwinski
If OP-TEE early loading is performed, OP-TEE will configure the PL210 and lock write access to the controller from the normal world. Test this by trying to write the same value back and do not configure if we can not write to the PL310. Signed-off-by: Rouven Czerwinski ---

[PATCH v3 0/5] OP-TEE early loading

2020-01-27 Thread Rouven Czerwinski
v3 of the OP-TEE early loading patch series. This allows loading OP-TEE during the lowlevel board initialization, instead of loading it before the kernel is started. v3: - include arm64 setjmp from U-Boot - build setjmp unconditionally - rename pl2x0 write test function v2: - fixed smaller nits

[PATCH v3 5/5] user: add documentation for OP-TEE loading

2020-01-27 Thread Rouven Czerwinski
Some rudimentary documentation how to load OP-TEE. Signed-off-by: Rouven Czerwinski --- Documentation/user/optee.rst | 29 + Documentation/user/user-manual.rst | 1 + 2 files changed, 30 insertions(+) create mode 100644 Documentation/user/optee.rst diff

Re: [RFC PATCH] bootm: Register as bootentry provider

2020-01-27 Thread Christian Eggers
Hi Sascha, Am Montag, 27. Januar 2020, 13:49:38 CET schrieb Sascha Hauer: > On Mon, Jan 27, 2020 at 11:18:31AM +0100, Christian Eggers wrote: > > > Obviously anything involving shell scripts cannot work when no shell is > > > enabled. I suggest using bootloader spec (CONFIG_BLSPEC) to boot a > >

Re: [PATCH v2 1/7] usb: dwc2: Add host controller driver

2020-01-27 Thread Jules Maselbas
Hi Sascha, On Fri, Jan 24, 2020 at 03:32:59PM +0100, Sascha Hauer wrote: > Hi Jules, > > I can confirm the driver works on the RaspberryPi with some adjustments, > see below. Some more comments inline. > > > +static int wait_for_chhltd(struct dwc2 *dwc2, u8 hc, uint32_t *sub, u8 > > *tgl) > >

Re: [RFC PATCH 9/9] usb: dwc2: Add gadget driver

2020-01-27 Thread Jules Maselbas
Hi Sascha, On Mon, Jan 27, 2020 at 02:40:34PM +0100, Sascha Hauer wrote: > Hi Jules, > > +int dwc2_gadget_init(struct dwc2 *dwc2) > > +{ > > + u32 dctl; > > + int epnum; > > + int ret; > > + > > + dwc2_core_init(dwc2); > > This is called once during probe here and once during host init,

[PATCH 4/4] ARM: phyCORE-i.MX8M SOM: add pmic initialisation for power good

2020-01-27 Thread Michael Grzeschik
This patch is adding the same PMIC handling as the u-boot spl does for this Board. It ensures sane defaults. Signed-off-by: Michael Grzeschik --- arch/arm/boards/phytec-som-imx8mq/board.c | 38 +++ 1 file changed, 38 insertions(+) diff --git

[PATCH 2/4] regulator: pfuze: add support to other architectures

2020-01-27 Thread Michael Grzeschik
Currently the pfuze driver is build dependent to ARCH_IMX6. To make it possible to work with ARCH_IMX8 we move the imx6_poweroff call to an own poweroff handler. Signed-off-by: Michael Grzeschik --- arch/arm/mach-imx/imx6.c | 8 drivers/regulator/Kconfig | 2 +-

[PATCH 1/4] regulator: pfuze: remove unsued define

2020-01-27 Thread Michael Grzeschik
Signed-off-by: Michael Grzeschik --- drivers/regulator/pfuze.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/regulator/pfuze.c b/drivers/regulator/pfuze.c index 1950ffb04c..55f7eb5d4c 100644 --- a/drivers/regulator/pfuze.c +++ b/drivers/regulator/pfuze.c @@ -31,8 +31,6 @@

[PATCH 3/4] regulator: pfuze: add include regmap.h so struct regmap is known

2020-01-27 Thread Michael Grzeschik
Without this the user of the function will get a compile warning about the undeclared struct regmap. Signed-off-by: Michael Grzeschik --- include/mfd/pfuze.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/mfd/pfuze.h b/include/mfd/pfuze.h index 6045ceec0a..5427b21005 100644 ---

[PATCH v4 2/3] imd: add support for checksum generation/verification

2020-01-27 Thread Steffen Trumtrar
Add a new imd type "checksum". This type consists of the CRC32 checksum of the whole barebox image minus the checksum itself. The checksum can be written to the imd field with the bareboximd host-tool. It can be verified with said tool or with "imd" on the target. Signed-off-by: Steffen Trumtrar

[PATCH v4 1/3] imd: replace magicvalue with sizeof(struct)

2020-01-27 Thread Steffen Trumtrar
Instead of using "8" as the size of an imd_header, use the sizeof operator. Signed-off-by: Steffen Trumtrar --- common/imd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/imd.c b/common/imd.c index 913a01de87bf..e0dab69644c0 100644 --- a/common/imd.c +++

[PATCH v4 3/3] commands: bbu: add support for imd checksum

2020-01-27 Thread Steffen Trumtrar
Add support for verifying an image by use of the imd checksum. If the checksum that is saved in the image and the one that is calculated over the image differ, barebox_update aborts. Signed-off-by: Steffen Trumtrar --- common/bbu.c | 4 1 file changed, 4 insertions(+) diff --git

Re: [RFC PATCH 9/9] usb: dwc2: Add gadget driver

2020-01-27 Thread Sascha Hauer
Hi Jules, On Wed, Jan 22, 2020 at 04:49:50PM +0100, Jules Maselbas wrote: > Signed-off-by: Jules Maselbas > --- > drivers/usb/dwc2/Makefile |2 +- > drivers/usb/dwc2/core.h |8 +- > drivers/usb/dwc2/dwc2.c |2 + > drivers/usb/dwc2/dwc2.h |2 + > drivers/usb/dwc2/gadget.c |

[PATCH] images: Use separate LDFLAGS for PBL

2020-01-27 Thread Christian Eggers
When setting CONFIG_PBL_RELOCATABLE=y (selected by PBL_MULTI_IMAGES) and CONFIG_RELOCATABLE=n (trying to reduce image size), the PBL is also linked with "-static" instead of "-pie". The result is a non-working PBL. As a side effect, also get rid of erroneous "-Map barebox.map" when linking the

Re: [PATCH 0/2] gpiolib: minor optimization

2020-01-27 Thread Sascha Hauer
On Mon, Jan 27, 2020 at 12:44:51PM +0100, Uwe Kleine-König wrote: > From: Uwe Kleine-König > > Hello, > > while working on gpiolib I noticed that gpio_request_one() repeatedly > checks the validity of the gpio_info obtained by gpio_to_desc(). > > This series introduces some helper functions

Re: [PATCH] common: make CONFIG_BAREBOX_UPDATE visible

2020-01-27 Thread Sascha Hauer
On Mon, Jan 27, 2020 at 08:44:15AM +0100, Christian Eggers wrote: > The barebox update infrastructure is also useful without > CONFIG_CMD_BAREBOX_UPDATE (e.g. from a own barebox_main() with > CONFIG_SHELL_NONE). > > Signed-off-by: Christian Eggers > --- > common/Kconfig | 6 +++--- > 1 file

Re: [PATCH] gadget: f_fastboot: Fix memory leak

2020-01-27 Thread Sascha Hauer
On Mon, Jan 27, 2020 at 08:42:53AM +0100, Christian Eggers wrote: > bootm_data::os_file is not required to be a copied string. It isn't > freed anywhere. > > Signed-off-by: Christian Eggers > --- > drivers/usb/gadget/f_fastboot.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied,

Re: [PATCH] eeprom: at25: Allow page sizes greater than 16 bit

2020-01-27 Thread Sascha Hauer
On Mon, Jan 27, 2020 at 08:41:15AM +0100, Christian Eggers wrote: > For FRAM devices the page size is usually equal to the device size. Some > available devices are greater than 64kB, so a 32 bit variable must be > used. > > The same change has to be done for the Linux driver. I'll try to >

Re: [PATCH] ARM: imx6: properly check for IPU presence

2020-01-27 Thread Sascha Hauer
On Fri, Jan 24, 2020 at 06:46:48PM +0100, Lucas Stach wrote: > Since a73850bd76d0 (ARM: imx: disable IPU QoS setup for correct SoCs), which > fixed the condition to not execute the IPU QoS fixups on SoCs that don't have > a IPU, the fixups aren't applied on i.MX6Q/DP anymore, since those SoCs were

Re: [RFC PATCH] bootm: Register as bootentry provider

2020-01-27 Thread Sascha Hauer
On Mon, Jan 27, 2020 at 11:18:31AM +0100, Christian Eggers wrote: > > Obviously anything involving shell scripts cannot work when no shell is > > enabled. I suggest using bootloader spec (CONFIG_BLSPEC) to boot a > > kernel. This works without shell support. > > I would like to avoid using

[PATCH 2/2] gpiolib: introduce helper functions working on gpio_info structs

2020-01-27 Thread Uwe Kleine-König
From: Uwe Kleine-König gpioinfo_*() assume their gpio_info pointer parameter to be valid and don't ensure the gpio to be requested. This drops several checks for being requested and allows further extensions to work with unrequested gpios. Signed-off-by: Uwe Kleine-König ---

[PATCH 1/2] gpiolib: reorder functions

2020-01-27 Thread Uwe Kleine-König
From: Uwe Kleine-König gpio_request_one() and gpio_request_array() make use of gpio_direction_*, so it is natural to define the former them further low in the file. It doesn't matter for the compiler here as all functions are declared in a header, but the next commit adds a few more functions

[PATCH 0/2] gpiolib: minor optimization

2020-01-27 Thread Uwe Kleine-König
From: Uwe Kleine-König Hello, while working on gpiolib I noticed that gpio_request_one() repeatedly checks the validity of the gpio_info obtained by gpio_to_desc(). This series introduces some helper functions (prefixed gpioinfo_) that take an gpio_info instead of a plain gpio number and

[RFC PATCH] bootm: Register as bootentry provider

2020-01-27 Thread Christian Eggers
> Obviously anything involving shell scripts cannot work when no shell is > enabled. I suggest using bootloader spec (CONFIG_BLSPEC) to boot a > kernel. This works without shell support. I would like to avoid using bootloader spec. The patch below works fine for me. Do you think that this (or

Re: Configuring for secure boot / Using bootchooser

2020-01-27 Thread Sascha Hauer
On Thu, Jan 23, 2020 at 11:29:41AM +0100, Christian Eggers wrote: > Hi Sascha, > > seems I ran into trouble (see below) with CONFIG_SHELL_NONE. > > Am Montag, 20. Januar 2020, 20:53:51 CET schrieb Sascha Hauer: > > Hi Christian, > > > > On Mon, Jan 20, 2020 at 05:38:36PM +0100, Christian Eggers

Re: [PATCH 1/5] state: remove param member from struct state_string

2020-01-27 Thread Sascha Hauer
On Thu, Jan 23, 2020 at 01:20:41PM +0100, Christian Eggers wrote: > After adding the parameter, the pointer isn't required anymore. > > Signed-off-by: Christian Eggers > --- > common/state/state.h | 1 - > common/state/state_variables.c | 7 --- > 2 files changed, 4 insertions(+),

Re: [PATCH] bootchooser: Change name of kernel parameter

2020-01-27 Thread Christian Eggers
Hello Ahmad, > Existing userspace like RAUC[1] rely on this naming, so the default may > not be changed. > > [1]: > https://github.com/rauc/rauc/blob/f52978d9736f18794f7e277ca440e2e4e78c9703/src/context.c#L47 that is what I already suspected... For my initramfs (klibc based), I need a very

Re: [PATCH] bootchooser: Change name of kernel parameter

2020-01-27 Thread Ahmad Fatoum
Hello Christian, On 1/27/20 8:46 AM, Christian Eggers wrote: > When passing the target name as "bootchooser.active", Linux will not > pass the parameter as environment variable to the init process. The only > way to get the bootchooser result (e.g. in an initramfs), is to parse it > out of