Re: [PATCH 6/8] pinctrl: stm32: fix up st,package into stm32mp nodes

2020-03-30 Thread Sascha Hauer
On Tue, Mar 31, 2020 at 07:50:32AM +0200, Ahmad Fatoum wrote: > Hi, > > On 3/31/20 7:45 AM, Sascha Hauer wrote: > > On Mon, Mar 30, 2020 at 04:39:13PM +0200, Ahmad Fatoum wrote: > >> Since Linux v5.1, the pinctrl driver can use the st,package property > >> if provided to validate whether the ball

Re: [PATCH 08/12] video: backlight-pwm: use new pwm_apply_state API

2020-03-30 Thread Ahmad Fatoum
Hi, On 3/31/20 8:10 AM, Sascha Hauer wrote: > On Mon, Mar 30, 2020 at 04:57:13PM +0200, Ahmad Fatoum wrote: >> From: Ahmad Fatoum >> >> Use pwm_apply_state we can avoid having to store PWM state in the >> instance structure and in future we have an easy way to support new >> parameters like inver

Re: [PATCH 12/12] PWM: add support for STM32

2020-03-30 Thread Ahmad Fatoum
Hello, On 3/31/20 8:41 AM, Sascha Hauer wrote: >> +pwm1 = &{/soc/timer@4400/pwm}; >> +pwm2 = &{/soc/timer@4000/pwm}; >> +pwm3 = &{/soc/timer@40001000/pwm}; >> +pwm4 = &{/soc/timer@40002000/pwm}; >> +pwm5 = &{/soc/timer@40003000/pw

Re: [PATCH 12/12] PWM: add support for STM32

2020-03-30 Thread Sascha Hauer
On Mon, Mar 30, 2020 at 04:57:17PM +0200, Ahmad Fatoum wrote: > From: Ahmad Fatoum > > This driver adds support for PWM driver on STM32 platform > based on the Linux v5.4 support. > > Signed-off-by: Ahmad Fatoum > --- > arch/arm/dts/stm32mp151.dtsi | 12 + > drivers/mfd/Kconfig

Re: [PATCH 08/12] video: backlight-pwm: use new pwm_apply_state API

2020-03-30 Thread Sascha Hauer
On Mon, Mar 30, 2020 at 04:57:13PM +0200, Ahmad Fatoum wrote: > From: Ahmad Fatoum > > Use pwm_apply_state we can avoid having to store PWM state in the > instance structure and in future we have an easy way to support new > parameters like inverted duty cycle. > > Signed-off-by: Ahmad Fatoum >

Re: [PATCH 6/8] pinctrl: stm32: fix up st,package into stm32mp nodes

2020-03-30 Thread Ahmad Fatoum
Hi, On 3/31/20 7:45 AM, Sascha Hauer wrote: > On Mon, Mar 30, 2020 at 04:39:13PM +0200, Ahmad Fatoum wrote: >> Since Linux v5.1, the pinctrl driver can use the st,package property >> if provided to validate whether the ball to be configured exists >> on the package. Have barebox supply this proper

Re: [PATCH 6/8] pinctrl: stm32: fix up st,package into stm32mp nodes

2020-03-30 Thread Sascha Hauer
On Mon, Mar 30, 2020 at 04:39:13PM +0200, Ahmad Fatoum wrote: > Since Linux v5.1, the pinctrl driver can use the st,package property > if provided to validate whether the ball to be configured exists > on the package. Have barebox supply this property. > > Signed-off-by: Ahmad Fatoum > --- > arc

Re: [PATCH] commands: of_property: fix crashes on incorrect number of arguments

2020-03-30 Thread Sascha Hauer
On Mon, Mar 30, 2020 at 04:33:55PM +0200, Ahmad Fatoum wrote: > of_property needs at least two parameters, the path and the property > name. If we supply less, we risk crashes, e.g. by running > of_property -fs /test > > Verify we got at least two parameters. > > Signed-off-by: Ahmad Fatoum > --

Re: [PATCH 1/2] mci: core: use SECTOR_SIZE instead of direct 512

2020-03-30 Thread Sascha Hauer
On Mon, Mar 30, 2020 at 04:32:58PM +0200, Ahmad Fatoum wrote: > Instead of hardcoding the 512 byte constant, use the symbolic > SECTOR_SIZE. > > Signed-off-by: Ahmad Fatoum > --- > drivers/mci/mci-core.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) Applied, thanks Sascha

