Re: [PATCH] mfd: axp20x: add mfd axp20x driver

2022-08-30 Thread Sascha Hauer
On Tue, Aug 30, 2022 at 10:09:11AM +0200, Johannes Zink wrote: > From: Ahmad Fatoum > > This commit ports the axp20x driver from linux kernel code. Structures > not applicable for barebox are being dropped. > > Signed-off-by: Ahmad Fatoum > Signed-off-by: Johannes Zink > --- > drivers/mfd/Kco

Re: [PATCH] drivers: mtd: nand: nand_mxs: enable nand_mxs on imx7

2022-08-30 Thread Sascha Hauer
On Tue, Aug 30, 2022 at 10:06:13AM +0200, Johannes Zink wrote: > The i.MX7 GPMI NAND controller is completely backwards compatible with > the version of the IP on the i.MX6. There are additional features like > increased ECC strength, that we may want to use in future, but for now > treating it the

Re: [PATCH v2] ARM: dts: i.MX8MM: describe feature controller

2022-08-30 Thread Sascha Hauer
On Tue, Aug 30, 2022 at 09:50:45AM +0200, Ahmad Fatoum wrote: > Now with i.MX8M feature controller driver support available, have the > OCOTP provide feature control on the i.MX8MM to ensure the kernel DT > does not cause Linux to access the VPU and its power domains, > when barebox knows them to b

Re: [PATCH v4 00/21] add "windowsize" (RFC 7440) support for tftp

2022-08-30 Thread Sascha Hauer
On Tue, Aug 30, 2022 at 09:37:55AM +0200, Enrico Scholz wrote: > The tftp "windowsize" greatly improves the performance of tftp > transfers. This patchset adds support for it. > > The first two patches are a little bit unrelated and enhance the 'cp > -v' output by giving information about the tra

Re: [PATCH 00/10] Add new feature controller framework

2022-08-30 Thread Sascha Hauer
On Tue, Aug 30, 2022 at 09:38:57AM +0200, Ahmad Fatoum wrote: > Hello Sascha, > > On 30.08.22 09:32, Sascha Hauer wrote: > > Hi Ahmad, > > > > On Thu, Aug 18, 2022 at 07:19:45AM +0200, Ahmad Fatoum wrote: > >> The i.MX8MM exists in a Lite variant with no VPUs as well as Solo and > >> Dual variant

Re: [PATCH] clks: imx7: fix initial clock setup with deep probe enabled

2022-08-30 Thread Sascha Hauer
On Tue, Aug 30, 2022 at 10:39:37AM +0200, Johannes Zink wrote: > We register the i.MX7 clock controller driver at core_initcall level and > then do some initial clock setup/reparenting at postcore_initcall level. > This doesn't work as expected when deep probe is enabled, because while > the driver

[PATCH] mdio_bus: Configure pinctrl for phy devices

2022-08-30 Thread Sascha Hauer
Some phys registered from devicetree have pinctrl settings attached to them. Configure the pinctrl state to make sure they can be accessed before trying to reset and detect the phy devices. Signed-off-by: Sascha Hauer --- drivers/net/phy/mdio_bus.c | 2 ++ 1 file changed, 2 insertions(+) diff -

Re: [PATCH v2 2/2] RISC-V: sifive: enable SPI Flash and SD in config

2022-08-30 Thread Antony Pavlov
On Tue, 23 Aug 2022 07:18:02 +0200 Ahmad Fatoum wrote: Hi Ahmad, > Hello Antony, > > On 22.08.22 13:32, Antony Pavlov wrote: > > On Tue, 26 Apr 2022 08:46:04 +0200 > > Ahmad Fatoum wrote: > > > > Hi Ahmad! > > > > I'm trying to run SiFive target with emulate.pl, e.g. > > > > barebox$ dd if=

Re: [PATCH v2] ARM: dts: i.MX8MM: describe feature controller

2022-08-30 Thread Ahmad Fatoum
On 30.08.22 10:29, Marco Felsch wrote: > On 22-08-30, Ahmad Fatoum wrote: >> Hello Marco, >> >> On 30.08.22 10:10, Marco Felsch wrote: >>> Hi Ahamd, >>> >>> On 22-08-30, Ahmad Fatoum wrote: Now with i.MX8M feature controller driver support available, have the OCOTP provide feature control

[PATCH] clks: imx7: fix initial clock setup with deep probe enabled

