All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] usb: Covert to support Live DT
@ 2020-03-04  0:59 ` Kever Yang
  0 siblings, 0 replies; 14+ messages in thread
From: Kever Yang @ 2020-03-04  0:59 UTC (permalink / raw)
  To: u-boot


This patch set convert to use APIs leading with dev_ or ofnode_ which
supports live DT instead of fdt_ or fdtdec or devfdt_.
Two functions update there parameter from offset to ofnode:
- usb_get_maximum_speed()
- usb_get_dr_mode()

For V3 update:
Squesh patch 3rd~9th/9 into one patch because the ofnode_to_offset(node) is
not work with the livetree, so we have to convert the api to support
livetree and its related function at the same time.

For V2 update:
Drop below patch after include ofnode.h in otg.h:
[PATCH 09/10] usb: Use ofnode as usb_get_dr_mode() parameter


Changes in v3:
- Squesh the 3rd~9th into one patch.

Kever Yang (3):
  usb: dwc3-of-simple: Drop redundant inclding header file
  usb: ehci-msm: Use dev interface to get device address
  usb: Migrate to support live DT for some driver

 drivers/usb/cdns3/core.c           | 15 ++++++---------
 drivers/usb/cdns3/gadget.c         |  2 +-
 drivers/usb/common/common.c        | 12 +++++-------
 drivers/usb/dwc3/dwc3-generic.c    | 16 +++++++---------
 drivers/usb/dwc3/dwc3-meson-g12a.c |  2 +-
 drivers/usb/gadget/dwc2_udc_otg.c  |  5 ++---
 drivers/usb/host/dwc3-of-simple.c  |  1 -
 drivers/usb/host/dwc3-sti-glue.c   | 20 +++++++-------------
 drivers/usb/host/ehci-msm.c        |  4 +---
 drivers/usb/host/ehci-mx6.c        |  2 +-
 drivers/usb/host/xhci-dwc3.c       |  3 +--
 drivers/usb/musb-new/ti-musb.c     | 12 +++++-------
 include/linux/usb/otg.h            | 10 ++++++----
 13 files changed, 43 insertions(+), 61 deletions(-)

-- 
2.17.1

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

* [PATCH v3 0/3] usb: Covert to support Live DT
@ 2020-03-04  0:59 ` Kever Yang
  0 siblings, 0 replies; 14+ messages in thread
From: Kever Yang @ 2020-03-04  0:59 UTC (permalink / raw)
  To: u-boot
  Cc: frank.wang, Kever Yang, Adam Ford, Anatolij Gustschin, Bin Meng,
	Daniel Schwierzeck, Fabio Estevam, Igor Opaniuk,
	Jean-Jacques Hiblot, Lukasz Majewski, Marek Vasut, Mark Kettenis,
	Neil Armstrong, Ramon Fried, Simon Glass, Vignesh Raghavendra,
	Ye Li, u-boot-amlogic


This patch set convert to use APIs leading with dev_ or ofnode_ which
supports live DT instead of fdt_ or fdtdec or devfdt_.
Two functions update there parameter from offset to ofnode:
- usb_get_maximum_speed()
- usb_get_dr_mode()

For V3 update:
Squesh patch 3rd~9th/9 into one patch because the ofnode_to_offset(node) is
not work with the livetree, so we have to convert the api to support
livetree and its related function at the same time.

For V2 update:
Drop below patch after include ofnode.h in otg.h:
[PATCH 09/10] usb: Use ofnode as usb_get_dr_mode() parameter


Changes in v3:
- Squesh the 3rd~9th into one patch.

Kever Yang (3):
  usb: dwc3-of-simple: Drop redundant inclding header file
  usb: ehci-msm: Use dev interface to get device address
  usb: Migrate to support live DT for some driver

 drivers/usb/cdns3/core.c           | 15 ++++++---------
 drivers/usb/cdns3/gadget.c         |  2 +-
 drivers/usb/common/common.c        | 12 +++++-------
 drivers/usb/dwc3/dwc3-generic.c    | 16 +++++++---------
 drivers/usb/dwc3/dwc3-meson-g12a.c |  2 +-
 drivers/usb/gadget/dwc2_udc_otg.c  |  5 ++---
 drivers/usb/host/dwc3-of-simple.c  |  1 -
 drivers/usb/host/dwc3-sti-glue.c   | 20 +++++++-------------
 drivers/usb/host/ehci-msm.c        |  4 +---
 drivers/usb/host/ehci-mx6.c        |  2 +-
 drivers/usb/host/xhci-dwc3.c       |  3 +--
 drivers/usb/musb-new/ti-musb.c     | 12 +++++-------
 include/linux/usb/otg.h            | 10 ++++++----
 13 files changed, 43 insertions(+), 61 deletions(-)

-- 
2.17.1




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

* [PATCH v3 1/3] usb: dwc3-of-simple: Drop redundant inclding header file
  2020-03-04  0:59 ` Kever Yang
  (?)
@ 2020-03-04  0:59 ` Kever Yang
  2020-03-04 12:23   ` Marek Vasut
  -1 siblings, 1 reply; 14+ messages in thread
From: Kever Yang @ 2020-03-04  0:59 UTC (permalink / raw)
  To: u-boot

The fdtdec.h is no use in this file, remove the include code.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

Changes in v3: None

 drivers/usb/host/dwc3-of-simple.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/host/dwc3-of-simple.c b/drivers/usb/host/dwc3-of-simple.c
index 45df614b09..e4abc6f3b9 100644
--- a/drivers/usb/host/dwc3-of-simple.c
+++ b/drivers/usb/host/dwc3-of-simple.c
@@ -12,7 +12,6 @@
 
 #include <common.h>
 #include <dm.h>
-#include <fdtdec.h>
 #include <reset.h>
 #include <clk.h>
 
-- 
2.17.1

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

* [PATCH v3 2/3] usb: ehci-msm: Use dev interface to get device address
  2020-03-04  0:59 ` Kever Yang
  (?)
  (?)
@ 2020-03-04  0:59 ` Kever Yang
  2020-03-04 17:51   ` Simon Glass
  -1 siblings, 1 reply; 14+ messages in thread
From: Kever Yang @ 2020-03-04  0:59 UTC (permalink / raw)
  To: u-boot