Re: [PATCH v2 0/4] usb: gadget: dfu: Fix timeout on erase when using big partition

2020-03-30 Thread Sascha Hauer
On Thu, Mar 26, 2020 at 07:33:00PM +0100, Jules Maselbas wrote: > Hi, > > The two first patch are focused on two fixes for an issue I encountered > when trying to use the DFU gadget on big flash partition (2MB). > > You can find more information in each patch, but here is a short summary > of the

[PATCH 2/2] fixup! regmap-mmio: Add big endian support

2020-03-30 Thread Ahmad Fatoum
of_regmap_init_mmio_clk was introduced as to avoid allocating new devices for syscon nodes, a device tree node sufficed. We already have an existing device node though, so let's use that. Through this device node, we can access the big-endian and friends properties. Signed-off-by: Ahmad Fatoum -

[PATCH 1/2] fixup! regmap-mmio: Add big endian support

2020-03-30 Thread Ahmad Fatoum
The Linux default for the regmap MMIO bus used for syscon is little endian, not big endian like for a general regmap bus. This fixes network breakage on the STM32MP, which uses a syscon in link mode configuration. Signed-off-by: Ahmad Fatoum --- drivers/base/regmap/regmap-mmio.c | 1 + 1 file c

[PATCH 11/12] of: introduce of_property_count_elems_of_size

2020-03-30 Thread Ahmad Fatoum
From: Ahmad Fatoum Import the Linux helper, so code using it may be more easily ported. Signed-off-by: Ahmad Fatoum --- drivers/of/base.c | 32 include/of.h | 8 2 files changed, 40 insertions(+) diff --git a/drivers/of/base.c b/drivers/of/base.

[PATCH 07/12] PWM: core: apply initial state in of_pwm_request

2020-03-30 Thread Ahmad Fatoum
This functions prepares a state that can later be tweaked and applied to the PWM device with pwm_apply_state(). This is a convenient function that first retrieves the current PWM state and the replaces the period with the reference values defined in pwm->args. Once the function returns, you can adj

[PATCH 12/12] PWM: add support for STM32

2020-03-30 Thread Ahmad Fatoum
From: Ahmad Fatoum This driver adds support for PWM driver on STM32 platform based on the Linux v5.4 support. Signed-off-by: Ahmad Fatoum --- arch/arm/dts/stm32mp151.dtsi | 12 + drivers/mfd/Kconfig | 7 + drivers/mfd/Makefile | 1 + drivers/mfd/stm32-timers.c

[PATCH 10/12] PWM: core: add apply API support for polarity

2020-03-30 Thread Ahmad Fatoum
From: Ahmad Fatoum Some PWM chips support outputting an inverted PWM signal. Add API support for this. Signed-off-by: Ahmad Fatoum --- drivers/pwm/core.c | 21 + include/pwm.h | 6 ++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/core

[PATCH 09/12] led: pwm: use new pwm_apply_state API

2020-03-30 Thread Ahmad Fatoum
From: Ahmad Fatoum To support PWM_POLARITY_INVERTED for PWM LEDs, we need to to use the apply API. Do so. Signed-off-by: Ahmad Fatoum --- drivers/led/led-pwm.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/led/led-pwm.c b/drivers/led/led-pwm.c

[PATCH 00/12] PWM: add support for ->apply, polarity and STM32