2022-08-30 Thread Johannes Zink
We register the i.MX7 clock controller driver at core_initcall level and then do some initial clock setup/reparenting at postcore_initcall level. This doesn't work as expected when deep probe is enabled, because while the driver is registered at core_initcall level, it's only probed later on, curre

Re: [PATCH v2] ARM: dts: i.MX8MM: describe feature controller

2022-08-30 Thread Marco Felsch
On 22-08-30, Ahmad Fatoum wrote: > Hello Marco, > > On 30.08.22 10:10, Marco Felsch wrote: > > Hi Ahamd, > > > > On 22-08-30, Ahmad Fatoum wrote: > >> Now with i.MX8M feature controller driver support available, have the > >> OCOTP provide feature control on the i.MX8MM to ensure the kernel DT >

Re: [PATCH v2] ARM: dts: i.MX8MM: describe feature controller

2022-08-30 Thread Ahmad Fatoum
Hello Marco, On 30.08.22 10:10, Marco Felsch wrote: > Hi Ahamd, > > On 22-08-30, Ahmad Fatoum wrote: >> Now with i.MX8M feature controller driver support available, have the >> OCOTP provide feature control on the i.MX8MM to ensure the kernel DT >> does not cause Linux to access the VPU and its p

Re: [PATCH v2] ARM: dts: i.MX8MM: describe feature controller

2022-08-30 Thread Marco Felsch
Hi Ahamd, On 22-08-30, Ahmad Fatoum wrote: > Now with i.MX8M feature controller driver support available, have the > OCOTP provide feature control on the i.MX8MM to ensure the kernel DT > does not cause Linux to access the VPU and its power domains, > when barebox knows them to be unavailable. >

[PATCH] mfd: axp20x: add mfd axp20x driver

2022-08-30 Thread Johannes Zink
From: Ahmad Fatoum This commit ports the axp20x driver from linux kernel code. Structures not applicable for barebox are being dropped. Signed-off-by: Ahmad Fatoum Signed-off-by: Johannes Zink --- drivers/mfd/Kconfig| 8 + drivers/mfd/Makefile | 1 + drivers/mfd/axp20x-i2c.c

[PATCH] drivers: mtd: nand: nand_mxs: enable nand_mxs on imx7

2022-08-30 Thread Johannes Zink
The i.MX7 GPMI NAND controller is completely backwards compatible with the version of the IP on the i.MX6. There are additional features like increased ECC strength, that we may want to use in future, but for now treating it the same as an i.MX6 works without problems. Since the gpmi_nand driver r

[PATCH v2] ARM: dts: i.MX8MM: describe feature controller

2022-08-30 Thread Ahmad Fatoum
Now with i.MX8M feature controller driver support available, have the OCOTP provide feature control on the i.MX8MM to ensure the kernel DT does not cause Linux to access the VPU and its power domains, when barebox knows them to be unavailable. This is needed because the upstream kernel imx8mm.dtsi

[PATCH v4 13/21] tftp: reduce block size on lookup requests

2022-08-30 Thread Enrico Scholz
Save some bytes on network traffic by reducing the server response for lookup requests. Signed-off-by: Enrico Scholz --- fs/tftp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/tftp.c b/fs/tftp.c index 7181c58d1083..16e57daaef37 100644 --- a/fs/tftp.c +++ b/fs/tftp.c

[PATCH v4 12/21] tftp: record whether tftp file is opened for lookup operation only

2022-08-30 Thread Enrico Scholz
Opening a tftp is done in two steps: at first `tftp_lookup()` is called to get the filesize and then it is opened again and data are read. The `tftp_lookup()` call sends only a RRQ/WRQ, reads then the "tsize" from the response and closes the transfer by sending an error datagram. The tftp server w

[PATCH v4 16/21] tftp: implement 'windowsize' (RFC 7440) support

2022-08-30 Thread Enrico Scholz
Results (with the reorder patch; numbers in bytes/s) on an iMX8MP are: | windowsize | VPN | 1 Gb/s | 100 Mb/s | ||---||| | 128| 3.869.284 | 98.643.085 | 11.434.852 | | 64| 3.863.581 | 98.550.375 | 11.434.852 | | 48

[PATCH v4 19/21] tftp: add selftest

2022-08-30 Thread Enrico Scholz
Unittest for window cache functions. Signed-off-by: Enrico Scholz --- fs/tftp-selftest.h | 56 fs/tftp.c | 106 - test/self/Kconfig | 7 +++ 3 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 fs/

[PATCH v4 00/21] add "windowsize" (RFC 7440) support for tftp

