All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [UBOOT PATCH 0/2] dm: core: Scan "/firmware" node by default
@ 2018-08-10  8:45 Rajan Vaja
  2018-08-10  8:45 ` [U-Boot] [UBOOT PATCH 1/2] dm: core: Move "/clock" node scan into function Rajan Vaja
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Rajan Vaja @ 2018-08-10  8:45 UTC (permalink / raw)
  To: u-boot

All Linux firmware drivers are put under "/firmware" node
and it has support to populate "/firmware" node by default.

u-boot and Linux can share same DTB. In this case, driver
probe for devices under "/firmware" will not be invoked
as "/firmware" does not have its own "compatible" property.

This patch series scans "/firmware" node by default like "/clocks".
To avoid duplication of code, first patch moves, node scan code
into separate function.

Rajan Vaja (2):
  dm: core: Move "/clock" node scan into function
  dm: core: Scan "/firmware" node by default

 drivers/core/root.c | 35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

-- 
BRANCH: zynq3/master-next-test

Changes since RFC:
  * Rebase on top on zynq3 branch.
-- 
2.7.4

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [UBOOT PATCH 1/2] dm: core: Move "/clock" node scan into function
  2018-08-10  8:45 [U-Boot] [UBOOT PATCH 0/2] dm: core: Scan "/firmware" node by default Rajan Vaja
@ 2018-08-10  8:45 ` Rajan Vaja
  2018-08-17 12:49   ` Simon Glass
  2018-08-10  8:45 ` [U-Boot] [UBOOT PATCH 2/2] dm: core: Scan "/firmware" node by default Rajan Vaja
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 21+ messages in thread
From: Rajan Vaja @ 2018-08-10  8:45 UTC (permalink / raw)
  To: u-boot

Create separate function for scanning node by path and
move "/clock" node scan code into that function.

This will be usable if scanning of more node is required.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
 drivers/core/root.c | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 72bcc7d..1ab4c38 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -330,10 +330,25 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
 }
 #endif
 
