[PATCH v2] commands: of_property: Extend command usage on external dtb

2021-06-25 Thread Yunus Bas
The scope of the of_property command is limited to the internal devicetree only. There is the possibility to add fixtures to postpone the operation until boot and after the kernel DTB is already loaded, but this does not cover the case when the property value needs to be phandle adresses defined

[PATCH] pinctrl: rockchip: Register gpios as device

2021-06-25 Thread Sascha Hauer
The gpio device nodes are subnodes of the pinctrl device node, so we can register a regular driver for it. With this deep-probe support finds a driver for the gpio device nodes and of_device_ensure_probed() can correctly work on the gpio nodes. Signed-off-by: Sascha Hauer ---

[PATCH 1/2] of: refuse to delete root node of live tree

2021-06-25 Thread Sascha Hauer
The root node of the live tree should never be deleted, so refuse to do so and print an error message. Deleting the live tree was possible with the oftree -f command which was removed in c39c70bac5 ("commands: oftree: kill oftree -f"). As this no longer exists we also do not need the

[PATCH 2/2] of: Fix deep-probe triggering when removing nodes

2021-06-25 Thread Sascha Hauer
During deletion of device nodes of_find_device_by_node() is called in order to set the device_node pointer of the device corresponding to the to-be-deleted node to NULL. This is not necessary anymore as the live tree should not be deleted. This fixes problems with deep-probe support.

Re: [PATCH] commands: of_property: Extend command usage on external dtb

2021-06-25 Thread Yunus Bas
Hi Sascha, Am Freitag, dem 25.06.2021 um 09:50 +0200 schrieb Sascha Hauer: > Hi, > > On Thu, Jun 24, 2021 at 05:28:10PM +0200, Yunus Bas wrote: > > @@ -314,6 +320,9 @@ static int do_of_property(int argc, char > > *argv[]) > > case 'f': > > fixup = 1; > >   

Re: [PATCH 4/7] ARM: zynqmp: add update handler

2021-06-25 Thread Michael Tretter
On Thu, 24 Jun 2021 15:34:33 +0200, Ahmad Fatoum wrote: > On 24.06.21 15:24, Michael Tretter wrote: > > On Thu, 24 Jun 2021 12:52:58 +0200, Ahmad Fatoum wrote: > >> On 24.06.21 12:23, Michael Tretter wrote: > >>> The ZynqMP boots from an SDHCI device by reading a boot.bin file from > >>> the

[PATCH v2] firmware: socfpga: set APPLYCFG after loading bitstream

2021-06-25 Thread Steffen Trumtrar
To make changes to the SDRAM controller effective, the APPLYCFG bit must be set after programming the bitstream to the FPGA. This has to be done without any SDRAM usage. Therefore copy the function to execute to the OCRAM and execute it from there. Signed-off-by: Steffen Trumtrar --- Notes:

Re: [PATCH] commands: of_property: Extend command usage on external dtb

2021-06-25 Thread Sascha Hauer
Hi, On Thu, Jun 24, 2021 at 05:28:10PM +0200, Yunus Bas wrote: > @@ -314,6 +320,9 @@ static int do_of_property(int argc, char *argv[]) > case 'f': > fixup = 1; > break; > + case 'e': > + dtbfile = optarg; >

Re: [PATCH] clk: starfive-jh7100: Fix duplicate numbers

2021-06-25 Thread Sascha Hauer
On Thu, Jun 24, 2021 at 05:09:31PM +0200, Geert Uytterhoeven wrote: > Fixes: 6f92e74e5b94d8e6 ("clk: add initial StarFive clock support") > Signed-off-by: Geert Uytterhoeven > --- > Completely untested. > > include/dt-bindings/clock/starfive-jh7100.h | 4 ++-- > 1 file changed, 2 insertions(+),

Re: [PATCH v2 0/7] ZynqMP: Cleanup and extend board support

2021-06-25 Thread Sascha Hauer
On Thu, Jun 24, 2021 at 05:00:47PM +0200, Michael Tretter wrote: > This is v2 of the series to extend the ZynqMP ZCU104 board support. > > This series adds support for reset source detection, Barebox environment, > barebox_update and soft reset (via PSCI) for the ZynqMP ZCU104 board. It > extends