2020-03-30 Thread Ahmad Fatoum
Hi, - Port Linux apply API to make porting future PWM drivers easier - Remove duplicated PWM state, so device variables can be used to query and influence actual configuration - Add support for PWM polarity - Add support for STM32 Cheers, Ahmad Fatoum (12): led: pwm: always initialize PWM LED

[PATCH 05/12] PWM: core: remove old PWM API in favor of Linux ->apply

2020-03-30 Thread Ahmad Fatoum
Linux has the new atomic PWM API in addition to the old one for backward compatibility. We only have three PWM drivers in here, so port them over to the new ->apply API. Signed-off-by: Ahmad Fatoum --- drivers/pwm/core.c| 66 +- drivers/pwm/pwm-imx.c | 32 ++--

[PATCH 08/12] video: backlight-pwm: use new pwm_apply_state API

2020-03-30 Thread Ahmad Fatoum
From: Ahmad Fatoum Use pwm_apply_state we can avoid having to store PWM state in the instance structure and in future we have an easy way to support new parameters like inverted duty cycle. Signed-off-by: Ahmad Fatoum --- drivers/video/backlight-pwm.c | 13 - 1 file changed, 8 inse

[PATCH 06/12] PWM: core: retire pwm_set_period

2020-03-30 Thread Ahmad Fatoum
From: Ahmad Fatoum Client code can use pwm_apply_state or pwm_config to set period as well as duty cycle. Having a pwm_set_period thus doesn't add any value. Signed-off-by: Ahmad Fatoum --- drivers/pwm/core.c | 7 +-- include/pwm.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-

[PATCH 04/12] PWM: core: group PWM state into new struct pwm_state

2020-03-30 Thread Ahmad Fatoum
From: Ahmad Fatoum As a prerequisite for moving to the new apply API, we need to group all state into one struct that we can apply at once. Prepare for this. Signed-off-by: Ahmad Fatoum --- drivers/pwm/core.c | 34 -- include/pwm.h | 21 +++-

[PATCH 03/12] PWM: core: remove ineffectual pwm_{set,get}_duty_cycle

2020-03-30 Thread Ahmad Fatoum
From: Ahmad Fatoum The setter sets a value unused anywhere, but in the getter. As the functions are unused, just drop them. There's pwm_config that can be used for this instead. Signed-off-by: Ahmad Fatoum --- drivers/pwm/core.c | 10 -- include/pwm.h | 2 -- 2 files changed, 12

[PATCH 02/12] PWM: core: remove FLAG_ENABLED

2020-03-30 Thread Ahmad Fatoum
From: Ahmad Fatoum In preparation for moving to a struct pwm_state like Linux does, turn the flag into a variable. Signed-off-by: Ahmad Fatoum --- drivers/pwm/core.c | 12 include/pwm.h | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/core.

[PATCH 01/12] led: pwm: always initialize PWM LEDs as inactive

2020-03-30 Thread Ahmad Fatoum
While the active-low property is respected when setting brightness, it's ignored when initializing the LED as off in the probe function and thus LEDs are active on startup. Fix this. Fixes: 769eb5e7bb ("led: pwm: support active-low property") Signed-off-by: Ahmad Fatoum --- drivers/led/led-pwm.c

[PATCH 8/8] ARM: stm32mp: add support for STM32MP157-EV1 board

2020-03-30 Thread Ahmad Fatoum
The STM32MP157A-EV1 and STM32MP157C-EV1 Evaluation boards are the full-feature demonstration and development platforms for the STM32MP1. The C suffix indicates that crypto and secure boot are supported. They can be handled the same for now. Later on, when the crypto cores get device tree nodes, we

[PATCH 4/8] nvmem: bsec: allow reads at unaligned offsets

2020-03-30 Thread Ahmad Fatoum
Setting the NVMEM stride to 4 means we can't have nvmem cells pointing at odd addresses. Linux sets it to 1 instead and handles reads at unaligned addresses by splitting them up to aligned chunks. Copy over the code to do the same. Unaligned writes remain illegal. Signed-off-by: Ahmad Fatoum ---