+static int dm_scan_fdt_ofnode_path(const char *path, bool pre_reloc_only)
+{
+	ofnode node;
+
+	node = ofnode_path(path);
+	if (!ofnode_valid(node))
+		return 0;
+
+#if CONFIG_IS_ENABLED(OF_LIVE)
+	if (of_live_active())
+		return dm_scan_fdt_live(gd->dm_root, node.np, pre_reloc_only);
+#endif
+	return dm_scan_fdt_node(gd->dm_root, gd->fdt_blob, node.of_offset,
+				pre_reloc_only);
+}
+
 int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
 {
 	int ret;
-	ofnode node;
 
 	ret = dm_scan_fdt(gd->fdt_blob, pre_reloc_only);
 	if (ret) {
@@ -341,21 +356,9 @@ int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
 		return ret;
 	}
 
-	/* bind fixed-clock */
-	node = ofnode_path("/clocks");
-	/* if no DT "clocks" node, no need to go further */
-	if (!ofnode_valid(node))
-		return ret;
-
-#if CONFIG_IS_ENABLED(OF_LIVE)
-	if (of_live_active())
-		ret = dm_scan_fdt_live(gd->dm_root, node.np, pre_reloc_only);
-	else
-#endif
-		ret = dm_scan_fdt_node(gd->dm_root, gd->fdt_blob, node.of_offset,
-				       pre_reloc_only);
+	ret = dm_scan_fdt_ofnode_path("/clocks", pre_reloc_only);
 	if (ret)
-		debug("dm_scan_fdt_node() failed: %d\n", ret);
+		debug("scan for /clocks failed: %d\n", ret);
 
 	return ret;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [UBOOT PATCH 2/2] dm: core: Scan "/firmware" node by default
  2018-08-10  8:45 [U-Boot] [UBOOT PATCH 0/2] dm: core: Scan "/firmware" node by default Rajan Vaja
  2018-08-10  8:45 ` [U-Boot] [UBOOT PATCH 1/2] dm: core: Move "/clock" node scan into function Rajan Vaja
@ 2018-08-10  8:45 ` Rajan Vaja
  2018-08-17 12:49   ` Simon Glass
  2018-08-10  8:55 ` [U-Boot] [UBOOT PATCH 0/2] " Michal Simek
  2018-09-19 10:43 ` [U-Boot] [PATCH v2 0/4] " Rajan Vaja
  3 siblings, 1 reply; 21+ messages in thread
From: Rajan Vaja @ 2018-08-10  8:45 UTC (permalink / raw)
  To: u-boot

All Linux firmware drivers are put under "/firmware" node
and it has support to populate "/firmware" node by default.

u-boot and Linux can share same DTB. In this case, driver
probe for devices under "/firmware" will not be invoked
as "/firmware" does not have its own "compatible" property.

This patch scans "/firmware" node by default like "/clocks".

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
 drivers/core/root.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 1ab4c38..47d10b8 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -357,8 +357,14 @@ int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
 	}
 
 	ret = dm_scan_fdt_ofnode_path("/clocks", pre_reloc_only);
-	if (ret)
+	if (ret) {
 		debug("scan for /clocks failed: %d\n", ret);
+		return ret;
+	}
+
+	ret = dm_scan_fdt_ofnode_path("/firmware", pre_reloc_only);
+	if (ret)
+		debug("scan for /firmware failed: %d\n", ret);
 
 	return ret;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [UBOOT PATCH 0/2] dm: core: Scan "/firmware" node by default
  2018-08-10  8:45 [U-Boot] [UBOOT PATCH 0/2] dm: core: Scan "/firmware" node by default Rajan Vaja
  2018-08-10  8:45 ` [U-Boot] [UBOOT PATCH 1/2] dm: core: Move "/clock" node scan into function Rajan Vaja
  2018-08-10  8:45 ` [U-Boot] [UBOOT PATCH 2/2] dm: core: Scan "/firmware" node by default Rajan Vaja
@ 2018-08-10  8:55 ` Michal Simek
  2018-09-19 10:43 ` [U-Boot] [PATCH v2 0/4] " Rajan Vaja
  3 siblings, 0 replies; 21+ messages in thread
From: Michal Simek @ 2018-08-10  8:55 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On 10.8.2018 10:45, Rajan Vaja wrote:
> All Linux firmware drivers are put under "/firmware" node
> and it has support to populate "/firmware" node by default.
> 
> u-boot and Linux can share same DTB. In this case, driver
> probe for devices under "/firmware" will not be invoked
> as "/firmware" does not have its own "compatible" property.
> 
> This patch series scans "/firmware" node by default like "/clocks".
> To avoid duplication of code, first patch moves, node scan code
> into separate function.
> 
> Rajan Vaja (2):
>   dm: core: Move "/clock" node scan into function
>   dm: core: Scan "/firmware" node by default
> 
>  drivers/core/root.c | 35 ++++++++++++++++++++++-------------
>  1 file changed, 22 insertions(+), 13 deletions(-)
> 

This patch is done based on acked binding
https://lkml.org/lkml/2018/8/3/683
and
https://lkml.org/lkml/2018/8/3/684

where clock driver is child of firmware node.

Can you please look at these 2 patches?

Thanks,
Michal

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [UBOOT PATCH 2/2] dm: core: Scan "/firmware" node by default
  2018-08-10  8:45 ` [U-Boot] [UBOOT PATCH 2/2] dm: core: Scan "/firmware" node by default Rajan Vaja
@ 2018-08-17 12:49   ` Simon Glass
  2018-08-17 13:22     ` Michal Simek
  0 siblings, 1 reply; 21+ messages in thread
From: Simon Glass @ 2018-08-17 12:49 UTC (permalink / raw)
  To: u-boot

On 10 August 2018 at 02:45, Rajan Vaja <rajan.vaja@xilinx.com> wrote:
> All Linux firmware drivers are put under "/firmware" node
> and it has support to populate "/firmware" node by default.
>
> u-boot and Linux can share same DTB. In this case, driver
> probe for devices under "/firmware" will not be invoked
> as "/firmware" does not have its own "compatible" property.
>
> This patch scans "/firmware" node by default like "/clocks".
>
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>  drivers/core/root.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

We should add a firmware device for sandbox.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [UBOOT PATCH 1/2] dm: core: Move "/clock" node scan into function
  2018-08-10  8:45 ` [U-Boot] [UBOOT PATCH 1/2] dm: core: Move "/clock" node scan into function Rajan Vaja
@ 2018-08-17 12:49   ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2018-08-17 12:49 UTC (permalink / raw)
  To: u-boot

On 10 August 2018 at 02:45, Rajan Vaja <rajan.vaja@xilinx.com> wrote:
> Create separate function for scanning node by path and
> move "/clock" node scan code into that function.
>
> This will be usable if scanning of more node is required.
>
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>  drivers/core/root.c | 33 ++++++++++++++++++---------------
>  1 file changed, 18 insertions(+), 15 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [UBOOT PATCH 2/2] dm: core: Scan "/firmware" node by default
  2018-08-17 12:49   ` Simon Glass
@ 2018-08-17 13:22     ` Michal Simek
  2018-08-17 18:03       ` Simon Glass
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Simek @ 2018-08-17 13:22 UTC (permalink / raw)
  To: u-boot

On 17.8.2018 14:49, Simon Glass wrote:
> On 10 August 2018 at 02:45, Rajan Vaja <rajan.vaja@xilinx.com> wrote:
>> All Linux firmware drivers are put under "/firmware" node
>> and it has support to populate "/firmware" node by default.
>>
>> u-boot and Linux can share same DTB. In this case, driver
>> probe for devices under "/firmware" will not be invoked
>> as "/firmware" does not have its own "compatible" property.
>>
>> This patch scans "/firmware" node by default like "/clocks".
>>
>> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
>> ---
>>  drivers/core/root.c | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> We should add a firmware device for sandbox.
> 

what to add there?

M

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [UBOOT PATCH 2/2] dm: core: Scan "/firmware" node by default
  2018-08-17 13:22     ` Michal Simek
@ 2018-08-17 18:03       ` Simon Glass
  2018-08-20  7:04         ` Michal Simek
  0 siblings, 1 reply; 21+ messages in thread
From: Simon Glass @ 2018-08-17 18:03 UTC (permalink / raw)
  To: u-boot

Hi Michael,

On 17 August 2018 at 07:22, Michal Simek <michal.simek@xilinx.com> wrote:
> On 17.8.2018 14:49, Simon Glass wrote:
>> On 10 August 2018 at 02:45, Rajan Vaja <rajan.vaja@xilinx.com> wrote:
>>> All Linux firmware drivers are put under "/firmware" node
>>> and it has support to populate "/firmware" node by default.
>>>
>>> u-boot and Linux can share same DTB. In this case, driver
>>> probe for devices under "/firmware" will not be invoked
>>> as "/firmware" does not have its own "compatible" property.
>>>
>>> This patch scans "/firmware" node by default like "/clocks".
>>>
>>> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
>>> ---
>>>  drivers/core/root.c | 8 +++++++-
>>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>
>> We should add a firmware device for sandbox.
>>
>
> what to add there?

It can be any device, but I suggest something simple like a
demo-shape? Then you can check that it is accessible in a test in
test/dm/core.c, perhaps.

Regards,
Simon

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [UBOOT PATCH 2/2] dm: core: Scan "/firmware" node by default
  2018-08-17 18:03       ` Simon Glass
@ 2018-08-20  7:04         ` Michal Simek
  0 siblings, 0 replies; 21+ messages in thread
From: Michal Simek @ 2018-08-20  7:04 UTC (permalink / raw)
  To: u-boot

On 17.8.2018 20:03, Simon Glass wrote:
> Hi Michael,
> 
> On 17 August 2018 at 07:22, Michal Simek <michal.simek@xilinx.com> wrote:
>> On 17.8.2018 14:49, Simon Glass wrote:
>>> On 10 August 2018 at 02:45, Rajan Vaja <rajan.vaja@xilinx.com> wrote:
>>>> All Linux firmware drivers are put under "/firmware" node
>>>> and it has support to populate "/firmware" node by default.
>>>>
>>>> u-boot and Linux can share same DTB. In this case, driver
>>>> probe for devices under "/firmware" will not be invoked
>>>> as "/firmware" does not have its own "compatible" property.
>>>>
>>>> This patch scans "/firmware" node by default like "/clocks".
>>>>
>>>> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
>>>> ---
>>>>  drivers/core/root.c | 8 +++++++-
>>>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>>
>>> We should add a firmware device for sandbox.
>>>
>>
>> what to add there?
> 
> It can be any device, but I suggest something simple like a
> demo-shape? Then you can check that it is accessible in a test in
> test/dm/core.c, perhaps.

Rajan: please take a look at it.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 0/4] dm: core: Scan "/firmware" node by default
  2018-08-10  8:45 [U-Boot] [UBOOT PATCH 0/2] dm: core: Scan "/firmware" node by default Rajan Vaja
                   ` (2 preceding siblings ...)
  2018-08-10  8:55 ` [U-Boot] [UBOOT PATCH 0/2] " Michal Simek
@ 2018-09-19 10:43 ` Rajan Vaja
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 1/4] firmware: Add FIRMWARE config prompt string Rajan Vaja
                     ` (4 more replies)
  3 siblings, 5 replies; 21+ messages in thread
From: Rajan Vaja @ 2018-09-19 10:43 UTC (permalink / raw)
  To: u-boot

All Linux firmware drivers are put under "/firmware" node
and it has support to populate "/firmware" node by default.

u-boot and Linux can share same DTB. In this case, driver
probe for devices under "/firmware" will not be invoked
as "/firmware" does not have its own "compatible" property.

This patch series scans "/firmware" node by default like "/clocks".
To avoid duplication of code, first patch moves, node scan code
into separate function.

This series also test to make sure "/firmware" nodes are scanned
properly.

Rajan Vaja (4):
  firmware: Add FIRMWARE config prompt string
  dm: core: Move "/clock" node scan into function
  dm: core: Scan "/firmware" node by default
  dm: test: Add "/firmware" node scan test

 arch/sandbox/dts/test.dts           |  7 +++++++
 drivers/core/root.c                 | 35 ++++++++++++++++++++++-------------
 drivers/firmware/Kconfig            |  2 +-
 drivers/firmware/Makefile           |  1 +
 drivers/firmware/firmware-sandbox.c | 20 ++++++++++++++++++++
 test/dm/Makefile                    |  1 +
 test/dm/firmware.c                  | 22 ++++++++++++++++++++++
 7 files changed, 74 insertions(+), 14 deletions(-)
 create mode 100644 drivers/firmware/firmware-sandbox.c
 create mode 100644 test/dm/firmware.c

-- 
Changes in v2:
 * Add firmware device for sanbox and its test
 * Fix Kconfig to enable FIRMWARE config
-- 
2.7.4

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 1/4] firmware: Add FIRMWARE config prompt string
  2018-09-19 10:43 ` [U-Boot] [PATCH v2 0/4] " Rajan Vaja
