All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] dm: Simplify livetree handling
@ 2020-11-29  0:49 Simon Glass
  2020-11-29  0:50 ` [PATCH 01/11] dm: core: Rename device_bind() to device_bind_offset() Simon Glass
                   ` (21 more replies)
  0 siblings, 22 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:49 UTC (permalink / raw)
  To: u-boot

At present there are separate code paths for livetree and flattree in
places where they can be made common. Also there are a few functions
that support flattree but can be moved over to use the livetree API (i.e.
ofnode instead of a DT offset).

This series tidies up these areas.


Simon Glass (11):
  dm: core: Rename device_bind() to device_bind_offset()
  dm: core: Rename device_bind_ofnode() to device_bind()
  dm: core: Add a livetree function to check node status
  dm: Remove uses of device_bind_offset()
  dm: Drop uses of dev_set_of_offset()
  dm: core: Drop dev_set_of_offset()
  dm: core: Drop device_bind_offset()
  dm: core: Add an ofnode function to get the devicetree root
  dm: core: Combine the flattree and livetree binding code
  dm: core: Drop unused parameter from dm_scan_fdt()
  dm: core: Drop unused parameter from dm_extended_scan_fdt()

 drivers/clk/at91/compat.c                   | 20 ++---
 drivers/clk/clk.c                           |  2 +-
 drivers/core/device.c                       | 10 +--
 drivers/core/ofnode.c                       | 10 +++
 drivers/core/root.c                         | 97 ++++++---------------
 drivers/firmware/scmi/scmi_agent-uclass.c   |  4 +-
 drivers/gpio/dwapb_gpio.c                   |  4 +-
 drivers/gpio/mt7621_gpio.c                  |  5 +-
 drivers/gpio/s5p_gpio.c                     |  6 +-
 drivers/gpio/sunxi_gpio.c                   |  5 +-
 drivers/gpio/tegra186_gpio.c                |  3 +-
 drivers/gpio/tegra_gpio.c                   |  4 +-
 drivers/misc/i2c_eeprom.c                   |  4 +-
 drivers/mtd/spi/sandbox.c                   |  2 +-
 drivers/net/mvpp2.c                         |  4 +-
 drivers/pci/pci-uclass.c                    |  4 +-
 drivers/pci/pci_mvebu.c                     |  4 +-
 drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  2 +-
 drivers/pinctrl/meson/pinctrl-meson.c       |  5 +-
 drivers/pinctrl/mscc/pinctrl-jr2.c          |  2 +-
 drivers/pinctrl/mscc/pinctrl-luton.c        |  2 +-
 drivers/pinctrl/mscc/pinctrl-ocelot.c       |  2 +-
 drivers/pinctrl/mscc/pinctrl-serval.c       |  2 +-
 drivers/pinctrl/mscc/pinctrl-servalt.c      |  2 +-
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 +-
 drivers/usb/host/usb-uclass.c               |  4 +-
 include/dm/device-internal.h                | 10 +--
 include/dm/device.h                         |  5 --
 include/dm/ofnode.h                         | 23 +++++
 include/dm/root.h                           |  8 +-
 test/dm/core.c                              |  6 +-
 test/dm/ofnode.c                            | 12 +++
 test/dm/test-fdt.c                          |  4 +-
 test/dm/test-main.c                         |  4 +-
 34 files changed, 130 insertions(+), 159 deletions(-)

-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 01/11] dm: core: Rename device_bind() to device_bind_offset()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-11-29  0:50 ` [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind() Simon Glass
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

This function is not necessary anymore, since device_bind_ofnode() does
the same thing and works with both flattree and livetree.

Rename it to indicate that it is special.

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

 arch/x86/cpu/apollolake/spl.c               | 2 +-
 drivers/clk/clk.c                           | 2 +-
 drivers/core/device.c                       | 6 +++---
 drivers/gpio/mt7621_gpio.c                  | 4 ++--
 drivers/gpio/s5p_gpio.c                     | 4 ++--
 drivers/gpio/sunxi_gpio.c                   | 4 ++--
 drivers/gpio/tegra186_gpio.c                | 4 ++--
 drivers/gpio/tegra_gpio.c                   | 5 +++--
 drivers/net/mvpp2.c                         | 2 +-
 drivers/pinctrl/broadcom/pinctrl-bcm283x.c  | 5 +++--
 drivers/pinctrl/meson/pinctrl-meson.c       | 2 +-
 drivers/pinctrl/mscc/pinctrl-jr2.c          | 4 ++--
 drivers/pinctrl/mscc/pinctrl-luton.c        | 4 ++--
 drivers/pinctrl/mscc/pinctrl-ocelot.c       | 4 ++--
 drivers/pinctrl/mscc/pinctrl-serval.c       | 4 ++--
 drivers/pinctrl/mscc/pinctrl-servalt.c      | 4 ++--
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 4 ++--
 drivers/power/regulator/Kconfig             | 2 +-
 include/dm/device-internal.h                | 8 ++++----
 include/power/regulator.h                   | 2 +-
 20 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/arch/x86/cpu/apollolake/spl.c b/arch/x86/cpu/apollolake/spl.c
index 089b37c59f8..1f75e1894b7 100644
--- a/arch/x86/cpu/apollolake/spl.c
+++ b/arch/x86/cpu/apollolake/spl.c
@@ -86,7 +86,7 @@ static int apl_flash_probe(struct udevice *dev)
 /*
  * Manually set the parent of the SPI flash to SPI, since dtoc doesn't. We also
  * need to allocate the parent_platdata since by the time this function is
- * called device_bind() has already gone past that step.
+ * called device_bind_offset() has already gone past that step.
  */
 static int apl_flash_bind(struct udevice *dev)
 {
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 319808d433f..1fa9bec6fea 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -36,7 +36,7 @@ int clk_register(struct clk *clk, const char *drv_name,
 		return -ENOENT;
 	}
 
-	ret = device_bind(parent, drv, name, NULL, -1, &clk->dev);
+	ret = device_bind_offset(parent, drv, name, NULL, -1, &clk->dev);
 	if (ret) {
 		printf("%s: CLK: %s driver bind error [%d]!\n", __func__, name,
 		       ret);
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 4b3dcb3b379..081dd1f7780 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -232,9 +232,9 @@ int device_bind_with_driver_data(struct udevice *parent,
 				  0, devp);
 }
 
-int device_bind(struct udevice *parent, const struct driver *drv,
-		const char *name, void *platdata, int of_offset,
-		struct udevice **devp)
+int device_bind_offset(struct udevice *parent, const struct driver *drv,
+		       const char *name, void *platdata, int of_offset,
+		       struct udevice **devp)
 {
 	return device_bind_common(parent, drv, name, platdata, 0,
 				  offset_to_ofnode(of_offset), 0, devp);
diff --git a/drivers/gpio/mt7621_gpio.c b/drivers/gpio/mt7621_gpio.c
index 612413e17bc..b64bc838a31 100644
--- a/drivers/gpio/mt7621_gpio.c
+++ b/drivers/gpio/mt7621_gpio.c
@@ -157,8 +157,8 @@ static int gpio_mediatek_bind(struct udevice *parent)
 		plat->gpio_count = MTK_BANK_WIDTH;
 		plat->bank = bank;
 
-		ret = device_bind(parent, parent->driver,
-				  plat->bank_name, plat, -1, &dev);
+		ret = device_bind_offset(parent, parent->driver,
+					 plat->bank_name, plat, -1, &dev);
 		if (ret)
 			return ret;
 
diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index c78227f4da3..4f9fedd6129 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -332,8 +332,8 @@ static int gpio_exynos_bind(struct udevice *parent)
 			return -ENOMEM;
 
 		plat->bank_name = fdt_get_name(blob, node, NULL);
-		ret = device_bind(parent, parent->driver,
-				  plat->bank_name, plat, -1, &dev);
+		ret = device_bind_offset(parent, parent->driver,
+					 plat->bank_name, plat, -1, &dev);
 		if (ret)
 			return ret;
 
diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index 02c3471b568..f18f0c8152c 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -305,8 +305,8 @@ static int gpio_sunxi_bind(struct udevice *parent)
 		plat->bank_name = gpio_bank_name(soc_data->start + bank);
 		plat->gpio_count = SUNXI_GPIOS_PER_BANK;
 
-		ret = device_bind(parent, parent->driver,
-					plat->bank_name, plat, -1, &dev);
+		ret = device_bind_offset(parent, parent->driver,
+					 plat->bank_name, plat, -1, &dev);
 		if (ret)
 			return ret;
 		dev_set_of_offset(dev, dev_of_offset(parent));
diff --git a/drivers/gpio/tegra186_gpio.c b/drivers/gpio/tegra186_gpio.c
index 6626b5415a3..a518a395cab 100644
--- a/drivers/gpio/tegra186_gpio.c
+++ b/drivers/gpio/tegra186_gpio.c
@@ -190,8 +190,8 @@ static int tegra186_gpio_bind(struct udevice *parent)
 		plat->name = ctlr_data->ports[port].name;
 		plat->regs = &(regs[ctlr_data->ports[port].offset / 4]);
 
-		ret = device_bind(parent, parent->driver, plat->name, plat,
-				  -1, &dev);
+		ret = device_bind_offset(parent, parent->driver, plat->name,
+					 plat, -1, &dev);
 		if (ret)
 			return ret;
 		dev_set_of_offset(dev, dev_of_offset(parent));
diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c
index 912577a5719..0056171fc51 100644
--- a/drivers/gpio/tegra_gpio.c
+++ b/drivers/gpio/tegra_gpio.c
@@ -360,8 +360,9 @@ static int gpio_tegra_bind(struct udevice *parent)
 			plat->base_gpio = TEGRA_GPIOS_PER_PORT * base_port;
 			plat->port_name = gpio_port_name(base_port);
 
-			ret = device_bind(parent, parent->driver,
-					  plat->port_name, plat, -1, &dev);
+			ret = device_bind_offset(parent, parent->driver,
+						 plat->port_name, plat, -1,
+						 &dev);
 			if (ret)
 				return ret;
 			dev_set_of_offset(dev, dev_of_offset(parent));
diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index 8f790a8b44c..df77a0d5e8e 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -5477,7 +5477,7 @@ static int mvpp2_base_bind(struct udevice *parent)
 		sprintf(name, "mvpp2-%d", id);
 
 		/* Create child device UCLASS_ETH and bind it */
-		device_bind(parent, &mvpp2_driver, name, plat, subnode, &dev);
+		device_bind_offset(parent, &mvpp2_driver, name, plat, subnode, &dev);
 		dev_set_of_offset(dev, subnode);
 	}
 
diff --git a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
index 41da8141232..54928a607cb 100644
--- a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
+++ b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
@@ -125,8 +125,9 @@ int bcm283x_pinctl_probe(struct udevice *dev)
 	struct udevice *pdev;
 
 	/* Create GPIO device as well */
-	ret = device_bind(dev, lists_driver_lookup_name("gpio_bcm2835"),
-			  "gpio_bcm2835", NULL, dev_of_offset(dev), &pdev);
+	ret = device_bind_offset(dev, lists_driver_lookup_name("gpio_bcm2835"),
+				 "gpio_bcm2835", NULL, dev_of_offset(dev),
+				 &pdev);
 	if (ret) {
 		/*
 		 * While we really want the pinctrl driver to work to make
diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index d4539b02d88..45a1ccf58d6 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -419,7 +419,7 @@ int meson_pinctrl_probe(struct udevice *dev)
 	sprintf(name, "meson-gpio");
 
 	/* Create child device UCLASS_GPIO and bind it */
-	device_bind(dev, priv->data->gpio_driver, name, NULL, gpio, &gpio_dev);
+	device_bind_offset(dev, priv->data->gpio_driver, name, NULL, gpio, &gpio_dev);
 	dev_set_of_offset(gpio_dev, gpio);
 
 	return 0;
diff --git a/drivers/pinctrl/mscc/pinctrl-jr2.c b/drivers/pinctrl/mscc/pinctrl-jr2.c
index 72a9470854e..fc730b79d6a 100644
--- a/drivers/pinctrl/mscc/pinctrl-jr2.c
+++ b/drivers/pinctrl/mscc/pinctrl-jr2.c
@@ -299,8 +299,8 @@ static int jr2_pinctrl_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = device_bind(dev, &jr2_gpio_driver, "jr2-gpio", NULL,
-			  dev_of_offset(dev), NULL);
+	ret = device_bind_offset(dev, &jr2_gpio_driver, "jr2-gpio", NULL,
+				 dev_of_offset(dev), NULL);
 
 	if (ret)
 		return ret;
diff --git a/drivers/pinctrl/mscc/pinctrl-luton.c b/drivers/pinctrl/mscc/pinctrl-luton.c
index 17fbc53c257..4fb17984abe 100644
--- a/drivers/pinctrl/mscc/pinctrl-luton.c
+++ b/drivers/pinctrl/mscc/pinctrl-luton.c
@@ -165,8 +165,8 @@ int luton_pinctrl_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = device_bind(dev, &luton_gpio_driver, "luton-gpio", NULL,
-			  dev_of_offset(dev), NULL);
+	ret = device_bind_offset(dev, &luton_gpio_driver, "luton-gpio", NULL,
+				 dev_of_offset(dev), NULL);
 
 	return 0;
 }
diff --git a/drivers/pinctrl/mscc/pinctrl-ocelot.c b/drivers/pinctrl/mscc/pinctrl-ocelot.c
index 49e026bc98b..12ecad7a6e9 100644
--- a/drivers/pinctrl/mscc/pinctrl-ocelot.c
+++ b/drivers/pinctrl/mscc/pinctrl-ocelot.c
@@ -181,8 +181,8 @@ int ocelot_pinctrl_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = device_bind(dev, &ocelot_gpio_driver, "ocelot-gpio", NULL,
-			  dev_of_offset(dev), NULL);
+	ret = device_bind_offset(dev, &ocelot_gpio_driver, "ocelot-gpio", NULL,
+				 dev_of_offset(dev), NULL);
 
 	return ret;
 }
diff --git a/drivers/pinctrl/mscc/pinctrl-serval.c b/drivers/pinctrl/mscc/pinctrl-serval.c
index d59f08d4eb7..93b31d20833 100644
--- a/drivers/pinctrl/mscc/pinctrl-serval.c
+++ b/drivers/pinctrl/mscc/pinctrl-serval.c
@@ -209,8 +209,8 @@ static int serval_pinctrl_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = device_bind(dev, &serval_gpio_driver, "serval-gpio", NULL,
-			  dev_of_offset(dev), NULL);
+	ret = device_bind_offset(dev, &serval_gpio_driver, "serval-gpio", NULL,
+				 dev_of_offset(dev), NULL);
 
 	if (ret)
 		return ret;
diff --git a/drivers/pinctrl/mscc/pinctrl-servalt.c b/drivers/pinctrl/mscc/pinctrl-servalt.c
index 592b7c547b7..9bbc7698a52 100644
--- a/drivers/pinctrl/mscc/pinctrl-servalt.c
+++ b/drivers/pinctrl/mscc/pinctrl-servalt.c
@@ -245,8 +245,8 @@ static int servalt_pinctrl_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = device_bind(dev, &servalt_gpio_driver, "servalt-gpio", NULL,
-			  dev_of_offset(dev), NULL);
+	ret = device_bind_offset(dev, &servalt_gpio_driver, "servalt-gpio", NULL,
+				 dev_of_offset(dev), NULL);
 
 	if (ret)
 		return ret;
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
index fb497803b93..7bbeb413ba5 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -567,8 +567,8 @@ static int armada_37xx_gpiochip_register(struct udevice *parent,
 	sprintf(name, "armada-37xx-gpio");
 
 	/* Create child device UCLASS_GPIO and bind it */
-	device_bind(parent, &armada_37xx_gpio_driver, name, NULL, subnode,
-		    &dev);
+	device_bind_offset(parent, &armada_37xx_gpio_driver, name, NULL,
+			   subnode, &dev);
 	dev_set_of_offset(dev, subnode);
 
 	return 0;
diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
index d431102462a..a6f78d96706 100644
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -11,7 +11,7 @@ config DM_REGULATOR
 	- 'include/power/regulator.h'
 	- 'drivers/power/pmic/pmic-uclass.c'
 	- 'drivers/power/pmic/regulator-uclass.c'
-	It's important to call the device_bind() with the proper node offset,
+	It's important to call the device_bind_offset() with the proper node offset,
 	when binding the regulator devices. The pmic_bind_childs() can be used
 	for this purpose if PMIC I/O driver is implemented or dm_scan_fdt_dev()
 	otherwise. Detailed information can be found in the header file.
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index c5d7ec0650f..59d3be09a1e 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -16,7 +16,7 @@ struct device_node;
 struct udevice;
 
 /**
- * device_bind() - Create a device and bind it to a driver
+ * device_bind_offset() - Create a device and bind it to a driver
  *
  * Called to set up a new device attached to a driver. The device will either
  * have platdata, or a device tree node which can be used to create the
@@ -36,9 +36,9 @@ struct udevice;
  * @devp: if non-NULL, returns a pointer to the bound device
  * @return 0 if OK, -ve on error
  */
-int device_bind(struct udevice *parent, const struct driver *drv,
-		const char *name, void *platdata, int of_offset,
-		struct udevice **devp);
+int device_bind_offset(struct udevice *parent, const struct driver *drv,
+		       const char *name, void *platdata, int of_offset,
+		       struct udevice **devp);
 
 int device_bind_ofnode(struct udevice *parent, const struct driver *drv,
 		       const char *name, void *platdata, ofnode node,
diff --git a/include/power/regulator.h b/include/power/regulator.h
index 7f278e8c7dc..4d58a436fea 100644
--- a/include/power/regulator.h
+++ b/include/power/regulator.h
@@ -48,7 +48,7 @@
  * If regulator-name property is not provided, node name will be chosen.
  *
  * Regulator bind:
- * For each regulator device, the device_bind() should be called with passed
+ * For each regulator device, the device_bind_offset() should be called with passed
  * device tree offset. This is required for this uclass's '.post_bind' method,
  * which does the scan on the device node, for the 'regulator-name' constraint.
  * If the parent is not a PMIC device, and the child is not bind by function:
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
  2020-11-29  0:50 ` [PATCH 01/11] dm: core: Rename device_bind() to device_bind_offset() Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-11-29  0:50 ` [PATCH 03/11] dm: core: Add a livetree function to check node status Simon Glass
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

This is the standard function to use when binding devices. Drop the
'_ofnode' suffix to make this clear.

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

 drivers/core/device.c                     | 6 +++---
 drivers/firmware/scmi/scmi_agent-uclass.c | 4 ++--
 drivers/gpio/dwapb_gpio.c                 | 4 ++--
 drivers/misc/i2c_eeprom.c                 | 4 ++--
 drivers/mtd/spi/sandbox.c                 | 2 +-
 drivers/pci/pci-uclass.c                  | 4 ++--
 drivers/pci/pci_mvebu.c                   | 4 ++--
 drivers/usb/host/usb-uclass.c             | 4 ++--
 include/dm/device-internal.h              | 6 +++---
 test/dm/core.c                            | 4 ++--
 10 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index 081dd1f7780..c8a219d77b3 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -240,9 +240,9 @@ int device_bind_offset(struct udevice *parent, const struct driver *drv,
 				  offset_to_ofnode(of_offset), 0, devp);
 }
 
-int device_bind_ofnode(struct udevice *parent, const struct driver *drv,
-		       const char *name, void *platdata, ofnode node,
-		       struct udevice **devp)
+int device_bind(struct udevice *parent, const struct driver *drv,
+		const char *name, void *platdata, ofnode node,
+		struct udevice **devp)
 {
 	return device_bind_common(parent, drv, name, platdata, 0, node, 0,
 				  devp);
diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c
index 7dc533149b6..b3d3f0a51b0 100644
--- a/drivers/firmware/scmi/scmi_agent-uclass.c
+++ b/drivers/firmware/scmi/scmi_agent-uclass.c
@@ -89,8 +89,8 @@ static int scmi_bind_protocols(struct udevice *dev)
 			continue;
 		}
 
-		ret = device_bind_ofnode(dev, drv, ofnode_get_name(node),
-					 NULL, node, NULL);
+		ret = device_bind(dev, drv, ofnode_get_name(node), NULL, node,
+				  NULL);
 		if (ret)
 			break;
 	}
diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c
index 37916e77716..cf20a5024e0 100644
--- a/drivers/gpio/dwapb_gpio.c
+++ b/drivers/gpio/dwapb_gpio.c
@@ -202,8 +202,8 @@ static int gpio_dwapb_bind(struct udevice *dev)
 			}
 		}
 
-		ret = device_bind_ofnode(dev, dev->driver, plat->name,
-					 plat, node, &subdev);
+		ret = device_bind(dev, dev->driver, plat->name, plat, node,
+				  &subdev);
 		if (ret)
 			return ret;
 
diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c
index 3651ba4871e..92e18356254 100644
--- a/drivers/misc/i2c_eeprom.c
+++ b/drivers/misc/i2c_eeprom.c
@@ -131,8 +131,8 @@ static int i2c_eeprom_std_bind(struct udevice *dev)
 		if (!name)
 			continue;
 
-		device_bind_ofnode(dev, DM_GET_DRIVER(i2c_eeprom_partition),
-				   name, NULL, partition, NULL);
+		device_bind(dev, DM_GET_DRIVER(i2c_eeprom_partition), name,
+			    NULL, partition, NULL);
 	}
 
 	return 0;
diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
index 0b602dc9140..1d0c1cb3fa2 100644
--- a/drivers/mtd/spi/sandbox.c
+++ b/drivers/mtd/spi/sandbox.c
@@ -538,7 +538,7 @@ int sandbox_sf_bind_emul(struct sandbox_state *state, int busnum, int cs,
 	str = strdup(name);
 	if (!str)
 		return -ENOMEM;
-	ret = device_bind_ofnode(bus, drv, str, NULL, node, &emul);
+	ret = device_bind(bus, drv, str, NULL, node, &emul);
 	if (ret) {
 		free(str);
 		printf("Cannot create emul device for spec '%s' (err=%d)\n",
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index eb07d253011..9230cfe88b5 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -750,8 +750,8 @@ static int pci_find_and_bind_driver(struct udevice *parent,
 			 * find another driver. For now this doesn't seem
 			 * necesssary, so just bind the first match.
 			 */
-			ret = device_bind_ofnode(parent, drv, drv->name, NULL,
-						 node, &dev);
+			ret = device_bind(parent, drv, drv->name, NULL, node,
+					  &dev);
 			if (ret)
 				goto error;
 			debug("%s: Match found: %s\n", __func__, drv->name);
diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c
index c9afe751501..ba1c139dbc5 100644
--- a/drivers/pci/pci_mvebu.c
+++ b/drivers/pci/pci_mvebu.c
@@ -501,8 +501,8 @@ static int mvebu_pcie_bind(struct udevice *parent)
 			return -ENOMEM;
 
 		/* Create child device UCLASS_PCI and bind it */
-		device_bind_ofnode(parent, &pcie_mvebu_drv, pcie->name, pcie,
-				   subnode, &dev);
+		device_bind(parent, &pcie_mvebu_drv, pcie->name, pcie, subnode,
+			    &dev);
 	}
 
 	return 0;
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 8773824e057..2f8c9037c12 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -581,8 +581,8 @@ static int usb_find_and_bind_driver(struct udevice *parent,
 			 * find another driver. For now this doesn't seem
 			 * necesssary, so just bind the first match.
 			 */
-			ret = device_bind_ofnode(parent, drv, drv->name, NULL,
-						 node, &dev);
+			ret = device_bind(parent, drv, drv->name, NULL, node,
+					  &dev);
 			if (ret)
 				goto error;
 			debug("%s: Match found: %s\n", __func__, drv->name);
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index 59d3be09a1e..636210f73ed 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -40,9 +40,9 @@ int device_bind_offset(struct udevice *parent, const struct driver *drv,
 		       const char *name, void *platdata, int of_offset,
 		       struct udevice **devp);
 
-int device_bind_ofnode(struct udevice *parent, const struct driver *drv,
-		       const char *name, void *platdata, ofnode node,
-		       struct udevice **devp);
+int device_bind(struct udevice *parent, const struct driver *drv,
+		const char *name, void *platdata, ofnode node,
+		struct udevice **devp);
 
 /**
  * device_bind_with_driver_data() - Create a device and bind it to a driver
diff --git a/test/dm/core.c b/test/dm/core.c
index 6f380a574cf..ba9e60d09cb 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -1052,8 +1052,8 @@ static int dm_test_inactive_child(struct unit_test_state *uts)
 	 */
 	ut_asserteq(-ENODEV, device_find_first_inactive_child(parent,
 							UCLASS_TEST, &dev1));
-	ut_assertok(device_bind_ofnode(parent, DM_GET_DRIVER(test_drv),
-				       "test_child", 0, ofnode_null(), &dev1));
+	ut_assertok(device_bind(parent, DM_GET_DRIVER(test_drv),
+				"test_child", 0, ofnode_null(), &dev1));
 
 	ut_assertok(device_find_first_inactive_child(parent, UCLASS_TEST,
 						     &dev2));
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 03/11] dm: core: Add a livetree function to check node status
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
  2020-11-29  0:50 ` [PATCH 01/11] dm: core: Rename device_bind() to device_bind_offset() Simon Glass
  2020-11-29  0:50 ` [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind() Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-11-29  0:50 ` [PATCH 04/11] dm: Remove uses of device_bind_offset() Simon Glass
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