[PATCH 7/8] ARM: stm32mp: init: don't query package type

2020-03-30 Thread Ahmad Fatoum
Now that we have a nvmem cell describing the package, we don't need to provide a stm32mp_package() function for querying it. Displaying the package type on every boot is also not that useful, especially when some SoCs don't even have the bsec field populated. As the code has now become duplicate (

[PATCH 3/8] ARM: stm32mp: init: fix up CPU device tree nodes

2020-03-30 Thread Ahmad Fatoum
To facilitate using the same barebox binary for multiple variants of the STM32MP15x, have it fix up the CPU device tree nodes. Signed-off-by: Ahmad Fatoum --- arch/arm/mach-stm32mp/init.c | 45 1 file changed, 45 insertions(+) diff --git a/arch/arm/mach-stm3

[PATCH 6/8] pinctrl: stm32: fix up st,package into stm32mp nodes

2020-03-30 Thread Ahmad Fatoum
Since Linux v5.1, the pinctrl driver can use the st,package property if provided to validate whether the ball to be configured exists on the package. Have barebox supply this property. Signed-off-by: Ahmad Fatoum --- arch/arm/dts/stm32mp151.dtsi| 16 drivers/pinctrl/pinctrl-stm32.c

[PATCH 1/8] ARM: stm32mp: init: don't cast signed error to unsigned

2020-03-30 Thread Ahmad Fatoum
bsec_read_field returns a negative value on error, pass it along signed. This doesn't matter now, because we ignore the error code, but it's the correct thing to do. Signed-off-by: Ahmad Fatoum --- arch/arm/mach-stm32mp/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 5/8] nvmem: bsec: remove wrongly named bsec_field type

2020-03-30 Thread Ahmad Fatoum
BSEC_SMC_READ_SHADOW and BSEC_SMC_WRITE_SHADOW aren't fields, but operations to apply on fields. Rename it accordingly and fix up instances where it was used wrongly. Signed-off-by: Ahmad Fatoum --- arch/arm/mach-stm32mp/include/mach/bsec.h | 6 +++--- drivers/nvmem/bsec.c |

[PATCH 2/8] ARM: stm32mp: init: detect Revision Z and 800 MHz profiles

2020-03-30 Thread Ahmad Fatoum
Revision A was 0x1000 and B was 0x2000, so I assumed the next would be revision C valued 0x3000. Alas, it's revision Z with 0x2001... Change the code accordingly and add detection for the new 800Mhz profiles. Code taken from U-Boot commit cf0818b477 ("stm32mp1: support of STM32MP15x Rev.Z") and P

Re: imx7d dual core boot

2020-03-30 Thread Giorgio
Hi Ahmad, I think I've found the problem with my imx7d: in your commit id ae0a375ba71ba9b9a70cb7eda177445fcfbf586d: ARM: cache-armv7: remove duplicate domain initialization ... you removed the two asm lines: movne r1, #-1 mcrne p15, 0, r1, c3, c0, 0 @ load

[PATCH] commands: of_property: fix crashes on incorrect number of arguments

2020-03-30 Thread Ahmad Fatoum
of_property needs at least two parameters, the path and the property name. If we supply less, we risk crashes, e.g. by running of_property -fs /test Verify we got at least two parameters. Signed-off-by: Ahmad Fatoum --- commands/of_property.c | 11 --- 1 file changed, 4 insertions(+), 7

[PATCH 1/2] mci: core: use SECTOR_SIZE instead of direct 512

2020-03-30 Thread Ahmad Fatoum
Instead of hardcoding the 512 byte constant, use the symbolic SECTOR_SIZE. Signed-off-by: Ahmad Fatoum --- drivers/mci/mci-core.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c index 34aaee54f9ed..f3718327f18d 100644

Re: [PATCH v2 4/4] usb: gadget: dfu: Fix DFU mode interface descriptor