@ 2018-09-19 10:43   ` Rajan Vaja
  2018-09-26  5:41     ` Simon Glass
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 2/4] dm: core: Move "/clock" node scan into function Rajan Vaja
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Rajan Vaja @ 2018-09-19 10:43 UTC (permalink / raw)
  To: u-boot

There is no prompt string for FIRMWARE config. Without this,
FIRMWARE config cannot be enabled through menuconfing or
config file. Fix this by adding prompt summary.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
Changes in v2:
  * New patch
---
 drivers/firmware/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index cb73b70..feaea81 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -1,5 +1,5 @@
 config FIRMWARE
-	bool
+	bool "Enable Firmware driver support"
 
 config ARM_PSCI_FW
 	bool
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 2/4] dm: core: Move "/clock" node scan into function
  2018-09-19 10:43 ` [U-Boot] [PATCH v2 0/4] " Rajan Vaja
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 1/4] firmware: Add FIRMWARE config prompt string Rajan Vaja
@ 2018-09-19 10:43   ` Rajan Vaja
  2018-09-28 15:55     ` Simon Glass
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 3/4] dm: core: Scan "/firmware" node by default Rajan Vaja
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Rajan Vaja @ 2018-09-19 10:43 UTC (permalink / raw)
  To: u-boot

Create separate function for scanning node by path and
move "/clock" node scan code into that function.

This will be usable if scanning of more node is required.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
  * None
---
 drivers/core/root.c | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 72bcc7d..1ab4c38 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -330,10 +330,25 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
 }
 #endif
 
+static int dm_scan_fdt_ofnode_path(const char *path, bool pre_reloc_only)
+{
+	ofnode node;
+
+	node = ofnode_path(path);
+	if (!ofnode_valid(node))
+		return 0;
+
+#if CONFIG_IS_ENABLED(OF_LIVE)
+	if (of_live_active())
+		return dm_scan_fdt_live(gd->dm_root, node.np, pre_reloc_only);
+#endif
+	return dm_scan_fdt_node(gd->dm_root, gd->fdt_blob, node.of_offset,
+				pre_reloc_only);
+}
+
 int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
 {
 	int ret;
-	ofnode node;
 
 	ret = dm_scan_fdt(gd->fdt_blob, pre_reloc_only);
 	if (ret) {
@@ -341,21 +356,9 @@ int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
 		return ret;
 	}
 
-	/* bind fixed-clock */
-	node = ofnode_path("/clocks");
-	/* if no DT "clocks" node, no need to go further */
-	if (!ofnode_valid(node))
-		return ret;
-
-#if CONFIG_IS_ENABLED(OF_LIVE)
-	if (of_live_active())
-		ret = dm_scan_fdt_live(gd->dm_root, node.np, pre_reloc_only);
-	else
-#endif
-		ret = dm_scan_fdt_node(gd->dm_root, gd->fdt_blob, node.of_offset,
-				       pre_reloc_only);
+	ret = dm_scan_fdt_ofnode_path("/clocks", pre_reloc_only);
 	if (ret)
-		debug("dm_scan_fdt_node() failed: %d\n", ret);
+		debug("scan for /clocks failed: %d\n", ret);
 
 	return ret;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 3/4] dm: core: Scan "/firmware" node by default
  2018-09-19 10:43 ` [U-Boot] [PATCH v2 0/4] " Rajan Vaja
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 1/4] firmware: Add FIRMWARE config prompt string Rajan Vaja
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 2/4] dm: core: Move "/clock" node scan into function Rajan Vaja
@ 2018-09-19 10:43   ` Rajan Vaja
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 4/4] dm: test: Add "/firmware" node scan test Rajan Vaja
  2018-09-26  6:33   ` [U-Boot] [PATCH v2 0/4] dm: core: Scan "/firmware" node by default Michal Simek
  4 siblings, 0 replies; 21+ messages in thread