Use dev_read_addr_ptr() instead of devfdt_get_addr() so that we can support
live DT.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
---

Changes in v3: None

 drivers/usb/host/ehci-msm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 5c257ccf4d..dd92808ff7 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -10,8 +10,6 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
-#include <fdtdec.h>
-#include <linux/libfdt.h>
 #include <usb.h>
 #include <usb/ehci-ci.h>
 #include <usb/ulpi.h>
@@ -108,7 +106,7 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
 	struct msm_ehci_priv *priv = dev_get_priv(dev);
 
 	priv->ulpi_vp.port_num = 0;
-	priv->ehci = (void *)devfdt_get_addr(dev);
+	priv->ehci = dev_read_addr_ptr(dev);
 
 	if (priv->ehci == (void *)FDT_ADDR_T_NONE)
 		return -EINVAL;
-- 
2.17.1

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

* [PATCH v3 3/3] usb: Migrate to support live DT for some driver
  2020-03-04  0:59 ` Kever Yang
@ 2020-03-04  0:59   ` Kever Yang
  -1 siblings, 0 replies; 14+ messages in thread
From: Kever Yang @ 2020-03-04  0:59 UTC (permalink / raw)
  To: u-boot

Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT.
This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use
ofnode as parameter instead of fdt offset. And all the drivers who use
these APIs update to use live dt APIs at the same time.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

Changes in v3:
- Squesh the 3rd~9th into one patch.

 drivers/usb/cdns3/core.c           | 15 ++++++---------
 drivers/usb/cdns3/gadget.c         |  2 +-
 drivers/usb/common/common.c        | 12 +++++-------
 drivers/usb/dwc3/dwc3-generic.c    | 16 +++++++---------
 drivers/usb/dwc3/dwc3-meson-g12a.c |  2 +-
 drivers/usb/gadget/dwc2_udc_otg.c  |  5 ++---
 drivers/usb/host/dwc3-sti-glue.c   | 20 +++++++-------------
 drivers/usb/host/ehci-mx6.c        |  2 +-
 drivers/usb/host/xhci-dwc3.c       |  3 +--
 drivers/usb/musb-new/ti-musb.c     | 12 +++++-------
 include/linux/usb/otg.h            | 10 ++++++----
 11 files changed, 42 insertions(+), 57 deletions(-)

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index f947e6983c..ce846488a8 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -108,7 +108,7 @@ static int cdns3_core_init_role(struct cdns3 *cdns)
 	enum usb_dr_mode dr_mode;
 	int ret = 0;
 