2020-03-30 Thread Jules Maselbas
Hi Sascha, On Mon, Mar 30, 2020 at 07:26:30AM +0200, Sascha Hauer wrote: > DFU stopped working for me quite a while ago and I tracked it down to > this dfu-util commit: > > | commit 377f6f136d3369529f44578acaeee82d7c7d7af9 > | Author: Paul Fertser > | Date: Sun Aug 10 14:26:05 2014 +0400 > |

[PATCH 0/8] NFS fixes

2020-03-30 Thread Sascha Hauer
This series fixes some issues with the NFS code. It was easy to confuse the code by pressing ctrl-c during a file transfer. The next file transfers then ended in corrupted files. Sascha Sascha Hauer (8): nfs: Add function to free packets nfs: Add missing free nfs: remove unnecessary check

[PATCH 3/8] nfs: remove unnecessary check

2020-03-30 Thread Sascha Hauer
In rpc_check_reply() pkt is never NULL, drop the unnecessary patch. Signed-off-by: Sascha Hauer --- fs/nfs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/nfs.c b/fs/nfs.c index eb316fe295..9956791820 100644 --- a/fs/nfs.c +++ b/fs/nfs.c @@ -366,9 +366,6 @@ static int rpc_check_reply(

[PATCH 7/8] fs: nfs: don't maintain nfs dentries in dcache

2020-03-30 Thread Sascha Hauer
nfs dentries may change underneath barebox, so do not maintain them in the dcache. Signed-off-by: Sascha Hauer --- fs/nfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs.c b/fs/nfs.c index 26ff354c37..a5fc6467fb 100644 --- a/fs/nfs.c +++ b/fs/nfs.c @@ -1396,6 +1396,7 @@ static int n

[PATCH 8/8] nfs: Do not allow to abort

2020-03-30 Thread Sascha Hauer
When ctrl-c is pressed then ctrlc() will return true until ctrlc_handled() is called. This means that once ctrl-c is pressed every NFS operation will fail until the upper layer calls ctrlc_handled(). When for example we are doing a 'ls -l' on an NFS directory then after a ctrl-c press not the 'ls -

[PATCH 5/8] nfs: Fix polling for packets

2020-03-30 Thread Sascha Hauer
It can happen that the first packet we receive is not the desired one. In this case we have to poll for further packets. set nfs_state back to STATE_START before polling for more packets, otherwise we check the same packet again and again. Signed-off-by: Sascha Hauer --- fs/nfs.c | 7 +-- 1

[PATCH 2/8] nfs: Add missing free

2020-03-30 Thread Sascha Hauer
Add forgotten packet free in error path. Signed-off-by: Sascha Hauer --- fs/nfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs.c b/fs/nfs.c index 0d098f2a66..eb316fe295 100644 --- a/fs/nfs.c +++ b/fs/nfs.c @@ -773,6 +773,7 @@ static int nfs_lookup_req(struct nfs_priv *npriv, struct

[PATCH 6/8] nfs: queue received packets

2020-03-30 Thread Sascha Hauer
It may happen that we receive more than one RPC packet before we come along to check the result. Instead of handling just a single received packet and possibly overwriting the last one queue the received RPC packets. Signed-off-by: Sascha Hauer --- fs/nfs.c | 52 +

[PATCH 1/8] nfs: Add function to free packets

2020-03-30 Thread Sascha Hauer
Add to function to free packets rather than freeing them directly. We will introduce received packet qeueuing with one of the next patches, this patch is meant to make it better readable. Signed-off-by: Sascha Hauer --- fs/nfs.c | 27 --- 1 file changed, 16 insertions(+),

[PATCH 4/8] nfs: Fix rpc_check_reply() return value for stale packets

2020-03-30 Thread Sascha Hauer
When we receive a packet with the previous rpc_id then we have the comment "stale packet, wait a bit longer", but that's not what the code does. rpc_check_reply() returns 0 in this case and the caller then interprets the packet as valid. Always return -EAGAIN for invalid rpc_ids. This lets the call