From: Rajan Vaja @ 2018-09-19 10:43 UTC (permalink / raw)
  To: u-boot

All Linux firmware drivers are put under "/firmware" node
and it has support to populate "/firmware" node by default.

u-boot and Linux can share same DTB. In this case, driver
probe for devices under "/firmware" will not be invoked
as "/firmware" does not have its own "compatible" property.

This patch scans "/firmware" node by default like "/clocks".

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
  * None
---
 drivers/core/root.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 1ab4c38..47d10b8 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -357,8 +357,14 @@ int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
 	}
 
 	ret = dm_scan_fdt_ofnode_path("/clocks", pre_reloc_only);
-	if (ret)
+	if (ret) {
 		debug("scan for /clocks failed: %d\n", ret);
+		return ret;
+	}
+
+	ret = dm_scan_fdt_ofnode_path("/firmware", pre_reloc_only);
+	if (ret)
+		debug("scan for /firmware failed: %d\n", ret);
 
 	return ret;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 4/4] dm: test: Add "/firmware" node scan test
  2018-09-19 10:43 ` [U-Boot] [PATCH v2 0/4] " Rajan Vaja
                     ` (2 preceding siblings ...)
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 3/4] dm: core: Scan "/firmware" node by default Rajan Vaja
@ 2018-09-19 10:43   ` Rajan Vaja
  2018-09-26  5:41     ` Simon Glass
  2018-09-26  6:33   ` [U-Boot] [PATCH v2 0/4] dm: core: Scan "/firmware" node by default Michal Simek
  4 siblings, 1 reply; 21+ messages in thread
From: Rajan Vaja @ 2018-09-19 10:43 UTC (permalink / raw)
  To: u-boot

Add a test which verifies that all subnodes under "/firmware"
nodes are scanned.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
Changes in v2:
  * New patch
---
 arch/sandbox/dts/test.dts           |  7 +++++++
 drivers/firmware/Makefile           |  1 +
 drivers/firmware/firmware-sandbox.c | 20 ++++++++++++++++++++
 test/dm/Makefile                    |  1 +
 test/dm/firmware.c                  | 22 ++++++++++++++++++++++
 5 files changed, 51 insertions(+)
 create mode 100644 drivers/firmware/firmware-sandbox.c
 create mode 100644 test/dm/firmware.c

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 3668263..94c603a 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -630,6 +630,13 @@
 			};
 		};
 	};
+
+	firmware {
+		sandbox_firmware: sandbox-firmware {
+			compatible = "sandbox,firmware";
+		};
+	};
+
 };
 
 #include "sandbox_pmic.dtsi"
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 1cdda14..6cb8358 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -1,3 +1,4 @@
 obj-$(CONFIG_FIRMWARE)		+= firmware-uclass.o
 obj-$(CONFIG_ARM_PSCI_FW)	+= psci.o
 obj-$(CONFIG_TI_SCI_PROTOCOL)	+= ti_sci.o
+obj-$(CONFIG_SANDBOX)		+= firmware-sandbox.o
diff --git a/drivers/firmware/firmware-sandbox.c b/drivers/firmware/firmware-sandbox.c
new file mode 100644
index 0000000..d970d75
--- /dev/null
+++ b/drivers/firmware/firmware-sandbox.c
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * sandbox firmware driver
+ *
+ * Copyright (C) 2018 Xilinx, Inc.
+ */
+
+#include <common.h>
+#include <dm.h>
+
+static const struct udevice_id generic_sandbox_firmware_ids[] = {
+	{ .compatible = "sandbox,firmware" },
+	{ }
+};
+
+U_BOOT_DRIVER(sandbox_firmware) = {
+	.name = "sandbox_firmware",
+	.id = UCLASS_FIRMWARE,
+	.of_match = generic_sandbox_firmware_ids,
+};
diff --git a/test/dm/Makefile b/test/dm/Makefile
index 3f5a634..3f54710 100644
--- a/test/dm/Makefile
+++ b/test/dm/Makefile
@@ -47,4 +47,5 @@ obj-$(CONFIG_WDT) += wdt.o
 obj-$(CONFIG_AXI) += axi.o
 obj-$(CONFIG_MISC) += misc.o
 obj-$(CONFIG_DM_SERIAL) += serial.o
+obj-$(CONFIG_FIRMWARE) += firmware.o
 endif
diff --git a/test/dm/firmware.c b/test/dm/firmware.c
new file mode 100644
index 0000000..60fdcbb
--- /dev/null
+++ b/test/dm/firmware.c
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Xilinx, Inc.
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <syscon.h>
+#include <asm/test.h>
+#include <dm/test.h>
+#include <test/ut.h>
+
+/* Base test of firmware probe */
+static int dm_test_firmware_probe(struct unit_test_state *uts)
+{
+	struct udevice *dev;
+
+	ut_assertok(uclass_get_device_by_name(UCLASS_FIRMWARE,
+					      "sandbox-firmware", &dev));
+	return 0;
+}
+DM_TEST(dm_test_firmware_probe, DM_TESTF_SCAN_FDT);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 1/4] firmware: Add FIRMWARE config prompt string
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 1/4] firmware: Add FIRMWARE config prompt string Rajan Vaja
@ 2018-09-26  5:41     ` Simon Glass
  2018-10-02 11:21       ` Simon Glass
  0 siblings, 1 reply; 21+ messages in thread
From: Simon Glass @ 2018-09-26  5:41 UTC (permalink / raw)
  To: u-boot

On 19 September 2018 at 04:43, Rajan Vaja <rajan.vaja@xilinx.com> wrote:
> There is no prompt string for FIRMWARE config. Without this,
> FIRMWARE config cannot be enabled through menuconfing or
> config file. Fix this by adding prompt summary.
>
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
> Changes in v2:
>   * New patch
> ---
>  drivers/firmware/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 4/4] dm: test: Add "/firmware" node scan test
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 4/4] dm: test: Add "/firmware" node scan test Rajan Vaja
@ 2018-09-26  5:41     ` Simon Glass
  2018-10-02 11:21       ` Simon Glass
  0 siblings, 1 reply; 21+ messages in thread
From: Simon Glass @ 2018-09-26  5:41 UTC (permalink / raw)
  To: u-boot

On 19 September 2018 at 04:43, Rajan Vaja <rajan.vaja@xilinx.com> wrote:
> Add a test which verifies that all subnodes under "/firmware"
> nodes are scanned.
>
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
> Changes in v2:
>   * New patch
> ---
>  arch/sandbox/dts/test.dts           |  7 +++++++
>  drivers/firmware/Makefile           |  1 +
>  drivers/firmware/firmware-sandbox.c | 20 ++++++++++++++++++++
>  test/dm/Makefile                    |  1 +
>  test/dm/firmware.c                  | 22 ++++++++++++++++++++++
>  5 files changed, 51 insertions(+)
>  create mode 100644 drivers/firmware/firmware-sandbox.c
>  create mode 100644 test/dm/firmware.c

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 0/4] dm: core: Scan "/firmware" node by default
  2018-09-19 10:43 ` [U-Boot] [PATCH v2 0/4] " Rajan Vaja
                     ` (3 preceding siblings ...)
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 4/4] dm: test: Add "/firmware" node scan test Rajan Vaja
@ 2018-09-26  6:33   ` Michal Simek
  2018-09-28 15:55     ` Simon Glass
  4 siblings, 1 reply; 21+ messages in thread
From: Michal Simek @ 2018-09-26  6:33 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On 19.9.2018 12:43, Rajan Vaja wrote:
> All Linux firmware drivers are put under "/firmware" node
> and it has support to populate "/firmware" node by default.
> 
> u-boot and Linux can share same DTB. In this case, driver
> probe for devices under "/firmware" will not be invoked
> as "/firmware" does not have its own "compatible" property.
> 
> This patch series scans "/firmware" node by default like "/clocks".
> To avoid duplication of code, first patch moves, node scan code
> into separate function.
> 
> This series also test to make sure "/firmware" nodes are scanned
> properly.
> 
> Rajan Vaja (4):
>   firmware: Add FIRMWARE config prompt string
>   dm: core: Move "/clock" node scan into function
>   dm: core: Scan "/firmware" node by default
>   dm: test: Add "/firmware" node scan test
> 
>  arch/sandbox/dts/test.dts           |  7 +++++++
>  drivers/core/root.c                 | 35 ++++++++++++++++++++++-------------
>  drivers/firmware/Kconfig            |  2 +-
>  drivers/firmware/Makefile           |  1 +
>  drivers/firmware/firmware-sandbox.c | 20 ++++++++++++++++++++
>  test/dm/Makefile                    |  1 +
>  test/dm/firmware.c                  | 22 ++++++++++++++++++++++
>  7 files changed, 74 insertions(+), 14 deletions(-)
>  create mode 100644 drivers/firmware/firmware-sandbox.c
>  create mode 100644 test/dm/firmware.c
> 

Can you please take it via your tree?

Thanks,
Michal

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 0/4] dm: core: Scan "/firmware" node by default
  2018-09-26  6:33   ` [U-Boot] [PATCH v2 0/4] dm: core: Scan "/firmware" node by default Michal Simek