Add a way to find out if a node is enabled or not, based on its 'status'
property.

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

 drivers/core/ofnode.c | 10 ++++++++++
 include/dm/ofnode.h   | 11 +++++++++++
 test/dm/ofnode.c      | 12 ++++++++++++
 3 files changed, 33 insertions(+)

diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index a68076bf351..87072094f32 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -226,6 +226,16 @@ int ofnode_read_u32_array(ofnode node, const char *propname,
 	}
 }
 
+bool ofnode_is_enabled(ofnode node)
+{
+	if (ofnode_is_np(node)) {
+		return of_device_is_available(ofnode_to_np(node));
+	} else {
+		return fdtdec_get_is_enabled(gd->fdt_blob,
+					     ofnode_to_offset(node));
+	}
+}
+
 ofnode ofnode_first_subnode(ofnode node)
 {
 	assert(ofnode_valid(node));
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index ced7f6ffb25..ee8c44a71ec 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -345,6 +345,17 @@ const char *ofnode_read_string(ofnode node, const char *propname);
  */
 int ofnode_read_u32_array(ofnode node, const char *propname,
 			  u32 *out_values, size_t sz);
+/**
+ * ofnode_is_enabled() - Checks whether a node is enabled.
+ * This looks for a 'status' property. If this exists, then returns true if
+ * the status is 'okay' and false otherwise. If there is no status property,
+ * it returns true on the assumption that anything mentioned should be enabled
+ * by default.
+ *
+ * @node: node to examine
+ * @return false (not enabled) or true (enabled)
+ */
+bool ofnode_is_enabled(ofnode node);
 
 /**
  * ofnode_read_bool() - read a boolean value from a property
diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c
index fb1ceb13180..c5391342962 100644
--- a/test/dm/ofnode.c
+++ b/test/dm/ofnode.c
@@ -249,3 +249,15 @@ static int dm_test_ofnode_get_child_count(struct unit_test_state *uts)
 }
 DM_TEST(dm_test_ofnode_get_child_count,
 	UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+
+static int dm_test_ofnode_is_enabled(struct unit_test_state *uts)
+{
+	ofnode root_node = ofnode_path("/");
+	ofnode node = ofnode_path("/usb at 0");
+
+	ut_assert(ofnode_is_enabled(root_node));
+	ut_assert(!ofnode_is_enabled(node));
+
+	return 0;
+}
+DM_TEST(dm_test_ofnode_is_enabled, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 04/11] dm: Remove uses of device_bind_offset()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (2 preceding siblings ...)
  2020-11-29  0:50 ` [PATCH 03/11] dm: core: Add a livetree function to check node status Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-11-29  0:50 ` [PATCH 05/11] dm: Drop uses of dev_set_of_offset() Simon Glass
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

This function is not needed since the standard device_bind() can be used
instead.

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

 arch/x86/cpu/apollolake/spl.c               |  2 +-
 drivers/clk/at91/compat.c                   | 20 ++++++++------------
 drivers/clk/clk.c                           |  2 +-
 drivers/gpio/mt7621_gpio.c                  |  4 ++--
 drivers/gpio/s5p_gpio.c                     |  4 ++--
 drivers/gpio/sunxi_gpio.c                   |  4 ++--
 drivers/gpio/tegra186_gpio.c                |  4 ++--
 drivers/gpio/tegra_gpio.c                   |  6 +++---
 drivers/net/mvpp2.c                         |  4 ++--
 drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
 drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
 drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
 drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
 drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
 drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
 drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
 drivers/power/regulator/Kconfig             |  2 +-
 include/dm/device-internal.h                |  4 ++--
 include/power/regulator.h                   |  2 +-
 20 files changed, 46 insertions(+), 49 deletions(-)

diff --git a/arch/x86/cpu/apollolake/spl.c b/arch/x86/cpu/apollolake/spl.c
index 1f75e1894b7..089b37c59f8 100644
--- a/arch/x86/cpu/apollolake/spl.c
+++ b/arch/x86/cpu/apollolake/spl.c
@@ -86,7 +86,7 @@ static int apl_flash_probe(struct udevice *dev)
 /*
  * Manually set the parent of the SPI flash to SPI, since dtoc doesn't. We also
  * need to allocate the parent_platdata since by the time this function is
- * called device_bind_offset() has already gone past that step.
+ * called device_bind() has already gone past that step.
  */
 static int apl_flash_bind(struct udevice *dev)
 {
diff --git a/drivers/clk/at91/compat.c b/drivers/clk/at91/compat.c
index 9563285674b..afd67b290d8 100644
--- a/drivers/clk/at91/compat.c
+++ b/drivers/clk/at91/compat.c
@@ -62,34 +62,30 @@ static int at91_pmc_core_probe(struct udevice *dev)
  */
 int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name)
 {
-	const void *fdt = gd->fdt_blob;
-	int offset = dev_of_offset(dev);
+	ofnode parent = dev_ofnode(dev);
+	ofnode node;
 	bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
 	const char *name;
 	int ret;
 
-	for (offset = fdt_first_subnode(fdt, offset);
-	     offset > 0;
-	     offset = fdt_next_subnode(fdt, offset)) {
-		if (pre_reloc_only &&
-		    !ofnode_pre_reloc(offset_to_ofnode(offset)))
+	ofnode_for_each_subnode(node, parent) {
+		if (pre_reloc_only && !ofnode_pre_reloc(node))
 			continue;
 		/*
 		 * If this node has "compatible" property, this is not
 		 * a clock sub-node, but a normal device. skip.
 		 */
-		fdt_get_property(fdt, offset, "compatible", &ret);
-		if (ret >= 0)
+		if (ofnode_read_prop(node, "compatible", NULL))
 			continue;
 
 		if (ret != -FDT_ERR_NOTFOUND)
 			return ret;
 
-		name = fdt_get_name(fdt, offset, NULL);
+		name = ofnode_get_name(node);
 		if (!name)
 			return -EINVAL;
-		ret = device_bind_driver_to_node(dev, drv_name, name,
-					offset_to_ofnode(offset), NULL);
+		ret = device_bind_driver_to_node(dev, drv_name, name, node,
+						 NULL);
 		if (ret)
 			return ret;
 	}
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 1fa9bec6fea..928ad13641a 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -36,7 +36,7 @@ int clk_register(struct clk *clk, const char *drv_name,
 		return -ENOENT;
 	}
 
-	ret = device_bind_offset(parent, drv, name, NULL, -1, &clk->dev);
+	ret = device_bind(parent, drv, name, NULL, ofnode_null(), &clk->dev);
 	if (ret) {
 		printf("%s: CLK: %s driver bind error [%d]!\n", __func__, name,
 		       ret);
diff --git a/drivers/gpio/mt7621_gpio.c b/drivers/gpio/mt7621_gpio.c
index b64bc838a31..8b41e34844e 100644
--- a/drivers/gpio/mt7621_gpio.c
+++ b/drivers/gpio/mt7621_gpio.c
@@ -157,8 +157,8 @@ static int gpio_mediatek_bind(struct udevice *parent)
 		plat->gpio_count = MTK_BANK_WIDTH;
 		plat->bank = bank;
 
-		ret = device_bind_offset(parent, parent->driver,
-					 plat->bank_name, plat, -1, &dev);
+		ret = device_bind(parent, parent->driver, plat->bank_name, plat,
+				  ofnode_null(), &dev);
 		if (ret)
 			return ret;
 
diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index 4f9fedd6129..d6054c4a6dd 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -332,8 +332,8 @@ static int gpio_exynos_bind(struct udevice *parent)
 			return -ENOMEM;
 
 		plat->bank_name = fdt_get_name(blob, node, NULL);
-		ret = device_bind_offset(parent, parent->driver,
-					 plat->bank_name, plat, -1, &dev);
+		ret = device_bind(parent, parent->driver, plat->bank_name, plat,
+				  ofnode_null(), &dev);
 		if (ret)
 			return ret;
 
diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index f18f0c8152c..b6b0e9acbdb 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -305,8 +305,8 @@ static int gpio_sunxi_bind(struct udevice *parent)
 		plat->bank_name = gpio_bank_name(soc_data->start + bank);
 		plat->gpio_count = SUNXI_GPIOS_PER_BANK;
 
-		ret = device_bind_offset(parent, parent->driver,
-					 plat->bank_name, plat, -1, &dev);
+		ret = device_bind(parent, parent->driver, plat->bank_name, plat,
+				  ofnode_null(), &dev);
 		if (ret)
 			return ret;
 		dev_set_of_offset(dev, dev_of_offset(parent));
diff --git a/drivers/gpio/tegra186_gpio.c b/drivers/gpio/tegra186_gpio.c
index a518a395cab..bcc322c3b02 100644
--- a/drivers/gpio/tegra186_gpio.c
+++ b/drivers/gpio/tegra186_gpio.c
@@ -190,8 +190,8 @@ static int tegra186_gpio_bind(struct udevice *parent)
 		plat->name = ctlr_data->ports[port].name;
 		plat->regs = &(regs[ctlr_data->ports[port].offset / 4]);
 
-		ret = device_bind_offset(parent, parent->driver, plat->name,
-					 plat, -1, &dev);
+		ret = device_bind(parent, parent->driver, plat->name, plat,
+				  ofnode_null(), &dev);
 		if (ret)
 			return ret;
 		dev_set_of_offset(dev, dev_of_offset(parent));
diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c
index 0056171fc51..3877ee659af 100644
--- a/drivers/gpio/tegra_gpio.c
+++ b/drivers/gpio/tegra_gpio.c
@@ -360,9 +360,9 @@ static int gpio_tegra_bind(struct udevice *parent)
 			plat->base_gpio = TEGRA_GPIOS_PER_PORT * base_port;
 			plat->port_name = gpio_port_name(base_port);
 
-			ret = device_bind_offset(parent, parent->driver,
-						 plat->port_name, plat, -1,
-						 &dev);
+			ret = device_bind(parent, parent->driver,
+					  plat->port_name, plat, ofnode_null(),
+					  &dev);
 			if (ret)
 				return ret;
 			dev_set_of_offset(dev, dev_of_offset(parent));
diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index df77a0d5e8e..c1a78a2918e 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -5477,8 +5477,8 @@ static int mvpp2_base_bind(struct udevice *parent)
 		sprintf(name, "mvpp2-%d", id);
 
 		/* Create child device UCLASS_ETH and bind it */
-		device_bind_offset(parent, &mvpp2_driver, name, plat, subnode, &dev);
-		dev_set_of_offset(dev, subnode);
+		device_bind(parent, &mvpp2_driver, name, plat,
+			    offset_to_ofnode(subnode), &dev);
 	}
 
 	return 0;
diff --git a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
index 54928a607cb..5f5f3f3622f 100644
--- a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
+++ b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
@@ -125,9 +125,8 @@ int bcm283x_pinctl_probe(struct udevice *dev)
 	struct udevice *pdev;
 
 	/* Create GPIO device as well */
-	ret = device_bind_offset(dev, lists_driver_lookup_name("gpio_bcm2835"),
-				 "gpio_bcm2835", NULL, dev_of_offset(dev),
-				 &pdev);
+	ret = device_bind(dev, lists_driver_lookup_name("gpio_bcm2835"),
+			  "gpio_bcm2835", NULL, dev_ofnode(dev), &pdev);
 	if (ret) {
 		/*
 		 * While we really want the pinctrl driver to work to make
diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index 45a1ccf58d6..c35e4c42a09 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -347,6 +347,7 @@ int meson_pinctrl_probe(struct udevice *dev)
 	int na, ns;
 	char *name;
 
+	/* FIXME: Should use livetree */
 	na = fdt_address_cells(gd->fdt_blob, dev_of_offset(dev->parent));
 	if (na < 1) {
 		debug("bad #address-cells\n");
@@ -419,7 +420,8 @@ int meson_pinctrl_probe(struct udevice *dev)
 	sprintf(name, "meson-gpio");
 
 	/* Create child device UCLASS_GPIO and bind it */
-	device_bind_offset(dev, priv->data->gpio_driver, name, NULL, gpio, &gpio_dev);
+	device_bind(dev, priv->data->gpio_driver, name, NULL,
+		    offset_to_ofnode(gpio), &gpio_dev);
 	dev_set_of_offset(gpio_dev, gpio);
 
 	return 0;
diff --git a/drivers/pinctrl/mscc/pinctrl-jr2.c b/drivers/pinctrl/mscc/pinctrl-jr2.c
index fc730b79d6a..6de7a416f0e 100644
--- a/drivers/pinctrl/mscc/pinctrl-jr2.c
+++ b/drivers/pinctrl/mscc/pinctrl-jr2.c
@@ -299,8 +299,8 @@ static int jr2_pinctrl_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = device_bind_offset(dev, &jr2_gpio_driver, "jr2-gpio", NULL,
-				 dev_of_offset(dev), NULL);
+	ret = device_bind(dev, &jr2_gpio_driver, "jr2-gpio", NULL,
+			  dev_ofnode(dev), NULL);
 
 	if (ret)
 		return ret;
diff --git a/drivers/pinctrl/mscc/pinctrl-luton.c b/drivers/pinctrl/mscc/pinctrl-luton.c
index 4fb17984abe..0adeef9ec67 100644
--- a/drivers/pinctrl/mscc/pinctrl-luton.c
+++ b/drivers/pinctrl/mscc/pinctrl-luton.c
@@ -165,8 +165,8 @@ int luton_pinctrl_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = device_bind_offset(dev, &luton_gpio_driver, "luton-gpio", NULL,
-				 dev_of_offset(dev), NULL);
+	ret = device_bind(dev, &luton_gpio_driver, "luton-gpio", NULL,
+			  dev_ofnode(dev), NULL);
 
 	return 0;
 }
diff --git a/drivers/pinctrl/mscc/pinctrl-ocelot.c b/drivers/pinctrl/mscc/pinctrl-ocelot.c
index 12ecad7a6e9..4df5eef1b10 100644
--- a/drivers/pinctrl/mscc/pinctrl-ocelot.c
+++ b/drivers/pinctrl/mscc/pinctrl-ocelot.c
@@ -181,8 +181,8 @@ int ocelot_pinctrl_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = device_bind_offset(dev, &ocelot_gpio_driver, "ocelot-gpio", NULL,
-				 dev_of_offset(dev), NULL);
+	ret = device_bind(dev, &ocelot_gpio_driver, "ocelot-gpio", NULL,
+			  dev_ofnode(dev), NULL);
 
 	return ret;
 }
diff --git a/drivers/pinctrl/mscc/pinctrl-serval.c b/drivers/pinctrl/mscc/pinctrl-serval.c
index 93b31d20833..2cef5df3dc2 100644
--- a/drivers/pinctrl/mscc/pinctrl-serval.c
+++ b/drivers/pinctrl/mscc/pinctrl-serval.c
@@ -209,8 +209,8 @@ static int serval_pinctrl_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = device_bind_offset(dev, &serval_gpio_driver, "serval-gpio", NULL,
-				 dev_of_offset(dev), NULL);
+	ret = device_bind(dev, &serval_gpio_driver, "serval-gpio", NULL,
+			  dev_ofnode(dev), NULL);
 
 	if (ret)
 		return ret;
diff --git a/drivers/pinctrl/mscc/pinctrl-servalt.c b/drivers/pinctrl/mscc/pinctrl-servalt.c
index 9bbc7698a52..37ce52ce7b8 100644
--- a/drivers/pinctrl/mscc/pinctrl-servalt.c
+++ b/drivers/pinctrl/mscc/pinctrl-servalt.c
@@ -245,8 +245,8 @@ static int servalt_pinctrl_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = device_bind_offset(dev, &servalt_gpio_driver, "servalt-gpio", NULL,
-				 dev_of_offset(dev), NULL);
+	ret = device_bind(dev, &servalt_gpio_driver, "servalt-gpio", NULL,
+			  dev_ofnode(dev), NULL);
 
 	if (ret)
 		return ret;
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
index 7bbeb413ba5..17d7603ebdb 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -547,13 +547,14 @@ static int armada_37xx_gpiochip_register(struct udevice *parent,
 	int subnode;
 	char *name;
 
-	/* Lookup GPIO driver */
+	/* FIXME: Should not need to lookup GPIO uclass */
 	drv = lists_uclass_lookup(UCLASS_GPIO);
 	if (!drv) {
 		puts("Cannot find GPIO driver\n");
 		return -ENOENT;
 	}
 
+	/* FIXME: Use livtree and check the result of device_bind() below */
 	fdt_for_each_subnode(subnode, blob, node) {
 		if (fdtdec_get_bool(blob, subnode, "gpio-controller")) {
 			ret = 0;
@@ -567,9 +568,8 @@ static int armada_37xx_gpiochip_register(struct udevice *parent,
 	sprintf(name, "armada-37xx-gpio");
 
 	/* Create child device UCLASS_GPIO and bind it */
-	device_bind_offset(parent, &armada_37xx_gpio_driver, name, NULL,
-			   subnode, &dev);
-	dev_set_of_offset(dev, subnode);
+	device_bind(parent, &armada_37xx_gpio_driver, name, NULL,
+		    offset_to_ofnode(subnode), &dev);
 
 	return 0;
 }
diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
index a6f78d96706..d431102462a 100644
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -11,7 +11,7 @@ config DM_REGULATOR
 	- 'include/power/regulator.h'
 	- 'drivers/power/pmic/pmic-uclass.c'
 	- 'drivers/power/pmic/regulator-uclass.c'
-	It's important to call the device_bind_offset() with the proper node offset,
+	It's important to call the device_bind() with the proper node offset,
 	when binding the regulator devices. The pmic_bind_childs() can be used
 	for this purpose if PMIC I/O driver is implemented or dm_scan_fdt_dev()
 	otherwise. Detailed information can be found in the header file.
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index 636210f73ed..6f4f8510f7e 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -37,8 +37,8 @@ struct udevice;
  * @return 0 if OK, -ve on error
  */
 int device_bind_offset(struct udevice *parent, const struct driver *drv,
-		       const char *name, void *platdata, int of_offset,
-		       struct udevice **devp);
+		const char *name, void *platdata, int of_offset,
+		struct udevice **devp);
 
 int device_bind(struct udevice *parent, const struct driver *drv,
 		const char *name, void *platdata, ofnode node,
diff --git a/include/power/regulator.h b/include/power/regulator.h
index 4d58a436fea..7f278e8c7dc 100644
--- a/include/power/regulator.h
+++ b/include/power/regulator.h
@@ -48,7 +48,7 @@
  * If regulator-name property is not provided, node name will be chosen.
  *
  * Regulator bind:
- * For each regulator device, the device_bind_offset() should be called with passed
+ * For each regulator device, the device_bind() should be called with passed
  * device tree offset. This is required for this uclass's '.post_bind' method,
  * which does the scan on the device node, for the 'regulator-name' constraint.
  * If the parent is not a PMIC device, and the child is not bind by function:
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 05/11] dm: Drop uses of dev_set_of_offset()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (3 preceding siblings ...)
  2020-11-29  0:50 ` [PATCH 04/11] dm: Remove uses of device_bind_offset() Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-11-29  0:50 ` [PATCH 06/11] dm: core: Drop dev_set_of_offset() Simon Glass
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

The need for this can be avoided by passing the correct node to the
device_bind() function.

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

 drivers/gpio/mt7621_gpio.c            | 3 +--
 drivers/gpio/s5p_gpio.c               | 4 +---
 drivers/gpio/sunxi_gpio.c             | 3 +--
 drivers/gpio/tegra186_gpio.c          | 3 +--
 drivers/gpio/tegra_gpio.c             | 5 ++---
 drivers/pinctrl/meson/pinctrl-meson.c | 1 -
 6 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/gpio/mt7621_gpio.c b/drivers/gpio/mt7621_gpio.c
index 8b41e34844e..ea51291e237 100644
--- a/drivers/gpio/mt7621_gpio.c
+++ b/drivers/gpio/mt7621_gpio.c
@@ -158,11 +158,10 @@ static int gpio_mediatek_bind(struct udevice *parent)
 		plat->bank = bank;
 
 		ret = device_bind(parent, parent->driver, plat->bank_name, plat,
-				  ofnode_null(), &dev);
+				  node, &dev);
 		if (ret)
 			return ret;
 
-		dev->node = node;
 		bank++;
 	}
 
diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index d6054c4a6dd..ec8d54922d3 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -333,12 +333,10 @@ static int gpio_exynos_bind(struct udevice *parent)
 
 		plat->bank_name = fdt_get_name(blob, node, NULL);
 		ret = device_bind(parent, parent->driver, plat->bank_name, plat,
-				  ofnode_null(), &dev);
+				  offset_to_ofnode(node), &dev);
 		if (ret)
 			return ret;
 
-		dev_set_of_offset(dev, node);
-
 		reg = dev_read_addr(dev);
 		if (reg != FDT_ADDR_T_NONE)
 			bank = (struct s5p_gpio_bank *)((ulong)base + reg);
diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index b6b0e9acbdb..dea71a7f340 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -306,10 +306,9 @@ static int gpio_sunxi_bind(struct udevice *parent)
 		plat->gpio_count = SUNXI_GPIOS_PER_BANK;
 
 		ret = device_bind(parent, parent->driver, plat->bank_name, plat,
-				  ofnode_null(), &dev);
+				  dev_ofnode(parent), &dev);
 		if (ret)
 			return ret;
-		dev_set_of_offset(dev, dev_of_offset(parent));
 	}
 
 	return 0;