-	dr_mode = usb_get_dr_mode(dev_of_offset(dev));
+	dr_mode = usb_get_dr_mode(dev->node);
 	cdns->role = USB_ROLE_NONE;
 
 	/*
@@ -384,22 +384,20 @@ static const struct udevice_id cdns3_ids[] = {
 
 int cdns3_bind(struct udevice *parent)
 {
-	int from = dev_of_offset(parent);
-	const void *fdt = gd->fdt_blob;
 	enum usb_dr_mode dr_mode;
 	struct udevice *dev;
 	const char *driver;
 	const char *name;
-	int node;
+	ofnode node;
 	int ret;
 
-	node = fdt_node_offset_by_compatible(fdt, from, "cdns,usb3");
-	if (node < 0) {
+	node = ofnode_by_compatible(parent->node, "cdns,usb3");
+	if (!ofnode_valid(node)) {
 		ret = -ENODEV;
 		goto fail;
 	}
 
-	name = fdt_get_name(fdt, node, NULL);
+	name = ofnode_get_name(node);
 	dr_mode = usb_get_dr_mode(node);
 
 	switch (dr_mode) {
@@ -422,8 +420,7 @@ int cdns3_bind(struct udevice *parent)
 		goto fail;
 	};
 
-	ret = device_bind_driver_to_node(parent, driver, name,
-					 offset_to_ofnode(node), &dev);
+	ret = device_bind_driver_to_node(parent, driver, name, node, &dev);
 	if (ret) {
 		printf("%s: not able to bind usb device mode\n",
 		       __func__);
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 22e90a5717..8ebe64e8b3 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -2579,7 +2579,7 @@ static int cdns3_gadget_start(struct cdns3 *cdns)
 	if (!priv_dev->onchip_buffers)
 		priv_dev->onchip_buffers = 256;
 
-	max_speed = usb_get_maximum_speed(dev_of_offset(cdns->dev));
+	max_speed = usb_get_maximum_speed(dev_ofnode(cdns->dev));
 
 	/* Check the maximum_speed parameter */
 	switch (max_speed) {
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c
index a55def5aba..0db281b970 100644
--- a/drivers/usb/common/common.c
+++ b/drivers/usb/common/common.c
@@ -7,7 +7,7 @@
  */
 
 #include <common.h>
-#include <linux/libfdt.h>
+#include <dm.h>
 #include <linux/usb/otg.h>
 #include <linux/usb/ch9.h>
 
@@ -20,13 +20,12 @@ static const char *const usb_dr_modes[] = {
 	[USB_DR_MODE_OTG]		= "otg",
 };
 
-enum usb_dr_mode usb_get_dr_mode(int node)
+enum usb_dr_mode usb_get_dr_mode(ofnode node)
 {
-	const void *fdt = gd->fdt_blob;
 	const char *dr_mode;
 	int i;
 
-	dr_mode = fdt_getprop(fdt, node, "dr_mode", NULL);
+	dr_mode = ofnode_read_string(node, "dr_mode");
 	if (!dr_mode) {
 		pr_err("usb dr_mode not found\n");
 		return USB_DR_MODE_UNKNOWN;
@@ -48,13 +47,12 @@ static const char *const speed_names[] = {
 	[USB_SPEED_SUPER] = "super-speed",
 };
 
-enum usb_device_speed usb_get_maximum_speed(int node)
+enum usb_device_speed usb_get_maximum_speed(ofnode node)
 {
-	const void *fdt = gd->fdt_blob;
 	const char *max_speed;
 	int i;
 
-	max_speed = fdt_getprop(fdt, node, "maximum-speed", NULL);
+	max_speed = ofnode_read_string(node, "maximum-speed");
 	if (!max_speed) {
 		pr_err("usb maximum-speed not found\n");
 		return USB_SPEED_UNKNOWN;
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 3e116b2c5c..febcfc0f54 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -88,9 +88,9 @@ static int dwc3_generic_remove(struct udevice *dev,
 static int dwc3_generic_ofdata_to_platdata(struct udevice *dev)
 {
 	struct dwc3_generic_plat *plat = dev_get_platdata(dev);
-	int node = dev_of_offset(dev);
+	ofnode node = dev->node;
 
-	plat->base = devfdt_get_addr(dev);
+	plat->base = dev_read_addr(dev);
 
 	plat->maximum_speed = usb_get_maximum_speed(node);
 	if (plat->maximum_speed == USB_SPEED_UNKNOWN) {
@@ -284,13 +284,11 @@ struct dwc3_glue_ops ti_ops = {
 
 static int dwc3_glue_bind(struct udevice *parent)
 {
-	const void *fdt = gd->fdt_blob;
-	int node;
+	ofnode node;
 	int ret;
 
-	for (node = fdt_first_subnode(fdt, dev_of_offset(parent)); node > 0;
-	     node = fdt_next_subnode(fdt, node)) {
-		const char *name = fdt_get_name(fdt, node, NULL);
+	ofnode_for_each_subnode(node, parent->node) {
+		const char *name = ofnode_get_name(node);
 		enum usb_dr_mode dr_mode;
 		struct udevice *dev;
 		const char *driver = NULL;
@@ -322,7 +320,7 @@ static int dwc3_glue_bind(struct udevice *parent)
 			continue;
 
 		ret = device_bind_driver_to_node(parent, driver, name,
-						 offset_to_ofnode(node), &dev);
+						 node, &dev);
 		if (ret) {
 			debug("%s: not able to bind usb device mode\n",
 			      __func__);
@@ -400,7 +398,7 @@ static int dwc3_glue_probe(struct udevice *dev)
 	while (child) {
 		enum usb_dr_mode dr_mode;
 
-		dr_mode = usb_get_dr_mode(dev_of_offset(child));
+		dr_mode = usb_get_dr_mode(child->node);
 		device_find_next_child(&child);
 		if (ops && ops->select_dr_mode)
 			ops->select_dr_mode(dev, index, dr_mode);
diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
index 832bcd70ff..d4453f8784 100644
--- a/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -393,7 +393,7 @@ static int dwc3_meson_g12a_probe(struct udevice *dev)
 	}
 #endif
 
-	priv->otg_mode = usb_get_dr_mode(dev_of_offset(dev));
+	priv->otg_mode = usb_get_dr_mode(dev->node);
 
 	ret = dwc3_meson_g12a_usb_init(priv);
 	if (ret)
diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
index 496abf38e7..b9c814cf73 100644
--- a/drivers/usb/gadget/dwc2_udc_otg.c
+++ b/drivers/usb/gadget/dwc2_udc_otg.c
@@ -1039,13 +1039,12 @@ void dwc2_phy_shutdown(struct udevice *dev, struct phy *usb_phys, int num_phys)
 static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev)
 {
 	struct dwc2_plat_otg_data *platdata = dev_get_platdata(dev);
-	int node = dev_of_offset(dev);
 	ulong drvdata;
 	void (*set_params)(struct dwc2_plat_otg_data *data);
 	int ret;
 
-	if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL &&
-	    usb_get_dr_mode(node) != USB_DR_MODE_OTG) {
+	if (usb_get_dr_mode(dev->node) != USB_DR_MODE_PERIPHERAL &&
+	    usb_get_dr_mode(dev->node) != USB_DR_MODE_OTG) {
 		dev_dbg(dev, "Invalid mode\n");
 		return -ENODEV;
 	}
diff --git a/drivers/usb/host/dwc3-sti-glue.c b/drivers/usb/host/dwc3-sti-glue.c
index ad7cf6e6b5..c99a1985cc 100644
--- a/drivers/usb/host/dwc3-sti-glue.c
+++ b/drivers/usb/host/dwc3-sti-glue.c
@@ -10,8 +10,6 @@
 #include <asm/io.h>
 #include <dm.h>
 #include <errno.h>
-#include <fdtdec.h>
-#include <linux/libfdt.h>
 #include <dm/lists.h>
 #include <regmap.h>
 #include <reset-uclass.h>
@@ -109,8 +107,7 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
 	int ret;
 	u32 reg[4];
 
-	ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(dev),
-				   "reg", reg, ARRAY_SIZE(reg));
+	ret = ofnode_read_u32_array(dev->node, "reg", reg, ARRAY_SIZE(reg));
 	if (ret) {
 		pr_err("unable to find st,stih407-dwc3 reg property(%d)\n", ret);
 		return ret;
@@ -153,18 +150,15 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
 static int sti_dwc3_glue_bind(struct udevice *dev)
 {
 	struct sti_dwc3_glue_platdata *plat = dev_get_platdata(dev);
-	int dwc3_node;
+	ofnode node, dwc3_node;
 
-	/* check if one subnode is present */
-	dwc3_node = fdt_first_subnode(gd->fdt_blob, dev_of_offset(dev));
-	if (dwc3_node <= 0) {
-		pr_err("Can't find subnode for %s\n", dev->name);
-		return -ENODEV;
+	/* Find snps,dwc3 node from subnode */
+	ofnode_for_each_subnode(node, dev->node) {
+		if (ofnode_device_is_compatible(node, "snps,dwc3"))
+			dwc3_node = node;
 	}
 
-	/* check if the subnode compatible string is the dwc3 one*/
-	if (fdt_node_check_compatible(gd->fdt_blob, dwc3_node,
-				      "snps,dwc3") != 0) {
+	if (!ofnode_valid(node)) {
 		pr_err("Can't find dwc3 subnode for %s\n", dev->name);
 		return -ENODEV;
 	}
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 1993ad620a..f2ceb51310 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -513,7 +513,7 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
 	struct usb_platdata *plat = dev_get_platdata(dev);
 	enum usb_dr_mode dr_mode;
 
-	dr_mode = usb_get_dr_mode(dev_of_offset(dev));
+	dr_mode = usb_get_dr_mode(dev->node);
 
 	switch (dr_mode) {
 	case USB_DR_MODE_HOST:
diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c
index c1c681ca6c..9fcfa39d4b 100644
--- a/drivers/usb/host/xhci-dwc3.c
+++ b/drivers/usb/host/xhci-dwc3.c
@@ -9,7 +9,6 @@
 
 #include <common.h>
 #include <dm.h>
-#include <fdtdec.h>
 #include <generic-phy.h>
 #include <usb.h>
 #include <dwc3-uboot.h>
@@ -155,7 +154,7 @@ static int xhci_dwc3_probe(struct udevice *dev)
 
 	writel(reg, &dwc3_reg->g_usb2phycfg[0]);
 
-	dr_mode = usb_get_dr_mode(dev_of_offset(dev));
+	dr_mode = usb_get_dr_mode(dev->node);
 	if (dr_mode == USB_DR_MODE_UNKNOWN)
 		/* by default set dual role mode to HOST */
 		dr_mode = USB_DR_MODE_HOST;
diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c
index 00759f3e83..608facefa3 100644
--- a/drivers/usb/musb-new/ti-musb.c
+++ b/drivers/usb/musb-new/ti-musb.c
@@ -285,14 +285,12 @@ U_BOOT_DRIVER(ti_musb_peripheral) = {
 #if CONFIG_IS_ENABLED(OF_CONTROL)
 static int ti_musb_wrapper_bind(struct udevice *parent)
 {
-	const void *fdt = gd->fdt_blob;
-	int node;
+	ofnode node;
 	int ret;
 
-	for (node = fdt_first_subnode(fdt, dev_of_offset(parent)); node > 0;
-	     node = fdt_next_subnode(fdt, node)) {
+	ofnode_for_each_subnode(node, parent->node) {
 		struct udevice *dev;
-		const char *name = fdt_get_name(fdt, node, NULL);
+		const char *name = ofnode_get_name(node);
 		enum usb_dr_mode dr_mode;
 		struct driver *drv;
 
@@ -306,7 +304,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
 			ret = device_bind_driver_to_node(parent,
 							 "ti-musb-peripheral",
 							 name,
-							 offset_to_ofnode(node),
+							 node,
 							 &dev);
 			if (ret)
 				pr_err("musb - not able to bind usb peripheral node\n");
@@ -316,7 +314,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
 			ret = device_bind_driver_to_node(parent,
 							 "ti-musb-host",
 							 name,
-							 offset_to_ofnode(node),
+							 node,
 							 &dev);
 			if (ret)
 				pr_err("musb - not able to bind usb host node\n");
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index d2604c5caf..c19b916be9 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -9,6 +9,8 @@
 #ifndef __LINUX_USB_OTG_H
 #define __LINUX_USB_OTG_H
 
+#include <dm/ofnode.h>
+
 enum usb_dr_mode {
 	USB_DR_MODE_UNKNOWN,
 	USB_DR_MODE_HOST,
@@ -18,20 +20,20 @@ enum usb_dr_mode {
 
 /**
  * usb_get_dr_mode() - Get dual role mode for given device
- * @node: Node offset to the given device
+ * @node: ofnode of the given device
  *
  * The function gets phy interface string from property 'dr_mode',
  * and returns the correspondig enum usb_dr_mode
  */
-enum usb_dr_mode usb_get_dr_mode(int node);
+enum usb_dr_mode usb_get_dr_mode(ofnode node);
 
 /**
  * usb_get_maximum_speed() - Get maximum speed for given device
- * @node: Node offset to the given device
+ * @node: ofnode of the given device
  *
  * The function gets phy interface string from property 'maximum-speed',
  * and returns the correspondig enum usb_device_speed
  */
-enum usb_device_speed usb_get_maximum_speed(int node);
+enum usb_device_speed usb_get_maximum_speed(ofnode node);
 
 #endif /* __LINUX_USB_OTG_H */
-- 
2.17.1

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

* [PATCH v3 3/3] usb: Migrate to support live DT for some driver
@ 2020-03-04  0:59   ` Kever Yang
  0 siblings, 0 replies; 14+ messages in thread
From: Kever Yang @ 2020-03-04  0:59 UTC (permalink / raw)
  To: u-boot
  Cc: frank.wang, Kever Yang, Adam Ford, Anatolij Gustschin, Bin Meng,
	Daniel Schwierzeck, Fabio Estevam, Igor Opaniuk,
	Jean-Jacques Hiblot, Lukasz Majewski, Marek Vasut,
	Neil Armstrong, Simon Glass, Vignesh Raghavendra, Ye Li,
	u-boot-amlogic

Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT.
This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use
ofnode as parameter instead of fdt offset. And all the drivers who use
these APIs update to use live dt APIs at the same time.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

Changes in v3:
- Squesh the 3rd~9th into one patch.

 drivers/usb/cdns3/core.c           | 15 ++++++---------
 drivers/usb/cdns3/gadget.c         |  2 +-
 drivers/usb/common/common.c        | 12 +++++-------
 drivers/usb/dwc3/dwc3-generic.c    | 16 +++++++---------
 drivers/usb/dwc3/dwc3-meson-g12a.c |  2 +-
 drivers/usb/gadget/dwc2_udc_otg.c  |  5 ++---
 drivers/usb/host/dwc3-sti-glue.c   | 20 +++++++-------------
 drivers/usb/host/ehci-mx6.c        |  2 +-
 drivers/usb/host/xhci-dwc3.c       |  3 +--
 drivers/usb/musb-new/ti-musb.c     | 12 +++++-------
 include/linux/usb/otg.h            | 10 ++++++----
 11 files changed, 42 insertions(+), 57 deletions(-)

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index f947e6983c..ce846488a8 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -108,7 +108,7 @@ static int cdns3_core_init_role(struct cdns3 *cdns)
 	enum usb_dr_mode dr_mode;
 	int ret = 0;
 
-	dr_mode = usb_get_dr_mode(dev_of_offset(dev));
+	dr_mode = usb_get_dr_mode(dev->node);
 	cdns->role = USB_ROLE_NONE;
 
 	/*
@@ -384,22 +384,20 @@ static const struct udevice_id cdns3_ids[] = {
 
 int cdns3_bind(struct udevice *parent)
 {
-	int from = dev_of_offset(parent);
-	const void *fdt = gd->fdt_blob;
 	enum usb_dr_mode dr_mode;
 	struct udevice *dev;
 	const char *driver;
 	const char *name;
-	int node;
+	ofnode node;
 	int ret;
 
-	node = fdt_node_offset_by_compatible(fdt, from, "cdns,usb3");
-	if (node < 0) {
+	node = ofnode_by_compatible(parent->node, "cdns,usb3");
+	if (!ofnode_valid(node)) {
 		ret = -ENODEV;
 		goto fail;
 	}
 
-	name = fdt_get_name(fdt, node, NULL);
+	name = ofnode_get_name(node);
 	dr_mode = usb_get_dr_mode(node);
 
 	switch (dr_mode) {
@@ -422,8 +420,7 @@ int cdns3_bind(struct udevice *parent)
 		goto fail;
 	};
 
-	ret = device_bind_driver_to_node(parent, driver, name,
-					 offset_to_ofnode(node), &dev);
+	ret = device_bind_driver_to_node(parent, driver, name, node, &dev);
 	if (ret) {
 		printf("%s: not able to bind usb device mode\n",
 		       __func__);
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 22e90a5717..8ebe64e8b3 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -2579,7 +2579,7 @@ static int cdns3_gadget_start(struct cdns3 *cdns)
 	if (!priv_dev->onchip_buffers)
 		priv_dev->onchip_buffers = 256;
 
-	max_speed = usb_get_maximum_speed(dev_of_offset(cdns->dev));
+	max_speed = usb_get_maximum_speed(dev_ofnode(cdns->dev));
 
 	/* Check the maximum_speed parameter */
 	switch (max_speed) {
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c
index a55def5aba..0db281b970 100644
--- a/drivers/usb/common/common.c
+++ b/drivers/usb/common/common.c
@@ -7,7 +7,7 @@
  */
 
 #include <common.h>
-#include <linux/libfdt.h>
+#include <dm.h>
 #include <linux/usb/otg.h>
 #include <linux/usb/ch9.h>
 
@@ -20,13 +20,12 @@ static const char *const usb_dr_modes[] = {
 	[USB_DR_MODE_OTG]		= "otg",
 };
 
-enum usb_dr_mode usb_get_dr_mode(int node)
+enum usb_dr_mode usb_get_dr_mode(ofnode node)
 {
-	const void *fdt = gd->fdt_blob;
 	const char *dr_mode;
 	int i;
 
-	dr_mode = fdt_getprop(fdt, node, "dr_mode", NULL);
+	dr_mode = ofnode_read_string(node, "dr_mode");
 	if (!dr_mode) {
 		pr_err("usb dr_mode not found\n");
 		return USB_DR_MODE_UNKNOWN;
@@ -48,13 +47,12 @@ static const char *const speed_names[] = {
 	[USB_SPEED_SUPER] = "super-speed",
 };
 
-enum usb_device_speed usb_get_maximum_speed(int node)
+enum usb_device_speed usb_get_maximum_speed(ofnode node)
 {
-	const void *fdt = gd->fdt_blob;
 	const char *max_speed;
 	int i;
 
-	max_speed = fdt_getprop(fdt, node, "maximum-speed", NULL);
+	max_speed = ofnode_read_string(node, "maximum-speed");
 	if (!max_speed) {
 		pr_err("usb maximum-speed not found\n");
 		return USB_SPEED_UNKNOWN;
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 3e116b2c5c..febcfc0f54 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -88,9 +88,9 @@ static int dwc3_generic_remove(struct udevice *dev,
 static int dwc3_generic_ofdata_to_platdata(struct udevice *dev)
 {
 	struct dwc3_generic_plat *plat = dev_get_platdata(dev);
-	int node = dev_of_offset(dev);
+	ofnode node = dev->node;
 
-	plat->base = devfdt_get_addr(dev);
+	plat->base = dev_read_addr(dev);
 
 	plat->maximum_speed = usb_get_maximum_speed(node);
 	if (plat->maximum_speed == USB_SPEED_UNKNOWN) {
@@ -284,13 +284,11 @@ struct dwc3_glue_ops ti_ops = {
 
 static int dwc3_glue_bind(struct udevice *parent)
 {
-	const void *fdt = gd->fdt_blob;
-	int node;
+	ofnode node;
 	int ret;
 
-	for (node = fdt_first_subnode(fdt, dev_of_offset(parent)); node > 0;
-	     node = fdt_next_subnode(fdt, node)) {
-		const char *name = fdt_get_name(fdt, node, NULL);
+	ofnode_for_each_subnode(node, parent->node) {
+		const char *name = ofnode_get_name(node);
 		enum usb_dr_mode dr_mode;
 		struct udevice *dev;
 		const char *driver = NULL;
@@ -322,7 +320,7 @@ static int dwc3_glue_bind(struct udevice *parent)
 			continue;
 
 		ret = device_bind_driver_to_node(parent, driver, name,
-						 offset_to_ofnode(node), &dev);
+						 node, &dev);
 		if (ret) {
 			debug("%s: not able to bind usb device mode\n",
 			      __func__);
@@ -400,7 +398,7 @@ static int dwc3_glue_probe(struct udevice *dev)
 	while (child) {
 		enum usb_dr_mode dr_mode;
 
-		dr_mode = usb_get_dr_mode(dev_of_offset(child));
+		dr_mode = usb_get_dr_mode(child->node);
 		device_find_next_child(&child);
 		if (ops && ops->select_dr_mode)
 			ops->select_dr_mode(dev, index, dr_mode);
diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
index 832bcd70ff..d4453f8784 100644
--- a/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -393,7 +393,7 @@ static int dwc3_meson_g12a_probe(struct udevice *dev)
 	}
 #endif
 
-	priv->otg_mode = usb_get_dr_mode(dev_of_offset(dev));
+	priv->otg_mode = usb_get_dr_mode(dev->node);
 
 	ret = dwc3_meson_g12a_usb_init(priv);
 	if (ret)
diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
index 496abf38e7..b9c814cf73 100644
--- a/drivers/usb/gadget/dwc2_udc_otg.c
+++ b/drivers/usb/gadget/dwc2_udc_otg.c
@@ -1039,13 +1039,12 @@ void dwc2_phy_shutdown(struct udevice *dev, struct phy *usb_phys, int num_phys)
 static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev)
 {
 	struct dwc2_plat_otg_data *platdata = dev_get_platdata(dev);
-	int node = dev_of_offset(dev);
 	ulong drvdata;
 	void (*set_params)(struct dwc2_plat_otg_data *data);
 	int ret;
 
-	if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL &&
-	    usb_get_dr_mode(node) != USB_DR_MODE_OTG) {
+	if (usb_get_dr_mode(dev->node) != USB_DR_MODE_PERIPHERAL &&
+	    usb_get_dr_mode(dev->node) != USB_DR_MODE_OTG) {
 		dev_dbg(dev, "Invalid mode\n");
 		return -ENODEV;
 	}
diff --git a/drivers/usb/host/dwc3-sti-glue.c b/drivers/usb/host/dwc3-sti-glue.c
index ad7cf6e6b5..c99a1985cc 100644
--- a/drivers/usb/host/dwc3-sti-glue.c
+++ b/drivers/usb/host/dwc3-sti-glue.c
@@ -10,8 +10,6 @@
 #include <asm/io.h>
 #include <dm.h>
 #include <errno.h>
-#include <fdtdec.h>
-#include <linux/libfdt.h>
 #include <dm/lists.h>
 #include <regmap.h>
 #include <reset-uclass.h>
@@ -109,8 +107,7 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
 	int ret;
 	u32 reg[4];
 
-	ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(dev),
-				   "reg", reg, ARRAY_SIZE(reg));
+	ret = ofnode_read_u32_array(dev->node, "reg", reg, ARRAY_SIZE(reg));
 	if (ret) {
 		pr_err("unable to find st,stih407-dwc3 reg property(%d)\n", ret);
 		return ret;
@@ -153,18 +150,15 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
 static int sti_dwc3_glue_bind(struct udevice *dev)
 {
 	struct sti_dwc3_glue_platdata *plat = dev_get_platdata(dev);
-	int dwc3_node;
+	ofnode node, dwc3_node;
 
-	/* check if one subnode is present */
-	dwc3_node = fdt_first_subnode(gd->fdt_blob, dev_of_offset(dev));
-	if (dwc3_node <= 0) {
-		pr_err("Can't find subnode for %s\n", dev->name);
-		return -ENODEV;
+	/* Find snps,dwc3 node from subnode */
+	ofnode_for_each_subnode(node, dev->node) {
+		if (ofnode_device_is_compatible(node, "snps,dwc3"))
+			dwc3_node = node;
 	}
 
-	/* check if the subnode compatible string is the dwc3 one*/
-	if (fdt_node_check_compatible(gd->fdt_blob, dwc3_node,
-				      "snps,dwc3") != 0) {
+	if (!ofnode_valid(node)) {
 		pr_err("Can't find dwc3 subnode for %s\n", dev->name);
 		return -ENODEV;
 	}
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 1993ad620a..f2ceb51310 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -513,7 +513,7 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
 	struct usb_platdata *plat = dev_get_platdata(dev);
 	enum usb_dr_mode dr_mode;
 
-	dr_mode = usb_get_dr_mode(dev_of_offset(dev));
+	dr_mode = usb_get_dr_mode(dev->node);
 
 	switch (dr_mode) {
 	case USB_DR_MODE_HOST:
diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c
index c1c681ca6c..9fcfa39d4b 100644
--- a/drivers/usb/host/xhci-dwc3.c
+++ b/drivers/usb/host/xhci-dwc3.c
@@ -9,7 +9,6 @@
 
 #include <common.h>
 #include <dm.h>
-#include <fdtdec.h>
 #include <generic-phy.h>
 #include <usb.h>
 #include <dwc3-uboot.h>
@@ -155,7 +154,7 @@ static int xhci_dwc3_probe(struct udevice *dev)
 
 	writel(reg, &dwc3_reg->g_usb2phycfg[0]);
 
-	dr_mode = usb_get_dr_mode(dev_of_offset(dev));
+	dr_mode = usb_get_dr_mode(dev->node);
 	if (dr_mode == USB_DR_MODE_UNKNOWN)
 		/* by default set dual role mode to HOST */
 		dr_mode = USB_DR_MODE_HOST;
diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c
index 00759f3e83..608facefa3 100644
--- a/drivers/usb/musb-new/ti-musb.c
+++ b/drivers/usb/musb-new/ti-musb.c
@@ -285,14 +285,12 @@ U_BOOT_DRIVER(ti_musb_peripheral) = {
 #if CONFIG_IS_ENABLED(OF_CONTROL)
 static int ti_musb_wrapper_bind(struct udevice *parent)
 {
-	const void *fdt = gd->fdt_blob;
-	int node;
+	ofnode node;
 	int ret;
 
-	for (node = fdt_first_subnode(fdt, dev_of_offset(parent)); node > 0;
-	     node = fdt_next_subnode(fdt, node)) {
+	ofnode_for_each_subnode(node, parent->node) {
 		struct udevice *dev;
-		const char *name = fdt_get_name(fdt, node, NULL);
+		const char *name = ofnode_get_name(node);
 		enum usb_dr_mode dr_mode;
 		struct driver *drv;
 
@@ -306,7 +304,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
 			ret = device_bind_driver_to_node(parent,
 							 "ti-musb-peripheral",
 							 name,
-							 offset_to_ofnode(node),
+							 node,
 							 &dev);
 			if (ret)
 				pr_err("musb - not able to bind usb peripheral node\n");
@@ -316,7 +314,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
 			ret = device_bind_driver_to_node(parent,
 							 "ti-musb-host",
 							 name,
-							 offset_to_ofnode(node),
+							 node,
 							 &dev);
 			if (ret)
 				pr_err("musb - not able to bind usb host node\n");
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index d2604c5caf..c19b916be9 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -9,6 +9,8 @@
 #ifndef __LINUX_USB_OTG_H
 #define __LINUX_USB_OTG_H
 
+#include <dm/ofnode.h>
+
 enum usb_dr_mode {
 	USB_DR_MODE_UNKNOWN,
 	USB_DR_MODE_HOST,
@@ -18,20 +20,20 @@ enum usb_dr_mode {
 
 /**
  * usb_get_dr_mode() - Get dual role mode for given device
- * @node: Node offset to the given device
+ * @node: ofnode of the given device
  *
  * The function gets phy interface string from property 'dr_mode',
  * and returns the correspondig enum usb_dr_mode
  */
-enum usb_dr_mode usb_get_dr_mode(int node);
+enum usb_dr_mode usb_get_dr_mode(ofnode node);
 
 /**
  * usb_get_maximum_speed() - Get maximum speed for given device
- * @node: Node offset to the given device
+ * @node: ofnode of the given device
  *
  * The function gets phy interface string from property 'maximum-speed',
  * and returns the correspondig enum usb_device_speed
  */
-enum usb_device_speed usb_get_maximum_speed(int node);
+enum usb_device_speed usb_get_maximum_speed(ofnode node);
 
 #endif /* __LINUX_USB_OTG_H */
-- 
2.17.1




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

* [PATCH v3 1/3] usb: dwc3-of-simple: Drop redundant inclding header file
  2020-03-04  0:59 ` [PATCH v3 1/3] usb: dwc3-of-simple: Drop redundant inclding header file Kever Yang
@ 2020-03-04 12:23   ` Marek Vasut
  0 siblings, 0 replies; 14+ messages in thread
From: Marek Vasut @ 2020-03-04 12:23 UTC (permalink / raw)
  To: u-boot

On 3/4/20 1:59 AM, Kever Yang wrote:
> The fdtdec.h is no use in this file, remove the include code.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
> Changes in v3: None

There's typo in the subject, I'll fix it when applying.

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

* [PATCH v3 3/3] usb: Migrate to support live DT for some driver
  2020-03-04  0:59   ` Kever Yang
@ 2020-03-04 12:24     ` Marek Vasut
  -1 siblings, 0 replies; 14+ messages in thread
From: Marek Vasut @ 2020-03-04 12:24 UTC (permalink / raw)
  To: u-boot

On 3/4/20 1:59 AM, Kever Yang wrote:
> Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT.
> This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use
> ofnode as parameter instead of fdt offset. And all the drivers who use
> these APIs update to use live dt APIs at the same time.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>

I'll wait for RB from Simon on 2/3 and 3/3 , however they look good to me.

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

* Re: [PATCH v3 3/3] usb: Migrate to support live DT for some driver
@ 2020-03-04 12:24     ` Marek Vasut
  0 siblings, 0 replies; 14+ messages in thread
From: Marek Vasut @ 2020-03-04 12:24 UTC (permalink / raw)
  To: Kever Yang, u-boot
  Cc: frank.wang, Adam Ford, Anatolij Gustschin, Bin Meng,
	Daniel Schwierzeck, Fabio Estevam, Igor Opaniuk,
	Jean-Jacques Hiblot, Lukasz Majewski, Neil Armstrong,
	Simon Glass, Vignesh Raghavendra, Ye Li, u-boot-amlogic

On 3/4/20 1:59 AM, Kever Yang wrote:
> Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT.
> This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use
> ofnode as parameter instead of fdt offset. And all the drivers who use
> these APIs update to use live dt APIs at the same time.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>

I'll wait for RB from Simon on 2/3 and 3/3 , however they look good to me.

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

* [PATCH v3 3/3] usb: Migrate to support live DT for some driver
  2020-03-04 12:24     ` Marek Vasut
@ 2020-03-04 17:51       ` Simon Glass
  -1 siblings, 0 replies; 14+ messages in thread
From: Simon Glass @ 2020-03-04 17:51 UTC (permalink / raw)
  To: u-boot

On Wed, 4 Mar 2020 at 05:32, Marek Vasut <marex@denx.de> wrote:
>
> On 3/4/20 1:59 AM, Kever Yang wrote:
> > Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT.
> > This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use
> > ofnode as parameter instead of fdt offset. And all the drivers who use
> > these APIs update to use live dt APIs at the same time.
> >
> > Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>
> I'll wait for RB from Simon on 2/3 and 3/3 , however they look good to me.

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

(no need to wait though!)

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

* Re: [PATCH v3 3/3] usb: Migrate to support live DT for some driver
@ 2020-03-04 17:51       ` Simon Glass
  0 siblings, 0 replies; 14+ messages in thread
From: Simon Glass @ 2020-03-04 17:51 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Kever Yang, U-Boot Mailing List, Frank Wang, Adam Ford,
	Anatolij Gustschin, Bin Meng, Daniel Schwierzeck, Fabio Estevam,
	Igor Opaniuk, Jean-Jacques Hiblot, Lukasz Majewski,
	Neil Armstrong, Vignesh Raghavendra, Ye Li, u-boot-amlogic

On Wed, 4 Mar 2020 at 05:32, Marek Vasut <marex@denx.de> wrote:
>
> On 3/4/20 1:59 AM, Kever Yang wrote:
> > Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT.
> > This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use
> > ofnode as parameter instead of fdt offset. And all the drivers who use
> > these APIs update to use live dt APIs at the same time.
> >
> > Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>
> I'll wait for RB from Simon on 2/3 and 3/3 , however they look good to me.

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

(no need to wait though!)

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

* [PATCH v3 2/3] usb: ehci-msm: Use dev interface to get device address
  2020-03-04  0:59 ` [PATCH v3 2/3] usb: ehci-msm: Use dev interface to get device address Kever Yang
@ 2020-03-04 17:51   ` Simon Glass
  0 siblings, 0 replies; 14+ messages in thread
From: Simon Glass @ 2020-03-04 17:51 UTC (permalink / raw)
  To: u-boot

On Tue, 3 Mar 2020 at 18:03, Kever Yang <kever.yang@rock-chips.com> wrote:
>
> Use dev_read_addr_ptr() instead of devfdt_get_addr() so that we can support
> live DT.
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
> ---
>
> Changes in v3: None
>
>  drivers/usb/host/ehci-msm.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

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

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

* [PATCH v3 0/3] usb: Covert to support Live DT
  2020-03-04  0:59 ` Kever Yang
@ 2020-03-04 18:00   ` Marek Vasut
  -1 siblings, 0 replies; 14+ messages in thread
From: Marek Vasut @ 2020-03-04 18:00 UTC (permalink / raw)
  To: u-boot

On 3/4/20 1:59 AM, Kever Yang wrote:
> This patch set convert to use APIs leading with dev_ or ofnode_ which
> supports live DT instead of fdt_ or fdtdec or devfdt_.
> Two functions update there parameter from offset to ofnode:
> - usb_get_maximum_speed()
> - usb_get_dr_mode()
> 
> For V3 update:
> Squesh patch 3rd~9th/9 into one patch because the ofnode_to_offset(node) is
> not work with the livetree, so we have to convert the api to support
> livetree and its related function at the same time.
> 
> For V2 update:
> Drop below patch after include ofnode.h in otg.h:
> [PATCH 09/10] usb: Use ofnode as usb_get_dr_mode() parameter
> 
> 
> Changes in v3:
> - Squesh the 3rd~9th into one patch.
> 
> Kever Yang (3):
>   usb: dwc3-of-simple: Drop redundant inclding header file
>   usb: ehci-msm: Use dev interface to get device address
>   usb: Migrate to support live DT for some driver
> 
>  drivers/usb/cdns3/core.c           | 15 ++++++---------
>  drivers/usb/cdns3/gadget.c         |  2 +-
>  drivers/usb/common/common.c        | 12 +++++-------
>  drivers/usb/dwc3/dwc3-generic.c    | 16 +++++++---------
>  drivers/usb/dwc3/dwc3-meson-g12a.c |  2 +-
>  drivers/usb/gadget/dwc2_udc_otg.c  |  5 ++---
>  drivers/usb/host/dwc3-of-simple.c  |  1 -
>  drivers/usb/host/dwc3-sti-glue.c   | 20 +++++++-------------
>  drivers/usb/host/ehci-msm.c        |  4 +---
>  drivers/usb/host/ehci-mx6.c        |  2 +-
>  drivers/usb/host/xhci-dwc3.c       |  3 +--
>  drivers/usb/musb-new/ti-musb.c     | 12 +++++-------
>  include/linux/usb/otg.h            | 10 ++++++----
>  13 files changed, 43 insertions(+), 61 deletions(-)
> 

All patches applied, thanks.

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

* Re: [PATCH v3 0/3] usb: Covert to support Live DT
@ 2020-03-04 18:00   ` Marek Vasut
  0 siblings, 0 replies; 14+ messages in thread
From: Marek Vasut @ 2020-03-04 18:00 UTC (permalink / raw)
  To: Kever Yang, u-boot
  Cc: frank.wang, Adam Ford, Anatolij Gustschin, Bin Meng,
	Daniel Schwierzeck, Fabio Estevam, Igor Opaniuk,
	Jean-Jacques Hiblot, Lukasz Majewski, Mark Kettenis,
	Neil Armstrong, Ramon Fried, Simon Glass, Vignesh Raghavendra,
	Ye Li, u-boot-amlogic

On 3/4/20 1:59 AM, Kever Yang wrote:
> This patch set convert to use APIs leading with dev_ or ofnode_ which
> supports live DT instead of fdt_ or fdtdec or devfdt_.
> Two functions update there parameter from offset to ofnode:
> - usb_get_maximum_speed()
> - usb_get_dr_mode()
> 
> For V3 update:
> Squesh patch 3rd~9th/9 into one patch because the ofnode_to_offset(node) is
> not work with the livetree, so we have to convert the api to support
> livetree and its related function at the same time.
> 
> For V2 update:
> Drop below patch after include ofnode.h in otg.h:
> [PATCH 09/10] usb: Use ofnode as usb_get_dr_mode() parameter
> 
> 
> Changes in v3:
> - Squesh the 3rd~9th into one patch.
> 
> Kever Yang (3):
>   usb: dwc3-of-simple: Drop redundant inclding header file
>   usb: ehci-msm: Use dev interface to get device address
>   usb: Migrate to support live DT for some driver
> 
>  drivers/usb/cdns3/core.c           | 15 ++++++---------
>  drivers/usb/cdns3/gadget.c         |  2 +-
>  drivers/usb/common/common.c        | 12 +++++-------
>  drivers/usb/dwc3/dwc3-generic.c    | 16 +++++++---------
>  drivers/usb/dwc3/dwc3-meson-g12a.c |  2 +-
>  drivers/usb/gadget/dwc2_udc_otg.c  |  5 ++---
>  drivers/usb/host/dwc3-of-simple.c  |  1 -
>  drivers/usb/host/dwc3-sti-glue.c   | 20 +++++++-------------
>  drivers/usb/host/ehci-msm.c        |  4 +---
>  drivers/usb/host/ehci-mx6.c        |  2 +-
>  drivers/usb/host/xhci-dwc3.c       |  3 +--
>  drivers/usb/musb-new/ti-musb.c     | 12 +++++-------
>  include/linux/usb/otg.h            | 10 ++++++----
>  13 files changed, 43 insertions(+), 61 deletions(-)
> 

All patches applied, thanks.

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

end of thread, other threads:[~2020-03-04 18:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04  0:59 [PATCH v3 0/3] usb: Covert to support Live DT Kever Yang
2020-03-04  0:59 ` Kever Yang
2020-03-04  0:59 ` [PATCH v3 1/3] usb: dwc3-of-simple: Drop redundant inclding header file Kever Yang
2020-03-04 12:23   ` Marek Vasut
2020-03-04  0:59 ` [PATCH v3 2/3] usb: ehci-msm: Use dev interface to get device address Kever Yang
2020-03-04 17:51   ` Simon Glass
2020-03-04  0:59 ` [PATCH v3 3/3] usb: Migrate to support live DT for some driver Kever Yang
2020-03-04  0:59   ` Kever Yang
2020-03-04 12:24   ` Marek Vasut
2020-03-04 12:24     ` Marek Vasut
2020-03-04 17:51     ` Simon Glass
2020-03-04 17:51       ` Simon Glass
2020-03-04 18:00 ` [PATCH v3 0/3] usb: Covert to support Live DT Marek Vasut
2020-03-04 18:00   ` Marek Vasut

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.