@ 2018-09-28 15:55     ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2018-09-28 15:55 UTC (permalink / raw)
  To: u-boot

On 25 September 2018 at 23:33, Michal Simek <michal.simek@xilinx.com> wrote:
> Hi Simon,
>
> On 19.9.2018 12:43, Rajan Vaja wrote:
>> All Linux firmware drivers are put under "/firmware" node
>> and it has support to populate "/firmware" node by default.
>>
>> u-boot and Linux can share same DTB. In this case, driver
>> probe for devices under "/firmware" will not be invoked
>> as "/firmware" does not have its own "compatible" property.
>>
>> This patch series scans "/firmware" node by default like "/clocks".
>> To avoid duplication of code, first patch moves, node scan code
>> into separate function.
>>
>> This series also test to make sure "/firmware" nodes are scanned
>> properly.
>>
>> Rajan Vaja (4):
>>   firmware: Add FIRMWARE config prompt string
>>   dm: core: Move "/clock" node scan into function
>>   dm: core: Scan "/firmware" node by default
>>   dm: test: Add "/firmware" node scan test
>>
>>  arch/sandbox/dts/test.dts           |  7 +++++++
>>  drivers/core/root.c                 | 35 ++++++++++++++++++++++-------------
>>  drivers/firmware/Kconfig            |  2 +-
>>  drivers/firmware/Makefile           |  1 +
>>  drivers/firmware/firmware-sandbox.c | 20 ++++++++++++++++++++
>>  test/dm/Makefile                    |  1 +
>>  test/dm/firmware.c                  | 22 ++++++++++++++++++++++
>>  7 files changed, 74 insertions(+), 14 deletions(-)
>>  create mode 100644 drivers/firmware/firmware-sandbox.c
>>  create mode 100644 test/dm/firmware.c
>>
>
> Can you please take it via your tree?
>
> Thanks,
> Michal