diff --git a/drivers/gpio/tegra186_gpio.c b/drivers/gpio/tegra186_gpio.c
index bcc322c3b02..ad97e13a1cb 100644
--- a/drivers/gpio/tegra186_gpio.c
+++ b/drivers/gpio/tegra186_gpio.c
@@ -191,10 +191,9 @@ static int tegra186_gpio_bind(struct udevice *parent)
 		plat->regs = &(regs[ctlr_data->ports[port].offset / 4]);
 
 		ret = device_bind(parent, parent->driver, plat->name, plat,
-				  ofnode_null(), &dev);
+				  dev_ofnode(parent), &dev);
 		if (ret)
 			return ret;
-		dev_set_of_offset(dev, dev_of_offset(parent));
 	}
 
 	return 0;
diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c
index 3877ee659af..22d25313227 100644
--- a/drivers/gpio/tegra_gpio.c
+++ b/drivers/gpio/tegra_gpio.c
@@ -361,11 +361,10 @@ static int gpio_tegra_bind(struct udevice *parent)
 			plat->port_name = gpio_port_name(base_port);
 
 			ret = device_bind(parent, parent->driver,
-					  plat->port_name, plat, ofnode_null(),
-					  &dev);
+					  plat->port_name, plat,
+					  dev_ofnode(parent), &dev);
 			if (ret)
 				return ret;