Re: [PATCH v4 0/8] usbgadget: add support for USB mass storage gadget

2021-06-25 Thread Sascha Hauer
On Tue, Jun 22, 2021 at 10:26:09AM +0200, Ahmad Fatoum wrote: > v3 -> v4: > - change bthreads to be scheduled like workqueues instead of pollers > - change virtio input from bthread to poller > - add useful bthread debug print > > v2 -> v3: > - rebase on v3 of the preparatory system

[PATCH 10/19] pinctrl: Find controller node first

2021-06-25 Thread Sascha Hauer
The pinctrl controller node is the first parent node that has a compatible property. Use that information to find the node without iterating up to the root node. Signed-off-by: Sascha Hauer --- drivers/pinctrl/pinctrl.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git

[PATCH 05/19] of: base: move clock init from of_probe() to barebox_register_of()

2021-06-25 Thread Sascha Hauer
From: Marco Felsch This is required for the new deep-probe mechanism. Barebox deep-probe calls of_probe() very late and so clock drivers using the old CLK_OF_DECLARE_DRIVER() mechanism are added very late. This would break the deep-probe approach. Move of_clk_init() and call it right before

[PATCH 08/19] initcall: add of_populate_initcall

2021-06-25 Thread Sascha Hauer
From: Marco Felsch Add dedicated initcall for of_probe() which is required for the following device-on-demand/deep-probe mechanism. Signed-off-by: Marco Felsch Link: https://lore.pengutronix.de/20201021115813.31645-7-m.fel...@pengutronix.de Signed-off-by: Sascha Hauer ---

[PATCH 13/19] phy: Add deep probe support

2021-06-25 Thread Sascha Hauer
Add deep probe support to the phy core. Signed-off-by: Sascha Hauer --- drivers/phy/phy-core.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index ff6e35d160..493876b17f 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@

[PATCH 16/19] ARM: boards: mx6-sabrelite: add deep-probe support

2021-06-25 Thread Sascha Hauer
From: Marco Felsch Convert to board driver and explicitly request the required gpio resources instead of relying on their existence based on the initcall level. Signed-off-by: Marco Felsch Link: https://lore.pengutronix.de/20201021115813.31645-11-m.fel...@pengutronix.de Signed-off-by: Sascha

[PATCH 15/19] ARM: stm32mp: ddrctrl: add deep-probe support

2021-06-25 Thread Sascha Hauer
From: Marco Felsch In case of deep-probe we have to ensure that the memory device is available after the mem_initcall(). Signed-off-by: Marco Felsch Link: https://lore.pengutronix.de/20201021115813.31645-10-m.fel...@pengutronix.de Signed-off-by: Sascha Hauer ---

[PATCH 11/19] common: Explicitly probe consoles earlier with deep probe

2021-06-25 Thread Sascha Hauer
With deep probe support the device providing the console can come quite late in the probe order. Make sure it's probed at postconsole_initcall time as it used to be without deep probe support so that we get output earlier. Signed-off-by: Sascha Hauer --- drivers/of/platform.c | 17

[PATCH 14/19] ARM: i.MX: esdctl: add deep-probe support

2021-06-25 Thread Sascha Hauer
From: Marco Felsch In case of deep-probe we have to ensure that the memory device is available after the mem_initcall(). Signed-off-by: Marco Felsch Link: https://lore.pengutronix.de/20201021115813.31645-9-m.fel...@pengutronix.de Signed-off-by: Sascha Hauer --- arch/arm/mach-imx/esdctl.c |

[PATCH 09/19] common: add initial barebox deep-probe support

2021-06-25 Thread Sascha Hauer
From: Marco Felsch The barebox 'deep probe' or 'probe on demand' mechanism is the answer of unwanted -EPROBE_DEFER failures. The EPROBE_DEFER error code was introduced by commit ab3da15bc14c ("base: Introduce deferred probing") and since then it causes a few problems. The error is returned if

[PATCH 17/19] ARM: i.MX Phytec physom: convert to board driver