2022-08-30 Thread Enrico Scholz
The tftp "windowsize" greatly improves the performance of tftp transfers. This patchset adds support for it. The first two patches are a little bit unrelated and enhance the 'cp -v' output by giving information about the transfer speed. They can be dropped if they are unwanted. I tested the fun

[PATCH v4 09/21] tftp: add debug_assert() macro

2022-08-30 Thread Enrico Scholz
Is a noop in normal cases (when compiler sees that the condition can be evaluated without sideeffects) but allows optimizations based on the condition. E.g. in | void foo(int a) | { | debug_assert(a == 23); | | if (a == 23) | return; | | bar(); | } the call to 'bar()' will be

[PATCH v4 02/21] tftp: allow to change tftp port

2022-08-30 Thread Enrico Scholz
This adds a 'port=' mount option for tftp filesystems. Useful e.g. when working with a local, non-privileged tftp server Signed-off-by: Enrico Scholz --- fs/tftp.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/tftp.c b/fs/tftp.c index c26204ae76e6..913ca1df6e42 1

[PATCH v4 10/21] tftp: allocate buffers and fifo dynamically

2022-08-30 Thread Enrico Scholz
Use the actual blocksize for allocating buffers instead of assuming an hardcoded value. This requires to add an additional 'START' state which is entered after receiving (RRQ) or sending (WRQ) the OACK. Without it, the next state would be entered and the (not allocated yet) fifo be used. For non

[PATCH v4 01/21] tftp: add some 'const' annotations

2022-08-30 Thread Enrico Scholz
Signed-off-by: Enrico Scholz --- fs/tftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/tftp.c b/fs/tftp.c index d186e7983a6d..c26204ae76e6 100644 --- a/fs/tftp.c +++ b/fs/tftp.c @@ -94,7 +94,7 @@ static int tftp_truncate(struct device_d *dev, FILE *f, loff_t size)

[PATCH v4 06/21] tftp: minor refactoring of RRQ/WRQ packet generation code

2022-08-30 Thread Enrico Scholz
Having 11 printf arguments with lot of them being 0, makes it difficulty to read and extend. Add some comments and use '\0' for %c. Signed-off-by: Enrico Scholz --- fs/tftp.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/tftp.c b/fs/tftp.c index c1a193711793.

[PATCH v4 05/21] tftp: assign 'priv->block' later in WRQ

2022-08-30 Thread Enrico Scholz
Some refactoring; makes next patches cleaner. Signed-off-by: Enrico Scholz --- fs/tftp.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/tftp.c b/fs/tftp.c index 361661d2180e..c1a193711793 100644 --- a/fs/tftp.c +++ b/fs/tftp.c @@ -254,6 +254,7 @@ static void tf

[PATCH v4 04/21] tftp: do not set 'tsize' in WRQ requests

2022-08-30 Thread Enrico Scholz
The filesize is not known for push requests and barebox always sent '0'. Server might reject data because it will always exceed this length. Send this option only for RRQ requests. Signed-off-by: Enrico Scholz --- fs/tftp.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) d

[PATCH v4 21/21] tftp: add some documentation about windowsize support

2022-08-30 Thread Enrico Scholz
Signed-off-by: Enrico Scholz --- Documentation/filesystems/tftp.rst | 38 ++ 1 file changed, 38 insertions(+) diff --git a/Documentation/filesystems/tftp.rst b/Documentation/filesystems/tftp.rst index a292765e2511..8929213d3c4a 100644 --- a/Documentation/filesystems/

[PATCH v4 11/21] tftp: add sanity check for OACK response

2022-08-30 Thread Enrico Scholz
Catch bad 'blocksize' or 'windowsize' responses from the server. Signed-off-by: Enrico Scholz --- fs/tftp.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/fs/tftp.c b/fs/tftp.c index 64a94797cda3..4e31adcd60ed 100644 --- a/fs/tftp.c +++ b/fs/tftp.c @@ -2

[PATCH v4 07/21] tftp: replace hardcoded blksize by global constant

2022-08-30 Thread Enrico Scholz
Signed-off-by: Enrico Scholz --- fs/tftp.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/tftp.c b/fs/tftp.c index 0b2a420b6639..264841f24407 100644 --- a/fs/tftp.c +++ b/fs/tftp.c @@ -65,6 +65,7 @@ #define STATE_DONE 8 #define TFTP_BLOCK_SIZE

[PATCH v4 15/21] tftp: detect out-of-memory situations