-			dev_set_of_offset(dev, dev_of_offset(parent));
 		}
 	}
 
diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index c35e4c42a09..37bddb14e08 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -422,7 +422,6 @@ int meson_pinctrl_probe(struct udevice *dev)
 	/* Create child device UCLASS_GPIO and bind it */
 	device_bind(dev, priv->data->gpio_driver, name, NULL,
 		    offset_to_ofnode(gpio), &gpio_dev);
-	dev_set_of_offset(gpio_dev, gpio);
 
 	return 0;
 }
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 06/11] dm: core: Drop dev_set_of_offset()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (4 preceding siblings ...)
  2020-11-29  0:50 ` [PATCH 05/11] dm: Drop uses of dev_set_of_offset() Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-11-29  0:50 ` [PATCH 07/11] dm: core: Drop device_bind_offset() Simon Glass
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

This pre-livetree function is not needed anymore. Drop it.

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

 include/dm/device.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/dm/device.h b/include/dm/device.h
index 5bef4842470..25a77d08b9d 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -177,11 +177,6 @@ static inline int dev_of_offset(const struct udevice *dev)
 	return ofnode_to_offset(dev->node);
 }
 
-static inline void dev_set_of_offset(struct udevice *dev, int of_offset)
-{
-	dev->node = offset_to_ofnode(of_offset);
-}
-
 static inline bool dev_has_of_node(struct udevice *dev)
 {
 	return ofnode_valid(dev->node);
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 07/11] dm: core: Drop device_bind_offset()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (5 preceding siblings ...)
  2020-11-29  0:50 ` [PATCH 06/11] dm: core: Drop dev_set_of_offset() Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-11-29  0:50 ` [PATCH 08/11] dm: core: Add an ofnode function to get the devicetree root Simon Glass
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

This function is not needed since the standard device_bind() can be used
instead. Drop it.

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

 drivers/core/device.c        |  8 --------
 include/dm/device-internal.h | 10 +++-------
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index c8a219d77b3..79afaf06290 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -232,14 +232,6 @@ int device_bind_with_driver_data(struct udevice *parent,
 				  0, devp);
 }
 
-int device_bind_offset(struct udevice *parent, const struct driver *drv,
-		       const char *name, void *platdata, int of_offset,
-		       struct udevice **devp)
-{
-	return device_bind_common(parent, drv, name, platdata, 0,
-				  offset_to_ofnode(of_offset), 0, devp);
-}
-
 int device_bind(struct udevice *parent, const struct driver *drv,
 		const char *name, void *platdata, ofnode node,
 		struct udevice **devp)
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index 6f4f8510f7e..578a483497e 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -16,7 +16,7 @@ struct device_node;
 struct udevice;
 
 /**
- * device_bind_offset() - Create a device and bind it to a driver
+ * device_bind() - Create a device and bind it to a driver
  *
  * Called to set up a new device attached to a driver. The device will either
  * have platdata, or a device tree node which can be used to create the
@@ -31,15 +31,11 @@ struct udevice;
  * @platdata: Pointer to data for this device - the structure is device-
  * specific but may include the device's I/O address, etc.. This is NULL for
  * devices which use device tree.
- * @of_offset: Offset of device tree node for this device. This is -1 for
- * devices which don't use device tree.
+ * @ofnode: Devicetree node for this device. This is ofnode_null() for
+ * devices which don't use devicetree or don't have a node.
  * @devp: if non-NULL, returns a pointer to the bound device
  * @return 0 if OK, -ve on error
  */
-int device_bind_offset(struct udevice *parent, const struct driver *drv,
-		const char *name, void *platdata, int of_offset,
-		struct udevice **devp);
-
 int device_bind(struct udevice *parent, const struct driver *drv,
 		const char *name, void *platdata, ofnode node,
 		struct udevice **devp);
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 08/11] dm: core: Add an ofnode function to get the devicetree root
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (6 preceding siblings ...)
  2020-11-29  0:50 ` [PATCH 07/11] dm: core: Drop device_bind_offset() Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-11-29  0:50 ` [PATCH 09/11] dm: core: Combine the flattree and livetree binding code Simon Glass
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

This is needed in at least one place. Avoid the conditional code in root.c
by adding this inline function.

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

 drivers/core/root.c |  8 ++------
 include/dm/ofnode.h | 12 ++++++++++++
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 5f10d7a39c7..9ee65504e6e 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -147,12 +147,8 @@ int dm_init(bool of_live)
 	ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);
 	if (ret)
 		return ret;
-#if CONFIG_IS_ENABLED(OF_CONTROL)
-	if (CONFIG_IS_ENABLED(OF_LIVE) && of_live)
-		DM_ROOT_NON_CONST->node = np_to_ofnode(gd_of_root());
-	else
-		DM_ROOT_NON_CONST->node = offset_to_ofnode(0);
-#endif
+	if (CONFIG_IS_ENABLED(OF_CONTROL))
+		DM_ROOT_NON_CONST->node = ofnode_root();
 	ret = device_probe(DM_ROOT_NON_CONST);
 	if (ret)
 		return ret;
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index ee8c44a71ec..53f04ac91d0 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -218,6 +218,18 @@ static inline ofnode ofnode_null(void)
 	return node;
 }
 
+static inline ofnode ofnode_root(void)
+{
+	ofnode node;
+
+	if (of_live_active())
+		node.np = gd_of_root();
+	else
+		node.of_offset = 0;
+
+	return node;
+}
+
 /**
  * ofnode_read_u32() - Read a 32-bit integer from a property
  *
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 09/11] dm: core: Combine the flattree and livetree binding code
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (7 preceding siblings ...)
  2020-11-29  0:50 ` [PATCH 08/11] dm: core: Add an ofnode function to get the devicetree root Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-11-29  0:50 ` [PATCH 10/11] dm: core: Drop unused parameter from dm_scan_fdt() Simon Glass
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

At present there are two copies of this code. With ofnode we can combine
them to reduce duplication. Update the dm_scan_fdt_node() function and
adjust its callers.

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

 drivers/core/root.c | 74 ++++++++++-----------------------------------
 1 file changed, 16 insertions(+), 58 deletions(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 9ee65504e6e..62efa0fedcf 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -199,33 +199,6 @@ int dm_scan_platdata(bool pre_reloc_only)
 }
 
 #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
-static int dm_scan_fdt_live(struct udevice *parent,
-			    const struct device_node *node_parent,
-			    bool pre_reloc_only)
-{
-	struct device_node *np;
-	int ret = 0, err;
-
-	for (np = node_parent->child; np; np = np->sibling) {
-
-		if (!of_device_is_available(np)) {
-			pr_debug("   - ignoring disabled device\n");
-			continue;
-		}
-		err = lists_bind_fdt(parent, np_to_ofnode(np), NULL,
-				     pre_reloc_only);
-		if (err && !ret) {
-			ret = err;
-			debug("%s: ret=%d\n", np->name, ret);
-		}
-	}
-
-	if (ret)
-		dm_warn("Some drivers failed to bind\n");
-
-	return ret;
-}
-
 /**
  * dm_scan_fdt_node() - Scan the device tree and bind drivers for a node
  *
@@ -233,28 +206,30 @@ static int dm_scan_fdt_live(struct udevice *parent,
  * for each one.
  *
  * @parent: Parent device for the devices that will be created
- * @blob: Pointer to device tree blob
- * @offset: Offset of node to scan
+ * @node: Node to scan
  * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC
  * flag. If false bind all drivers.
  * @return 0 if OK, -ve on error
  */