Applied to u-boot-dm, and now in mainline, thanks!

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 2/4] dm: core: Move "/clock" node scan into function
  2018-09-19 10:43   ` [U-Boot] [PATCH v2 2/4] dm: core: Move "/clock" node scan into function Rajan Vaja
@ 2018-09-28 15:55     ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2018-09-28 15:55 UTC (permalink / raw)
  To: u-boot

On 19 September 2018 at 03:43, Rajan Vaja <rajan.vaja@xilinx.com> wrote:
> Create separate function for scanning node by path and
> move "/clock" node scan code into that function.
>
> This will be usable if scanning of more node is required.
>
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> Changes in v2:
>   * None
> ---
>  drivers/core/root.c | 33 ++++++++++++++++++---------------
>  1 file changed, 18 insertions(+), 15 deletions(-)

Applied to u-boot-dm, and now in mainline, thanks!

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 1/4] firmware: Add FIRMWARE config prompt string
  2018-09-26  5:41     ` Simon Glass
@ 2018-10-02 11:21       ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2018-10-02 11:21 UTC (permalink / raw)
  To: u-boot

On 25 September 2018 at 22:41, Simon Glass <sjg@chromium.org> wrote:
> On 19 September 2018 at 04:43, Rajan Vaja <rajan.vaja@xilinx.com> wrote:
>> There is no prompt string for FIRMWARE config. Without this,
>> FIRMWARE config cannot be enabled through menuconfing or
>> config file. Fix this by adding prompt summary.
>>
>> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
>> ---
>> Changes in v2:
>>   * New patch
>> ---
>>  drivers/firmware/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, and now in mainline, thanks!

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v2 4/4] dm: test: Add "/firmware" node scan test
  2018-09-26  5:41     ` Simon Glass
@ 2018-10-02 11:21       ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2018-10-02 11:21 UTC (permalink / raw)
  To: u-boot

On 25 September 2018 at 22:41, Simon Glass <sjg@chromium.org> wrote:
> On 19 September 2018 at 04:43, Rajan Vaja <rajan.vaja@xilinx.com> wrote:
>> Add a test which verifies that all subnodes under "/firmware"
>> nodes are scanned.
>>
>> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
>> ---
>> Changes in v2:
>>   * New patch
>> ---
>>  arch/sandbox/dts/test.dts           |  7 +++++++
>>  drivers/firmware/Makefile           |  1 +
>>  drivers/firmware/firmware-sandbox.c | 20 ++++++++++++++++++++
>>  test/dm/Makefile                    |  1 +
>>  test/dm/firmware.c                  | 22 ++++++++++++++++++++++
>>  5 files changed, 51 insertions(+)
>>  create mode 100644 drivers/firmware/firmware-sandbox.c
>>  create mode 100644 test/dm/firmware.c
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, and now in mainline, thanks!

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-10-02 11:21 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10  8:45 [U-Boot] [UBOOT PATCH 0/2] dm: core: Scan "/firmware" node by default Rajan Vaja
2018-08-10  8:45 ` [U-Boot] [UBOOT PATCH 1/2] dm: core: Move "/clock" node scan into function Rajan Vaja
2018-08-17 12:49   ` Simon Glass
2018-08-10  8:45 ` [U-Boot] [UBOOT PATCH 2/2] dm: core: Scan "/firmware" node by default Rajan Vaja
2018-08-17 12:49   ` Simon Glass
2018-08-17 13:22     ` Michal Simek
2018-08-17 18:03       ` Simon Glass
2018-08-20  7:04         ` Michal Simek
2018-08-10  8:55 ` [U-Boot] [UBOOT PATCH 0/2] " Michal Simek
2018-09-19 10:43 ` [U-Boot] [PATCH v2 0/4] " Rajan Vaja
2018-09-19 10:43   ` [U-Boot] [PATCH v2 1/4] firmware: Add FIRMWARE config prompt string Rajan Vaja
2018-09-26  5:41     ` Simon Glass
2018-10-02 11:21       ` Simon Glass
2018-09-19 10:43   ` [U-Boot] [PATCH v2 2/4] dm: core: Move "/clock" node scan into function Rajan Vaja
2018-09-28 15:55     ` Simon Glass
2018-09-19 10:43   ` [U-Boot] [PATCH v2 3/4] dm: core: Scan "/firmware" node by default Rajan Vaja
2018-09-19 10:43   ` [U-Boot] [PATCH v2 4/4] dm: test: Add "/firmware" node scan test Rajan Vaja
2018-09-26  5:41     ` Simon Glass
2018-10-02 11:21       ` Simon Glass
2018-09-26  6:33   ` [U-Boot] [PATCH v2 0/4] dm: core: Scan "/firmware" node by default Michal Simek
2018-09-28 15:55     ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.