2022-08-30 Thread Enrico Scholz
it should never happen due to the program logic; but detect a failed kfifo_put() just in case... Signed-off-by: Enrico Scholz --- fs/tftp.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fs/tftp.c b/fs/tftp.c index 5b0dcb2b75d6..e62ff2a80bb5 100644 --- a/fs/tftp.

[PATCH v4 08/21] tftp: remove sanity check of first block

2022-08-30 Thread Enrico Scholz
With tftp window size support in the next patches, the first received block might be !=1 (e.g. when it was reordered or dropped). There could be checked whether it is in the first window, but the corresponding sanity check can be dropped completely: - OACK logic verifies that we speak with a tftp

[PATCH v4 03/21] cmd:tftp: add '-P' option to set tftp server port number

2022-08-30 Thread Enrico Scholz
Signed-off-by: Enrico Scholz --- commands/tftp.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/commands/tftp.c b/commands/tftp.c index 48ff00c6217c..6ac822c9e832 100644 --- a/commands/tftp.c +++ b/commands/tftp.c @@ -21,15 +21,24 @@ static int do_tftp

[PATCH v4 20/21] tftp: accept OACK + DATA datagrams only in certain states

2022-08-30 Thread Enrico Scholz
These packets are valid in certain points of the transfer only and accepting them too early or too late can corrupt internal states. Reject them when they are unexpected. Signed-off-by: Enrico Scholz --- fs/tftp.c | 12 1 file changed, 12 insertions(+) diff --git a/fs/tftp.c b/fs/

[PATCH v4 14/21] tftp: refactor data processing

2022-08-30 Thread Enrico Scholz
move block handling into dedicated function Signed-off-by: Enrico Scholz --- fs/tftp.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/fs/tftp.c b/fs/tftp.c index 16e57daaef37..5b0dcb2b75d6 100644 --- a/fs/tftp.c +++ b/fs/tftp.c @@ -298

[PATCH v4 17/21] tftp: do not use 'priv->block' for RRQ

2022-08-30 Thread Enrico Scholz
attribute is not used outside tftp_recv() for RRQ. Signed-off-by: Enrico Scholz --- fs/tftp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/tftp.c b/fs/tftp.c index 88767223b052..c6c7a2e3c887 100644 --- a/fs/tftp.c +++ b/fs/tftp.c @@ -425,7 +425,7 @@ static void tf

[PATCH v4 18/21] tftp: reorder tftp packets

2022-08-30 Thread Enrico Scholz
With the tftp "windowsize" option, reordering of udp datagrams becomes an issue. Depending on the network topology, this reordering occurs several times with large tftp transfers and will heavily reduce the transfer speed. This patch adds a packet cache so that datagrams can be reassembled in the

Re: [PATCH 00/10] Add new feature controller framework

2022-08-30 Thread Ahmad Fatoum
Hello Sascha, On 30.08.22 09:32, Sascha Hauer wrote: > Hi Ahmad, > > On Thu, Aug 18, 2022 at 07:19:45AM +0200, Ahmad Fatoum wrote: >> The i.MX8MM exists in a Lite variant with no VPUs as well as Solo and >> Dual variants with one or two cores respectively instead of the default >> four. For i.MX6

Re: [PATCH 1/4] ARM: socfpga: achilles: fix entry_function usage

2022-08-30 Thread Sascha Hauer
On Fri, Aug 26, 2022 at 08:49:53AM +0200, Steffen Trumtrar wrote: > Since commit 3e62b38ff641f263df2f6c9e3ebda3c7c62f310b > we use ENTRY_FUNCTION_WITHSTACK in the bringup barebox. > The patch should have removed the arm_setup_stack line > as it is already done in the ENTRY_FUNCTION_WITHSTACK macro.

Re: [PATCH 00/10] Add new feature controller framework

2022-08-30 Thread Sascha Hauer
Hi Ahmad, On Thu, Aug 18, 2022 at 07:19:45AM +0200, Ahmad Fatoum wrote: > The i.MX8MM exists in a Lite variant with no VPUs as well as Solo and > Dual variants with one or two cores respectively instead of the default > four. For i.MX6, we had a manual fixup taking care of deleting the > excess CP

Re: [PATCH 0/8] tftp fixups

2022-08-30 Thread Sascha Hauer
On Mon, Aug 29, 2022 at 12:52:16PM +0200, Ahmad Fatoum wrote: > Hello Enrico, > > On 28.08.22 16:02, Enrico Scholz wrote: > > The "tftp: allocate buffers and fifo dynamically" patch in the last > > patchset broke interaction with non rfc 2347 servers (e.g. when data > > transfer starts immediately