-static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
-			    int offset, bool pre_reloc_only)
+static int dm_scan_fdt_node(struct udevice *parent, ofnode parent_node,
+			    bool pre_reloc_only)
 {
 	int ret = 0, err;
+	ofnode node;
+
+	if (!ofnode_valid(parent_node))
+		return 0;
 
-	for (offset = fdt_first_subnode(blob, offset);
-	     offset > 0;
-	     offset = fdt_next_subnode(blob, offset)) {
-		const char *node_name = fdt_get_name(blob, offset, NULL);
+	for (node = ofnode_first_subnode(parent_node);
+	     ofnode_valid(node);
+	     node = ofnode_next_subnode(node)) {
+		const char *node_name = ofnode_get_name(node);
 
-		if (!fdtdec_get_is_enabled(blob, offset)) {
+		if (!ofnode_is_enabled(node)) {
 			pr_debug("   - ignoring disabled device\n");
 			continue;
 		}
-		err = lists_bind_fdt(parent, offset_to_ofnode(offset), NULL,
-				     pre_reloc_only);
+		err = lists_bind_fdt(parent, node, NULL, pre_reloc_only);
 		if (err && !ret) {
 			ret = err;
 			debug("%s: ret=%d\n", node_name, ret);
@@ -269,24 +244,13 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
 
 int dm_scan_fdt_dev(struct udevice *dev)
 {
-	if (!dev_of_valid(dev))
-		return 0;
-
-	if (of_live_active())
-		return dm_scan_fdt_live(dev, dev_np(dev),
-				gd->flags & GD_FLG_RELOC ? false : true);
-
-	return dm_scan_fdt_node(dev, gd->fdt_blob, dev_of_offset(dev),
+	return dm_scan_fdt_node(dev, dev_ofnode(dev),
 				gd->flags & GD_FLG_RELOC ? false : true);
 }
 
 int dm_scan_fdt(const void *blob, bool pre_reloc_only)
 {
-	if (of_live_active())
-		return dm_scan_fdt_live(gd->dm_root, gd_of_root(),
-					pre_reloc_only);
-
-	return dm_scan_fdt_node(gd->dm_root, blob, 0, pre_reloc_only);
+	return dm_scan_fdt_node(gd->dm_root, ofnode_root(), pre_reloc_only);
 }
 
 static int dm_scan_fdt_ofnode_path(const void *blob, const char *path,
@@ -295,14 +259,8 @@ static int dm_scan_fdt_ofnode_path(const void *blob, const char *path,
 	ofnode node;
 
 	node = ofnode_path(path);
-	if (!ofnode_valid(node))
-		return 0;
-
-	if (of_live_active())
-		return dm_scan_fdt_live(gd->dm_root, node.np, pre_reloc_only);
 
-	return dm_scan_fdt_node(gd->dm_root, blob, node.of_offset,
-				pre_reloc_only);
+	return dm_scan_fdt_node(gd->dm_root, node, pre_reloc_only);
 }
 
 int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 10/11] dm: core: Drop unused parameter from dm_scan_fdt()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (8 preceding siblings ...)
  2020-11-29  0:50 ` [PATCH 09/11] dm: core: Combine the flattree and livetree binding code Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-11-29  0:50 ` [PATCH 11/11] dm: core: Drop unused parameter from dm_extended_scan_fdt() Simon Glass
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

This doesn't need to be passed the devicetree anymore. Drop it.

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

 drivers/core/root.c | 9 ++++-----
 include/dm/root.h   | 3 +--
 test/dm/core.c      | 2 +-
 test/dm/test-fdt.c  | 2 +-
 test/dm/test-main.c | 2 +-
 5 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 62efa0fedcf..54498b2df71 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -248,13 +248,12 @@ int dm_scan_fdt_dev(struct udevice *dev)
 				gd->flags & GD_FLG_RELOC ? false : true);
 }
 
-int dm_scan_fdt(const void *blob, bool pre_reloc_only)
+int dm_scan_fdt(bool pre_reloc_only)
 {
 	return dm_scan_fdt_node(gd->dm_root, ofnode_root(), pre_reloc_only);
 }
 
-static int dm_scan_fdt_ofnode_path(const void *blob, const char *path,
-				   bool pre_reloc_only)
+static int dm_scan_fdt_ofnode_path(const char *path, bool pre_reloc_only)
 {
 	ofnode node;
 
@@ -272,7 +271,7 @@ int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
 		"/firmware"
 	};
 
-	ret = dm_scan_fdt(blob, pre_reloc_only);
+	ret = dm_scan_fdt(pre_reloc_only);
 	if (ret) {
 		debug("dm_scan_fdt() failed: %d\n", ret);
 		return ret;
@@ -280,7 +279,7 @@ int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
 
 	/* Some nodes aren't devices themselves but may contain some */
 	for (i = 0; i < ARRAY_SIZE(nodes); i++) {
-		ret = dm_scan_fdt_ofnode_path(blob, nodes[i], pre_reloc_only);
+		ret = dm_scan_fdt_ofnode_path(nodes[i], pre_reloc_only);
 		if (ret) {
 			debug("dm_scan_fdt() scan for %s failed: %d\n",
 			      nodes[i], ret);
diff --git a/include/dm/root.h b/include/dm/root.h
index c8d629ba9bf..e277ebb9523 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -47,12 +47,11 @@ int dm_scan_platdata(bool pre_reloc_only);
  * This scans the device tree and creates a driver for each node. Only
  * the top-level subnodes are examined.
  *
- * @blob: Pointer to device tree blob
  * @pre_reloc_only: If true, bind only nodes with special devicetree properties,
  * or drivers with the DM_FLAG_PRE_RELOC flag. If false bind all drivers.
  * @return 0 if OK, -ve on error
  */
-int dm_scan_fdt(const void *blob, bool pre_reloc_only);
+int dm_scan_fdt(bool pre_reloc_only);
 
 /**
  * dm_extended_scan_fdt() - Scan the device tree and bind drivers
diff --git a/test/dm/core.c b/test/dm/core.c
index ba9e60d09cb..71ebb36d88b 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -486,7 +486,7 @@ static int dm_test_leak(struct unit_test_state *uts)
 		dm_leak_check_start(uts);
 
 		ut_assertok(dm_scan_platdata(false));
-		ut_assertok(dm_scan_fdt(gd->fdt_blob, false));
+		ut_assertok(dm_scan_fdt(false));
 
 		/* Scanning the uclass is enough to probe all the devices */
 		for (id = UCLASS_ROOT; id < UCLASS_COUNT; id++) {
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index cc12419ea0f..9507636b630 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -308,7 +308,7 @@ static int dm_test_fdt_pre_reloc(struct unit_test_state *uts)
 	struct uclass *uc;
 	int ret;
 
-	ret = dm_scan_fdt(gd->fdt_blob, true);
+	ret = dm_scan_fdt(true);
 	ut_assert(!ret);
 
 	ret = uclass_get(UCLASS_TEST_FDT, &uc);
diff --git a/test/dm/test-main.c b/test/dm/test-main.c
index fd24635006c..2ab73b647e6 100644
--- a/test/dm/test-main.c
+++ b/test/dm/test-main.c
@@ -213,7 +213,7 @@ int dm_test_main(const char *test_name)
 	ut_assertok(dm_init(CONFIG_IS_ENABLED(OF_LIVE)));
 	dm_scan_platdata(false);
 	if (!CONFIG_IS_ENABLED(OF_PLATDATA))
-		dm_scan_fdt(gd->fdt_blob, false);
+		dm_scan_fdt(false);
 
 	return uts->fail_count ? CMD_RET_FAILURE : 0;
 }
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 11/11] dm: core: Drop unused parameter from dm_extended_scan_fdt()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (9 preceding siblings ...)
  2020-11-29  0:50 ` [PATCH 10/11] dm: core: Drop unused parameter from dm_scan_fdt() Simon Glass
@ 2020-11-29  0:50 ` Simon Glass
  2020-12-10  0:26 ` Simon Glass
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-11-29  0:50 UTC (permalink / raw)
  To: u-boot

This doesn't need to be passed the devicetree anymore. Drop it.
Also rename the function to drop the _fdt suffix.

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

 drivers/core/root.c | 6 +++---
 include/dm/root.h   | 5 ++---
 test/dm/test-fdt.c  | 2 +-
 test/dm/test-main.c | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 54498b2df71..6f8168bb92d 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -262,7 +262,7 @@ static int dm_scan_fdt_ofnode_path(const char *path, bool pre_reloc_only)
 	return dm_scan_fdt_node(gd->dm_root, node, pre_reloc_only);
 }
 
-int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
+int dm_extended_scan(bool pre_reloc_only)
 {
 	int ret, i;
 	const char * const nodes[] = {
@@ -315,9 +315,9 @@ int dm_init_and_scan(bool pre_reloc_only)
 	}
 
 	if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
-		ret = dm_extended_scan_fdt(gd->fdt_blob, pre_reloc_only);
+		ret = dm_extended_scan(pre_reloc_only);
 		if (ret) {
-			debug("dm_extended_scan_dt() failed: %d\n", ret);
+			debug("dm_extended_scan() failed: %d\n", ret);
 			return ret;
 		}
 	}
diff --git a/include/dm/root.h b/include/dm/root.h
index e277ebb9523..830e31312df 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -54,18 +54,17 @@ int dm_scan_platdata(bool pre_reloc_only);
 int dm_scan_fdt(bool pre_reloc_only);
 
 /**
- * dm_extended_scan_fdt() - Scan the device tree and bind drivers
+ * dm_extended_scan() - Scan the device tree and bind drivers
  *
  * This calls dm_scna_dft() which scans the device tree and creates a driver
  * for each node. the top-level subnodes are examined and also all sub-nodes
  * of "clocks" node.
  *
- * @blob: Pointer to device tree blob
  * @pre_reloc_only: If true, bind only nodes with special devicetree properties,
  * or drivers with the DM_FLAG_PRE_RELOC flag. If false bind all drivers.
  * @return 0 if OK, -ve on error
  */
-int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only);
+int dm_extended_scan(bool pre_reloc_only);
 
 /**
  * dm_scan_other() - Scan for other devices
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 9507636b630..673ffb4de94 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -257,7 +257,7 @@ static int dm_test_fdt(struct unit_test_state *uts)
 	int ret;
 	int i;
 
-	ret = dm_extended_scan_fdt(gd->fdt_blob, false);
+	ret = dm_extended_scan(false);
 	ut_assert(!ret);
 
 	ret = uclass_get(UCLASS_TEST_FDT, &uc);
diff --git a/test/dm/test-main.c b/test/dm/test-main.c
index 2ab73b647e6..4814e186cb7 100644
--- a/test/dm/test-main.c
+++ b/test/dm/test-main.c
@@ -94,7 +94,7 @@ static int dm_do_test(struct unit_test_state *uts, struct unit_test *test,
 		ut_assertok(do_autoprobe(uts));
 	if (!CONFIG_IS_ENABLED(OF_PLATDATA) &&
 	    (test->flags & UT_TESTF_SCAN_FDT))
-		ut_assertok(dm_extended_scan_fdt(gd->fdt_blob, false));
+		ut_assertok(dm_extended_scan(false));
 
 	/*
 	 * Silence the console and rely on console recording to get
-- 
2.29.2.454.gaff20da3a2-goog

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

* [PATCH 11/11] dm: core: Drop unused parameter from dm_extended_scan_fdt()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (10 preceding siblings ...)
  2020-11-29  0:50 ` [PATCH 11/11] dm: core: Drop unused parameter from dm_extended_scan_fdt() Simon Glass
@ 2020-12-10  0:26 ` Simon Glass
  2020-12-10  0:26 ` [PATCH 10/11] dm: core: Drop unused parameter from dm_scan_fdt() Simon Glass
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

This doesn't need to be passed the devicetree anymore. Drop it.
Also rename the function to drop the _fdt suffix.

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

 drivers/core/root.c | 6 +++---
 include/dm/root.h   | 5 ++---
 test/dm/test-fdt.c  | 2 +-
 test/dm/test-main.c | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)

Applied to u-boot-dm, thanks!

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

* [PATCH 10/11] dm: core: Drop unused parameter from dm_scan_fdt()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (11 preceding siblings ...)
  2020-12-10  0:26 ` Simon Glass
@ 2020-12-10  0:26 ` Simon Glass
  2020-12-10  0:26 ` [PATCH 09/11] dm: core: Combine the flattree and livetree binding code Simon Glass
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

This doesn't need to be passed the devicetree anymore. Drop it.

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

 drivers/core/root.c | 9 ++++-----
 include/dm/root.h   | 3 +--
 test/dm/core.c      | 2 +-
 test/dm/test-fdt.c  | 2 +-
 test/dm/test-main.c | 2 +-
 5 files changed, 8 insertions(+), 10 deletions(-)

Applied to u-boot-dm, thanks!

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

* [PATCH 09/11] dm: core: Combine the flattree and livetree binding code
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (12 preceding siblings ...)
  2020-12-10  0:26 ` [PATCH 10/11] dm: core: Drop unused parameter from dm_scan_fdt() Simon Glass
@ 2020-12-10  0:26 ` Simon Glass
  2020-12-10  0:26 ` [PATCH 08/11] dm: core: Add an ofnode function to get the devicetree root Simon Glass
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

At present there are two copies of this code. With ofnode we can combine
them to reduce duplication. Update the dm_scan_fdt_node() function and
adjust its callers.

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

 drivers/core/root.c | 74 ++++++++++-----------------------------------
 1 file changed, 16 insertions(+), 58 deletions(-)

Applied to u-boot-dm, thanks!

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

* [PATCH 08/11] dm: core: Add an ofnode function to get the devicetree root
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (13 preceding siblings ...)
  2020-12-10  0:26 ` [PATCH 09/11] dm: core: Combine the flattree and livetree binding code Simon Glass
@ 2020-12-10  0:26 ` Simon Glass
  2020-12-10  0:26 ` [PATCH 07/11] dm: core: Drop device_bind_offset() Simon Glass
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

This is needed in at least one place. Avoid the conditional code in root.c
by adding this inline function.

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

 drivers/core/root.c |  8 ++------
 include/dm/ofnode.h | 12 ++++++++++++
 2 files changed, 14 insertions(+), 6 deletions(-)

Applied to u-boot-dm, thanks!

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

* [PATCH 07/11] dm: core: Drop device_bind_offset()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (14 preceding siblings ...)
  2020-12-10  0:26 ` [PATCH 08/11] dm: core: Add an ofnode function to get the devicetree root Simon Glass
@ 2020-12-10  0:26 ` Simon Glass
  2020-12-10  0:26 ` [PATCH 06/11] dm: core: Drop dev_set_of_offset() Simon Glass
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

This function is not needed since the standard device_bind() can be used
instead. Drop it.

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

 drivers/core/device.c        |  8 --------
 include/dm/device-internal.h | 10 +++-------
 2 files changed, 3 insertions(+), 15 deletions(-)

Applied to u-boot-dm, thanks!

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

* [PATCH 06/11] dm: core: Drop dev_set_of_offset()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (15 preceding siblings ...)
  2020-12-10  0:26 ` [PATCH 07/11] dm: core: Drop device_bind_offset() Simon Glass
@ 2020-12-10  0:26 ` Simon Glass
  2020-12-10  0:26   ` Simon Glass
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

This pre-livetree function is not needed anymore. Drop it.

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

 include/dm/device.h | 5 -----
 1 file changed, 5 deletions(-)

Applied to u-boot-dm, thanks!

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

* [PATCH 05/11] dm: Drop uses of dev_set_of_offset()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
@ 2020-12-10  0:26   ` Simon Glass
  2020-11-29  0:50 ` [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind() Simon Glass
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

The need for this can be avoided by passing the correct node to the
device_bind() function.

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

 drivers/gpio/mt7621_gpio.c            | 3 +--
 drivers/gpio/s5p_gpio.c               | 4 +---
 drivers/gpio/sunxi_gpio.c             | 3 +--
 drivers/gpio/tegra186_gpio.c          | 3 +--
 drivers/gpio/tegra_gpio.c             | 5 ++---
 drivers/pinctrl/meson/pinctrl-meson.c | 1 -
 6 files changed, 6 insertions(+), 13 deletions(-)

Applied to u-boot-dm, thanks!

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

* Re: [PATCH 05/11] dm: Drop uses of dev_set_of_offset()
@ 2020-12-10  0:26   ` Simon Glass
  0 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: Simon Glass
  Cc: Bin Meng, Icenowy Zheng, Jagan Teki, Marek Vasut,
	Masahiro Yamada, Neil Armstrong, Pavel Herrmann, u-boot-amlogic,
	U-Boot Mailing List

The need for this can be avoided by passing the correct node to the
device_bind() function.

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

 drivers/gpio/mt7621_gpio.c            | 3 +--
 drivers/gpio/s5p_gpio.c               | 4 +---
 drivers/gpio/sunxi_gpio.c             | 3 +--
 drivers/gpio/tegra186_gpio.c          | 3 +--
 drivers/gpio/tegra_gpio.c             | 5 ++---
 drivers/pinctrl/meson/pinctrl-meson.c | 1 -
 6 files changed, 6 insertions(+), 13 deletions(-)

Applied to u-boot-dm, thanks!

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

* [PATCH 04/11] dm: Remove uses of device_bind_offset()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
@ 2020-12-10  0:26   ` Simon Glass
  2020-11-29  0:50 ` [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind() Simon Glass
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

This function is not needed since the standard device_bind() can be used
instead.

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

 arch/x86/cpu/apollolake/spl.c               |  2 +-
 drivers/clk/at91/compat.c                   | 20 ++++++++------------
 drivers/clk/clk.c                           |  2 +-
 drivers/gpio/mt7621_gpio.c                  |  4 ++--
 drivers/gpio/s5p_gpio.c                     |  4 ++--
 drivers/gpio/sunxi_gpio.c                   |  4 ++--
 drivers/gpio/tegra186_gpio.c                |  4 ++--
 drivers/gpio/tegra_gpio.c                   |  6 +++---
 drivers/net/mvpp2.c                         |  4 ++--
 drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
 drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
 drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
 drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
 drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
 drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
 drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
 drivers/power/regulator/Kconfig             |  2 +-
 include/dm/device-internal.h                |  4 ++--
 include/power/regulator.h                   |  2 +-
 20 files changed, 46 insertions(+), 49 deletions(-)

Applied to u-boot-dm, thanks!

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

* Re: [PATCH 04/11] dm: Remove uses of device_bind_offset()
@ 2020-12-10  0:26   ` Simon Glass
  0 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: Simon Glass
  Cc: Anatolij Gustschin, Bin Meng, Claudiu Beznea, Gregory CLEMENT,
	Horatiu Vultur, Icenowy Zheng, Jaehoon Chung, Jagan Teki,
	Joe Hershberger, Lars Povlsen, Lukasz Majewski, Marek Vasut,
	Martin Fuzzey, Masahiro Yamada, Matthias Brugger, Neil Armstrong,
	Pavel Herrmann, Peng Fan, Robert Beckett, u-boot-amlogic,
	U-Boot Mailing List

This function is not needed since the standard device_bind() can be used
instead.

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

 arch/x86/cpu/apollolake/spl.c               |  2 +-
 drivers/clk/at91/compat.c                   | 20 ++++++++------------
 drivers/clk/clk.c                           |  2 +-
 drivers/gpio/mt7621_gpio.c                  |  4 ++--
 drivers/gpio/s5p_gpio.c                     |  4 ++--
 drivers/gpio/sunxi_gpio.c                   |  4 ++--
 drivers/gpio/tegra186_gpio.c                |  4 ++--
 drivers/gpio/tegra_gpio.c                   |  6 +++---
 drivers/net/mvpp2.c                         |  4 ++--
 drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
 drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
 drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
 drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
 drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
 drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
 drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
 drivers/power/regulator/Kconfig             |  2 +-
 include/dm/device-internal.h                |  4 ++--
 include/power/regulator.h                   |  2 +-
 20 files changed, 46 insertions(+), 49 deletions(-)

Applied to u-boot-dm, thanks!

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

* [PATCH 03/11] dm: core: Add a livetree function to check node status
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (18 preceding siblings ...)
  2020-12-10  0:26   ` Simon Glass
@ 2020-12-10  0:26 ` Simon Glass
  2020-12-10  0:26 ` [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind() Simon Glass
  2020-12-10  0:26   ` Simon Glass
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

Add a way to find out if a node is enabled or not, based on its 'status'
property.

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

 drivers/core/ofnode.c | 10 ++++++++++
 include/dm/ofnode.h   | 11 +++++++++++
 test/dm/ofnode.c      | 12 ++++++++++++
 3 files changed, 33 insertions(+)

Applied to u-boot-dm, thanks!

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

* [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
                   ` (19 preceding siblings ...)
  2020-12-10  0:26 ` [PATCH 03/11] dm: core: Add a livetree function to check node status Simon Glass
@ 2020-12-10  0:26 ` Simon Glass
  2020-12-10  0:26   ` Simon Glass
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

This is the standard function to use when binding devices. Drop the
'_ofnode' suffix to make this clear.

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

 drivers/core/device.c                     | 6 +++---
 drivers/firmware/scmi/scmi_agent-uclass.c | 4 ++--
 drivers/gpio/dwapb_gpio.c                 | 4 ++--
 drivers/misc/i2c_eeprom.c                 | 4 ++--
 drivers/mtd/spi/sandbox.c                 | 2 +-
 drivers/pci/pci-uclass.c                  | 4 ++--
 drivers/pci/pci_mvebu.c                   | 4 ++--
 drivers/usb/host/usb-uclass.c             | 4 ++--
 include/dm/device-internal.h              | 6 +++---
 test/dm/core.c                            | 4 ++--
 10 files changed, 21 insertions(+), 21 deletions(-)

Applied to u-boot-dm, thanks!

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

* [PATCH 01/11] dm: core: Rename device_bind() to device_bind_offset()
  2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
@ 2020-12-10  0:26   ` Simon Glass
  2020-11-29  0:50 ` [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind() Simon Glass
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: u-boot

This function is not necessary anymore, since device_bind_ofnode() does
the same thing and works with both flattree and livetree.

Rename it to indicate that it is special.

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

 arch/x86/cpu/apollolake/spl.c               | 2 +-
 drivers/clk/clk.c                           | 2 +-
 drivers/core/device.c                       | 6 +++---
 drivers/gpio/mt7621_gpio.c                  | 4 ++--
 drivers/gpio/s5p_gpio.c                     | 4 ++--
 drivers/gpio/sunxi_gpio.c                   | 4 ++--
 drivers/gpio/tegra186_gpio.c                | 4 ++--
 drivers/gpio/tegra_gpio.c                   | 5 +++--
 drivers/net/mvpp2.c                         | 2 +-
 drivers/pinctrl/broadcom/pinctrl-bcm283x.c  | 5 +++--
 drivers/pinctrl/meson/pinctrl-meson.c       | 2 +-
 drivers/pinctrl/mscc/pinctrl-jr2.c          | 4 ++--
 drivers/pinctrl/mscc/pinctrl-luton.c        | 4 ++--
 drivers/pinctrl/mscc/pinctrl-ocelot.c       | 4 ++--
 drivers/pinctrl/mscc/pinctrl-serval.c       | 4 ++--
 drivers/pinctrl/mscc/pinctrl-servalt.c      | 4 ++--
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 4 ++--
 drivers/power/regulator/Kconfig             | 2 +-
 include/dm/device-internal.h                | 8 ++++----
 include/power/regulator.h                   | 2 +-
 20 files changed, 39 insertions(+), 37 deletions(-)

Applied to u-boot-dm, thanks!

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

* Re: [PATCH 01/11] dm: core: Rename device_bind() to device_bind_offset()
@ 2020-12-10  0:26   ` Simon Glass
  0 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2020-12-10  0:26 UTC (permalink / raw)
  To: Simon Glass
  Cc: Anatolij Gustschin, Bin Meng, Gregory CLEMENT, Horatiu Vultur,
	Icenowy Zheng, Jaehoon Chung, Jagan Teki, Joe Hershberger,
	Lars Povlsen, Lukasz Majewski, Marek Vasut, Martin Fuzzey,
	Masahiro Yamada, Matthias Brugger, Neil Armstrong,
	Pavel Herrmann, Peng Fan, Robert Beckett, u-boot-amlogic,
	U-Boot Mailing List

This function is not necessary anymore, since device_bind_ofnode() does
the same thing and works with both flattree and livetree.

Rename it to indicate that it is special.

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

 arch/x86/cpu/apollolake/spl.c               | 2 +-
 drivers/clk/clk.c                           | 2 +-
 drivers/core/device.c                       | 6 +++---
 drivers/gpio/mt7621_gpio.c                  | 4 ++--
 drivers/gpio/s5p_gpio.c                     | 4 ++--
 drivers/gpio/sunxi_gpio.c                   | 4 ++--
 drivers/gpio/tegra186_gpio.c                | 4 ++--
 drivers/gpio/tegra_gpio.c                   | 5 +++--
 drivers/net/mvpp2.c                         | 2 +-
 drivers/pinctrl/broadcom/pinctrl-bcm283x.c  | 5 +++--
 drivers/pinctrl/meson/pinctrl-meson.c       | 2 +-
 drivers/pinctrl/mscc/pinctrl-jr2.c          | 4 ++--
 drivers/pinctrl/mscc/pinctrl-luton.c        | 4 ++--
 drivers/pinctrl/mscc/pinctrl-ocelot.c       | 4 ++--
 drivers/pinctrl/mscc/pinctrl-serval.c       | 4 ++--
 drivers/pinctrl/mscc/pinctrl-servalt.c      | 4 ++--
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 4 ++--
 drivers/power/regulator/Kconfig             | 2 +-
 include/dm/device-internal.h                | 8 ++++----
 include/power/regulator.h                   | 2 +-
 20 files changed, 39 insertions(+), 37 deletions(-)

Applied to u-boot-dm, thanks!

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

* [PATCH 04/11] dm: Remove uses of device_bind_offset()
  2020-12-10  0:26   ` Simon Glass
@ 2021-01-31  9:18     ` Eugen.Hristev
  -1 siblings, 0 replies; 35+ messages in thread
From: Eugen.Hristev at microchip.com @ 2021-01-31  9:18 UTC (permalink / raw)
  To: u-boot

On 10.12.2020 02:26, Simon Glass wrote:
> This function is not needed since the standard device_bind() can be used
> instead.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>   arch/x86/cpu/apollolake/spl.c               |  2 +-
>   drivers/clk/at91/compat.c                   | 20 ++++++++------------
>   drivers/clk/clk.c                           |  2 +-
>   drivers/gpio/mt7621_gpio.c                  |  4 ++--
>   drivers/gpio/s5p_gpio.c                     |  4 ++--
>   drivers/gpio/sunxi_gpio.c                   |  4 ++--
>   drivers/gpio/tegra186_gpio.c                |  4 ++--
>   drivers/gpio/tegra_gpio.c                   |  6 +++---
>   drivers/net/mvpp2.c                         |  4 ++--
>   drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
>   drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
>   drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
>   drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
>   drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
>   drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
>   drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
>   drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
>   drivers/power/regulator/Kconfig             |  2 +-
>   include/dm/device-internal.h                |  4 ++--
>   include/power/regulator.h                   |  2 +-
>   20 files changed, 46 insertions(+), 49 deletions(-)
> 
> Applied to u-boot-dm, thanks!
> 


Hi Simon,

I bisected the tree and this commit looks to break 
sama5d4_xplained_mmc_defconfig :

<debug_uart>
No serial driver found
Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Booting u-boot fails when adding this commit.

Could you please help or let me know how I can fix it ?

Thanks,
Eugen

a2703ce10cfcbe6a82ec8ed9ec10df2aeea08e64 is the first bad commit
commit a2703ce10cfcbe6a82ec8ed9ec10df2aeea08e64
Author: Simon Glass <sjg@chromium.org>
Date:   Sat Nov 28 17:50:03 2020 -0700

     dm: Remove uses of device_bind_offset()

     This function is not needed since the standard device_bind() can be 
used
     instead.

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

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

* Re: [PATCH 04/11] dm: Remove uses of device_bind_offset()
@ 2021-01-31  9:18     ` Eugen.Hristev
  0 siblings, 0 replies; 35+ messages in thread
From: Eugen.Hristev @ 2021-01-31  9:18 UTC (permalink / raw)
  To: sjg
  Cc: agust, bmeng.cn, Claudiu.Beznea, gregory.clement, Horatiu.Vultur,
	icenowy, jh80.chung, jagan, joe.hershberger, Lars.Povlsen, lukma,
	marex, martin.fuzzey, yamada.masahiro, mbrugger, narmstrong,
	morpheus.ibis, peng.fan, bob.beckett, u-boot-amlogic, u-boot

On 10.12.2020 02:26, Simon Glass wrote:
> This function is not needed since the standard device_bind() can be used
> instead.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>   arch/x86/cpu/apollolake/spl.c               |  2 +-
>   drivers/clk/at91/compat.c                   | 20 ++++++++------------
>   drivers/clk/clk.c                           |  2 +-
>   drivers/gpio/mt7621_gpio.c                  |  4 ++--
>   drivers/gpio/s5p_gpio.c                     |  4 ++--
>   drivers/gpio/sunxi_gpio.c                   |  4 ++--
>   drivers/gpio/tegra186_gpio.c                |  4 ++--
>   drivers/gpio/tegra_gpio.c                   |  6 +++---
>   drivers/net/mvpp2.c                         |  4 ++--
>   drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
>   drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
>   drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
>   drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
>   drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
>   drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
>   drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
>   drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
>   drivers/power/regulator/Kconfig             |  2 +-
>   include/dm/device-internal.h                |  4 ++--
>   include/power/regulator.h                   |  2 +-
>   20 files changed, 46 insertions(+), 49 deletions(-)
> 
> Applied to u-boot-dm, thanks!
> 


Hi Simon,

I bisected the tree and this commit looks to break 
sama5d4_xplained_mmc_defconfig :

<debug_uart>
No serial driver found
Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Could not initialize timer (err -19)

Booting u-boot fails when adding this commit.

Could you please help or let me know how I can fix it ?

Thanks,
Eugen

a2703ce10cfcbe6a82ec8ed9ec10df2aeea08e64 is the first bad commit
commit a2703ce10cfcbe6a82ec8ed9ec10df2aeea08e64
Author: Simon Glass <sjg@chromium.org>
Date:   Sat Nov 28 17:50:03 2020 -0700

     dm: Remove uses of device_bind_offset()

     This function is not needed since the standard device_bind() can be 
used
     instead.

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

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

* [PATCH 04/11] dm: Remove uses of device_bind_offset()
  2021-01-31  9:18     ` Eugen.Hristev
@ 2021-01-31 15:37       ` Simon Glass
  -1 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2021-01-31 15:37 UTC (permalink / raw)
  To: u-boot

Hi Eugen,

On Sun, 31 Jan 2021 at 02:18, <Eugen.Hristev@microchip.com> wrote:
>
> On 10.12.2020 02:26, Simon Glass wrote:
> > This function is not needed since the standard device_bind() can be used
> > instead.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> >   arch/x86/cpu/apollolake/spl.c               |  2 +-
> >   drivers/clk/at91/compat.c                   | 20 ++++++++------------
> >   drivers/clk/clk.c                           |  2 +-
> >   drivers/gpio/mt7621_gpio.c                  |  4 ++--
> >   drivers/gpio/s5p_gpio.c                     |  4 ++--
> >   drivers/gpio/sunxi_gpio.c                   |  4 ++--
> >   drivers/gpio/tegra186_gpio.c                |  4 ++--
> >   drivers/gpio/tegra_gpio.c                   |  6 +++---
> >   drivers/net/mvpp2.c                         |  4 ++--
> >   drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
> >   drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
> >   drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
> >   drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
> >   drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
> >   drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
> >   drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
> >   drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
> >   drivers/power/regulator/Kconfig             |  2 +-
> >   include/dm/device-internal.h                |  4 ++--
> >   include/power/regulator.h                   |  2 +-
> >   20 files changed, 46 insertions(+), 49 deletions(-)
> >
> > Applied to u-boot-dm, thanks!
> >
>
>
> Hi Simon,
>
> I bisected the tree and this commit looks to break
> sama5d4_xplained_mmc_defconfig :
>
> <debug_uart>
> No serial driver found
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Booting u-boot fails when adding this commit.
>
> Could you please help or let me know how I can fix it ?

I suspect the problem could be in the changes to
drivers/clk/at91/compat.c although I cannot see why

You could try reverting that change, and just using offset_to_ofnode()
in the device_bind_driver_to_node() call. I actually intended to do
that at the time due to the risk, but somehow I missed this one.

OTOH it would be good to move the code to livetree and stop using fdt offsets.

Regards,
Simon

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

* Re: [PATCH 04/11] dm: Remove uses of device_bind_offset()
@ 2021-01-31 15:37       ` Simon Glass
  0 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2021-01-31 15:37 UTC (permalink / raw)
  To: Eugen Hristev
  Cc: Anatolij Gustschin, Bin Meng, Claudiu Beznea, Gregory CLEMENT,
	Horatiu Vultur, Icenowy Zheng, Jaehoon Chung, Jagan Teki,
	Joe Hershberger, Lars Povlsen, Lukasz Majewski, Marek Vasut,
	Martin Fuzzey, Masahiro Yamada, Matthias Brugger, Neil Armstrong,
	Pavel Herrmann, Peng Fan, Robert Beckett, u-boot-amlogic,
	U-Boot Mailing List

Hi Eugen,

On Sun, 31 Jan 2021 at 02:18, <Eugen.Hristev@microchip.com> wrote:
>
> On 10.12.2020 02:26, Simon Glass wrote:
> > This function is not needed since the standard device_bind() can be used
> > instead.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> >   arch/x86/cpu/apollolake/spl.c               |  2 +-
> >   drivers/clk/at91/compat.c                   | 20 ++++++++------------
> >   drivers/clk/clk.c                           |  2 +-
> >   drivers/gpio/mt7621_gpio.c                  |  4 ++--
> >   drivers/gpio/s5p_gpio.c                     |  4 ++--
> >   drivers/gpio/sunxi_gpio.c                   |  4 ++--
> >   drivers/gpio/tegra186_gpio.c                |  4 ++--
> >   drivers/gpio/tegra_gpio.c                   |  6 +++---
> >   drivers/net/mvpp2.c                         |  4 ++--
> >   drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
> >   drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
> >   drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
> >   drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
> >   drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
> >   drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
> >   drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
> >   drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
> >   drivers/power/regulator/Kconfig             |  2 +-
> >   include/dm/device-internal.h                |  4 ++--
> >   include/power/regulator.h                   |  2 +-
> >   20 files changed, 46 insertions(+), 49 deletions(-)
> >
> > Applied to u-boot-dm, thanks!
> >
>
>
> Hi Simon,
>
> I bisected the tree and this commit looks to break
> sama5d4_xplained_mmc_defconfig :
>
> <debug_uart>
> No serial driver found
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Could not initialize timer (err -19)
>
> Booting u-boot fails when adding this commit.
>
> Could you please help or let me know how I can fix it ?

I suspect the problem could be in the changes to
drivers/clk/at91/compat.c although I cannot see why

You could try reverting that change, and just using offset_to_ofnode()
in the device_bind_driver_to_node() call. I actually intended to do
that at the time due to the risk, but somehow I missed this one.

OTOH it would be good to move the code to livetree and stop using fdt offsets.

Regards,
Simon

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

* [PATCH 04/11] dm: Remove uses of device_bind_offset()
  2021-01-31 15:37       ` Simon Glass
@ 2021-02-01  8:13         ` Eugen.Hristev
  -1 siblings, 0 replies; 35+ messages in thread
From: Eugen.Hristev at microchip.com @ 2021-02-01  8:13 UTC (permalink / raw)
  To: u-boot

On 31.01.2021 17:37, Simon Glass wrote:
> Hi Eugen,
> 
> On Sun, 31 Jan 2021 at 02:18, <Eugen.Hristev@microchip.com> wrote:
>>
>> On 10.12.2020 02:26, Simon Glass wrote:
>>> This function is not needed since the standard device_bind() can be used
>>> instead.
>>>
>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>>    arch/x86/cpu/apollolake/spl.c               |  2 +-
>>>    drivers/clk/at91/compat.c                   | 20 ++++++++------------
>>>    drivers/clk/clk.c                           |  2 +-
>>>    drivers/gpio/mt7621_gpio.c                  |  4 ++--
>>>    drivers/gpio/s5p_gpio.c                     |  4 ++--
>>>    drivers/gpio/sunxi_gpio.c                   |  4 ++--
>>>    drivers/gpio/tegra186_gpio.c                |  4 ++--
>>>    drivers/gpio/tegra_gpio.c                   |  6 +++---
>>>    drivers/net/mvpp2.c                         |  4 ++--
>>>    drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
>>>    drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
>>>    drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
>>>    drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
>>>    drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
>>>    drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
>>>    drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
>>>    drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
>>>    drivers/power/regulator/Kconfig             |  2 +-
>>>    include/dm/device-internal.h                |  4 ++--
>>>    include/power/regulator.h                   |  2 +-
>>>    20 files changed, 46 insertions(+), 49 deletions(-)
>>>
>>> Applied to u-boot-dm, thanks!
>>>
>>
>>
>> Hi Simon,
>>
>> I bisected the tree and this commit looks to break
>> sama5d4_xplained_mmc_defconfig :
>>
>> <debug_uart>
>> No serial driver found
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Booting u-boot fails when adding this commit.
>>
>> Could you please help or let me know how I can fix it ?
> 
> I suspect the problem could be in the changes to
> drivers/clk/at91/compat.c although I cannot see why
> 
> You could try reverting that change, and just using offset_to_ofnode()
> in the device_bind_driver_to_node() call. I actually intended to do
> that at the time due to the risk, but somehow I missed this one.
> 
> OTOH it would be good to move the code to livetree and stop using fdt offsets.
> 
> Regards,
> Simon
> 

I reverted the changes in compat.c and indeed now it boots correctly.

I tried to do the following change on top of your code as you suggested 
but it does not help:


--- a/drivers/clk/at91/compat.c
+++ b/drivers/clk/at91/compat.c
@@ -67,7 +67,7 @@ int at91_clk_sub_device_bind(struct udevice *dev, 
const char *drv_name)
         bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
         const char *name;
         int ret;
-
+       int offset = dev_of_offset(dev);
         ofnode_for_each_subnode(node, parent) {
                 if (pre_reloc_only && !ofnode_pre_reloc(node))
                         continue;
@@ -84,7 +84,7 @@ int at91_clk_sub_device_bind(struct udevice *dev, 
const char *drv_name)
                 name = ofnode_get_name(node);
                 if (!name)
                         return -EINVAL;
-               ret = device_bind_driver_to_node(dev, drv_name, name, node,
+               ret = device_bind_driver_to_node(dev, drv_name, name, 
offset_to_ofnode(offset),
                                                  NULL);
                 if (ret)
                         return ret;


I have a feeling the 'for loop' for the subnodes misses an essential 
driver and thus it fails booting

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

* Re: [PATCH 04/11] dm: Remove uses of device_bind_offset()
@ 2021-02-01  8:13         ` Eugen.Hristev
  0 siblings, 0 replies; 35+ messages in thread
From: Eugen.Hristev @ 2021-02-01  8:13 UTC (permalink / raw)
  To: sjg
  Cc: agust, bmeng.cn, Claudiu.Beznea, gregory.clement, Horatiu.Vultur,
	icenowy, jh80.chung, jagan, joe.hershberger, Lars.Povlsen, lukma,
	marex, martin.fuzzey, yamada.masahiro, mbrugger, narmstrong,
	morpheus.ibis, peng.fan, bob.beckett, u-boot-amlogic, u-boot

On 31.01.2021 17:37, Simon Glass wrote:
> Hi Eugen,
> 
> On Sun, 31 Jan 2021 at 02:18, <Eugen.Hristev@microchip.com> wrote:
>>
>> On 10.12.2020 02:26, Simon Glass wrote:
>>> This function is not needed since the standard device_bind() can be used
>>> instead.
>>>
>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>>    arch/x86/cpu/apollolake/spl.c               |  2 +-
>>>    drivers/clk/at91/compat.c                   | 20 ++++++++------------
>>>    drivers/clk/clk.c                           |  2 +-
>>>    drivers/gpio/mt7621_gpio.c                  |  4 ++--
>>>    drivers/gpio/s5p_gpio.c                     |  4 ++--
>>>    drivers/gpio/sunxi_gpio.c                   |  4 ++--
>>>    drivers/gpio/tegra186_gpio.c                |  4 ++--
>>>    drivers/gpio/tegra_gpio.c                   |  6 +++---
>>>    drivers/net/mvpp2.c                         |  4 ++--
>>>    drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
>>>    drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
>>>    drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
>>>    drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
>>>    drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
>>>    drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
>>>    drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
>>>    drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
>>>    drivers/power/regulator/Kconfig             |  2 +-
>>>    include/dm/device-internal.h                |  4 ++--
>>>    include/power/regulator.h                   |  2 +-
>>>    20 files changed, 46 insertions(+), 49 deletions(-)
>>>
>>> Applied to u-boot-dm, thanks!
>>>
>>
>>
>> Hi Simon,
>>
>> I bisected the tree and this commit looks to break
>> sama5d4_xplained_mmc_defconfig :
>>
>> <debug_uart>
>> No serial driver found
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Could not initialize timer (err -19)
>>
>> Booting u-boot fails when adding this commit.
>>
>> Could you please help or let me know how I can fix it ?
> 
> I suspect the problem could be in the changes to
> drivers/clk/at91/compat.c although I cannot see why
> 
> You could try reverting that change, and just using offset_to_ofnode()
> in the device_bind_driver_to_node() call. I actually intended to do
> that at the time due to the risk, but somehow I missed this one.
> 
> OTOH it would be good to move the code to livetree and stop using fdt offsets.
> 
> Regards,
> Simon
> 

I reverted the changes in compat.c and indeed now it boots correctly.

I tried to do the following change on top of your code as you suggested 
but it does not help:


--- a/drivers/clk/at91/compat.c
+++ b/drivers/clk/at91/compat.c
@@ -67,7 +67,7 @@ int at91_clk_sub_device_bind(struct udevice *dev, 
const char *drv_name)
         bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
         const char *name;
         int ret;
-
+       int offset = dev_of_offset(dev);
         ofnode_for_each_subnode(node, parent) {
                 if (pre_reloc_only && !ofnode_pre_reloc(node))
                         continue;
@@ -84,7 +84,7 @@ int at91_clk_sub_device_bind(struct udevice *dev, 
const char *drv_name)
                 name = ofnode_get_name(node);
                 if (!name)
                         return -EINVAL;
-               ret = device_bind_driver_to_node(dev, drv_name, name, node,
+               ret = device_bind_driver_to_node(dev, drv_name, name, 
offset_to_ofnode(offset),
                                                  NULL);
                 if (ret)
                         return ret;


I have a feeling the 'for loop' for the subnodes misses an essential 
driver and thus it fails booting

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

* [PATCH 04/11] dm: Remove uses of device_bind_offset()
  2021-02-01  8:13         ` Eugen.Hristev
@ 2021-02-01 12:02           ` Simon Glass
  -1 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2021-02-01 12:02 UTC (permalink / raw)
  To: u-boot

Hi Eugen,

On Mon, 1 Feb 2021 at 01:13, <Eugen.Hristev@microchip.com> wrote:
>
> On 31.01.2021 17:37, Simon Glass wrote:
> > Hi Eugen,
> >
> > On Sun, 31 Jan 2021 at 02:18, <Eugen.Hristev@microchip.com> wrote:
> >>
> >> On 10.12.2020 02:26, Simon Glass wrote:
> >>> This function is not needed since the standard device_bind() can be used
> >>> instead.
> >>>
> >>> Signed-off-by: Simon Glass <sjg@chromium.org>
> >>> ---
> >>>
> >>>    arch/x86/cpu/apollolake/spl.c               |  2 +-
> >>>    drivers/clk/at91/compat.c                   | 20 ++++++++------------
> >>>    drivers/clk/clk.c                           |  2 +-
> >>>    drivers/gpio/mt7621_gpio.c                  |  4 ++--
> >>>    drivers/gpio/s5p_gpio.c                     |  4 ++--
> >>>    drivers/gpio/sunxi_gpio.c                   |  4 ++--
> >>>    drivers/gpio/tegra186_gpio.c                |  4 ++--
> >>>    drivers/gpio/tegra_gpio.c                   |  6 +++---
> >>>    drivers/net/mvpp2.c                         |  4 ++--
> >>>    drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
> >>>    drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
> >>>    drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
> >>>    drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
> >>>    drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
> >>>    drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
> >>>    drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
> >>>    drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
> >>>    drivers/power/regulator/Kconfig             |  2 +-
> >>>    include/dm/device-internal.h                |  4 ++--
> >>>    include/power/regulator.h                   |  2 +-
> >>>    20 files changed, 46 insertions(+), 49 deletions(-)
> >>>
> >>> Applied to u-boot-dm, thanks!
> >>>
> >>
> >>
> >> Hi Simon,
> >>
> >> I bisected the tree and this commit looks to break
> >> sama5d4_xplained_mmc_defconfig :
> >>
> >> <debug_uart>
> >> No serial driver found
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Booting u-boot fails when adding this commit.
> >>
> >> Could you please help or let me know how I can fix it ?
> >
> > I suspect the problem could be in the changes to
> > drivers/clk/at91/compat.c although I cannot see why
> >
> > You could try reverting that change, and just using offset_to_ofnode()
> > in the device_bind_driver_to_node() call. I actually intended to do
> > that at the time due to the risk, but somehow I missed this one.
> >
> > OTOH it would be good to move the code to livetree and stop using fdt offsets.
> >
> > Regards,
> > Simon
> >
>
> I reverted the changes in compat.c and indeed now it boots correctly.
>
> I tried to do the following change on top of your code as you suggested
> but it does not help:
>
>
> --- a/drivers/clk/at91/compat.c
> +++ b/drivers/clk/at91/compat.c
> @@ -67,7 +67,7 @@ int at91_clk_sub_device_bind(struct udevice *dev,
> const char *drv_name)
>          bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
>          const char *name;
>          int ret;
> -
> +       int offset = dev_of_offset(dev);
>          ofnode_for_each_subnode(node, parent) {
>                  if (pre_reloc_only && !ofnode_pre_reloc(node))
>                          continue;
> @@ -84,7 +84,7 @@ int at91_clk_sub_device_bind(struct udevice *dev,
> const char *drv_name)
>                  name = ofnode_get_name(node);
>                  if (!name)
>                          return -EINVAL;
> -               ret = device_bind_driver_to_node(dev, drv_name, name, node,
> +               ret = device_bind_driver_to_node(dev, drv_name, name,
> offset_to_ofnode(offset),
>                                                   NULL);
>                  if (ret)
>                          return ret;
>
>
> I have a feeling the 'for loop' for the subnodes misses an essential
> driver and thus it fails booting

Then I think reverting all the changes is the best thing in this file.
Can you send a patch?

Ultimately this should be figured out, but I cannot see what is wrong
and don't have that hardware to try. I do have an old SAM9260/9263 but
I'm not sure if that uses the same driver.

Regards,
Simon

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

* Re: [PATCH 04/11] dm: Remove uses of device_bind_offset()
@ 2021-02-01 12:02           ` Simon Glass
  0 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2021-02-01 12:02 UTC (permalink / raw)
  To: Eugen Hristev
  Cc: Anatolij Gustschin, Bin Meng, Claudiu Beznea, Gregory CLEMENT,
	Horatiu Vultur, Icenowy Zheng, Jaehoon Chung, Jagan Teki,
	Joe Hershberger, Lars Povlsen, Lukasz Majewski, Marek Vasut,
	Martin Fuzzey, Masahiro Yamada, Matthias Brugger, Neil Armstrong,
	Pavel Herrmann, Peng Fan, Robert Beckett, u-boot-amlogic,
	U-Boot Mailing List

Hi Eugen,

On Mon, 1 Feb 2021 at 01:13, <Eugen.Hristev@microchip.com> wrote:
>
> On 31.01.2021 17:37, Simon Glass wrote:
> > Hi Eugen,
> >
> > On Sun, 31 Jan 2021 at 02:18, <Eugen.Hristev@microchip.com> wrote:
> >>
> >> On 10.12.2020 02:26, Simon Glass wrote:
> >>> This function is not needed since the standard device_bind() can be used
> >>> instead.
> >>>
> >>> Signed-off-by: Simon Glass <sjg@chromium.org>
> >>> ---
> >>>
> >>>    arch/x86/cpu/apollolake/spl.c               |  2 +-
> >>>    drivers/clk/at91/compat.c                   | 20 ++++++++------------
> >>>    drivers/clk/clk.c                           |  2 +-
> >>>    drivers/gpio/mt7621_gpio.c                  |  4 ++--
> >>>    drivers/gpio/s5p_gpio.c                     |  4 ++--
> >>>    drivers/gpio/sunxi_gpio.c                   |  4 ++--
> >>>    drivers/gpio/tegra186_gpio.c                |  4 ++--
> >>>    drivers/gpio/tegra_gpio.c                   |  6 +++---
> >>>    drivers/net/mvpp2.c                         |  4 ++--
> >>>    drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
> >>>    drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
> >>>    drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
> >>>    drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
> >>>    drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
> >>>    drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
> >>>    drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
> >>>    drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
> >>>    drivers/power/regulator/Kconfig             |  2 +-
> >>>    include/dm/device-internal.h                |  4 ++--
> >>>    include/power/regulator.h                   |  2 +-
> >>>    20 files changed, 46 insertions(+), 49 deletions(-)
> >>>
> >>> Applied to u-boot-dm, thanks!
> >>>
> >>
> >>
> >> Hi Simon,
> >>
> >> I bisected the tree and this commit looks to break
> >> sama5d4_xplained_mmc_defconfig :
> >>
> >> <debug_uart>
> >> No serial driver found
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Could not initialize timer (err -19)
> >>
> >> Booting u-boot fails when adding this commit.
> >>
> >> Could you please help or let me know how I can fix it ?
> >
> > I suspect the problem could be in the changes to
> > drivers/clk/at91/compat.c although I cannot see why
> >
> > You could try reverting that change, and just using offset_to_ofnode()
> > in the device_bind_driver_to_node() call. I actually intended to do
> > that at the time due to the risk, but somehow I missed this one.
> >
> > OTOH it would be good to move the code to livetree and stop using fdt offsets.
> >
> > Regards,
> > Simon
> >
>
> I reverted the changes in compat.c and indeed now it boots correctly.
>
> I tried to do the following change on top of your code as you suggested
> but it does not help:
>
>
> --- a/drivers/clk/at91/compat.c
> +++ b/drivers/clk/at91/compat.c
> @@ -67,7 +67,7 @@ int at91_clk_sub_device_bind(struct udevice *dev,
> const char *drv_name)
>          bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
>          const char *name;
>          int ret;
> -
> +       int offset = dev_of_offset(dev);
>          ofnode_for_each_subnode(node, parent) {
>                  if (pre_reloc_only && !ofnode_pre_reloc(node))
>                          continue;
> @@ -84,7 +84,7 @@ int at91_clk_sub_device_bind(struct udevice *dev,
> const char *drv_name)
>                  name = ofnode_get_name(node);
>                  if (!name)
>                          return -EINVAL;
> -               ret = device_bind_driver_to_node(dev, drv_name, name, node,
> +               ret = device_bind_driver_to_node(dev, drv_name, name,
> offset_to_ofnode(offset),
>                                                   NULL);
>                  if (ret)
>                          return ret;
>
>
> I have a feeling the 'for loop' for the subnodes misses an essential
> driver and thus it fails booting

Then I think reverting all the changes is the best thing in this file.
Can you send a patch?

Ultimately this should be figured out, but I cannot see what is wrong
and don't have that hardware to try. I do have an old SAM9260/9263 but
I'm not sure if that uses the same driver.

Regards,
Simon

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

* [PATCH 04/11] dm: Remove uses of device_bind_offset()
  2021-02-01 12:02           ` Simon Glass
  (?)
@ 2021-02-01 12:14           ` Eugen.Hristev at microchip.com
  -1 siblings, 0 replies; 35+ messages in thread
From: Eugen.Hristev at microchip.com @ 2021-02-01 12:14 UTC (permalink / raw)
  To: u-boot

On 01.02.2021 14:02, Simon Glass wrote:
> Hi Eugen,
> 
> On Mon, 1 Feb 2021 at 01:13, <Eugen.Hristev@microchip.com> wrote:
>>
>> On 31.01.2021 17:37, Simon Glass wrote:
>>> Hi Eugen,
>>>
>>> On Sun, 31 Jan 2021 at 02:18, <Eugen.Hristev@microchip.com> wrote:
>>>>
>>>> On 10.12.2020 02:26, Simon Glass wrote:
>>>>> This function is not needed since the standard device_bind() can be used
>>>>> instead.
>>>>>
>>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>>>> ---
>>>>>
>>>>>     arch/x86/cpu/apollolake/spl.c               |  2 +-
>>>>>     drivers/clk/at91/compat.c                   | 20 ++++++++------------
>>>>>     drivers/clk/clk.c                           |  2 +-
>>>>>     drivers/gpio/mt7621_gpio.c                  |  4 ++--
>>>>>     drivers/gpio/s5p_gpio.c                     |  4 ++--
>>>>>     drivers/gpio/sunxi_gpio.c                   |  4 ++--
>>>>>     drivers/gpio/tegra186_gpio.c                |  4 ++--
>>>>>     drivers/gpio/tegra_gpio.c                   |  6 +++---
>>>>>     drivers/net/mvpp2.c                         |  4 ++--
>>>>>     drivers/pinctrl/broadcom/pinctrl-bcm283x.c  |  5 ++---
>>>>>     drivers/pinctrl/meson/pinctrl-meson.c       |  4 +++-
>>>>>     drivers/pinctrl/mscc/pinctrl-jr2.c          |  4 ++--
>>>>>     drivers/pinctrl/mscc/pinctrl-luton.c        |  4 ++--
>>>>>     drivers/pinctrl/mscc/pinctrl-ocelot.c       |  4 ++--
>>>>>     drivers/pinctrl/mscc/pinctrl-serval.c       |  4 ++--
>>>>>     drivers/pinctrl/mscc/pinctrl-servalt.c      |  4 ++--
>>>>>     drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |  8 ++++----
>>>>>     drivers/power/regulator/Kconfig             |  2 +-
>>>>>     include/dm/device-internal.h                |  4 ++--
>>>>>     include/power/regulator.h                   |  2 +-
>>>>>     20 files changed, 46 insertions(+), 49 deletions(-)
>>>>>
>>>>> Applied to u-boot-dm, thanks!
>>>>>
>>>>
>>>>
>>>> Hi Simon,
>>>>
>>>> I bisected the tree and this commit looks to break
>>>> sama5d4_xplained_mmc_defconfig :
>>>>
>>>> <debug_uart>
>>>> No serial driver found
>>>> Could not initialize timer (err -19)
>>>>
>>>> Could not initialize timer (err -19)
>>>>
>>>> Could not initialize timer (err -19)
>>>>
>>>> Could not initialize timer (err -19)
>>>>
>>>> Could not initialize timer (err -19)
>>>>
>>>> Could not initialize timer (err -19)
>>>>
>>>> Could not initialize timer (err -19)
>>>>
>>>> Could not initialize timer (err -19)
>>>>
>>>> Could not initialize timer (err -19)
>>>>
>>>> Could not initialize timer (err -19)
>>>>
>>>> Booting u-boot fails when adding this commit.
>>>>
>>>> Could you please help or let me know how I can fix it ?
>>>
>>> I suspect the problem could be in the changes to
>>> drivers/clk/at91/compat.c although I cannot see why
>>>
>>> You could try reverting that change, and just using offset_to_ofnode()
>>> in the device_bind_driver_to_node() call. I actually intended to do
>>> that at the time due to the risk, but somehow I missed this one.
>>>
>>> OTOH it would be good to move the code to livetree and stop using fdt offsets.
>>>
>>> Regards,
>>> Simon
>>>
>>
>> I reverted the changes in compat.c and indeed now it boots correctly.
>>
>> I tried to do the following change on top of your code as you suggested
>> but it does not help:
>>
>>
>> --- a/drivers/clk/at91/compat.c
>> +++ b/drivers/clk/at91/compat.c
>> @@ -67,7 +67,7 @@ int at91_clk_sub_device_bind(struct udevice *dev,
>> const char *drv_name)
>>           bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
>>           const char *name;
>>           int ret;
>> -
>> +       int offset = dev_of_offset(dev);
>>           ofnode_for_each_subnode(node, parent) {
>>                   if (pre_reloc_only && !ofnode_pre_reloc(node))
>>                           continue;
>> @@ -84,7 +84,7 @@ int at91_clk_sub_device_bind(struct udevice *dev,
>> const char *drv_name)
>>                   name = ofnode_get_name(node);
>>                   if (!name)
>>                           return -EINVAL;
>> -               ret = device_bind_driver_to_node(dev, drv_name, name, node,
>> +               ret = device_bind_driver_to_node(dev, drv_name, name,
>> offset_to_ofnode(offset),
>>                                                    NULL);
>>                   if (ret)
>>                           return ret;
>>
>>
>> I have a feeling the 'for loop' for the subnodes misses an essential
>> driver and thus it fails booting
> 
> Then I think reverting all the changes is the best thing in this file.
> Can you send a patch?
> 
> Ultimately this should be figured out, but I cannot see what is wrong
> and don't have that hardware to try. I do have an old SAM9260/9263 but
> I'm not sure if that uses the same driver.
> 
> Regards,
> Simon
> 

I can do that, but if you have any hunches, I can test patches for you.

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

end of thread, other threads:[~2021-02-01 12:14 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-29  0:49 [PATCH 00/11] dm: Simplify livetree handling Simon Glass
2020-11-29  0:50 ` [PATCH 01/11] dm: core: Rename device_bind() to device_bind_offset() Simon Glass
2020-11-29  0:50 ` [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind() Simon Glass
2020-11-29  0:50 ` [PATCH 03/11] dm: core: Add a livetree function to check node status Simon Glass
2020-11-29  0:50 ` [PATCH 04/11] dm: Remove uses of device_bind_offset() Simon Glass
2020-11-29  0:50 ` [PATCH 05/11] dm: Drop uses of dev_set_of_offset() Simon Glass
2020-11-29  0:50 ` [PATCH 06/11] dm: core: Drop dev_set_of_offset() Simon Glass
2020-11-29  0:50 ` [PATCH 07/11] dm: core: Drop device_bind_offset() Simon Glass
2020-11-29  0:50 ` [PATCH 08/11] dm: core: Add an ofnode function to get the devicetree root Simon Glass
2020-11-29  0:50 ` [PATCH 09/11] dm: core: Combine the flattree and livetree binding code Simon Glass
2020-11-29  0:50 ` [PATCH 10/11] dm: core: Drop unused parameter from dm_scan_fdt() Simon Glass
2020-11-29  0:50 ` [PATCH 11/11] dm: core: Drop unused parameter from dm_extended_scan_fdt() Simon Glass
2020-12-10  0:26 ` Simon Glass
2020-12-10  0:26 ` [PATCH 10/11] dm: core: Drop unused parameter from dm_scan_fdt() Simon Glass
2020-12-10  0:26 ` [PATCH 09/11] dm: core: Combine the flattree and livetree binding code Simon Glass
2020-12-10  0:26 ` [PATCH 08/11] dm: core: Add an ofnode function to get the devicetree root Simon Glass
2020-12-10  0:26 ` [PATCH 07/11] dm: core: Drop device_bind_offset() Simon Glass
2020-12-10  0:26 ` [PATCH 06/11] dm: core: Drop dev_set_of_offset() Simon Glass
2020-12-10  0:26 ` [PATCH 05/11] dm: Drop uses of dev_set_of_offset() Simon Glass
2020-12-10  0:26   ` Simon Glass
2020-12-10  0:26 ` [PATCH 04/11] dm: Remove uses of device_bind_offset() Simon Glass
2020-12-10  0:26   ` Simon Glass
2021-01-31  9:18   ` Eugen.Hristev at microchip.com
2021-01-31  9:18     ` Eugen.Hristev
2021-01-31 15:37     ` Simon Glass
2021-01-31 15:37       ` Simon Glass
2021-02-01  8:13       ` Eugen.Hristev at microchip.com
2021-02-01  8:13         ` Eugen.Hristev
2021-02-01 12:02         ` Simon Glass
2021-02-01 12:02           ` Simon Glass
2021-02-01 12:14           ` Eugen.Hristev at microchip.com
2020-12-10  0:26 ` [PATCH 03/11] dm: core: Add a livetree function to check node status Simon Glass
2020-12-10  0:26 ` [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind() Simon Glass
2020-12-10  0:26 ` [PATCH 01/11] dm: core: Rename device_bind() to device_bind_offset() Simon Glass
2020-12-10  0:26   ` 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.