2021-06-25 Thread Sascha Hauer
Board driver is the new way for board specific fixups and the physom board with its many compatible strings can really take profit from it, so convert it. Signed-off-by: Sascha Hauer --- arch/arm/boards/phytec-som-imx6/board.c | 150 ++-- 1 file changed, 117 insertions(+),

[PATCH 18/19] ARM: i.MX Phytec physom: Add deep-probe support

2021-06-25 Thread Sascha Hauer
Signed-off-by: Sascha Hauer --- arch/arm/boards/phytec-som-imx6/board.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/boards/phytec-som-imx6/board.c b/arch/arm/boards/phytec-som-imx6/board.c index 36c4d9a78b..1e515a093a 100644 ---

[PATCH 02/19] of: platform: remove check of already added devices

2021-06-25 Thread Sascha Hauer
From: Marco Felsch This check is a relict of the early barebox device tree days, where devices were added by machine and/or board code too. The check ensured too not populate the same device twice. Nowadays _real_ hardware devices (devices with hardware resources) which are not auto enumerable

[PATCH 01/19] imx53: remove unused imx53_add_nand

2021-06-25 Thread Sascha Hauer
From: Marco Felsch The TX53 board was the last user of this function. This board was converted to device tree based boot by commit 971366078893 ("i.MX53/TX53: rework to dts based boot") so we can remove this legacy helper. Signed-off-by: Marco Felsch Link:

[PATCH 19/19] of: Add dummy driver

2021-06-25 Thread Sascha Hauer
With deep probe support we decide that a device for a new device node is available when the device has a driver. It sometimes happens that a consumer of a device node doesn't point to the node to which the driver is attached to, but instead a subnode, like this: usb2phy0:

[PATCH 03/19] of: platform: Keep track of populated platform devices

2021-06-25 Thread Sascha Hauer
From: Marco Felsch Linux does not allow to populate the same of device more than once. Linux uses the OF_POPULATED flag for that purpose. Align the logic with the current linux state with the exception that we are returning the already created device. This is needed for the later added

[PATCH v6 00/19] barebox deep probe support

2021-06-25 Thread Sascha Hauer
This is hopefully last round for this series. I made a few adjustments needed to get my Rockchip RK3568-EVB board working. Now with a non-trivial, non-i.MX board working I am confident that this series works as expected. Changes since v5: - Add deep-probe support for phy - debug print deep-probed

[PATCH 04/19] of: base: move memory init from DT to initcall

2021-06-25 Thread Sascha Hauer
From: Lucas Stach Instead of calling it from of_probe, convert it to a initcall at the appropriate level. This allows to move of_probe to later in the init sequence while keeping the memory init at the same place, which is important as many other drivers need the valid memory area to be set up

[PATCH 12/19] pinctrl: Add deep probe support

2021-06-25 Thread Sascha Hauer
This adds deep probe support for pinctrl. Signed-off-by: Sascha Hauer --- drivers/pinctrl/pinctrl.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl.c b/drivers/pinctrl/pinctrl.c index 84ac61f2d9..7e88391ff3 100644 ---

[PATCH 06/19] of: Set of_chosen and of_model earlier

2021-06-25 Thread Sascha Hauer
of_chosen and of_model can be set once we have the device tree root node, no need to wait until we probe the tree. Signed-off-by: Sascha Hauer --- drivers/of/base.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index

[PATCH 07/19] of: implement of_get_stdoutpath()

2021-06-25 Thread Sascha Hauer
For deep probe support it will be useful to have a function to get the node corresponding to the stdoutpath. of_device_is_stdout_path() already has that functionality in it, so make a separate funcion from it. Signed-off-by: Sascha Hauer --- drivers/of/base.c | 15 ++- include/of.h

[PATCH] ARM: Rockchip: rk3568 EVB: Add eMMC pinmux

2021-06-25 Thread Sascha Hauer
The eMMC relied on reset default pinmux. This doesn't work when not booting from eMMC, so add pinmux. Signed-off-by: Sascha Hauer --- arch/arm/dts/rk3568-evb1-v10.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/dts/rk3568-evb1-v10.dts b/arch/arm/dts/rk3568-evb1-v10.dts index