Skip to contentSkip to conversation

add imx usb driver for mx28/6x

PATCH New Richard Zhao 14 participants 67 messages Jun 13, 2012 – Jul 19, 2012

Subsystems (10)
lore
Share & tools
lore
#0 lore raw

v5 cover add imx usb driver for mx28/6x

The work is based on ci13xxx rework done by Alexander Shishkin.

Status:
- this version only support host
- usbotg controler works at host role

Changes since last version:
- collect ack received.

Richard Zhao (13):
usb: otg: add notify_connect/notify_disconnect callback
USB: move transceiver from ehci_hcd and ohci_hcd to hcd and rename it
as phy
USB: notify phy when root hub port connect change
usb: chipidea: permit driver bindings pass phy pointer
usb: otg: add basic mxs phy driver support
usb: chipidea: add imx platform driver
ARM: imx6q: correct device name of usbphy and usb controller clock
export
ARM: imx6q: add config-on-boot gpios
ARM: imx6q: add usbphy clocks
ARM: imx6q: disable usb charger detector
ARM: dts: imx6q-sabrelite: add usb devices
ARM: mxs: clk_register_clkdev mx28 usb clocks
ARM: dts: imx28-evk: add usb devices

 .../devicetree/bindings/arm/config-on-boot.txt     |   12 ++
 .../devicetree/bindings/usb/ci13xxx-imx.txt        |   20 ++
 Documentation/devicetree/bindings/usb/mxs-phy.txt  |   13 ++
 arch/arm/boot/dts/imx28-evk.dts                    |   36 ++++
 arch/arm/boot/dts/imx28.dtsi                       |   12 +-
 arch/arm/boot/dts/imx6q-sabrelite.dts              |   35 ++++
 arch/arm/boot/dts/imx6q.dtsi                       |   36 +++-
 arch/arm/mach-imx/clk-imx6q.c                      |   12 +-
 arch/arm/mach-imx/mach-imx6q.c                     |   59 ++++++
 drivers/clk/mxs/clk-imx28.c                        |    4 +
 drivers/usb/chipidea/Makefile                      |    3 +
 drivers/usb/chipidea/ci.h                          |    2 +
 drivers/usb/chipidea/ci13xxx_imx.c                 |  189 ++++++++++++++++++
 drivers/usb/chipidea/core.c                        |    4 +
 drivers/usb/chipidea/host.c                        |    1 +
 drivers/usb/chipidea/udc.c                         |   11 +-
 drivers/usb/core/hub.c                             |    8 +
 drivers/usb/host/ehci-fsl.c                        |   21 +-
 drivers/usb/host/ehci-hub.c                        |    2 +-
 drivers/usb/host/ehci.h                            |    4 -
 drivers/usb/host/ohci-omap.c                       |   27 +--
 drivers/usb/host/ohci.h                            |    5 -
 drivers/usb/otg/Kconfig                            |    8 +
 drivers/usb/otg/Makefile                           |    1 +
 drivers/usb/otg/mxs-phy.c                          |  204 ++++++++++++++++++++
 include/linux/usb/chipidea.h                       |    3 +
 include/linux/usb/hcd.h                            |    6 +
 include/linux/usb/otg.h                            |   21 ++
 28 files changed, 715 insertions(+), 44 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/config-on-boot.txt
 create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
 create mode 100644 Documentation/devicetree/bindings/usb/mxs-phy.txt
 create mode 100644 drivers/usb/chipidea/ci13xxx_imx.c
 create mode 100644 drivers/usb/otg/mxs-phy.c
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v5 1/13 usb: otg: add notify_connect/notify_disconnect callback

This let usb phy driver has a chance to change hw settings when connect status change.

---
 include/linux/usb/otg.h |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
include/linux/usb/otg.h +21 -0
index 38ab3f4..6dfdc8d 100644
@@ -117,6 +117,9 @@ struct usb_phy {
 	int	(*set_suspend)(struct usb_phy *x,
 				int suspend);
 
+	/* notify phy connect status change */
+	int	(*notify_connect)(struct usb_phy *x, int port);
+	int	(*notify_disconnect)(struct usb_phy *x, int port);
 };
 
 
@@ -252,6 +255,24 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
 }
 
 static inline int
+usb_phy_notify_connect(struct usb_phy *x, int port)
+{
+	if (x->notify_connect)
+		return x->notify_connect(x, port);
+	else
+		return 0;
+}
+
+static inline int
+usb_phy_notify_disconnect(struct usb_phy *x, int port)
+{
+	if (x->notify_disconnect)
+		return x->notify_disconnect(x, port);
+	else
+		return 0;
+}
+
+static inline int
 otg_start_srp(struct usb_otg *otg)
 {
 	if (otg && otg->start_srp)
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v5 2/13 USB: move transceiver from ehci_hcd and ohci_hcd to hcd and rename it as phy

In reply to Richard Zhao

- to decrease redundant since both ehci_hcd and ohci_hcd have the same variable
- it helps access phy in usb core code
- phy is more meaningful than transceiver

---
 drivers/usb/host/ehci-fsl.c  |   21 ++++++++++-----------
 drivers/usb/host/ehci-hub.c  |    2 +-
 drivers/usb/host/ehci.h      |    4 ----
 drivers/usb/host/ohci-omap.c |   27 ++++++++++++++-------------
 drivers/usb/host/ohci.h      |    5 -----
 include/linux/usb/hcd.h      |    6 ++++++
 6 files changed, 31 insertions(+), 34 deletions(-)
drivers/usb/host/ehci-fsl.c +10 -11
index 4336257..3379945 100644
@@ -142,19 +142,19 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
 	if (pdata->operating_mode == FSL_USB2_DR_OTG) {
 		struct ehci_hcd *ehci = hcd_to_ehci(hcd);
 
-		ehci->transceiver = usb_get_transceiver();
-		dev_dbg(&pdev->dev, "hcd=0x%p  ehci=0x%p, transceiver=0x%p\n",
-			hcd, ehci, ehci->transceiver);
+		hcd->phy = usb_get_transceiver();
+		dev_dbg(&pdev->dev, "hcd=0x%p  ehci=0x%p, phy=0x%p\n",
+			hcd, ehci, hcd->phy);
 
-		if (ehci->transceiver) {
-			retval = otg_set_host(ehci->transceiver->otg,
+		if (hcd->phy) {
+			retval = otg_set_host(hcd->phy->otg,
 					      &ehci_to_hcd(ehci)->self);
 			if (retval) {
-				usb_put_transceiver(ehci->transceiver);
+				usb_put_transceiver(hcd->phy);
 				goto err4;
 			}
 		} else {
-			dev_err(&pdev->dev, "can't find transceiver\n");
+			dev_err(&pdev->dev, "can't find phy\n");
 			retval = -ENODEV;
 			goto err4;
 		}
@@ -190,11 +190,10 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd,
 			       struct platform_device *pdev)
 {
 	struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
-	struct ehci_hcd *ehci = hcd_to_ehci(hcd);
 
-	if (ehci->transceiver) {
-		otg_set_host(ehci->transceiver->otg, NULL);
-		usb_put_transceiver(ehci->transceiver);
+	if (hcd->phy) {
+		otg_set_host(hcd->phy->otg, NULL);
+		usb_put_transceiver(hcd->phy);
 	}
 
 	usb_remove_hcd(hcd);
drivers/usb/host/ehci-hub.c +1 -1
index fc9e7cc..dd5eef6 100644
@@ -724,7 +724,7 @@ static int ehci_hub_control (
 #ifdef CONFIG_USB_OTG
 			if ((hcd->self.otg_port == (wIndex + 1))
 			    && hcd->self.b_hnp_enable) {
-				otg_start_hnp(ehci->transceiver->otg);
+				otg_start_hnp(hcd->phy->otg);
 				break;
 			}
 #endif
drivers/usb/host/ehci.h +0 -4
index 2694ed6..85c3572 100644
@@ -175,10 +175,6 @@ struct ehci_hcd {			/* one per controller */
 #ifdef DEBUG
 	struct dentry		*debug_dir;
 #endif
-	/*
-	 * OTG controllers and transceivers need software interaction
-	 */
-	struct usb_phy	*transceiver;
 };
 
 /* convert between an HCD pointer and the corresponding EHCI_HCD */
drivers/usb/host/ohci-omap.c +14 -13
index 9ce35d0..eccddb4 100644
@@ -167,14 +167,15 @@ static int omap_1510_local_bus_init(void)
 
 static void start_hnp(struct ohci_hcd *ohci)
 {
-	const unsigned	port = ohci_to_hcd(ohci)->self.otg_port - 1;
+	struct usb_hcd *hcd = ohci_to_hcd(ohci);
+	const unsigned	port = hcd->self.otg_port - 1;
 	unsigned long	flags;
 	u32 l;
 
-	otg_start_hnp(ohci->transceiver->otg);
+	otg_start_hnp(hcd->phy->otg);
 
 	local_irq_save(flags);
-	ohci->transceiver->state = OTG_STATE_A_SUSPEND;
+	hcd->phy->state = OTG_STATE_A_SUSPEND;
 	writel (RH_PS_PSS, &ohci->regs->roothub.portstatus [port]);
 	l = omap_readl(OTG_CTRL);
 	l &= ~OTG_A_BUSREQ;
@@ -211,18 +212,18 @@ static int ohci_omap_init(struct usb_hcd *hcd)
 
 #ifdef	CONFIG_USB_OTG
 	if (need_transceiver) {
-		ohci->transceiver = usb_get_transceiver();
-		if (ohci->transceiver) {
-			int	status = otg_set_host(ohci->transceiver->otg,
+		hcd->phy = usb_get_transceiver();
+		if (hcd->phy) {
+			int	status = otg_set_host(hcd->phy->otg,
 						&ohci_to_hcd(ohci)->self);
-			dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n",
-					ohci->transceiver->label, status);
+			dev_dbg(hcd->self.controller, "init %s phy, status %d\n",
+					hcd->phy->label, status);
 			if (status) {
-				usb_put_transceiver(ohci->transceiver);
+				usb_put_transceiver(hcd->phy);
 				return status;
 			}
 		} else {
-			dev_err(hcd->self.controller, "can't find transceiver\n");
+			dev_err(hcd->self.controller, "can't find phy\n");
 			return -ENODEV;
 		}
 		ohci->start_hnp = start_hnp;
@@ -403,9 +404,9 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
 	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
 
 	usb_remove_hcd(hcd);
-	if (ohci->transceiver) {
-		(void) otg_set_host(ohci->transceiver->otg, 0);
-		usb_put_transceiver(ohci->transceiver);
+	if (hcd->phy) {
+		(void) otg_set_host(hcd->phy->otg, 0);
+		usb_put_transceiver(hcd->phy);
 	}
 	if (machine_is_omap_osk())
 		gpio_free(9);
drivers/usb/host/ohci.h +0 -5
index 1b19aea..d329914 100644
@@ -372,11 +372,6 @@ struct ohci_hcd {
 	struct ed		*ed_controltail;	/* last in ctrl list */
 	struct ed		*periodic [NUM_INTS];	/* shadow int_table */
 
-	/*
-	 * OTG controllers and transceivers need software interaction;
-	 * other external transceivers should be software-transparent
-	 */
-	struct usb_phy	*transceiver;
 	void (*start_hnp)(struct ohci_hcd *ohci);
 
 	/*
include/linux/usb/hcd.h +6 -0
index 7f855d5..c532cbe 100644
@@ -93,6 +93,12 @@ struct usb_hcd {
 	 */
 	const struct hc_driver	*driver;	/* hw-specific hooks */
 
+	/*
+	 * OTG and some Host controllers need software interaction with phys;
+	 * other external phys should be software-transparent
+	 */
+	struct usb_phy	*phy;
+
 	/* Flags that need to be manipulated atomically because they can
 	 * change while the host controller is running.  Always use
 	 * set_bit() or clear_bit() to change their values.
Signature · 1 line
1.7.9.5
maintainer
#3 lore raw

PATCH v5 2/13 USB: move transceiver from ehci_hcd and ohci_hcd to hcd and rename it as phy

Quoted 5 lines · Richard Zhao

- to decrease redundant since both ehci_hcd and ohci_hcd have the same variable
- it helps access phy in usb core code
- phy is more meaningful than transceiver

#4 lore raw

PATCH v5 3/13 USB: notify phy when root hub port connect change

In reply to Richard Zhao

Phy may need to change settings when port connect change.

---
 drivers/usb/core/hub.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/usb/core/hub.c +8 -0
index 04fb834..e1a6d31 100644
@@ -20,6 +20,7 @@
 #include <linux/usb.h>
 #include <linux/usbdevice_fs.h>
 #include <linux/usb/hcd.h>
+#include <linux/usb/otg.h>
 #include <linux/usb/quirks.h>
 #include <linux/kthread.h>
 #include <linux/mutex.h>
@@ -4034,6 +4035,13 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
 		}
 	}
 
+	if (unlikely(hcd->phy && !hdev->level)) {
+		if (portstatus & USB_PORT_STAT_CONNECTION)
+			usb_phy_notify_connect(hcd->phy, port1);
+		else
+			usb_phy_notify_disconnect(hcd->phy, port1);
+	}
+
 	/* Return now if debouncing failed or nothing is connected or
 	 * the device was "removed".
 	 */
Signature · 1 line
1.7.9.5
maintainer
#5 lore raw

PATCH v5 3/13 USB: notify phy when root hub port connect change

Quoted 20 lines · Richard Zhao

Phy may need to change settings when port connect change.

---
 drivers/usb/core/hub.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/usb/core/hub.c +1 -0
index 04fb834..e1a6d31 100644
@@ -20,6 +20,7 @@
 #include <linux/usb.h>
 #include <linux/usbdevice_fs.h>
 #include <linux/usb/hcd.h>
+#include <linux/usb/otg.h>
 #include <linux/usb/quirks.h>
 #include <linux/kthread.h>
 #include <linux/mutex.h>

drivers/usb/core/hub.c static void hub_port_connect_change(struct usb_hub *hub, int port1, · line 4038

Quoted 4 lines
drivers/usb/core/hub.c +1 -0
@@ -4034,6 +4035,13 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
 		}
 	}
 
+	if (unlikely(hcd->phy && !hdev->level)) {

This is okay, but it's more common to test for root hubs with "!hdev->parent".

drivers/usb/core/hub.c static void hub_port_connect_change(struct usb_hub *hub, int port1, · line 4047

Quoted 9 lines
drivers/usb/core/hub.c +6 -0
+		if (portstatus & USB_PORT_STAT_CONNECTION)
+			usb_phy_notify_connect(hcd->phy, port1);
+		else
+			usb_phy_notify_disconnect(hcd->phy, port1);
+	}
+
 	/* Return now if debouncing failed or nothing is connected or
 	 * the device was "removed".
 	 */

Alan Stern

#6 lore raw

PATCH v5 3/13 USB: notify phy when root hub port connect change

Quoted 25 lines · Alan Stern
Quoted 23 lines · Richard Zhao

Phy may need to change settings when port connect change.

---
 drivers/usb/core/hub.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/usb/core/hub.c +1 -0
index 04fb834..e1a6d31 100644
@@ -20,6 +20,7 @@
 #include <linux/usb.h>
 #include <linux/usbdevice_fs.h>
 #include <linux/usb/hcd.h>
+#include <linux/usb/otg.h>
 #include <linux/usb/quirks.h>
 #include <linux/kthread.h>
 #include <linux/mutex.h>
@@ -4034,6 +4035,13 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
 		}
 	}
 
Quoted 4 lines

drivers/usb/core/hub.c static void hub_port_connect_change(struct usb_hub *hub, int port1, · line 4038

Quoted 1 line
drivers/usb/core/hub.c +1 -0
+	if (unlikely(hcd->phy && !hdev->level)) {

This is okay, but it's more common to test for root hubs with "!hdev->parent".

So it will be like:
if (unlikely(hcd->phy && !hdev->parent)) {

And,
I didn't check (portchange & USB_PORT_STAT_C_CONNECTION), because if the device is connected on boot, there'll be no USB_PORT_STAT_C_CONNECTION. Is it acceptable?

Thanks
Richard

Quoted 13 lines

drivers/usb/core/hub.c static void hub_port_connect_change(struct usb_hub *hub, int port1, · line 4047

Quoted 9 lines
drivers/usb/core/hub.c +6 -0
+		if (portstatus & USB_PORT_STAT_CONNECTION)
+			usb_phy_notify_connect(hcd->phy, port1);
+		else
+			usb_phy_notify_disconnect(hcd->phy, port1);
+	}
+
 	/* Return now if debouncing failed or nothing is connected or
 	 * the device was "removed".
 	 */

Alan Stern

maintainer
#7 lore raw

PATCH v5 3/13 USB: notify phy when root hub port connect change

Quoted 6 lines · Richard Zhao
Quoted 4 lines

drivers/usb/core/hub.c static void hub_port_connect_change(struct usb_hub *hub, int port1, · line 4038

Quoted 1 line
drivers/usb/core/hub.c +1 -0
+	if (unlikely(hcd->phy && !hdev->level)) {

This is okay, but it's more common to test for root hubs with "!hdev->parent".

So it will be like:
if (unlikely(hcd->phy && !hdev->parent)) {

Yes.

Quoted 4 lines

And,
I didn't check (portchange & USB_PORT_STAT_C_CONNECTION), because if the device is connected on boot, there'll be no USB_PORT_STAT_C_CONNECTION. Is it acceptable?

Yes. In fact the hub_port_debounce() routine turns off USB_PORT_STAT_C_CONNECTION anyway.

Alan Stern

#8 lore raw

PATCH v5 4/13 usb: chipidea: permit driver bindings pass phy pointer

In reply to Richard Zhao

Sometimes, the driver bindings may know what phy they use. For example, when using device tree, the usb controller may have a phandler pointing to usb phy.

---
 drivers/usb/chipidea/ci.h    |    2 ++
 drivers/usb/chipidea/core.c  |    4 ++++
 drivers/usb/chipidea/host.c  |    1 +
 drivers/usb/chipidea/udc.c   |   11 +++++++----
 include/linux/usb/chipidea.h |    3 +++
 5 files changed, 17 insertions(+), 4 deletions(-)
drivers/usb/chipidea/ci.h +2 -0
index 9655e35..d738603 100644
@@ -160,6 +160,8 @@ struct ci13xxx {
 
 	struct ci13xxx_platform_data	*platdata;
 	int				vbus_active;
+	/* FIXME: some day, we'll not use global phy */
+	bool				global_phy;
 	struct usb_phy			*transceiver;
 	struct usb_hcd			*hcd;
 };
drivers/usb/chipidea/core.c +4 -0
index c14ce2b..21407e7 100644
@@ -419,6 +419,10 @@ static int __devinit ci_hdrc_probe(struct platform_device *pdev)
 
 	ci->dev = dev;
 	ci->platdata = dev->platform_data;
+	if (ci->platdata->phy)
+		ci->transceiver = ci->platdata->phy;
+	else
+		ci->global_phy = true;
 
 	ret = hw_device_init(ci, base);
 	if (ret < 0) {
drivers/usb/chipidea/host.c +1 -0
index 4a4fdb8..ebff9f4 100644
@@ -117,6 +117,7 @@ static int host_start(struct ci13xxx *ci)
 	hcd->has_tt = 1;
 
 	hcd->power_budget = ci->platdata->power_budget;
+	hcd->phy = ci->transceiver;
 
 	ehci = hcd_to_ehci(hcd);
 	ehci->caps = ci->hw_bank.cap;
drivers/usb/chipidea/udc.c +7 -4
index ca9b387..b43b29c 100644
@@ -1684,7 +1684,8 @@ static int udc_start(struct ci13xxx *ci)
 
 	ci->gadget.ep0 = &ci->ep0in->ep;
 
-	ci->transceiver = usb_get_transceiver();
+	if (ci->global_phy) {
+		ci->transceiver = usb_get_transceiver();
 
 	if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) {
 		if (ci->transceiver == NULL) {
@@ -1728,7 +1729,8 @@ static int udc_start(struct ci13xxx *ci)
 remove_trans:
 	if (ci->transceiver) {
 		otg_set_peripheral(ci->transceiver->otg, &ci->gadget);
-		usb_put_transceiver(ci->transceiver);
+		if (ci->global_phy)
+			usb_put_transceiver(ci->transceiver);
 	}
 
 	dev_err(dev, "error = %i\n", retval);
@@ -1737,7 +1739,7 @@ remove_dbg:
 unreg_device:
 	device_unregister(&ci->gadget.dev);
 put_transceiver:
-	if (ci->transceiver)
+	if (ci->transceiver && ci->global_phy)
 		usb_put_transceiver(ci->transceiver);
 free_pools:
 	dma_pool_destroy(ci->td_pool);
@@ -1771,7 +1773,8 @@ static void udc_stop(struct ci13xxx *ci)
 
 	if (ci->transceiver) {
 		otg_set_peripheral(ci->transceiver->otg, NULL);
-		usb_put_transceiver(ci->transceiver);
+		if (ci->global_phy)
+			usb_put_transceiver(ci->transceiver);
 	}
 	dbg_remove_files(&ci->gadget.dev);
 	device_unregister(&ci->gadget.dev);
include/linux/usb/chipidea.h +3 -0
index be078f0..544825d 100644
@@ -5,12 +5,15 @@
 #ifndef __LINUX_USB_CHIPIDEA_H
 #define __LINUX_USB_CHIPIDEA_H
 
+#include <linux/usb/otg.h>
+
 struct ci13xxx;
 struct ci13xxx_platform_data {
 	const char	*name;
 	/* offset of the capability registers */
 	uintptr_t	 capoffset;
 	unsigned	 power_budget;
+	struct usb_phy	*phy;
 	unsigned long	 flags;
 #define CI13XXX_REGS_SHARED		BIT(0)
 #define CI13XXX_REQUIRE_TRANSCEIVER	BIT(1)
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH v5 5/13 usb: otg: add basic mxs phy driver support

In reply to Richard Zhao

mxs phy is used in Freescale i.MX SoCs, for example imx23, imx28, imx6Q. This patch adds the basic host support.

---
 Documentation/devicetree/bindings/usb/mxs-phy.txt |   13 ++
 drivers/usb/otg/Kconfig                           |    8 +
 drivers/usb/otg/Makefile                          |    1 +
 drivers/usb/otg/mxs-phy.c                         |  204 +++++++++++++++++++++
 4 files changed, 226 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/mxs-phy.txt
 create mode 100644 drivers/usb/otg/mxs-phy.c
Documentation/devicetree/bindings/usb/mxs-phy.txt new file +13 -0
new file mode 100644
index 0000000..5835b27
@@ -0,0 +1,13 @@
+* Freescale MXS USB Phy Device
+
+Required properties:
+- compatible: Should be "fsl,imx23-usbphy"
+- reg: Should contain registers location and length
+- interrupts: Should contain phy interrupt
+
+Example:
+usbphy1: usbphy at 020c9000 {
+	compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
+	reg = <0x020c9000 0x1000>;
+	interrupts = <0 44 0x04>;
+};
drivers/usb/otg/Kconfig +8 -0
index 5c87db0..3a9bc44 100644
@@ -116,6 +116,14 @@ config FSL_USB2_OTG
 	help
 	  Enable this to support Freescale USB OTG transceiver.
 
+config USB_MXS_PHY
+	tristate "Freescale MXS USB PHY support"
+	select USB_OTG_UTILS
+	help
+	  Enable this to support the Freescale MXS USB PHY.
+
+	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
+
 config USB_MV_OTG
 	tristate "Marvell USB OTG support"
 	depends on USB_EHCI_MV && USB_MV_UDC && USB_SUSPEND
drivers/usb/otg/Makefile +1 -0
index 41aa509..a844b8d 100644
@@ -20,4 +20,5 @@ obj-$(CONFIG_USB_MSM_OTG)	+= msm_otg.o
 obj-$(CONFIG_AB8500_USB)	+= ab8500-usb.o
 fsl_usb2_otg-objs		:= fsl_otg.o otg_fsm.o
 obj-$(CONFIG_FSL_USB2_OTG)	+= fsl_usb2_otg.o
+obj-$(CONFIG_USB_MXS_PHY)	+= mxs-phy.o
 obj-$(CONFIG_USB_MV_OTG)	+= mv_otg.o
drivers/usb/otg/mxs-phy.c new file +204 -0

204 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#10 lore raw

PATCH v5 5/13 usb: otg: add basic mxs phy driver support

Quoted 118 lines · Richard Zhao

mxs phy is used in Freescale i.MX SoCs, for example imx23, imx28, imx6Q. This patch adds the basic host support.

---
 Documentation/devicetree/bindings/usb/mxs-phy.txt |   13 ++
 drivers/usb/otg/Kconfig                           |    8 +
 drivers/usb/otg/Makefile                          |    1 +
 drivers/usb/otg/mxs-phy.c                         |  204 +++++++++++++++++++++
 4 files changed, 226 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/mxs-phy.txt
 create mode 100644 drivers/usb/otg/mxs-phy.c
Documentation/devicetree/bindings/usb/mxs-phy.txt new file +13 -0
new file mode 100644
index 0000000..5835b27
@@ -0,0 +1,13 @@
+* Freescale MXS USB Phy Device
+
+Required properties:
+- compatible: Should be "fsl,imx23-usbphy"
+- reg: Should contain registers location and length
+- interrupts: Should contain phy interrupt
+
+Example:
+usbphy1: usbphy at 020c9000 {
+	compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
+	reg = <0x020c9000 0x1000>;
+	interrupts = <0 44 0x04>;
+};
drivers/usb/otg/Kconfig +8 -0
index 5c87db0..3a9bc44 100644
@@ -116,6 +116,14 @@ config FSL_USB2_OTG
 	help
 	  Enable this to support Freescale USB OTG transceiver.
 
+config USB_MXS_PHY
+	tristate "Freescale MXS USB PHY support"
+	select USB_OTG_UTILS
+	help
+	  Enable this to support the Freescale MXS USB PHY.
+
+	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
+
 config USB_MV_OTG
 	tristate "Marvell USB OTG support"
 	depends on USB_EHCI_MV && USB_MV_UDC && USB_SUSPEND
drivers/usb/otg/Makefile +1 -0
index 41aa509..a844b8d 100644
@@ -20,4 +20,5 @@ obj-$(CONFIG_USB_MSM_OTG)	+= msm_otg.o
 obj-$(CONFIG_AB8500_USB)	+= ab8500-usb.o
 fsl_usb2_otg-objs		:= fsl_otg.o otg_fsm.o
 obj-$(CONFIG_FSL_USB2_OTG)	+= fsl_usb2_otg.o
+obj-$(CONFIG_USB_MXS_PHY)	+= mxs-phy.o
 obj-$(CONFIG_USB_MV_OTG)	+= mv_otg.o
drivers/usb/otg/mxs-phy.c new file +47 -0
new file mode 100644
index 0000000..a55aaed
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright (C) 2012 Marek Vasut <[email protected]>
+ * on behalf of DENX Software Engineering GmbH
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+#include <linux/usb/otg.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/io.h>
+
+#define DRIVER_NAME "mxs_phy"
+
+#define HW_USBPHY_PWD				0x00
+#define HW_USBPHY_CTRL				0x30
+#define HW_USBPHY_CTRL_SET			0x34
+#define HW_USBPHY_CTRL_CLR			0x38
+
+#define BM_USBPHY_CTRL_SFTRST			BIT(31)
+#define BM_USBPHY_CTRL_CLKGATE			BIT(30)
+#define BM_USBPHY_CTRL_ENUTMILEVEL3		BIT(15)
+#define BM_USBPHY_CTRL_ENUTMILEVEL2		BIT(14)
+#define BM_USBPHY_CTRL_ENHOSTDISCONDETECT	BIT(1)
+
+struct mxs_phy {
+	struct usb_phy phy;
+	struct clk *clk;
+	int connected:1;
+};
+
+#define to_mxs_phy(p) container_of((p), struct mxs_phy, phy)
+
+static void mxs_phy_hw_init(struct mxs_phy *mxs_phy)
+{
+	void __iomem *base = mxs_phy->phy.io_priv;
+

drivers/usb/otg/mxs-phy.c line 57

Quoted 10 lines
drivers/usb/otg/mxs-phy.c new file +10 -0
+	writel_relaxed(BM_USBPHY_CTRL_CLKGATE, base + HW_USBPHY_CTRL_CLR);
+
+	/* Reset USBPHY module */
+	writel_relaxed(BM_USBPHY_CTRL_SFTRST, base + HW_USBPHY_CTRL_SET);
+	udelay(10);
+
+	/* Remove CLKGATE and SFTRST */
+	writel_relaxed(BM_USBPHY_CTRL_CLKGATE | BM_USBPHY_CTRL_SFTRST,
+			base + HW_USBPHY_CTRL_CLR);
+	udelay(10);

Is stmp_reset_block() suitable for what you want to do here?

drivers/usb/otg/mxs-phy.c line 139

Quoted 7 lines
drivers/usb/otg/mxs-phy.c new file +7 -0
+	base = devm_request_and_ioremap(&pdev->dev, res);
+	if (!base)
+		return -EBUSY;
+
+	clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(clk)) {
+		dev_err(&pdev->dev, "can't get the clock!");

Please add the return value to these kind of messages.

drivers/usb/otg/mxs-phy.c line 145

Quoted 6 lines
drivers/usb/otg/mxs-phy.c new file +6 -0
+		return PTR_ERR(clk);
+	}
+
+	mxs_phy = devm_kzalloc(&pdev->dev, sizeof(*mxs_phy), GFP_KERNEL);
+	if (!mxs_phy) {
+		dev_err(&pdev->dev, "Failed to allocate USB PHY structure!\n");

This message is rather useless. It is really not expected for kzalloc to fail. If it fails here you really have problems elsewhere and this message won't help you debugging it.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#11 lore raw

PATCH v5 5/13 usb: otg: add basic mxs phy driver support

Dear Sascha Hauer,

Quoted 9 lines · Richard Zhao
Quoted 8 lines

mxs phy is used in Freescale i.MX SoCs, for example imx23, imx28, imx6Q. This patch adds the basic host support.

[...]

Quoted 6 lines

drivers/usb/otg/mxs-phy.c line 57

Quoted 4 lines
drivers/usb/otg/mxs-phy.c new file +4 -0
+	/* Remove CLKGATE and SFTRST */
+	writel_relaxed(BM_USBPHY_CTRL_CLKGATE | BM_USBPHY_CTRL_SFTRST,
+			base + HW_USBPHY_CTRL_CLR);
+	udelay(10);

Is stmp_reset_block() suitable for what you want to do here?

IIRC it is.

Quoted 10 lines

drivers/usb/otg/mxs-phy.c line 139

Quoted 7 lines
drivers/usb/otg/mxs-phy.c new file +7 -0
+	base = devm_request_and_ioremap(&pdev->dev, res);
+	if (!base)
+		return -EBUSY;
+
+	clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(clk)) {
+		dev_err(&pdev->dev, "can't get the clock!");

Please add the return value to these kind of messages.

Quoted 10 lines

drivers/usb/otg/mxs-phy.c line 145

Quoted 6 lines
drivers/usb/otg/mxs-phy.c new file +6 -0
+		return PTR_ERR(clk);
+	}
+
+	mxs_phy = devm_kzalloc(&pdev->dev, sizeof(*mxs_phy), GFP_KERNEL);
+	if (!mxs_phy) {
+		dev_err(&pdev->dev, "Failed to allocate USB PHY structure!\n");

This message is rather useless. It is really not expected for kzalloc to fail. If it fails here you really have problems elsewhere and this message won't help you debugging it.

It's not useless, but it'll hardly ever be displayed if you run out of memory so badly this kzalloc() will fail.

Quoted 1 line

Sascha

Best regards,

maintainer
#12 lore raw

PATCH v5 5/13 usb: otg: add basic mxs phy driver support

Quoted 9 lines · Marek Vasut

Dear Sascha Hauer,

Quoted 4 lines

This message is rather useless. It is really not expected for kzalloc to fail. If it fails here you really have problems elsewhere and this message won't help you debugging it.

It's not useless, but it'll hardly ever be displayed if you run out of memory so badly this kzalloc() will fail.

If you run out of memory while allocating a few bytes it's really not interesting where exactly this happens. The message won't give you any hint where you can fix this problem. Also, if you bail out of a drivers probe function with -ENOMEM you will have a message in the log anyway.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#13 lore raw

PATCH v5 5/13 usb: otg: add basic mxs phy driver support

In reply to Marek Vasut
Quoted 13 lines · Marek Vasut

Dear Sascha Hauer,

Quoted 9 lines · Richard Zhao
Quoted 8 lines

mxs phy is used in Freescale i.MX SoCs, for example imx23, imx28, imx6Q. This patch adds the basic host support.

[...]

Quoted 8 lines
Quoted 6 lines

drivers/usb/otg/mxs-phy.c line 57

Quoted 4 lines
drivers/usb/otg/mxs-phy.c new file +4 -0
+	/* Remove CLKGATE and SFTRST */
+	writel_relaxed(BM_USBPHY_CTRL_CLKGATE | BM_USBPHY_CTRL_SFTRST,
+			base + HW_USBPHY_CTRL_CLR);
+	udelay(10);

Is stmp_reset_block() suitable for what you want to do here?

IIRC it is.

Thanks.

Quoted 10 lines
Quoted 10 lines

drivers/usb/otg/mxs-phy.c line 139

Quoted 8 lines
drivers/usb/otg/mxs-phy.c new file +7 -0
+	base = devm_request_and_ioremap(&pdev->dev, res);
+	if (!base)
+		return -EBUSY;
+
+	clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(clk)) {
+		dev_err(&pdev->dev, "can't get the clock!");

Please add the return value to these kind of messages.

Make sense.

Quoted 11 lines
Quoted 11 lines

drivers/usb/otg/mxs-phy.c line 145

Quoted 7 lines
drivers/usb/otg/mxs-phy.c new file +6 -0
+		return PTR_ERR(clk);
+	}
+
+	mxs_phy = devm_kzalloc(&pdev->dev, sizeof(*mxs_phy), GFP_KERNEL);
+	if (!mxs_phy) {
+		dev_err(&pdev->dev, "Failed to allocate USB PHY structure!\n");

This message is rather useless. It is really not expected for kzalloc to fail. If it fails here you really have problems elsewhere and this message won't help you debugging it.

At least it shows the point it fails and people can look back what code has been run.

Thanks
Richard

Quoted 8 lines

It's not useless, but it'll hardly ever be displayed if you run out of memory so badly this kzalloc() will fail.

Quoted 1 line

Sascha

Best regards,

#14 lore raw

PATCH v5 6/13 usb: chipidea: add imx platform driver

In reply to Richard Zhao

This patch supports only the host-mode functionality so far.

Cc Peter Chen <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 .../devicetree/bindings/usb/ci13xxx-imx.txt        |   20 +++
 drivers/usb/chipidea/Makefile                      |    3 +
 drivers/usb/chipidea/ci13xxx_imx.c                 |  189 ++++++++++++++++++++
 3 files changed, 212 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
 create mode 100644 drivers/usb/chipidea/ci13xxx_imx.c
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +20 -0
new file mode 100644
index 0000000..beb75d6
@@ -0,0 +1,20 @@
+* Freescale i.MX ci13xxx usb controllers
+
+Required properties:
+- compatible: Should be "fsl,imx31-usb"
+- reg: Should contain registers location and length
+- interrupts: Should contain controller interrupt
+
+Optional properties:
+- fsl,usbphy: phandler of usb phy that connects to the only one port
+- fsl,hub-reset-gpios: gpio used to reset on-board usb hub
+- fsl,vbus-power-gpios: gpio used to set vbus power of the only one port
+
+Examples:
+usb at 02184000 { /* USB OTG */
+	compatible = "fsl,imx6q-usb", "fsl,imx31-usb";
+	reg = <0x02184000 0x200>;
+	interrupts = <0 43 0x04>;
+	fsl,usbphy = <&usbphy1>;
+	fsl,vbus-power-gpios = <&gpio3 22 0>;
+};
drivers/usb/chipidea/Makefile +3 -0
index b69900a..5c66d9c 100644
@@ -14,3 +14,6 @@ ifneq ($(CONFIG_PCI),)
 	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_pci.o
 endif
 
+ifneq ($(CONFIG_OF_DEVICE),)
+	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_imx.o
+endif
drivers/usb/chipidea/ci13xxx_imx.c new file +189 -0

189 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#15 lore raw

PATCH v5 6/13 usb: chipidea: add imx platform driver

Quoted 27 lines · Richard Zhao

This patch supports only the host-mode functionality so far.

Cc Peter Chen <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 .../devicetree/bindings/usb/ci13xxx-imx.txt        |   20 +++
 drivers/usb/chipidea/Makefile                      |    3 +
 drivers/usb/chipidea/ci13xxx_imx.c                 |  189 ++++++++++++++++++++
 3 files changed, 212 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
 create mode 100644 drivers/usb/chipidea/ci13xxx_imx.c
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +5 -0
new file mode 100644
index 0000000..beb75d6
@@ -0,0 +1,20 @@
+* Freescale i.MX ci13xxx usb controllers
+
+Required properties:
+- compatible: Should be "fsl,imx31-usb"
+- reg: Should contain registers location and length

Documentation/devicetree/bindings/usb/ci13xxx-imx.txt line 15

Quoted 10 lines
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +10 -0
+- interrupts: Should contain controller interrupt
+
+Optional properties:
+- fsl,usbphy: phandler of usb phy that connects to the only one port
+- fsl,hub-reset-gpios: gpio used to reset on-board usb hub
+- fsl,vbus-power-gpios: gpio used to set vbus power of the only one port
+
+Examples:
+usb at 02184000 { /* USB OTG */
+	compatible = "fsl,imx6q-usb", "fsl,imx31-usb";

The i.MX27 also has this core. As it's older that's probably the right fallback instead of i.MX31.

Quoted 19 lines
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +5 -0
+	reg = <0x02184000 0x200>;
+	interrupts = <0 43 0x04>;
+	fsl,usbphy = <&usbphy1>;
+	fsl,vbus-power-gpios = <&gpio3 22 0>;
+};
drivers/usb/chipidea/Makefile +6 -0
index b69900a..5c66d9c 100644
@@ -14,3 +14,6 @@ ifneq ($(CONFIG_PCI),)
 	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_pci.o
 endif
 
+ifneq ($(CONFIG_OF_DEVICE),)
+	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_imx.o
+endif
+
+static int __devinit ci13xxx_imx_probe(struct platform_device *pdev)
+{

drivers/usb/chipidea/Makefile ifneq ($(CONFIG_PCI),)

Quoted 10 lines
drivers/usb/chipidea/Makefile +10 -0
+	struct ci13xxx_imx_data *data;
+	struct platform_device *plat_ci, *phy_pdev;
+	struct device_node *phy_np;
+	struct resource *res;
+	struct regulator *reg_vbus;
+	int ret;
+
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data) {
+		dev_err(&pdev->dev, "Failed to allocate CI13xxx-IMX data!\n");

Same as in the other patch: This message contains no useful information.

Quoted 6 lines
drivers/usb/chipidea/Makefile +6 -0
+		return -ENOMEM;
+	}
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res) {
+		dev_err(&pdev->dev, "Can't get device resources!\n");

drivers/usb/chipidea/Makefile

Quoted 10 lines
drivers/usb/chipidea/Makefile +10 -0
+		return -ENOENT;
+	}
+
+	data->clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(data->clk)) {
+		dev_err(&pdev->dev, "Failed to get clock!\n");
+		return PTR_ERR(data->clk);
+	}
+
+	ret = clk_prepare_enable(data->clk);

You forgot to undo this is the error path.

drivers/usb/chipidea/Makefile

Quoted 7 lines
drivers/usb/chipidea/Makefile +7 -0
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to prepare or enable clock!\n");
+		return ret;
+	}
+
+	phy_np = of_parse_phandle(pdev->dev.of_node, "fsl,usbphy", 0);
+	if (phy_np) {

Ok, we maybe can do without a phy on some devices, but if we have one...

drivers/usb/chipidea/Makefile

Quoted 3 lines
drivers/usb/chipidea/Makefile +3 -0
+		data->phy_np = phy_np;
+		phy_pdev = of_find_device_by_node(phy_np);
+		if (phy_pdev) {

... shouldn't it be an error if we do not find the device?

Quoted 12 lines
drivers/usb/chipidea/Makefile +12 -0
+			struct usb_phy *phy;
+			phy = pdev_to_phy(phy_pdev);
+			if (phy &&
+			    try_module_get(phy_pdev->dev.driver->owner)) {
+				usb_phy_init(phy);
+				data->phy = phy;
+			}
+		}
+	}
+
+	/* we only support host now, so enable vbus here */
+	reg_vbus = devm_regulator_get(&pdev->dev, "vbus");

drivers/usb/chipidea/Makefile

Quoted 10 lines
drivers/usb/chipidea/Makefile +10 -0
+	if (!IS_ERR(reg_vbus)) {
+		ret = regulator_enable(reg_vbus);
+		if (ret) {
+			dev_err(&pdev->dev,
+				"Failed to enable vbus regulator!\n");
+			goto put_np;
+		}
+		data->reg_vbus = reg_vbus;
+	} else
+		reg_vbus = NULL;

If you have braces in one path of a if/else add them to the other path aswell.

Quoted 4 lines
drivers/usb/chipidea/Makefile +4 -0
+
+	ci13xxx_imx_platdata.phy = data->phy;
+
+	if (!pdev->dev.dma_mask) {

drivers/usb/chipidea/Makefile

Quoted 10 lines
drivers/usb/chipidea/Makefile +10 -0
+		pdev->dev.dma_mask = devm_kzalloc(&pdev->dev,
+				      sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
+		if (!pdev->dev.dma_mask) {
+			ret = -ENOMEM;
+			dev_err(&pdev->dev, "Failed to alloc dma_mask!\n");
+			goto err;
+		}
+		*pdev->dev.dma_mask = DMA_BIT_MASK(32);
+		dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask);
+	}

Do you need this? I assume not.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#16 lore raw

PATCH v5 6/13 usb: chipidea: add imx platform driver

Dear Sascha Hauer,

Quoted 18 lines · Richard Zhao
Quoted 17 lines

This patch supports only the host-mode functionality so far.

Cc Peter Chen <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

 .../devicetree/bindings/usb/ci13xxx-imx.txt        |   20 +++
 drivers/usb/chipidea/Makefile                      |    3 +
 drivers/usb/chipidea/ci13xxx_imx.c                 |  189
 ++++++++++++++++++++ 3 files changed, 212 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
 create mode 100644 drivers/usb/chipidea/ci13xxx_imx.c

[...]

Quoted 8 lines
Quoted 8 lines
drivers/usb/chipidea/ci13xxx_imx.c new file +8 -0
+
+	ci13xxx_imx_platdata.phy = data->phy;
+
+	if (!pdev->dev.dma_mask) {
+		pdev->dev.dma_mask = devm_kzalloc(&pdev->dev,
+				      sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
+		if (!pdev->dev.dma_mask) {
+			ret = -ENOMEM;
Quoted 8 lines

drivers/usb/chipidea/ci13xxx_imx.c line 118

Quoted 6 lines
drivers/usb/chipidea/ci13xxx_imx.c new file +6 -0
+			dev_err(&pdev->dev, "Failed to alloc dma_mask!\n");
+			goto err;
+		}
+		*pdev->dev.dma_mask = DMA_BIT_MASK(32);
+		dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask);
+	}

Do you need this? I assume not.

Ain't this the dma mask crap without which the usb stuff won't work?

Quoted 1 line

Sascha

Best regards,
Marek Vasut

maintainer
#17 lore raw

PATCH v5 6/13 usb: chipidea: add imx platform driver

Quoted 17 lines · Marek Vasut

Dear Sascha Hauer,

Quoted 6 lines
Quoted 6 lines
drivers/usb/chipidea/ci13xxx_imx.c new file +6 -0
+
+	if (!pdev->dev.dma_mask) {
+		pdev->dev.dma_mask = devm_kzalloc(&pdev->dev,
+				      sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
+		if (!pdev->dev.dma_mask) {
+			ret = -ENOMEM;
Quoted 8 lines

drivers/usb/chipidea/ci13xxx_imx.c line 118

Quoted 6 lines
drivers/usb/chipidea/ci13xxx_imx.c new file +6 -0
+			dev_err(&pdev->dev, "Failed to alloc dma_mask!\n");
+			goto err;
+		}
+		*pdev->dev.dma_mask = DMA_BIT_MASK(32);
+		dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask);
+	}

Do you need this? I assume not.

Quoted 1 line

Ain't this the dma mask crap without which the usb stuff won't work?

Yes, the device needs this, but afaik the of platform code will set this for you. You only have to do this manually for devices which you allocate yourself.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#18 lore raw

PATCH v5 6/13 usb: chipidea: add imx platform driver

Quoted 18 lines · Sascha Hauer
Quoted 17 lines · Marek Vasut

Dear Sascha Hauer,

Quoted 14 lines

drivers/usb/chipidea/ci13xxx_imx.c line 118

Quoted 12 lines
drivers/usb/chipidea/ci13xxx_imx.c new file +12 -0
+
+	if (!pdev->dev.dma_mask) {
+		pdev->dev.dma_mask = devm_kzalloc(&pdev->dev,
+				      sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
+		if (!pdev->dev.dma_mask) {
+			ret = -ENOMEM;
+			dev_err(&pdev->dev, "Failed to alloc dma_mask!\n");
+			goto err;
+		}
+		*pdev->dev.dma_mask = DMA_BIT_MASK(32);
+		dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask);
+	}

Do you need this? I assume not.

Quoted 5 lines
Quoted 1 line

Ain't this the dma mask crap without which the usb stuff won't work?

Yes, the device needs this, but afaik the of platform code will set this for you. You only have to do this manually for devices which you allocate yourself.

Unfortunately, devices device tree populated don't set dma_mask. It always hit if (!pdev->dev.dma_mask). I'm not the only one suffer it.

Thanks
Richard

Quoted 9 lines

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#19 lore raw

PATCH v5 6/13 usb: chipidea: add imx platform driver

In reply to Sascha Hauer
Quoted 33 lines · Sascha Hauer
Quoted 32 lines · Richard Zhao

This patch supports only the host-mode functionality so far.

Cc Peter Chen <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 .../devicetree/bindings/usb/ci13xxx-imx.txt        |   20 +++
 drivers/usb/chipidea/Makefile                      |    3 +
 drivers/usb/chipidea/ci13xxx_imx.c                 |  189 ++++++++++++++++++++
 3 files changed, 212 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
 create mode 100644 drivers/usb/chipidea/ci13xxx_imx.c
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +10 -0
new file mode 100644
index 0000000..beb75d6
@@ -0,0 +1,20 @@
+* Freescale i.MX ci13xxx usb controllers
+
+Required properties:
+- compatible: Should be "fsl,imx31-usb"
+- reg: Should contain registers location and length
+- interrupts: Should contain controller interrupt
+
+Optional properties:
+- fsl,usbphy: phandler of usb phy that connects to the only one port
+- fsl,hub-reset-gpios: gpio used to reset on-board usb hub
Quoted 8 lines

Documentation/devicetree/bindings/usb/ci13xxx-imx.txt line 15

Quoted 5 lines
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +5 -0
+- fsl,vbus-power-gpios: gpio used to set vbus power of the only one port
+
+Examples:
+usb at 02184000 { /* USB OTG */
+	compatible = "fsl,imx6q-usb", "fsl,imx31-usb";

The i.MX27 also has this core. As it's older that's probably the right fallback instead of i.MX31.

hmm.., I'll check the history and change it if it's correct.

Quoted 43 lines
Quoted 20 lines
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +5 -0
+	reg = <0x02184000 0x200>;
+	interrupts = <0 43 0x04>;
+	fsl,usbphy = <&usbphy1>;
+	fsl,vbus-power-gpios = <&gpio3 22 0>;
+};
drivers/usb/chipidea/Makefile +6 -0
index b69900a..5c66d9c 100644
@@ -14,3 +14,6 @@ ifneq ($(CONFIG_PCI),)
 	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_pci.o
 endif
 
+ifneq ($(CONFIG_OF_DEVICE),)
+	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_imx.o
+endif
+
+static int __devinit ci13xxx_imx_probe(struct platform_device *pdev)
+{

drivers/usb/chipidea/Makefile ifneq ($(CONFIG_PCI),)

Quoted 10 lines
drivers/usb/chipidea/Makefile +10 -0
+	struct ci13xxx_imx_data *data;
+	struct platform_device *plat_ci, *phy_pdev;
+	struct device_node *phy_np;
+	struct resource *res;
+	struct regulator *reg_vbus;
+	int ret;
+
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data) {
+		dev_err(&pdev->dev, "Failed to allocate CI13xxx-IMX data!\n");

Same as in the other patch: This message contains no useful information.

Quoted 10 lines
drivers/usb/chipidea/Makefile +10 -0
+		return -ENOMEM;
+	}
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res) {
+		dev_err(&pdev->dev, "Can't get device resources!\n");
+		return -ENOENT;
+	}
+
+	data->clk = devm_clk_get(&pdev->dev, NULL);
Quoted 8 lines

drivers/usb/chipidea/Makefile

Quoted 6 lines
drivers/usb/chipidea/Makefile +6 -0
+	if (IS_ERR(data->clk)) {
+		dev_err(&pdev->dev, "Failed to get clock!\n");
+		return PTR_ERR(data->clk);
+	}
+
+	ret = clk_prepare_enable(data->clk);

You forgot to undo this is the error path.

Nice catch.

Quoted 10 lines

drivers/usb/chipidea/Makefile

Quoted 8 lines
drivers/usb/chipidea/Makefile +7 -0
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to prepare or enable clock!\n");
+		return ret;
+	}
+
+	phy_np = of_parse_phandle(pdev->dev.of_node, "fsl,usbphy", 0);
+	if (phy_np) {

Ok, we maybe can do without a phy on some devices, but if we have one...

Some phy maybe passed by usb_set_transceiver. It's handled by chipidea udc driver.

Quoted 6 lines

drivers/usb/chipidea/Makefile

Quoted 4 lines
drivers/usb/chipidea/Makefile +3 -0
+		data->phy_np = phy_np;
+		phy_pdev = of_find_device_by_node(phy_np);
+		if (phy_pdev) {

... shouldn't it be an error if we do not find the device?

Same reason as above. We still have chance to pass phy by usb_set_transceiver.

Quoted 18 lines
Quoted 18 lines
drivers/usb/chipidea/Makefile +17 -0
+			struct usb_phy *phy;
+			phy = pdev_to_phy(phy_pdev);
+			if (phy &&
+			    try_module_get(phy_pdev->dev.driver->owner)) {
+				usb_phy_init(phy);
+				data->phy = phy;
+			}
+		}
+	}
+
+	/* we only support host now, so enable vbus here */
+	reg_vbus = devm_regulator_get(&pdev->dev, "vbus");
+	if (!IS_ERR(reg_vbus)) {
+		ret = regulator_enable(reg_vbus);
+		if (ret) {
+			dev_err(&pdev->dev,
+				"Failed to enable vbus regulator!\n");
Quoted 8 lines

drivers/usb/chipidea/Makefile

Quoted 5 lines
drivers/usb/chipidea/Makefile +5 -0
+			goto put_np;
+		}
+		data->reg_vbus = reg_vbus;
+	} else
+		reg_vbus = NULL;

If you have braces in one path of a if/else add them to the other path aswell.

I just tried it didn't cause warning of checkpatch. I'll change it.

Quoted 17 lines
Quoted 5 lines
drivers/usb/chipidea/Makefile +4 -0
+
+	ci13xxx_imx_platdata.phy = data->phy;
+
+	if (!pdev->dev.dma_mask) {

drivers/usb/chipidea/Makefile

Quoted 10 lines
drivers/usb/chipidea/Makefile +10 -0
+		pdev->dev.dma_mask = devm_kzalloc(&pdev->dev,
+				      sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
+		if (!pdev->dev.dma_mask) {
+			ret = -ENOMEM;
+			dev_err(&pdev->dev, "Failed to alloc dma_mask!\n");
+			goto err;
+		}
+		*pdev->dev.dma_mask = DMA_BIT_MASK(32);
+		dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask);
+	}

Do you need this? I assume not.

DT didn't set dma_mask when populate devices.

Thanks
Richard

Quoted 13 lines

Sascha

Signature · 8 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#20 lore raw

PATCH v5 7/13 ARM: imx6q: correct device name of usbphy and usb controller clock export

In reply to Richard Zhao
---
 arch/arm/mach-imx/clk-imx6q.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-imx/clk-imx6q.c +4 -1
index 96e9edd..f99509a 100644
@@ -391,7 +391,10 @@ int __init mx6q_clocks_init(void)
 	clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0");
 	clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0");
 	clk_register_clkdev(clk[twd], NULL, "smp_twd");
-	clk_register_clkdev(clk[usboh3], NULL, "usboh3");
+	clk_register_clkdev(clk[usboh3], NULL, "2184000.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184200.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184400.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184600.usb");
 	clk_register_clkdev(clk[uart_serial], "per", "2020000.serial");
 	clk_register_clkdev(clk[uart_ipg], "ipg", "2020000.serial");
 	clk_register_clkdev(clk[uart_serial], "per", "21e8000.serial");
Signature · 1 line
1.7.9.5
#21 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

In reply to Richard Zhao

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>
---
 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35 ++++++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/config-on-boot.txt
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +12 -0
new file mode 100644
index 0000000..f98ed74
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings that needs
+  to be set one time on boot but aren't owned by any driver, or the owned driver
+  is too generic to handle such settings. For example, usb hub uses generic
+  driver in usb core code, a on-board usb may need deassert reset pin.
+
+Optional properties:
+- output-gpios: Output gpio array that needs to set.
+- output-gpio-values: This property is required if output-gpios is set.
+  The value is a array of 0 or 1. Total count eaquals the number of gpios.
arch/arm/boot/dts/imx6q-sabrelite.dts +7 -0
index e0ec929..1dd2261 100644
@@ -17,6 +17,13 @@
 	model = "Freescale i.MX6 Quad SABRE Lite Board";
 	compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
 
+	config-on-boot {
+		output-gpios = <
+				&gpio3 22 0>;	/* vbus reset */
+		output-gpio-values = <
+				1>;		/* vbus reset */
+	};
+
 	memory {
 		reg = <0x10000000 0x40000000>;
 	};
arch/arm/mach-imx/mach-imx6q.c +35 -0
index b47e98b..577cf19 100644
@@ -19,6 +19,7 @@
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_gpio.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/pinctrl/machine.h>
@@ -113,6 +114,38 @@ static void __init imx6q_sabrelite_init(void)
 	imx6q_sabrelite_cko1_setup();
 }
 
+static void __init imx6q_config_on_boot(void)
+{
+	struct device_node *np;
+	struct property *pp;
+	int cnt, len, i;
+	int gpio;
+
+	np = of_find_node_by_path("/config-on-boot");
+	if (!np)
+		return;
+	cnt = of_gpio_named_count(np, "output-gpios");
+	pp = of_find_property(np, "output-gpio-values", &len);
+	if (!pp || cnt != len / sizeof(u32)) {
+		pr_err("Invalid config-on-boot gpios!\n");
+		of_node_put(np);
+		return;
+	}
+	for (i = 0; i < cnt; i++) {
+		gpio = of_get_named_gpio(np, "output-gpios", i);
+		if (gpio_is_valid(gpio))
+			gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+					"config-on-boot");
+	}
+
+	of_node_put(np);
+}
+
+static void __init imx6q_post_populate(void)
+{
+	imx6q_config_on_boot();
+}
+
 static void __init imx6q_init_machine(void)
 {
 	/*
@@ -126,6 +159,8 @@ static void __init imx6q_init_machine(void)
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	imx6q_post_populate();
+
 	imx6q_pm_init();
 }
 
Signature · 1 line
1.7.9.5
#22 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 22 lines · Richard Zhao

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>
---
 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35 ++++++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/config-on-boot.txt
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +0 -0
new file mode 100644
index 0000000..f98ed74

Documentation/devicetree/bindings/arm/config-on-boot.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +7 -0
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings that needs
+  to be set one time on boot but aren't owned by any driver, or the owned driver
+  is too generic to handle such settings. For example, usb hub uses generic
+  driver in usb core code, a on-board usb may need deassert reset pin.

NAK. This is not a h/w description and should be solved within the kernel or bootloader. Either fix this in u-boot, the platform code, or make the generic driver support this in a generic way.

Rob

Quoted 83 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +5 -0
+
+Optional properties:
+- output-gpios: Output gpio array that needs to set.
+- output-gpio-values: This property is required if output-gpios is set.
+  The value is a array of 0 or 1. Total count eaquals the number of gpios.
arch/arm/boot/dts/imx6q-sabrelite.dts +7 -0
index e0ec929..1dd2261 100644
@@ -17,6 +17,13 @@
 	model = "Freescale i.MX6 Quad SABRE Lite Board";
 	compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
 
+	config-on-boot {
+		output-gpios = <
+				&gpio3 22 0>;	/* vbus reset */
+		output-gpio-values = <
+				1>;		/* vbus reset */
+	};
+
 	memory {
 		reg = <0x10000000 0x40000000>;
 	};
arch/arm/mach-imx/mach-imx6q.c +35 -0
index b47e98b..577cf19 100644
@@ -19,6 +19,7 @@
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_gpio.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/pinctrl/machine.h>
@@ -113,6 +114,38 @@ static void __init imx6q_sabrelite_init(void)
 	imx6q_sabrelite_cko1_setup();
 }
 
+static void __init imx6q_config_on_boot(void)
+{
+	struct device_node *np;
+	struct property *pp;
+	int cnt, len, i;
+	int gpio;
+
+	np = of_find_node_by_path("/config-on-boot");
+	if (!np)
+		return;
+	cnt = of_gpio_named_count(np, "output-gpios");
+	pp = of_find_property(np, "output-gpio-values", &len);
+	if (!pp || cnt != len / sizeof(u32)) {
+		pr_err("Invalid config-on-boot gpios!\n");
+		of_node_put(np);
+		return;
+	}
+	for (i = 0; i < cnt; i++) {
+		gpio = of_get_named_gpio(np, "output-gpios", i);
+		if (gpio_is_valid(gpio))
+			gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+					"config-on-boot");
+	}
+
+	of_node_put(np);
+}
+
+static void __init imx6q_post_populate(void)
+{
+	imx6q_config_on_boot();
+}
+
 static void __init imx6q_init_machine(void)
 {
 	/*
@@ -126,6 +159,8 @@ static void __init imx6q_init_machine(void)
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	imx6q_post_populate();
+
 	imx6q_pm_init();
 }
 
#23 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Dear Rob Herring,

Quoted 29 lines · Richard Zhao
Quoted 28 lines

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>

---

 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35
 ++++++++++++++++++++ 3 files changed, 54 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/arm/config-on-boot.txt

(quoted diff) +0 -0

b/Documentation/devicetree/bindings/arm/config-on-boot.txt new file mode 100644
index 0000000..f98ed74

Documentation/devicetree/bindings/arm/config-on-boot.txt new file +3 -0
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
Quoted 8 lines
Quoted 5 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +1 -0
+  It must be in root node. config-on-boot means to describe settings

that needs + to be set one time on boot but aren't owned by any driver, or the owned driver + is too generic to handle such settings. For example, usb hub uses generic + driver in usb core code, a on-board usb may need deassert reset pin.

NAK. This is not a h/w description and should be solved within the kernel or bootloader. Either fix this in u-boot

I don't want to be the bastard here, but this shouldn't go into uboot.

Quoted 1 line

the platform code

Yes, it should be here. But then, it's some usb reset, so maybe the PHY should somehow handle it?

Quoted 2 lines

, or
make the generic driver support this in a generic way.

Well, this is platform specific stuff, so it shouldn't be in any way part of the driver.

Quoted 93 lines

Rob

Quoted 90 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +5 -0
+
+Optional properties:
+- output-gpios: Output gpio array that needs to set.
+- output-gpio-values: This property is required if output-gpios is set.
+  The value is a array of 0 or 1. Total count eaquals the number of

gpios. diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts index e0ec929..1dd2261 100644

arch/arm/boot/dts/imx6q-sabrelite.dts +7 -0
@@ -17,6 +17,13 @@
 
 	model = "Freescale i.MX6 Quad SABRE Lite Board";
 	compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
 
+	config-on-boot {
+		output-gpios = <
+				&gpio3 22 0>;	/* vbus reset */
+		output-gpio-values = <
+				1>;		/* vbus reset */
+	};
+
 
 	memory {
arch/arm/boot/dts/imx6q-sabrelite.dts +0 -0
 		reg = <0x10000000 0x40000000>;
 
 	};
(quoted diff) +0 -0

b/arch/arm/mach-imx/mach-imx6q.c index b47e98b..577cf19 100644

arch/arm/mach-imx/mach-imx6q.c +1 -0
@@ -19,6 +19,7 @@
 
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 
+#include <linux/of_gpio.h>
 

#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/pinctrl/machine.h>

arch/arm/mach-imx/mach-imx6q.c +32 -0
@@ -113,6 +114,38 @@ static void __init imx6q_sabrelite_init(void)
 
 	imx6q_sabrelite_cko1_setup();
 
 }
 
+static void __init imx6q_config_on_boot(void)
+{
+	struct device_node *np;
+	struct property *pp;
+	int cnt, len, i;
+	int gpio;
+
+	np = of_find_node_by_path("/config-on-boot");
+	if (!np)
+		return;
+	cnt = of_gpio_named_count(np, "output-gpios");
+	pp = of_find_property(np, "output-gpio-values", &len);
+	if (!pp || cnt != len / sizeof(u32)) {
+		pr_err("Invalid config-on-boot gpios!\n");
+		of_node_put(np);
+		return;
+	}
+	for (i = 0; i < cnt; i++) {
+		gpio = of_get_named_gpio(np, "output-gpios", i);
+		if (gpio_is_valid(gpio))
+			gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+					"config-on-boot");
+	}
+
+	of_node_put(np);
+}
+
+static void __init imx6q_post_populate(void)
+{
+	imx6q_config_on_boot();
+}
+
 

static void __init imx6q_init_machine(void)
{

arch/arm/mach-imx/mach-imx6q.c +0 -0
 	/*
@@ -126,6 +159,8 @@ static void __init imx6q_init_machine(void)
 
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-imx/mach-imx6q.c +2 -0
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	imx6q_post_populate();
+
 
 	imx6q_pm_init();
 

}

Best regards,
Marek Vasut

#24 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 40 lines · Marek Vasut

Dear Rob Herring,

Quoted 29 lines · Richard Zhao
Quoted 28 lines

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>

---

 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35
 ++++++++++++++++++++ 3 files changed, 54 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/arm/config-on-boot.txt

(quoted diff) +0 -0

b/Documentation/devicetree/bindings/arm/config-on-boot.txt new file mode 100644
index 0000000..f98ed74

Documentation/devicetree/bindings/arm/config-on-boot.txt new file +3 -0
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
Quoted 8 lines
Quoted 5 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +1 -0
+  It must be in root node. config-on-boot means to describe settings

that needs + to be set one time on boot but aren't owned by any driver, or the owned driver + is too generic to handle such settings. For example, usb hub uses generic + driver in usb core code, a on-board usb may need deassert reset pin.

NAK. This is not a h/w description and should be solved within the kernel or bootloader. Either fix this in u-boot

Quoted 1 line

I don't want to be the bastard here, but this shouldn't go into uboot.

Just listing possible options. Obviously, no one wants the dirty stuff in their code...

There would never be a need in u-boot to support boot from USB mass storage? In which case you would have to handle this reset line leaving it deasserted and linux would likely never know. (Yes, I know we can't rely on bootloader setup.)

Quoted 10 lines
Quoted 1 line

the platform code

Yes, it should be here. But then, it's some usb reset, so maybe the PHY should somehow handle it?

Quoted 2 lines

, or
make the generic driver support this in a generic way.

Well, this is platform specific stuff, so it shouldn't be in any way part of the driver.

An embedded hub with gpio controlled reset line sounds fairly generic to me. The only platform specific part is which gpio line which is nothing new to deal with.

On the other hand, this is really a flaw in the h/w design as whether the hub is integrated on board or a separate hub should be transparent to s/w. So just keeping it contained in platform code may be the best option.

Rob

Quoted 105 lines
Quoted 94 lines

Rob

Quoted 90 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +5 -0
+
+Optional properties:
+- output-gpios: Output gpio array that needs to set.
+- output-gpio-values: This property is required if output-gpios is set.
+  The value is a array of 0 or 1. Total count eaquals the number of

gpios. diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts index e0ec929..1dd2261 100644

arch/arm/boot/dts/imx6q-sabrelite.dts +7 -0
@@ -17,6 +17,13 @@
 
 	model = "Freescale i.MX6 Quad SABRE Lite Board";
 	compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
 
+	config-on-boot {
+		output-gpios = <
+				&gpio3 22 0>;	/* vbus reset */
+		output-gpio-values = <
+				1>;		/* vbus reset */
+	};
+
 
 	memory {
arch/arm/boot/dts/imx6q-sabrelite.dts +0 -0
 		reg = <0x10000000 0x40000000>;
 
 	};
(quoted diff) +0 -0

b/arch/arm/mach-imx/mach-imx6q.c index b47e98b..577cf19 100644

arch/arm/mach-imx/mach-imx6q.c +1 -0
@@ -19,6 +19,7 @@
 
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 
+#include <linux/of_gpio.h>
 

#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/pinctrl/machine.h>

arch/arm/mach-imx/mach-imx6q.c +32 -0
@@ -113,6 +114,38 @@ static void __init imx6q_sabrelite_init(void)
 
 	imx6q_sabrelite_cko1_setup();
 
 }
 
+static void __init imx6q_config_on_boot(void)
+{
+	struct device_node *np;
+	struct property *pp;
+	int cnt, len, i;
+	int gpio;
+
+	np = of_find_node_by_path("/config-on-boot");
+	if (!np)
+		return;
+	cnt = of_gpio_named_count(np, "output-gpios");
+	pp = of_find_property(np, "output-gpio-values", &len);
+	if (!pp || cnt != len / sizeof(u32)) {
+		pr_err("Invalid config-on-boot gpios!\n");
+		of_node_put(np);
+		return;
+	}
+	for (i = 0; i < cnt; i++) {
+		gpio = of_get_named_gpio(np, "output-gpios", i);
+		if (gpio_is_valid(gpio))
+			gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+					"config-on-boot");
+	}
+
+	of_node_put(np);
+}
+
+static void __init imx6q_post_populate(void)
+{
+	imx6q_config_on_boot();
+}
+
 

static void __init imx6q_init_machine(void)
{

arch/arm/mach-imx/mach-imx6q.c +0 -0
 	/*
@@ -126,6 +159,8 @@ static void __init imx6q_init_machine(void)
 
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-imx/mach-imx6q.c +2 -0
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	imx6q_post_populate();
+
 
 	imx6q_pm_init();
 

}

Best regards,
Marek Vasut

#25 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Dear Rob Herring,

Quoted 41 lines · Marek Vasut
Quoted 40 lines

Dear Rob Herring,

Quoted 37 lines · Richard Zhao
Quoted 29 lines

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>

---

 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35
 ++++++++++++++++++++ 3 files changed, 54 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/arm/config-on-boot.txt

(quoted diff) +0 -0

b/Documentation/devicetree/bindings/arm/config-on-boot.txt new file mode 100644
index 0000000..f98ed74

Documentation/devicetree/bindings/arm/config-on-boot.txt new file +4 -0
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings
Quoted 4 lines

that needs + to be set one time on boot but aren't owned by any driver, or the owned driver + is too generic to handle such settings. For example, usb hub uses generic + driver in usb core code, a on-board usb may need deassert reset pin.

NAK. This is not a h/w description and should be solved within the kernel or bootloader. Either fix this in u-boot

Quoted 7 lines
Quoted 1 line

I don't want to be the bastard here, but this shouldn't go into uboot.

Just listing possible options. Obviously, no one wants the dirty stuff in their code...

There would never be a need in u-boot to support boot from USB mass storage?

We already support that obviously ;-)

Quoted 3 lines

In which case you would have to handle this reset line leaving it deasserted and linux would likely never know. (Yes, I know we can't rely on bootloader setup.)

But we defer the initialization of USB to a point where user really needs it. Therefore if you boot from ie. NAND, you won't have the USB inited anyway.

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

the platform code

Yes, it should be here. But then, it's some usb reset, so maybe the PHY should somehow handle it?

Quoted 2 lines

, or
make the generic driver support this in a generic way.

Quoted 6 lines
Quoted 2 lines

Well, this is platform specific stuff, so it shouldn't be in any way part of the driver.

An embedded hub with gpio controlled reset line sounds fairly generic to me. The only platform specific part is which gpio line which is nothing new to deal with.

And what about embedded hub that has two distinct power GPIOs? And we can go forever with this discussion.

Quoted 3 lines

On the other hand, this is really a flaw in the h/w design as whether the hub is integrated on board or a separate hub should be transparent to s/w.

I don't think so. You might want to minimize the power consumption by disabling the hub power completely.

Quoted 2 lines

So just keeping it contained in platform code may be the best option.

Agreed

Quoted 105 lines

Rob

Quoted 103 lines
Quoted 92 lines

Rob

Quoted 90 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +4 -0
+
+Optional properties:
+- output-gpios: Output gpio array that needs to set.
+- output-gpio-values: This property is required if output-gpios is

set. + The value is a array of 0 or 1. Total count eaquals the number of gpios. diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts index e0ec929..1dd2261 100644

arch/arm/boot/dts/imx6q-sabrelite.dts +7 -0
@@ -17,6 +17,13 @@
 
 	model = "Freescale i.MX6 Quad SABRE Lite Board";
 	compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
 
+	config-on-boot {
+		output-gpios = <
+				&gpio3 22 0>;	/* vbus reset */
+		output-gpio-values = <
+				1>;		/* vbus reset */
+	};
+
 
 	memory {
arch/arm/boot/dts/imx6q-sabrelite.dts +0 -0
 		reg = <0x10000000 0x40000000>;
 
 	};
(quoted diff) +0 -0

b/arch/arm/mach-imx/mach-imx6q.c index b47e98b..577cf19 100644

arch/arm/mach-imx/mach-imx6q.c +1 -0
@@ -19,6 +19,7 @@
 
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 
+#include <linux/of_gpio.h>
 

#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/pinctrl/machine.h>

arch/arm/mach-imx/mach-imx6q.c +32 -0
@@ -113,6 +114,38 @@ static void __init imx6q_sabrelite_init(void)
 
 	imx6q_sabrelite_cko1_setup();
 
 }
 
+static void __init imx6q_config_on_boot(void)
+{
+	struct device_node *np;
+	struct property *pp;
+	int cnt, len, i;
+	int gpio;
+
+	np = of_find_node_by_path("/config-on-boot");
+	if (!np)
+		return;
+	cnt = of_gpio_named_count(np, "output-gpios");
+	pp = of_find_property(np, "output-gpio-values", &len);
+	if (!pp || cnt != len / sizeof(u32)) {
+		pr_err("Invalid config-on-boot gpios!\n");
+		of_node_put(np);
+		return;
+	}
+	for (i = 0; i < cnt; i++) {
+		gpio = of_get_named_gpio(np, "output-gpios", i);
+		if (gpio_is_valid(gpio))
+			gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+					"config-on-boot");
+	}
+
+	of_node_put(np);
+}
+
+static void __init imx6q_post_populate(void)
+{
+	imx6q_config_on_boot();
+}
+
 

static void __init imx6q_init_machine(void)
{

arch/arm/mach-imx/mach-imx6q.c +0 -0
 	/*
@@ -126,6 +159,8 @@ static void __init imx6q_init_machine(void)
 
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-imx/mach-imx6q.c +2 -0
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	imx6q_post_populate();
+
 
 	imx6q_pm_init();
 

}

Best regards,
Marek Vasut

#26 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

In reply to Rob Herring
Quoted 17 lines · Rob Herring
Quoted 16 lines · Richard Zhao

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>
---
 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35 ++++++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/config-on-boot.txt
Quoted 15 lines

Documentation/devicetree/bindings/arm/config-on-boot.txt line 7

Quoted 13 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +7 -0
new file mode 100644
index 0000000..f98ed74
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings that needs
+  to be set one time on boot but aren't owned by any driver, or the owned driver
+  is too generic to handle such settings. For example, usb hub uses generic
+  driver in usb core code, a on-board usb may need deassert reset pin.

NAK. This is not a h/w description

It's misc things, but is hw description.

Quoted 2 lines

and should be solved within the
kernel or bootloader. Either fix this in u-boot,

Kernel might be better not to depend on uboot.

Quoted 1 line

the platform code, or

How do I get gpio in platfrom code without dts description?

Quoted 1 line

make the generic driver support this in a generic way.

It's called just after populate devices. It's hard for generic driver to decide when it's called.

Thanks
Richard

Quoted 87 lines

Rob

Quoted 83 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +5 -0
+
+Optional properties:
+- output-gpios: Output gpio array that needs to set.
+- output-gpio-values: This property is required if output-gpios is set.
+  The value is a array of 0 or 1. Total count eaquals the number of gpios.
arch/arm/boot/dts/imx6q-sabrelite.dts +7 -0
index e0ec929..1dd2261 100644
@@ -17,6 +17,13 @@
 	model = "Freescale i.MX6 Quad SABRE Lite Board";
 	compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
 
+	config-on-boot {
+		output-gpios = <
+				&gpio3 22 0>;	/* vbus reset */
+		output-gpio-values = <
+				1>;		/* vbus reset */
+	};
+
 	memory {
 		reg = <0x10000000 0x40000000>;
 	};
arch/arm/mach-imx/mach-imx6q.c +35 -0
index b47e98b..577cf19 100644
@@ -19,6 +19,7 @@
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_gpio.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/pinctrl/machine.h>
@@ -113,6 +114,38 @@ static void __init imx6q_sabrelite_init(void)
 	imx6q_sabrelite_cko1_setup();
 }
 
+static void __init imx6q_config_on_boot(void)
+{
+	struct device_node *np;
+	struct property *pp;
+	int cnt, len, i;
+	int gpio;
+
+	np = of_find_node_by_path("/config-on-boot");
+	if (!np)
+		return;
+	cnt = of_gpio_named_count(np, "output-gpios");
+	pp = of_find_property(np, "output-gpio-values", &len);
+	if (!pp || cnt != len / sizeof(u32)) {
+		pr_err("Invalid config-on-boot gpios!\n");
+		of_node_put(np);
+		return;
+	}
+	for (i = 0; i < cnt; i++) {
+		gpio = of_get_named_gpio(np, "output-gpios", i);
+		if (gpio_is_valid(gpio))
+			gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+					"config-on-boot");
+	}
+
+	of_node_put(np);
+}
+
+static void __init imx6q_post_populate(void)
+{
+	imx6q_config_on_boot();
+}
+
 static void __init imx6q_init_machine(void)
 {
 	/*
@@ -126,6 +159,8 @@ static void __init imx6q_init_machine(void)
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	imx6q_post_populate();
+
 	imx6q_pm_init();
 }
 
#27 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Dear Richard Zhao,

Quoted 38 lines · Rob Herring
Quoted 28 lines · Richard Zhao
Quoted 27 lines

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>

---

 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35
 ++++++++++++++++++++ 3 files changed, 54 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/arm/config-on-boot.txt

(quoted diff) +0 -0

b/Documentation/devicetree/bindings/arm/config-on-boot.txt new file mode 100644
index 0000000..f98ed74

Documentation/devicetree/bindings/arm/config-on-boot.txt new file +2 -0
@@ -0,0 +1,12 @@
+* Configure on Boot
+
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +2 -0
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings

that needs + to be set one time on boot but aren't owned by any driver, or the owned driver + is too generic to handle such settings. For example, usb hub uses generic + driver in usb core code, a on-board usb may need deassert reset pin.

NAK. This is not a h/w description

Quoted 6 lines

It's misc things, but is hw description.

Quoted 2 lines

and should be solved within the
kernel or bootloader. Either fix this in u-boot,

Kernel might be better not to depend on uboot.

And we don't want to polute uboot either, so this is a good move.

Quoted 3 lines
Quoted 1 line

the platform code, or

How do I get gpio in platfrom code without dts description?

Write a driver that does the GPIO setup in some generic way? Wasn't there something about this stuff going on? Shawn, you had some comments /wrt the M28 DTS. This might be what you meant?

Quoted 7 lines
Quoted 1 line

make the generic driver support this in a generic way.

It's called just after populate devices. It's hard for generic driver to decide when it's called.

Thanks
Richard

Best regards,
Marek Vasut

#28 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 4 lines · Marek Vasut

Write a driver that does the GPIO setup in some generic way? Wasn't there something about this stuff going on? Shawn, you had some comments /wrt the M28 DTS. This might be what you meant?

No. What Richard is looking for is a way to set/clear gpio, while what I was commenting on M28 DTS is the way to configure a pin into gpio mode. In this series, Richard chose to use "hog" feature to configure the pin into gpio mode, which means defining a pinctrl state for pin controller node itself, then at pinctrl subsystem init time, pinctrl core will configure these "hog" pins properly.

The "hog" method makes some sense for Richard's case, where the pin has no clear device/driver owner, and when gpio_request call can not configure the requested pin into gpio mode automatically yet.

Signature · 2 lines
Regards,
Shawn
#29 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

In reply to Richard Zhao
Quoted 33 lines · Richard Zhao
Quoted 17 lines · Rob Herring
Quoted 16 lines · Richard Zhao

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>
---
 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35 ++++++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/config-on-boot.txt
Quoted 15 lines

Documentation/devicetree/bindings/arm/config-on-boot.txt line 7

Quoted 13 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +7 -0
new file mode 100644
index 0000000..f98ed74
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings that needs
+  to be set one time on boot but aren't owned by any driver, or the owned driver
+  is too generic to handle such settings. For example, usb hub uses generic
+  driver in usb core code, a on-board usb may need deassert reset pin.

NAK. This is not a h/w description

Quoted 1 line

It's misc things, but is hw description.

You are defining something based on whether linux has a driver or not. That should not matter to DT. That's backwards.

Quoted 8 lines
Quoted 2 lines

and should be solved within the
kernel or bootloader. Either fix this in u-boot,

Kernel might be better not to depend on uboot.

Quoted 1 line

the platform code, or

How do I get gpio in platfrom code without dts description?

Quoted 1 line

make the generic driver support this in a generic way.

It's called just after populate devices. It's hard for generic driver to decide when it's called.

You need to describe that you have a hub on the usb bus and add the gpio line to that node. Just like PCI is probe-able, you still need DT nodes sometimes for cases like this. A simpler approach would be to just add the gpio to the ehci controller node, but that's not exactly correct.

Rob

Quoted 90 lines

Thanks
Richard

Quoted 87 lines

Rob

Quoted 83 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +5 -0
+
+Optional properties:
+- output-gpios: Output gpio array that needs to set.
+- output-gpio-values: This property is required if output-gpios is set.
+  The value is a array of 0 or 1. Total count eaquals the number of gpios.
arch/arm/boot/dts/imx6q-sabrelite.dts +7 -0
index e0ec929..1dd2261 100644
@@ -17,6 +17,13 @@
 	model = "Freescale i.MX6 Quad SABRE Lite Board";
 	compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
 
+	config-on-boot {
+		output-gpios = <
+				&gpio3 22 0>;	/* vbus reset */
+		output-gpio-values = <
+				1>;		/* vbus reset */
+	};
+
 	memory {
 		reg = <0x10000000 0x40000000>;
 	};
arch/arm/mach-imx/mach-imx6q.c +35 -0
index b47e98b..577cf19 100644
@@ -19,6 +19,7 @@
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_gpio.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/pinctrl/machine.h>
@@ -113,6 +114,38 @@ static void __init imx6q_sabrelite_init(void)
 	imx6q_sabrelite_cko1_setup();
 }
 
+static void __init imx6q_config_on_boot(void)
+{
+	struct device_node *np;
+	struct property *pp;
+	int cnt, len, i;
+	int gpio;
+
+	np = of_find_node_by_path("/config-on-boot");
+	if (!np)
+		return;
+	cnt = of_gpio_named_count(np, "output-gpios");
+	pp = of_find_property(np, "output-gpio-values", &len);
+	if (!pp || cnt != len / sizeof(u32)) {
+		pr_err("Invalid config-on-boot gpios!\n");
+		of_node_put(np);
+		return;
+	}
+	for (i = 0; i < cnt; i++) {
+		gpio = of_get_named_gpio(np, "output-gpios", i);
+		if (gpio_is_valid(gpio))
+			gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+					"config-on-boot");
+	}
+
+	of_node_put(np);
+}
+
+static void __init imx6q_post_populate(void)
+{
+	imx6q_config_on_boot();
+}
+
 static void __init imx6q_init_machine(void)
 {
 	/*
@@ -126,6 +159,8 @@ static void __init imx6q_init_machine(void)
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	imx6q_post_populate();
+
 	imx6q_pm_init();
 }
 
#30 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 34 lines · Rob Herring
Quoted 33 lines · Richard Zhao
Quoted 32 lines · Rob Herring
Quoted 22 lines · Richard Zhao

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>
---
 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35 ++++++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/config-on-boot.txt
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +0 -0
new file mode 100644
index 0000000..f98ed74

Documentation/devicetree/bindings/arm/config-on-boot.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +7 -0
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings that needs
+  to be set one time on boot but aren't owned by any driver, or the owned driver
+  is too generic to handle such settings. For example, usb hub uses generic
+  driver in usb core code, a on-board usb may need deassert reset pin.

NAK. This is not a h/w description

Quoted 4 lines
Quoted 1 line

It's misc things, but is hw description.

You are defining something based on whether linux has a driver or not. That should not matter to DT. That's backwards.

I just define the board needs some misc settings. If you think config-on-boot is not good, we can name it like config-misc.

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

and should be solved within the
kernel or bootloader. Either fix this in u-boot,

Kernel might be better not to depend on uboot.

Quoted 1 line

the platform code, or

Quoted 8 lines
Quoted 4 lines

How do I get gpio in platfrom code without dts description?

Quoted 1 line

make the generic driver support this in a generic way.

It's called just after populate devices. It's hard for generic driver to decide when it's called.

You need to describe that you have a hub on the usb bus and add the gpio line to that node. Just like PCI is probe-able, you still need DT nodes sometimes for cases like this.

PCI has dev id and may add quirks. But for embedded, I don't know how to connect a of node to a hub device enumerated by usb core code. And it may also pollute the usb core code.

Quoted 2 lines

A simpler approach would be to just add
the gpio to the ehci controller node, but that's not exactly correct.

That's exactly why this patch comes out.

Thanks
Richard

Quoted 10 lines

Rob

Quoted 6 lines

Thanks
Richard

Quoted 3 lines

Rob

#31 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 35 lines · Richard Zhao
Quoted 34 lines · Rob Herring
Quoted 33 lines · Richard Zhao
Quoted 32 lines · Rob Herring
Quoted 22 lines · Richard Zhao

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>
---
 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35 ++++++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/config-on-boot.txt
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +0 -0
new file mode 100644
index 0000000..f98ed74

Documentation/devicetree/bindings/arm/config-on-boot.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +7 -0
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings that needs
+  to be set one time on boot but aren't owned by any driver, or the owned driver
+  is too generic to handle such settings. For example, usb hub uses generic
+  driver in usb core code, a on-board usb may need deassert reset pin.

NAK. This is not a h/w description

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

It's misc things, but is hw description.

You are defining something based on whether linux has a driver or not. That should not matter to DT. That's backwards.

I just define the board needs some misc settings. If you think config-on-boot is not good, we can name it like config-misc.

Even worse.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 3 lines

and should be solved within the
kernel or bootloader. Either fix this in u-boot,

Kernel might be better not to depend on uboot.

Quoted 1 line

the platform code, or

How do I get gpio in platfrom code without dts description?

Quoted 1 line

make the generic driver support this in a generic way.

It's called just after populate devices. It's hard for generic driver to decide when it's called.

Quoted 6 lines
Quoted 3 lines

You need to describe that you have a hub on the usb bus and add the gpio line to that node. Just like PCI is probe-able, you still need DT nodes sometimes for cases like this.

PCI has dev id and may add quirks. But for embedded, I don't know how to connect a of node to a hub device enumerated by usb core code. And it may also pollute the usb core code.

USB also uses device and manufacturer ids. One of the main reasons for putting pci devices into dts is to describe out of band signals just like this.

Creating a binding and support code for full usb bus topology would be a lot of work which is why I propose a simpler approach below.

Quoted 3 lines
Quoted 2 lines

A simpler approach would be to just add
the gpio to the ehci controller node, but that's not exactly correct.

That's exactly why this patch comes out.

I mean just something like "fsl,hub-reset-gpios" in the ehci device node. It's at least under a usb node. Whether the ehci driver handles this or you just have a separate piece of code to find this property and setup the gpio is up to you.

Rob

#32 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 5 lines · Rob Herring

I mean just something like "fsl,hub-reset-gpios" in the ehci device node. It's at least under a usb node. Whether the ehci driver handles this or you just have a separate piece of code to find this property and setup the gpio is up to you.

I ever had an argument on this. If we have "fsl,hub-reset-gpios" defined in ehci device node, it should simply be ehci driver who needs to find this property and set up the gpio. Defining the property in ehci device node while having platform code to find the property just seems wired to me. That said, if it's not ehci driver who will use the property, we should not define the property in in ehci device node.

Signature · 2 lines
Regards,
Shawn
#33 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 6 lines · Shawn Guo
Quoted 5 lines · Rob Herring

I mean just something like "fsl,hub-reset-gpios" in the ehci device node. It's at least under a usb node. Whether the ehci driver handles this or you just have a separate piece of code to find this property and setup the gpio is up to you.

Quoted 6 lines

I ever had an argument on this. If we have "fsl,hub-reset-gpios" defined in ehci device node, it should simply be ehci driver who needs to find this property and set up the gpio. Defining the property in ehci device node while having platform code to find the property just seems wired to me. That said, if it's not ehci driver who will use the property, we should not define the property in in ehci device node.

There's no requirement that 1 DT node be 1 driver. That's purely an OS decision and it's usually simpler that way. But if it it's just a one time thing at boot, then its fine for the platform code to handle it.

Rob

#34 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

In reply to Rob Herring
Quoted 9 lines · Rob Herring
Quoted 8 lines · Richard Zhao
Quoted 7 lines · Rob Herring
Quoted 6 lines · Richard Zhao
Quoted 5 lines · Rob Herring
Quoted 4 lines · Richard Zhao

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

...

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Documentation/devicetree/bindings/arm/config-on-boot.txt +0 -0

...

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Documentation/devicetree/bindings/arm/config-on-boot.txt line 7

Quoted 5 lines
Documentation/devicetree/bindings/arm/config-on-boot.txt +5 -0
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings that needs
+  to be set one time on boot but aren't owned by any driver, or the owned driver
+  is too generic to handle such settings. For example, usb hub uses generic
+  driver in usb core code, a on-board usb may need deassert reset pin.

NAK. This is not a h/w description

...

Quoted 15 lines
Quoted 7 lines
Quoted 3 lines

You need to describe that you have a hub on the usb bus and add the gpio line to that node. Just like PCI is probe-able, you still need DT nodes sometimes for cases like this.

PCI has dev id and may add quirks. But for embedded, I don't know how to connect a of node to a hub device enumerated by usb core code. And it may also pollute the usb core code.

USB also uses device and manufacturer ids. One of the main reasons for putting pci devices into dts is to describe out of band signals just like this.

Creating a binding and support code for full usb bus topology would be a lot of work which is why I propose a simpler approach below.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

A simpler approach would be to just add
the gpio to the ehci controller node, but that's not exactly correct.

That's exactly why this patch comes out.

I mean just something like "fsl,hub-reset-gpios" in the ehci device node. It's at least under a usb node. Whether the ehci driver handles this or you just have a separate piece of code to find this property and setup the gpio is up to you.

I haven't been following the thread, but just noticed it. Very similar things (DT nodes for probed devices) are coming up quite a bit recently, for example:

Re: Where to power on the wifi device before loading the driver.
http://www.spinics.net/lists/arm-kernel/msg180368.html

dt: rfkill-gpio: add bindings documentation
http://www.spinics.net/lists/linux-tegra/msg03977.html

I wonder if there's any kind of infra-structure or standardized bindings that would be useful here?

#35 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 5 lines

I haven't been following the thread, but just noticed it. Very similar things (DT nodes for probed devices) are coming up quite a bit recently, for example:

Quoted 8 lines

Re: Where to power on the wifi device before loading the driver.
http://www.spinics.net/lists/arm-kernel/msg180368.html

dt: rfkill-gpio: add bindings documentation
http://www.spinics.net/lists/linux-tegra/msg03977.html

I wonder if there's any kind of infra-structure or standardized bindings that would be useful here?

Hi Stephen,
For your suggestion:

sdhci at 78000000 {
	compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci";
	reg = <0x78000000 0x200>;
	interrupts = <0 14 0x04>;

	sdio-device {
		reset-gpios = <...>;
		enable-gpios = <...>;
	};
};

I have a question, if reset-gpio or enable-gpio is not set, how bus (sd or usb) know it is a sdio device as the wifi is not powered on at the time, it will not response host's command, the hub at usb bus is the same.

#36 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 28 lines · On 06/20/2012 07:32 PM, Chen Peter-B29397 wrote:
Quoted 5 lines

I haven't been following the thread, but just noticed it. Very similar things (DT nodes for probed devices) are coming up quite a bit recently, for example:

Quoted 8 lines

Re: Where to power on the wifi device before loading the driver.
http://www.spinics.net/lists/arm-kernel/msg180368.html

dt: rfkill-gpio: add bindings documentation
http://www.spinics.net/lists/linux-tegra/msg03977.html

I wonder if there's any kind of infra-structure or standardized bindings that would be useful here?

Hi Stephen,
For your suggestion:

sdhci at 78000000 {
	compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci";
	reg = <0x78000000 0x200>;
	interrupts = <0 14 0x04>;

	sdio-device {
		reset-gpios = <...>;
		enable-gpios = <...>;
	};
};
Quoted 3 lines

I have a question, if reset-gpio or enable-gpio is not set, how bus (sd or usb) know it is a sdio device as the wifi is not powered on at the time, it will not response host's command, the hub at usb bus is the same.

That's a good point. We need those properties to be part of the device that controls the port/slot/connector, not the thing that plugs into it. Having each such binding and driver implement this themselves might not be a good idea though. Perhaps we can standardize on a mechanism for this; something vaguely like rfkill, but for arbitrary types of devices connected to ports.

For USB at least, where the power/reset/... GPIOs might affect just one port on a hub rather than the root USB host controller, the issue of representing these properties on a dynamically probed device still applies. Something like:

ehci {
    /* The following node is dynamically detected, although the hub
     * IC is physically soldered onto the board
     */
    hub {
        hub { /* also dynamic */
            port at 2 {
                child-supply = <&regulator>;
                reset-gpios = <&gpio 0 0>;
            };
        };
    };
};

But without knowing what might be connected to port at 2, how do we know how to sequence the power supply and reset GPIOs according to its requirements? I guess this is part of the specification of the port itself though, not the attached device, since anything that is allowed to plug in must conform to whatever sequencing the port is designed to give. If the connected device is known, the port at 2 node in DT can encode whatever sequencing requirements are associated with the known connected device.

#37 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 28 lines

That's a good point. We need those properties to be part of the device that controls the port/slot/connector, not the thing that plugs into it. Having each such binding and driver implement this themselves might not be a good idea though. Perhaps we can standardize on a mechanism for this; something vaguely like rfkill, but for arbitrary types of devices connected to ports.

For USB at least, where the power/reset/... GPIOs might affect just one port on a hub rather than the root USB host controller, the issue of representing these properties on a dynamically probed device still applies. Something like:

ehci {
    /* The following node is dynamically detected, although the hub
     * IC is physically soldered onto the board
     */
    hub {
        hub { /* also dynamic */
            port at 2 {
                child-supply = <&regulator>;
                reset-gpios = <&gpio 0 0>;
            };
        };
    };
};
Quoted 8 lines

But without knowing what might be connected to port at 2, how do we know how to sequence the power supply and reset GPIOs according to its requirements? I guess this is part of the specification of the port itself though, not the attached device, since anything that is allowed to plug in must conform to whatever sequencing the port is designed to give. If the connected device is known, the port at 2 node in DT can encode whatever sequencing requirements are associated with the known connected device.

In fact, for specific usb/sdio interface device, there should be a specific interface class driver for it, the best place is at that class driver, like wifi or 3g driver, as it is chip/device specific.

But the generic 3G and HUB devices are special, there is only one common driver for each of them (drivers/usb/core/hub.c & drivers/serial/option.c)

#38 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 37 lines · On 06/21/2012 06:03 PM, Chen Peter-B29397 wrote:
Quoted 28 lines

That's a good point. We need those properties to be part of the device that controls the port/slot/connector, not the thing that plugs into it. Having each such binding and driver implement this themselves might not be a good idea though. Perhaps we can standardize on a mechanism for this; something vaguely like rfkill, but for arbitrary types of devices connected to ports.

For USB at least, where the power/reset/... GPIOs might affect just one port on a hub rather than the root USB host controller, the issue of representing these properties on a dynamically probed device still applies. Something like:

ehci {
    /* The following node is dynamically detected, although the hub
     * IC is physically soldered onto the board
     */
    hub {
        hub { /* also dynamic */
            port at 2 {
                child-supply = <&regulator>;
                reset-gpios = <&gpio 0 0>;
            };
        };
    };
};
Quoted 8 lines

But without knowing what might be connected to port at 2, how do we know how to sequence the power supply and reset GPIOs according to its requirements? I guess this is part of the specification of the port itself though, not the attached device, since anything that is allowed to plug in must conform to whatever sequencing the port is designed to give. If the connected device is known, the port at 2 node in DT can encode whatever sequencing requirements are associated with the known connected device.

Quoted 3 lines

In fact, for specific usb/sdio interface device, there should be a specific interface class driver for it, the best place is at that class driver, like wifi or 3g driver, as it is chip/device specific.

But like you said, there's no way to tell what's attached to a USB or SDIO port before probing it, at least if the port is at all user-accessible. The class driver for the host-side of the port (USB hub or SDIO controller) would be the one that needs to implement this, not the class driver for the thing that could be plugged in (WiFi or 3G device).

Quoted 2 lines

But the generic 3G and HUB devices are special, there is only one common driver for each of them (drivers/usb/core/hub.c & drivers/serial/option.c)

#39 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 9 lines

But like you said, there's no way to tell what's attached to a USB or SDIO port before probing it, at least if the port is at all user-accessible. The class driver for the host-side of the port (USB hub or SDIO controller) would be the one that needs to implement this, not the class driver for the thing that could be plugged in (WiFi or 3G device).

Agree, I did not consider the situation that the class driver is loaded as module and only be loaded when that kinds of device (wifi/3g) has found (through udev).

Maybe we have to add misc control (power/reset) for devices at sd or usb controller driver's probe, and those gpio are belonged to controller's.

Quoted 3 lines
Quoted 1 line

But the generic 3G and HUB devices are special, there is only one

common driver

Quoted 1 line

for each of them (drivers/usb/core/hub.c & drivers/serial/option.c)

reviewer
#40 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

In reply to Richard Zhao
Quoted 16 lines · Richard Zhao
(quoted diff) +16 -0
+static void __init imx6q_config_on_boot(void)
+{
+ ? ? ? struct device_node *np;
+ ? ? ? struct property *pp;
+ ? ? ? int cnt, len, i;
+ ? ? ? int gpio;
+
+ ? ? ? np = of_find_node_by_path("/config-on-boot");
+ ? ? ? if (!np)
+ ? ? ? ? ? ? ? return;
+ ? ? ? cnt = of_gpio_named_count(np, "output-gpios");
+ ? ? ? pp = of_find_property(np, "output-gpio-values", &len);
+ ? ? ? if (!pp || cnt != len / sizeof(u32)) {
+ ? ? ? ? ? ? ? pr_err("Invalid config-on-boot gpios!\n");
+ ? ? ? ? ? ? ? of_node_put(np);
+ ? ? ? ? ? ? ? return;

Review

Quoted 10 lines
(quoted diff) +10 -0
+ ? ? ? }
+ ? ? ? for (i = 0; i < cnt; i++) {
+ ? ? ? ? ? ? ? gpio = of_get_named_gpio(np, "output-gpios", i);
+ ? ? ? ? ? ? ? if (gpio_is_valid(gpio))
+ ? ? ? ? ? ? ? ? ? ? ? gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "config-on-boot");
+ ? ? ? }
+
+ ? ? ? of_node_put(np);
+}

Couldn't this function be made generic and put outside of mach-imx6q.c so that other platforms could use it?

I need the same for mxs.

#41 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 33 lines · Fabio Estevam
Quoted 16 lines · Richard Zhao
(quoted diff) +16 -0
+static void __init imx6q_config_on_boot(void)
+{
+ ? ? ? struct device_node *np;
+ ? ? ? struct property *pp;
+ ? ? ? int cnt, len, i;
+ ? ? ? int gpio;
+
+ ? ? ? np = of_find_node_by_path("/config-on-boot");
+ ? ? ? if (!np)
+ ? ? ? ? ? ? ? return;
+ ? ? ? cnt = of_gpio_named_count(np, "output-gpios");
+ ? ? ? pp = of_find_property(np, "output-gpio-values", &len);
+ ? ? ? if (!pp || cnt != len / sizeof(u32)) {
+ ? ? ? ? ? ? ? pr_err("Invalid config-on-boot gpios!\n");
+ ? ? ? ? ? ? ? of_node_put(np);
+ ? ? ? ? ? ? ? return;

Review

Quoted 10 lines
(quoted diff) +10 -0
+ ? ? ? }
+ ? ? ? for (i = 0; i < cnt; i++) {
+ ? ? ? ? ? ? ? gpio = of_get_named_gpio(np, "output-gpios", i);
+ ? ? ? ? ? ? ? if (gpio_is_valid(gpio))
+ ? ? ? ? ? ? ? ? ? ? ? gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "config-on-boot");
+ ? ? ? }
+
+ ? ? ? of_node_put(np);
+}

Couldn't this function be made generic and put outside of mach-imx6q.c so that other platforms could use it?

Quoted 1 line

I need the same for mxs.

Yes, it is common. But it must be called after populate devices. Rob didn't agree the way yet.

Signature · 1 line
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
#42 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

In reply to Richard Zhao
Quoted 80 lines · Richard Zhao

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>
---
 .../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
 arch/arm/mach-imx/mach-imx6q.c                     |   35 ++++++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/config-on-boot.txt
Documentation/devicetree/bindings/arm/config-on-boot.txt new file +12 -0
new file mode 100644
index 0000000..f98ed74
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings that needs
+  to be set one time on boot but aren't owned by any driver, or the owned driver
+  is too generic to handle such settings. For example, usb hub uses generic
+  driver in usb core code, a on-board usb may need deassert reset pin.
+
+Optional properties:
+- output-gpios: Output gpio array that needs to set.
+- output-gpio-values: This property is required if output-gpios is set.
+  The value is a array of 0 or 1. Total count eaquals the number of gpios.
arch/arm/boot/dts/imx6q-sabrelite.dts +7 -0
index e0ec929..1dd2261 100644
@@ -17,6 +17,13 @@
 	model = "Freescale i.MX6 Quad SABRE Lite Board";
 	compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
 
+	config-on-boot {
+		output-gpios = <
+				&gpio3 22 0>;	/* vbus reset */
+		output-gpio-values = <
+				1>;		/* vbus reset */
+	};
+
 	memory {
 		reg = <0x10000000 0x40000000>;
 	};
arch/arm/mach-imx/mach-imx6q.c +13 -0
index b47e98b..577cf19 100644
@@ -19,6 +19,7 @@
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_gpio.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/pinctrl/machine.h>
@@ -113,6 +114,38 @@ static void __init imx6q_sabrelite_init(void)
 	imx6q_sabrelite_cko1_setup();
 }
 
+static void __init imx6q_config_on_boot(void)
+{
+	struct device_node *np;
+	struct property *pp;
+	int cnt, len, i;
+	int gpio;
+
+	np = of_find_node_by_path("/config-on-boot");
+	if (!np)
+		return;
+	cnt = of_gpio_named_count(np, "output-gpios");
+	pp = of_find_property(np, "output-gpio-values", &len);

arch/arm/mach-imx/mach-imx6q.c static void __init imx6q_sabrelite_init(void) · line 138

Quoted 10 lines
arch/arm/mach-imx/mach-imx6q.c +10 -0
+	if (!pp || cnt != len / sizeof(u32)) {
+		pr_err("Invalid config-on-boot gpios!\n");
+		of_node_put(np);
+		return;
+	}
+	for (i = 0; i < cnt; i++) {
+		gpio = of_get_named_gpio(np, "output-gpios", i);
+		if (gpio_is_valid(gpio))
+			gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+					"config-on-boot");

While trying to use this code: Is there a special reason why all pins are set to HIGH here? The contents of 'output-gpio-values' seem to be ignored?

Best regards

Dirk

#43 lore raw

PATCH v5 8/13 ARM: imx6q: add config-on-boot gpios

Quoted 85 lines · Dirk Behme
Quoted 84 lines · Richard Zhao

Sometimes, boards have gpios that don't own by any driver or owner by a generic driver that don't like hacks. Such gpios is normally output and need setup once on boot. So I introduce the config-on-boot gpios.

Cc Shawn Guo <[email protected]>
Cc Rob Herring <[email protected]>
Cc Grant Likely <[email protected]>

---

.../devicetree/bindings/arm/config-on-boot.txt     |   12 +++++++
arch/arm/boot/dts/imx6q-sabrelite.dts              |    7 ++++
arch/arm/mach-imx/mach-imx6q.c                     |   35 ++++++++++++++++++++
3 files changed, 54 insertions(+)

create mode 100644 Documentation/devicetree/bindings/arm/config-on-boot.txt

Documentation/devicetree/bindings/arm/config-on-boot.txt new file +12 -0
new file mode 100644
index 0000000..f98ed74
@@ -0,0 +1,12 @@
+* Configure on Boot
+
+Node name: config-on-boot
+  It must be in root node. config-on-boot means to describe settings that needs
+  to be set one time on boot but aren't owned by any driver, or the owned driver
+  is too generic to handle such settings. For example, usb hub uses generic
+  driver in usb core code, a on-board usb may need deassert reset pin.
+
+Optional properties:
+- output-gpios: Output gpio array that needs to set.
+- output-gpio-values: This property is required if output-gpios is set.
+  The value is a array of 0 or 1. Total count eaquals the number of gpios.
arch/arm/boot/dts/imx6q-sabrelite.dts +7 -0
index e0ec929..1dd2261 100644
@@ -17,6 +17,13 @@
 	model = "Freescale i.MX6 Quad SABRE Lite Board";
 	compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
+	config-on-boot {
+		output-gpios = <
+				&gpio3 22 0>;	/* vbus reset */
+		output-gpio-values = <
+				1>;		/* vbus reset */
+	};
+
 	memory {
 		reg = <0x10000000 0x40000000>;
 	};
arch/arm/mach-imx/mach-imx6q.c +19 -0
index b47e98b..577cf19 100644
@@ -19,6 +19,7 @@
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_gpio.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/pinctrl/machine.h>
@@ -113,6 +114,38 @@ static void __init imx6q_sabrelite_init(void)
 	imx6q_sabrelite_cko1_setup();
 }
+static void __init imx6q_config_on_boot(void)
+{
+	struct device_node *np;
+	struct property *pp;
+	int cnt, len, i;
+	int gpio;
+
+	np = of_find_node_by_path("/config-on-boot");
+	if (!np)
+		return;
+	cnt = of_gpio_named_count(np, "output-gpios");
+	pp = of_find_property(np, "output-gpio-values", &len);
+	if (!pp || cnt != len / sizeof(u32)) {
+		pr_err("Invalid config-on-boot gpios!\n");
+		of_node_put(np);
+		return;
+	}
+	for (i = 0; i < cnt; i++) {
Quoted 8 lines

arch/arm/mach-imx/mach-imx6q.c static void __init imx6q_sabrelite_init(void) · line 138

Quoted 4 lines
arch/arm/mach-imx/mach-imx6q.c +4 -0
+		gpio = of_get_named_gpio(np, "output-gpios", i);
+		if (gpio_is_valid(gpio))
+			gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
+					"config-on-boot");

While trying to use this code: Is there a special reason why all pins are set to HIGH here? The contents of 'output-gpio-values' seem to be ignored?

It may be bug here. The patch is rejected. imx6_sabrelite happens work by default value. So I won't follow it any more.

Thanks
Richard

Quoted 5 lines

Best regards

Dirk

#44 lore raw

PATCH v5 9/13 ARM: imx6q: add usbphy clocks

In reply to Richard Zhao
---
 arch/arm/mach-imx/clk-imx6q.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/mach-imx/clk-imx6q.c +6 -1
index f99509a..8c4166a 100644
@@ -152,7 +152,7 @@ enum mx6q_clks {
 	ssi2, ssi3, uart_ipg, uart_serial, usboh3, usdhc1, usdhc2, usdhc3,
 	usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg,
 	pll4_audio, pll5_video, pll6_mlb, pll7_usb_host, pll8_enet, ssi1_ipg,
-	ssi2_ipg, ssi3_ipg, clk_max
+	ssi2_ipg, ssi3_ipg, usbphy1, usbphy2, clk_max
 };
 
 static struct clk *clk[clk_max];
@@ -197,6 +197,9 @@ int __init mx6q_clocks_init(void)
 	clk[pll7_usb_host] = imx_clk_pllv3(IMX_PLLV3_USB,	"pll7_usb_host","osc", base + 0x20, 0x2000,   0x3);
 	clk[pll8_enet]     = imx_clk_pllv3(IMX_PLLV3_ENET,	"pll8_enet",	"osc", base + 0xe0, 0x182000, 0x3);
 
+	clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 6);
+	clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 6);
+
 	/*                                name              parent_name        reg       idx */
 	clk[pll2_pfd0_352m] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus",     base + 0x100, 0);
 	clk[pll2_pfd1_594m] = imx_clk_pfd("pll2_pfd1_594m", "pll2_bus",     base + 0x100, 1);
@@ -395,6 +398,8 @@ int __init mx6q_clocks_init(void)
 	clk_register_clkdev(clk[usboh3], NULL, "2184200.usb");
 	clk_register_clkdev(clk[usboh3], NULL, "2184400.usb");
 	clk_register_clkdev(clk[usboh3], NULL, "2184600.usb");
+	clk_register_clkdev(clk[usbphy1], NULL, "20c9000.usbphy");
+	clk_register_clkdev(clk[usbphy2], NULL, "20ca000.usbphy");
 	clk_register_clkdev(clk[uart_serial], "per", "2020000.serial");
 	clk_register_clkdev(clk[uart_ipg], "ipg", "2020000.serial");
 	clk_register_clkdev(clk[uart_serial], "per", "21e8000.serial");
Signature · 1 line
1.7.9.5
maintainer
#45 lore raw

PATCH v5 9/13 ARM: imx6q: add usbphy clocks

Quoted 29 lines · Richard Zhao
---
 arch/arm/mach-imx/clk-imx6q.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/mach-imx/clk-imx6q.c +4 -1
index f99509a..8c4166a 100644
@@ -152,7 +152,7 @@ enum mx6q_clks {
 	ssi2, ssi3, uart_ipg, uart_serial, usboh3, usdhc1, usdhc2, usdhc3,
 	usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg,
 	pll4_audio, pll5_video, pll6_mlb, pll7_usb_host, pll8_enet, ssi1_ipg,
-	ssi2_ipg, ssi3_ipg, clk_max
+	ssi2_ipg, ssi3_ipg, usbphy1, usbphy2, clk_max
 };
 
 static struct clk *clk[clk_max];
@@ -197,6 +197,9 @@ int __init mx6q_clocks_init(void)
 	clk[pll7_usb_host] = imx_clk_pllv3(IMX_PLLV3_USB,	"pll7_usb_host","osc", base + 0x20, 0x2000,   0x3);
 	clk[pll8_enet]     = imx_clk_pllv3(IMX_PLLV3_ENET,	"pll8_enet",	"osc", base + 0xe0, 0x182000, 0x3);
 
+	clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 6);
+	clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 6);
+
 	/*                                name              parent_name        reg       idx */
 	clk[pll2_pfd0_352m] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus",     base + 0x100, 0);
 	clk[pll2_pfd1_594m] = imx_clk_pfd("pll2_pfd1_594m", "pll2_bus",     base + 0x100, 1);

arch/arm/mach-imx/clk-imx6q.c int __init mx6q_clocks_init(void) · line 402

Quoted 5 lines
arch/arm/mach-imx/clk-imx6q.c +2 -0
@@ -395,6 +398,8 @@ int __init mx6q_clocks_init(void)
 	clk_register_clkdev(clk[usboh3], NULL, "2184200.usb");
 	clk_register_clkdev(clk[usboh3], NULL, "2184400.usb");
 	clk_register_clkdev(clk[usboh3], NULL, "2184600.usb");
+	clk_register_clkdev(clk[usbphy1], NULL, "20c9000.usbphy");
+	clk_register_clkdev(clk[usbphy2], NULL, "20ca000.usbphy");

Could you recheck with your hardware guys which input clocks this device really has. On earlier i.MX there are up to three clocks this module needs. Sooner or later we want to use this driver on the other i.MX aswell, and then we'll need support for the other clocks here, no matter if they are software controllable on i.MX6 or not.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#46 lore raw

PATCH v5 9/13 ARM: imx6q: add usbphy clocks

Quoted 5 lines

Could you recheck with your hardware guys which input clocks this device really has. On earlier i.MX there are up to three clocks this module needs. Sooner or later we want to use this driver on the other i.MX aswell, and then we'll need support for the other clocks here, no matter if they are software controllable on i.MX6 or not.

Only two clocks are needed for i.mx6, one is AHB clock usb gate which is used to visit registers, and other is PHY clock which is used to data transfer.

The i.mx23, i.mx28 and i.mx6q use FSL Internal PHY, it doesn't need serial clock.

#47 lore raw

PATCH v5 10/13 ARM: imx6q: disable usb charger detector

In reply to Richard Zhao

The external charger detector needs to be disabled, or the signal at DP will be poor

---
 arch/arm/mach-imx/mach-imx6q.c |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm/mach-imx/mach-imx6q.c +24 -0
index 577cf19..c4f9b82 100644
@@ -25,6 +25,7 @@
 #include <linux/pinctrl/machine.h>
 #include <linux/phy.h>
 #include <linux/micrel_phy.h>
+#include <linux/mfd/anatop.h>
 #include <asm/smp_twd.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/hardware/gic.h>
@@ -141,9 +142,32 @@ static void __init imx6q_config_on_boot(void)
 	of_node_put(np);
 }
 
+static void __init imx6q_usb_init(void)
+{
+#define HW_ANADIG_USB1_CHRG_DETECT		0x000001b0
+#define HW_ANADIG_USB2_CHRG_DETECT		0x00000210
+
+#define BM_ANADIG_USB_CHRG_DETECT_EN_B		0x00100000
+#define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B	0x00080000
+
+	/*
+	 * The external charger detector needs to be disabled,
+	 * or the signal at DP will be poor
+	 */
+	anatop_write_reg(NULL, HW_ANADIG_USB1_CHRG_DETECT,
+			BM_ANADIG_USB_CHRG_DETECT_EN_B
+			| BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B,
+			~0);
+	anatop_write_reg(NULL, HW_ANADIG_USB2_CHRG_DETECT,
+			BM_ANADIG_USB_CHRG_DETECT_EN_B |
+			BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B,
+			~0);
+}
+
 static void __init imx6q_post_populate(void)
 {
 	imx6q_config_on_boot();
+	imx6q_usb_init();
 }
 
 static void __init imx6q_init_machine(void)
Signature · 1 line
1.7.9.5
#48 lore raw

PATCH v5 11/13 ARM: dts: imx6q-sabrelite: add usb devices

In reply to Richard Zhao

- add usbphy devices
- add usb host controller and otg devices
- add on-board hub reset gpio pinctrl
- add usb h1 vbus regulator

---
 arch/arm/boot/dts/imx6q-sabrelite.dts |   28 +++++++++++++++++++++++++
 arch/arm/boot/dts/imx6q.dtsi          |   36 +++++++++++++++++++++++++++++++--
 2 files changed, 62 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx6q-sabrelite.dts +28 -0
index 1dd2261..06a5d00 100644
@@ -48,10 +48,29 @@
 					status = "okay";
 				};
 			};
+			iomuxc at 020e0000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_gpio_hog>;
 
+				gpios {
+					pinctrl_gpio_hog: gpiohog {
+						fsl,pins = <1044 0x80000000	/* MX6Q_PAD_GPIO_17__GPIO_7_12 */
+							   144  0x80000000>;	/* MX6Q_PAD_EIM_D22__GPIO_3_22 */
+					};
+				};
+			};
 		};
 
 		aips-bus at 02100000 { /* AIPS2 */
+			usb at 02184000 { /* USB OTG */
+				vbus-supply = <&reg_usb_otg_vbus>;
+				status = "okay";
+			};
+
+			usb at 02184200 { /* USB1 */
+				status = "okay";
+			};
+
 			ethernet at 02188000 {
 				phy-mode = "rgmii";
 				phy-reset-gpios = <&gpio3 23 0>;
@@ -118,6 +137,15 @@
 			regulator-max-microvolt = <3300000>;
 			regulator-always-on;
 		};
+
+		reg_usb_otg_vbus: usb_otg_vbus {
+			compatible = "regulator-fixed";
+			regulator-name = "usb_otg_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio3 22 0>;
+			enable-active-high;
+		};
 	};
 
 	sound {
arch/arm/boot/dts/imx6q.dtsi +34 -2
index 8c90cba..ccc8a5f 100644
@@ -444,12 +444,14 @@
 				};
 			};
 
-			usbphy at 020c9000 { /* USBPHY1 */
+			usbphy1: usbphy at 020c9000 {
+				compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
 				reg = <0x020c9000 0x1000>;
 				interrupts = <0 44 0x04>;
 			};
 
-			usbphy at 020ca000 { /* USBPHY2 */
+			usbphy2: usbphy at 020ca000 {
+				compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
 				reg = <0x020ca000 0x1000>;
 				interrupts = <0 45 0x04>;
 			};
@@ -573,6 +575,36 @@
 				reg = <0x0217c000 0x4000>;
 			};
 
+			usb at 02184000 { /* USB OTG */
+				compatible = "fsl,imx6q-usb", "fsl,imx31-usb";
+				reg = <0x02184000 0x200>;
+				interrupts = <0 43 0x04>;
+				fsl,usbphy = <&usbphy1>;
+				status = "disabled";
+			};
+
+			usb at 02184200 { /* USB1 */
+				compatible = "fsl,imx6q-usb", "fsl,imx31-usb";
+				reg = <0x02184200 0x200>;
+				interrupts = <0 40 0x04>;
+				fsl,usbphy = <&usbphy2>;
+				status = "disabled";
+			};
+
+			usb at 02184400 { /* USB2 */
+				compatible = "fsl,imx6q-usb", "fsl,imx31-usb";
+				reg = <0x02184400 0x200>;
+				interrupts = <0 41 0x04>;
+				status = "disabled";
+			};
+
+			usb at 02184600 { /* USB3 */
+				compatible = "fsl,imx6q-usb", "fsl,imx31-usb";
+				reg = <0x02184600 0x200>;
+				interrupts = <0 42 0x04>;
+				status = "disabled";
+			};
+
 			ethernet at 02188000 {
 				compatible = "fsl,imx6q-fec";
 				reg = <0x02188000 0x4000>;
Signature · 1 line
1.7.9.5
reviewer
#49 lore raw

PATCH v5 11/13 ARM: dts: imx6q-sabrelite: add usb devices

Richard/Shawn,

Quoted 3 lines · Richard Zhao

+ ? ? ? ? ? ? ? ? ? ? ? iomuxc at 020e0000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pinctrl-names = "default";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pinctrl-0 = <&pinctrl_gpio_hog>;

I would like to use this same concept on mxs, which does not have a "iomuxc" driver like imx6.

To which driver should I glue the 'pinctrl-0 = <&pinctrl_gpio_hog>;' on mxs?

#50 lore raw

PATCH v5 12/13 ARM: mxs: clk_register_clkdev mx28 usb clocks

In reply to Richard Zhao
---
 drivers/clk/mxs/clk-imx28.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/clk/mxs/clk-imx28.c +4 -0
index 2826a26..0201a0f 100644
@@ -328,6 +328,10 @@ int __init mx28_clocks_init(void)
 	clk_register_clkdevs(clks[fec], fec_lookups, ARRAY_SIZE(fec_lookups));
 	clk_register_clkdevs(clks[can0], can0_lookups, ARRAY_SIZE(can0_lookups));
 	clk_register_clkdevs(clks[can1], can1_lookups, ARRAY_SIZE(can1_lookups));
+	clk_register_clkdev(clks[usb0_pwr], NULL, "8007c000.usbphy");
+	clk_register_clkdev(clks[usb1_pwr], NULL, "8007e000.usbphy");
+	clk_register_clkdev(clks[usb0], NULL, "80080000.usb");
+	clk_register_clkdev(clks[usb1], NULL, "80090000.usb");
 
 	for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
 		clk_prepare_enable(clks[clks_init_on[i]]);
Signature · 1 line
1.7.9.5
#51 lore raw

PATCH v5 13/13 ARM: dts: imx28-evk: add usb devices

In reply to Richard Zhao

- add usb phy devices
- add usb controller devices
- add usb vbus regulators

---
 arch/arm/boot/dts/imx28-evk.dts |   36 ++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx28.dtsi    |   12 ++++++++++--
 2 files changed, 46 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx28-evk.dts +36 -0
index ee520a5..a06d86a 100644
@@ -73,10 +73,28 @@
 				pinctrl-0 = <&duart_pins_a>;
 				status = "okay";
 			};
+
+			usbphy0: usbphy at 8007c000 {
+				status = "okay";
+			};
+
+			usbphy1: usbphy at 8007e000 {
+				status = "okay";
+			};
 		};
 	};
 
 	ahb at 80080000 {
+		usb0: usb at 80080000 {
+			vbus-supply = <&reg_usb0_vbus>;
+			status = "okay";
+		};
+
+		usb1: usb at 80090000 {
+			vbus-supply = <&reg_usb1_vbus>;
+			status = "okay";
+		};
+
 		mac0: ethernet at 800f0000 {
 			phy-mode = "rmii";
 			pinctrl-names = "default";
@@ -102,6 +120,24 @@
 			regulator-max-microvolt = <3300000>;
 			regulator-always-on;
 		};
+
+		reg_usb0_vbus: usb0_vbus {
+			compatible = "regulator-fixed";
+			regulator-name = "usb0_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio3 9 0>;
+			enable-active-high;
+		};
+
+		reg_usb1_vbus: usb1_vbus {
+			compatible = "regulator-fixed";
+			regulator-name = "usb1_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio3 8 0>;
+			enable-active-high;
+		};
 	};
 
 	sound {
arch/arm/boot/dts/imx28.dtsi +10 -2
index 4634cb8..502ad05 100644
@@ -441,11 +441,13 @@
 			};
 
 			usbphy0: usbphy at 8007c000 {
+				compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy";
 				reg = <0x8007c000 0x2000>;
 				status = "disabled";
 			};
 
 			usbphy1: usbphy at 8007e000 {
+				compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy";
 				reg = <0x8007e000 0x2000>;
 				status = "disabled";
 			};
@@ -459,13 +461,19 @@
 		reg = <0x80080000 0x80000>;
 		ranges;
 
-		usbctrl0: usbctrl at 80080000 {
+		usb0: usb at 80080000 {
+			compatible = "fsl,imx28-usb", "fsl,imx31-usb";
 			reg = <0x80080000 0x10000>;
+			interrupts = <93>;
+			fsl,usbphy = <&usbphy0>;
 			status = "disabled";
 		};
 
-		usbctrl1: usbctrl at 80090000 {
+		usb1: usb at 80090000 {
+			compatible = "fsl,imx28-usb", "fsl,imx31-usb";
 			reg = <0x80090000 0x10000>;
+			interrupts = <92>;
+			fsl,usbphy = <&usbphy1>;
 			status = "disabled";
 		};
 
Signature · 1 line
1.7.9.5
reviewer
#52 lore raw

v5 cover add imx usb driver for mx28/6x

In reply to Richard Zhao

Hi Richard,

Quoted 9 lines · Richard Zhao

The work is based on ?ci13xxx rework done by Alexander Shishkin.

Status:
?- this version only support host
?- usbotg controler works at host role

Changes since last version:
?- collect ack received.

Quoted 16 lines

Richard Zhao (13):
?usb: otg: add notify_connect/notify_disconnect callback ?USB: move transceiver from ehci_hcd and ohci_hcd to hcd and rename it ? ?as phy
?USB: notify phy when root hub port connect change
?usb: chipidea: permit driver bindings pass phy pointer ?usb: otg: add basic mxs phy driver support
?usb: chipidea: add imx platform driver
?ARM: imx6q: correct device name of usbphy and usb controller clock ? ?export
?ARM: imx6q: add config-on-boot gpios
?ARM: imx6q: add usbphy clocks
?ARM: imx6q: disable usb charger detector
?ARM: dts: imx6q-sabrelite: add usb devices
?ARM: mxs: clk_register_clkdev mx28 usb clocks
?ARM: dts: imx28-evk: add usb devices

I am trying your patch series on a mx28evk and I am not able to have my USB pen drive detected.

I tried enabling all the required config options in .config.

Could you please share your .config?

Thanks,

Fabio Estevam

#53 lore raw

v5 cover add imx usb driver for mx28/6x

Dear Fabio Estevam,

Quoted 31 lines

Hi Richard,

On Wed, Jun 13, 2012 at 9:34 AM, Richard Zhao

Quoted 9 lines · <[email protected]> wrote:

The work is based on ci13xxx rework done by Alexander Shishkin.

Status:
- this version only support host
- usbotg controler works at host role

Changes since last version:
- collect ack received.

Quoted 16 lines

Richard Zhao (13):
usb: otg: add notify_connect/notify_disconnect callback
USB: move transceiver from ehci_hcd and ohci_hcd to hcd and rename it
as phy
USB: notify phy when root hub port connect change
usb: chipidea: permit driver bindings pass phy pointer
usb: otg: add basic mxs phy driver support
usb: chipidea: add imx platform driver
ARM: imx6q: correct device name of usbphy and usb controller clock
export
ARM: imx6q: add config-on-boot gpios
ARM: imx6q: add usbphy clocks
ARM: imx6q: disable usb charger detector
ARM: dts: imx6q-sabrelite: add usb devices
ARM: mxs: clk_register_clkdev mx28 usb clocks
ARM: dts: imx28-evk: add usb devices

Quoted 6 lines

I am trying your patch series on a mx28evk and I am not able to have my USB pen drive detected.

I tried enabling all the required config options in .config.

Could you please share your .config?

Do you have root TT enabled? If the pendrive isn't detected at all, it's probably the PHY not enabling (disabling?) the discon detector upon init. But the PHY driver is from my code, so that should work. Do you see any response at all upon connecting the stick?

Quoted 4 lines

Thanks,

Fabio Estevam

Best regards,
Marek Vasut

reviewer
#54 lore raw

v5 cover add imx usb driver for mx28/6x

Quoted 1 line · Marek Vasut

Do you have root TT enabled? If the pendrive isn't detected at all, it's

USB_EHCI_ROOT_HUB_TT is enabled.

Quoted 3 lines

probably the PHY not enabling (disabling?) the discon detector upon init. But the PHY driver is from my code, so that should work. Do you see any response at all upon connecting the stick?

Nothing shows up in the console after connecting the stick.

Attached my .config file.

Thanks,

Fabio Estevam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config_usb
Type: application/octet-stream
Size: 45496 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120618/f378b5b1/attachment-0001.obj>

#55 lore raw

v5 cover add imx usb driver for mx28/6x

Quoted 8 lines
Quoted 3 lines

Do you have root TT enabled? If the pendrive isn't detected at all,

it's

USB_EHCI_ROOT_HUB_TT is enabled.

Quoted 1 line

probably the PHY not enabling (disabling?) the discon detector upon

Quoted 9 lines

init. But

Quoted 1 line

the PHY driver is from my code, so that should work. Do you see any

response at

Quoted 1 line

all upon connecting the stick?

Nothing shows up in the console after connecting the stick.

Attached my .config file.

Make sure the vbus is on for your usb port.

Quoted 3 lines

Thanks,

Fabio Estevam

reviewer
#56 lore raw

v5 cover add imx usb driver for mx28/6x

Peter,

Quoted 5 lines · On Mon, Jun 18, 2012 at 10:14 PM, Chen Peter-B29397 <[email protected]>…
Quoted 4 lines

Nothing shows up in the console after connecting the stick.

Attached my .config file.

Make sure the vbus is on for your usb port.

So what is the magic needed here? Isn't Richard's series supposed to work as is?

What should be done in addition to Richard's patch in order to get USB host to work on mx28evk?

#57 lore raw

v5 cover add imx usb driver for mx28/6x

Dear Fabio Estevam,

Quoted 9 lines

Peter,

On Mon, Jun 18, 2012 at 10:14 PM, Chen Peter-B29397

Quoted 4 lines · <[email protected]> wrote:
Quoted 3 lines

Nothing shows up in the console after connecting the stick.

Attached my .config file.

Quoted 7 lines
Quoted 1 line

Make sure the vbus is on for your usb port.

So what is the magic needed here? Isn't Richard's series supposed to work as is?

What should be done in addition to Richard's patch in order to get USB host to work on mx28evk?

Ah right, you need to toggle the power supply (vbus) GPIO.

Best regards,
Marek Vasut

reviewer
#58 lore raw

v5 cover add imx usb driver for mx28/6x

Quoted 4 lines · Marek Vasut
Quoted 2 lines

What should be done in addition to Richard's patch in order to get USB host to work on mx28evk?

Ah right, you need to toggle the power supply (vbus) GPIO.

Toggle it where?

I see the following:

reg_usb0_vbus: usb0_vbus {
compatible = "regulator-fixed";
regulator-name = "usb0_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio3 9 0>;
enable-active-high;

So the gpio3_9 will turn on the vbus.

What is missing?

#59 lore raw

v5 cover add imx usb driver for mx28/6x

In reply to Fabio Estevam
Quoted 4 lines · Fabio Estevam

Nothing shows up in the console after connecting the stick.

Attached my .config file.

You haven't enabled the following two in your .config.

CONFIG_USB_CHIPIDEA
CONFIG_USB_CHIPIDEA_HOST

Signature · 2 lines
Regards,
Shawn
reviewer
#60 lore raw

v5 cover add imx usb driver for mx28/6x

Hi Shawn,

Quoted 6 lines · Shawn Guo
Quoted 2 lines

Attached my .config file.

You haven't enabled the following two in your .config.

CONFIG_USB_CHIPIDEA
CONFIG_USB_CHIPIDEA_HOST

Please check my config file again:

It does have:

CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_HOST=y

Can someone confirm that this patch series works on a mx28evk? If it does, please send me the .config that works.

Thanks,

Fabio Estevam

#61 lore raw

v5 cover add imx usb driver for mx28/6x

Quoted 3 lines · Fabio Estevam

Can someone confirm that this patch series works on a mx28evk? If it does, please send me the .config that works.

The series works fine on my imx28-evk board with the .config attached.

Signature · 1,907 lines
Regards,
Shawn
-------------- next part --------------
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.5.0-rc1 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_HAVE_PWM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_GENERIC_GPIO=y
CONFIG_HAVE_PROC_CPU=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_VECTORS_BASE=0xffff0000
CONFIG_ARM_PATCH_PHYS_VIRT=y
CONFIG_GENERIC_BUG=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_HAVE_IRQ_WORK=y
CONFIG_IRQ_WORK=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_FHANDLE is not set
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
# CONFIG_AUDIT is not set
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_IRQ_DOMAIN=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_KTIME_SCALAR=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y

#
# RCU Subsystem
#
CONFIG_TINY_RCU=y
# CONFIG_PREEMPT_RCU is not set
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=17
# CONFIG_CGROUPS is not set
# CONFIG_CHECKPOINT_RESTORE is not set
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
# CONFIG_IPC_NS is not set
# CONFIG_PID_NS is not set
# CONFIG_NET_NS is not set
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
# CONFIG_EXPERT is not set
CONFIG_UID16=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_USE_VMALLOC=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_PROFILING is not set
CONFIG_TRACEPOINTS=y
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
# CONFIG_JUMP_LABEL is not set
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_MODVERSIONS=y
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_BLOCK=y
CONFIG_LBDAF=y
CONFIG_BLK_DEV_BSG=y
# CONFIG_BLK_DEV_BSGLIB is not set
CONFIG_BLK_DEV_INTEGRITY=y

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_DEADLINE is not set
# CONFIG_IOSCHED_CFQ is not set
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"
# CONFIG_INLINE_SPIN_TRYLOCK is not set
# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK is not set
# CONFIG_INLINE_SPIN_LOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
CONFIG_UNINLINE_SPIN_UNLOCK=y
# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_READ_TRYLOCK is not set
# CONFIG_INLINE_READ_LOCK is not set
# CONFIG_INLINE_READ_LOCK_BH is not set
# CONFIG_INLINE_READ_LOCK_IRQ is not set
# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
# CONFIG_INLINE_READ_UNLOCK is not set
# CONFIG_INLINE_READ_UNLOCK_BH is not set
# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_WRITE_TRYLOCK is not set
# CONFIG_INLINE_WRITE_LOCK is not set
# CONFIG_INLINE_WRITE_LOCK_BH is not set
# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
# CONFIG_INLINE_WRITE_UNLOCK is not set
# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
# CONFIG_MUTEX_SPIN_ON_OWNER is not set
CONFIG_FREEZER=y

#
# System Type
#
CONFIG_MMU=y
# CONFIG_ARCH_INTEGRATOR is not set
# CONFIG_ARCH_REALVIEW is not set
# CONFIG_ARCH_VERSATILE is not set
# CONFIG_ARCH_VEXPRESS is not set
# CONFIG_ARCH_AT91 is not set
# CONFIG_ARCH_BCMRING is not set
# CONFIG_ARCH_HIGHBANK is not set
# CONFIG_ARCH_CLPS711X is not set
# CONFIG_ARCH_CNS3XXX is not set
# CONFIG_ARCH_GEMINI is not set
# CONFIG_ARCH_PRIMA2 is not set
# CONFIG_ARCH_EBSA110 is not set
# CONFIG_ARCH_EP93XX is not set
# CONFIG_ARCH_FOOTBRIDGE is not set
# CONFIG_ARCH_MXC is not set
CONFIG_ARCH_MXS=y
# CONFIG_ARCH_NETX is not set
# CONFIG_ARCH_H720X is not set
# CONFIG_ARCH_IOP13XX is not set
# CONFIG_ARCH_IOP32X is not set
# CONFIG_ARCH_IOP33X is not set
# CONFIG_ARCH_IXP4XX is not set
# CONFIG_ARCH_DOVE is not set
# CONFIG_ARCH_KIRKWOOD is not set
# CONFIG_ARCH_LPC32XX is not set
# CONFIG_ARCH_MV78XX0 is not set
# CONFIG_ARCH_ORION5X is not set
# CONFIG_ARCH_MMP is not set
# CONFIG_ARCH_KS8695 is not set
# CONFIG_ARCH_W90X900 is not set
# CONFIG_ARCH_TEGRA is not set
# CONFIG_ARCH_PICOXCELL is not set
# CONFIG_ARCH_PNX4008 is not set
# CONFIG_ARCH_PXA is not set
# CONFIG_ARCH_MSM is not set
# CONFIG_ARCH_SHMOBILE is not set
# CONFIG_ARCH_RPC is not set
# CONFIG_ARCH_SA1100 is not set
# CONFIG_ARCH_S3C24XX is not set
# CONFIG_ARCH_S3C64XX is not set
# CONFIG_ARCH_S5P64X0 is not set
# CONFIG_ARCH_S5PC100 is not set
# CONFIG_ARCH_S5PV210 is not set
# CONFIG_ARCH_EXYNOS is not set
# CONFIG_ARCH_SHARK is not set
# CONFIG_ARCH_U300 is not set
# CONFIG_ARCH_U8500 is not set
# CONFIG_ARCH_NOMADIK is not set
# CONFIG_ARCH_DAVINCI is not set
# CONFIG_ARCH_OMAP is not set
# CONFIG_PLAT_SPEAR is not set
# CONFIG_ARCH_VT8500 is not set
# CONFIG_ARCH_ZYNQ is not set
# CONFIG_GPIO_PCA953X is not set
CONFIG_MXS_HAVE_AMBA_DUART=y
CONFIG_MXS_HAVE_PLATFORM_AUART=y
CONFIG_MXS_HAVE_PLATFORM_FEC=y
CONFIG_MXS_HAVE_PLATFORM_FLEXCAN=y
CONFIG_MXS_HAVE_PLATFORM_MXS_I2C=y
CONFIG_MXS_HAVE_PLATFORM_MXS_MMC=y
CONFIG_MXS_HAVE_PLATFORM_MXS_PWM=y
CONFIG_MXS_HAVE_PLATFORM_MXSFB=y
CONFIG_MXS_HAVE_PLATFORM_MXS_SAIF=y
CONFIG_MXS_HAVE_PLATFORM_RTC_STMP3XXX=y
CONFIG_MXS_OCOTP=y
CONFIG_SOC_IMX23=y
CONFIG_SOC_IMX28=y

#
# MXS platforms:
#
CONFIG_MACH_MXS_DT=y
CONFIG_MACH_STMP378X_DEVB=y
CONFIG_MACH_MX23EVK=y
CONFIG_MACH_MX28EVK=y
CONFIG_MODULE_TX28=y
CONFIG_MODULE_M28=y
CONFIG_MACH_TX28=y
CONFIG_MACH_M28EVK=y
# CONFIG_MACH_APX4DEVKIT is not set

#
# Processor Type
#
CONFIG_CPU_ARM926T=y
CONFIG_CPU_32v5=y
CONFIG_CPU_ABRT_EV5TJ=y
CONFIG_CPU_PABRT_LEGACY=y
CONFIG_CPU_CACHE_VIVT=y
CONFIG_CPU_COPY_V4WB=y
CONFIG_CPU_TLB_V4WBI=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y
CONFIG_CPU_USE_DOMAINS=y

#
# Processor Features
#
# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
# CONFIG_ARM_THUMB is not set
# CONFIG_CPU_ICACHE_DISABLE is not set
# CONFIG_CPU_DCACHE_DISABLE is not set
# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
# CONFIG_CACHE_L2X0 is not set
CONFIG_ARM_L1_CACHE_SHIFT=5
CONFIG_ARM_NR_BANKS=8

#
# Bus support
#
CONFIG_ARM_AMBA=y
# CONFIG_PCI_SYSCALL is not set
# CONFIG_ARCH_SUPPORTS_MSI is not set
# CONFIG_PCCARD is not set

#
# Kernel Features
#
CONFIG_VMSPLIT_3G=y
# CONFIG_VMSPLIT_2G is not set
# CONFIG_VMSPLIT_1G is not set
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_ARCH_NR_GPIO=0
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_HZ=100
CONFIG_AEABI=y
CONFIG_OABI_COMPAT=y
# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
CONFIG_HAVE_ARCH_PFN_VALID=y
# CONFIG_HIGHMEM is not set
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=999999
# CONFIG_COMPACTION is not set
# CONFIG_PHYS_ADDR_T_64BIT is not set
CONFIG_ZONE_DMA_FLAG=0
CONFIG_VIRT_TO_BUS=y
# CONFIG_KSM is not set
CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_NEED_PER_CPU_KM=y
# CONFIG_CLEANCACHE is not set
CONFIG_FORCE_MAX_ZONEORDER=11
CONFIG_ALIGNMENT_TRAP=y
# CONFIG_UACCESS_WITH_MEMCPY is not set
# CONFIG_SECCOMP is not set
# CONFIG_CC_STACKPROTECTOR is not set
# CONFIG_DEPRECATED_PARAM_STRUCT is not set

#
# Boot options
#
CONFIG_USE_OF=y
CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZBOOT_ROM_BSS=0
# CONFIG_ARM_APPENDED_DTB is not set
CONFIG_CMDLINE=""
# CONFIG_XIP_KERNEL is not set
# CONFIG_KEXEC is not set
# CONFIG_CRASH_DUMP is not set
CONFIG_AUTO_ZRELADDR=y

#
# CPU Power Management
#
# CONFIG_CPU_IDLE is not set

#
# Floating point emulation
#

#
# At least one emulation must be selected
#
CONFIG_FPE_NWFPE=y
# CONFIG_FPE_NWFPE_XP is not set
# CONFIG_FPE_FASTFPE is not set
# CONFIG_VFP is not set

#
# Userspace binary formats
#
CONFIG_BINFMT_ELF=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_HAVE_AOUT=y
# CONFIG_BINFMT_AOUT is not set
# CONFIG_BINFMT_MISC is not set

#
# Power management options
#
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_PM_SLEEP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
# CONFIG_PM_RUNTIME is not set
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
# CONFIG_APM_EMULATION is not set
CONFIG_PM_CLK=y
CONFIG_CPU_PM=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARM_CPU_SUSPEND=y
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_UNIX=y
# CONFIG_UNIX_DIAG is not set
# CONFIG_XFRM_USER is not set
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
# CONFIG_IP_PNP_BOOTP is not set
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE_DEMUX is not set
# CONFIG_ARPD is not set
CONFIG_SYN_COOKIES=y
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_LRO is not set
# CONFIG_INET_DIAG is not set
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
# CONFIG_NETFILTER is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_L2TP is not set
# CONFIG_BRIDGE is not set
# CONFIG_NET_DSA is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
# CONFIG_DCB is not set
CONFIG_DNS_RESOLVER=y
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
CONFIG_BQL=y
# CONFIG_BPF_JIT is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NET_DROP_MONITOR is not set
# CONFIG_HAMRADIO is not set
CONFIG_CAN=m
CONFIG_CAN_RAW=m
CONFIG_CAN_BCM=m
# CONFIG_CAN_GW is not set

#
# CAN Device Drivers
#
# CONFIG_CAN_VCAN is not set
# CONFIG_CAN_SLCAN is not set
CONFIG_CAN_DEV=m
CONFIG_CAN_CALC_BITTIMING=y
# CONFIG_CAN_MCP251X is not set
CONFIG_HAVE_CAN_FLEXCAN=y
CONFIG_CAN_FLEXCAN=m
# CONFIG_CAN_SJA1000 is not set
# CONFIG_CAN_C_CAN is not set
# CONFIG_CAN_CC770 is not set

#
# CAN USB interfaces
#
# CONFIG_CAN_EMS_USB is not set
# CONFIG_CAN_ESD_USB2 is not set
# CONFIG_CAN_PEAK_USB is not set
# CONFIG_CAN_SOFTING is not set
# CONFIG_CAN_DEBUG_DEVICES is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
# CONFIG_WIRELESS is not set
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
# CONFIG_RFKILL_REGULATOR is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
# CONFIG_NFC is not set
CONFIG_HAVE_BPF_JIT=y

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
# CONFIG_DEVTMPFS_MOUNT is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_GENERIC_CPU_DEVICES is not set
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_SPI=y
# CONFIG_DMA_SHARED_BUFFER is not set
# CONFIG_CONNECTOR is not set
# CONFIG_MTD is not set
CONFIG_DTC=y
CONFIG_OF=y

#
# Device Tree and Open Firmware support
#
# CONFIG_PROC_DEVICETREE is not set
# CONFIG_OF_SELFTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_IRQ=y
CONFIG_OF_DEVICE=y
CONFIG_OF_I2C=y
CONFIG_OF_NET=y
CONFIG_OF_MDIO=y
# CONFIG_PARPORT is not set
# CONFIG_BLK_DEV is not set

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
# CONFIG_AD525X_DPOT is not set
# CONFIG_ATMEL_PWM is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
# CONFIG_SENSORS_TSL2550 is not set
# CONFIG_SENSORS_BH1780 is not set
# CONFIG_SENSORS_BH1770 is not set
# CONFIG_SENSORS_APDS990X is not set
# CONFIG_HMC6352 is not set
# CONFIG_DS1682 is not set
# CONFIG_TI_DAC7512 is not set
# CONFIG_BMP085_I2C is not set
# CONFIG_BMP085_SPI is not set
# CONFIG_USB_SWITCH_FSA9480 is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_AT25 is not set
# CONFIG_EEPROM_LEGACY is not set
# CONFIG_EEPROM_MAX6875 is not set
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_EEPROM_93XX46 is not set
# CONFIG_IWMC3200TOP is not set

#
# Texas Instruments shared transport line discipline
#
# CONFIG_TI_ST is not set
# CONFIG_SENSORS_LIS3_SPI is not set
# CONFIG_SENSORS_LIS3_I2C is not set

#
# Altera FPGA firmware download module
#
# CONFIG_ALTERA_STAPL is not set

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
# CONFIG_SCSI_TGT is not set
# CONFIG_SCSI_NETLINK is not set
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
# CONFIG_CHR_DEV_SG is not set
# CONFIG_CHR_DEV_SCH is not set
# CONFIG_SCSI_MULTI_LUN is not set
# CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set
# CONFIG_SCSI_SCAN_ASYNC is not set
CONFIG_SCSI_WAIT_SCAN=m

#
# SCSI Transports
#
# CONFIG_SCSI_SPI_ATTRS is not set
# CONFIG_SCSI_FC_ATTRS is not set
# CONFIG_SCSI_ISCSI_ATTRS is not set
# CONFIG_SCSI_SAS_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
# CONFIG_SCSI_SRP_ATTRS is not set
CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_ISCSI_BOOT_SYSFS is not set
# CONFIG_LIBFC is not set
# CONFIG_LIBFCOE is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_DH is not set
# CONFIG_SCSI_OSD_INITIATOR is not set
# CONFIG_ATA is not set
# CONFIG_MD is not set
# CONFIG_TARGET_CORE is not set
CONFIG_NETDEVICES=y
CONFIG_NET_CORE=y
# CONFIG_BONDING is not set
# CONFIG_DUMMY is not set
# CONFIG_EQUALIZER is not set
# CONFIG_MII is not set
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_TUN is not set
# CONFIG_VETH is not set

#
# CAIF transport drivers
#
CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_BROADCOM=y
# CONFIG_B44 is not set
# CONFIG_NET_CALXEDA_XGMAC is not set
CONFIG_NET_VENDOR_CHELSIO=y
CONFIG_NET_VENDOR_CIRRUS=y
# CONFIG_CS89x0 is not set
# CONFIG_DM9000 is not set
# CONFIG_DNET is not set
CONFIG_NET_VENDOR_FARADAY=y
# CONFIG_FTMAC100 is not set
# CONFIG_FTGMAC100 is not set
CONFIG_NET_VENDOR_FREESCALE=y
CONFIG_FEC=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_NET_VENDOR_I825XX=y
CONFIG_NET_VENDOR_MARVELL=y
CONFIG_NET_VENDOR_MICREL=y
# CONFIG_KS8842 is not set
# CONFIG_KS8851 is not set
# CONFIG_KS8851_MLL is not set
CONFIG_NET_VENDOR_MICROCHIP=y
CONFIG_ENC28J60=y
# CONFIG_ENC28J60_WRITEVERIFY is not set
CONFIG_NET_VENDOR_NATSEMI=y
CONFIG_NET_VENDOR_8390=y
# CONFIG_AX88796 is not set
# CONFIG_ETHOC is not set
CONFIG_NET_VENDOR_SEEQ=y
# CONFIG_SEEQ8005 is not set
CONFIG_NET_VENDOR_SMSC=y
# CONFIG_SMC91X is not set
# CONFIG_SMC911X is not set
# CONFIG_SMSC911X is not set
CONFIG_NET_VENDOR_STMICRO=y
# CONFIG_STMMAC_ETH is not set
CONFIG_NET_VENDOR_WIZNET=y
# CONFIG_WIZNET_W5100 is not set
# CONFIG_WIZNET_W5300 is not set
CONFIG_PHYLIB=y

#
# MII PHY device drivers
#
# CONFIG_AMD_PHY is not set
# CONFIG_MARVELL_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_QSEMI_PHY is not set
# CONFIG_LXT_PHY is not set
# CONFIG_CICADA_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_SMSC_PHY is not set
# CONFIG_BROADCOM_PHY is not set
# CONFIG_ICPLUS_PHY is not set
# CONFIG_REALTEK_PHY is not set
# CONFIG_NATIONAL_PHY is not set
# CONFIG_STE10XP is not set
# CONFIG_LSI_ET1011C_PHY is not set
# CONFIG_MICREL_PHY is not set
# CONFIG_FIXED_PHY is not set
# CONFIG_MDIO_BITBANG is not set
# CONFIG_MDIO_BUS_MUX_GPIO is not set
# CONFIG_MICREL_KS8995MA is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set

#
# USB Network Adapters
#
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_USBNET is not set
# CONFIG_USB_IPHETH is not set
# CONFIG_WLAN is not set

#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#
# CONFIG_WAN is not set
# CONFIG_ISDN is not set

#
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
# CONFIG_INPUT_POLLDEV is not set
# CONFIG_INPUT_SPARSEKMAP is not set
# CONFIG_INPUT_MATRIXKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
CONFIG_INPUT_EVDEV=m
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_ADS7846 is not set
# CONFIG_TOUCHSCREEN_AD7877 is not set
# CONFIG_TOUCHSCREEN_AD7879 is not set
# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
# CONFIG_TOUCHSCREEN_BU21013 is not set
# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set
# CONFIG_TOUCHSCREEN_DYNAPRO is not set
# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
# CONFIG_TOUCHSCREEN_EETI is not set
# CONFIG_TOUCHSCREEN_EGALAX is not set
# CONFIG_TOUCHSCREEN_FUJITSU is not set
# CONFIG_TOUCHSCREEN_ILI210X is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
# CONFIG_TOUCHSCREEN_ELO is not set
# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
# CONFIG_TOUCHSCREEN_WACOM_I2C is not set
# CONFIG_TOUCHSCREEN_MAX11801 is not set
# CONFIG_TOUCHSCREEN_MCS5000 is not set
# CONFIG_TOUCHSCREEN_MTOUCH is not set
# CONFIG_TOUCHSCREEN_INEXIO is not set
# CONFIG_TOUCHSCREEN_MK712 is not set
# CONFIG_TOUCHSCREEN_PENMOUNT is not set
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
# CONFIG_TOUCHSCREEN_PIXCIR is not set
# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
# CONFIG_TOUCHSCREEN_TSC_SERIO is not set
# CONFIG_TOUCHSCREEN_TSC2005 is not set
CONFIG_TOUCHSCREEN_TSC2007=m
# CONFIG_TOUCHSCREEN_W90X900 is not set
# CONFIG_TOUCHSCREEN_ST1232 is not set
# CONFIG_TOUCHSCREEN_TPS6507X is not set
# CONFIG_INPUT_MISC is not set

#
# Hardware I/O ports
#
# CONFIG_SERIO is not set
# CONFIG_GAMEPORT is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
# CONFIG_DEVKMEM is not set

#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_AMBA_PL010 is not set
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
# CONFIG_SERIAL_MAX3100 is not set
# CONFIG_SERIAL_MAX3107 is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_IFX6X60 is not set
# CONFIG_SERIAL_MXS_AUART is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
# CONFIG_HVC_DCC is not set
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_R3964 is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_MUX is not set
CONFIG_I2C_HELPER_AUTO=y

#
# I2C Hardware Bus support
#

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_DESIGNWARE_PLATFORM is not set
# CONFIG_I2C_GPIO is not set
CONFIG_I2C_MXS=y
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_PXA_PCI is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set

#
# External I2C/SMBus adapter drivers
#
# CONFIG_I2C_DIOLAN_U2C is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_TAOS_EVM is not set
# CONFIG_I2C_TINY_USB is not set

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_STUB is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
CONFIG_SPI_BITBANG=m
CONFIG_SPI_GPIO=m
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PL022 is not set
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_HSI is not set

#
# PPS support
#
# CONFIG_PPS is not set

#
# PPS generators support
#

#
# PTP clock support
#

#
# Enable Device Drivers -> PPS to see the PTP clock options.
#
CONFIG_PINCTRL=y

#
# Pin controllers
#
CONFIG_PINMUX=y
CONFIG_PINCONF=y
# CONFIG_DEBUG_PINCTRL is not set
CONFIG_PINCTRL_MXS=y
CONFIG_PINCTRL_IMX23=y
CONFIG_PINCTRL_IMX28=y
CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
CONFIG_ARCH_REQUIRE_GPIOLIB=y
CONFIG_GPIOLIB=y
CONFIG_OF_GPIO=y
CONFIG_DEBUG_GPIO=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_GENERIC=y

#
# Memory mapped GPIO drivers:
#
# CONFIG_GPIO_GENERIC_PLATFORM is not set
# CONFIG_GPIO_EM is not set
CONFIG_GPIO_MXS=y
# CONFIG_GPIO_PL061 is not set

#
# I2C GPIO expanders:
#
# CONFIG_GPIO_MAX7300 is not set
# CONFIG_GPIO_MAX732X is not set
# CONFIG_GPIO_PCF857X is not set
# CONFIG_GPIO_SX150X is not set
# CONFIG_GPIO_ADP5588 is not set

#
# PCI GPIO expanders:
#

#
# SPI GPIO expanders:
#
# CONFIG_GPIO_MAX7301 is not set
# CONFIG_GPIO_MCP23S08 is not set
# CONFIG_GPIO_MC33880 is not set
# CONFIG_GPIO_74X164 is not set

#
# AC97 GPIO expanders:
#

#
# MODULbus GPIO expanders:
#
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
# CONFIG_HWMON is not set
# CONFIG_THERMAL is not set
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set

#
# Multifunction device drivers
#
# CONFIG_MFD_CORE is not set
# CONFIG_MFD_88PM860X is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_MFD_ASIC3 is not set
# CONFIG_HTC_EGPIO is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_HTC_I2CPLD is not set
# CONFIG_MFD_LM3533 is not set
# CONFIG_TPS6105X is not set
# CONFIG_TPS65010 is not set
# CONFIG_TPS6507X is not set
# CONFIG_MFD_TPS65217 is not set
# CONFIG_MFD_TPS6586X is not set
# CONFIG_MFD_TPS65910 is not set
# CONFIG_MFD_TPS65912_I2C is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_TWL4030_CORE is not set
# CONFIG_TWL6040_CORE is not set
# CONFIG_MFD_STMPE is not set
# CONFIG_MFD_TC3589X is not set
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_T7L66XB is not set
# CONFIG_MFD_TC6387XB is not set
# CONFIG_MFD_TC6393XB is not set
# CONFIG_PMIC_DA903X is not set
# CONFIG_MFD_DA9052_SPI is not set
# CONFIG_MFD_DA9052_I2C is not set
# CONFIG_PMIC_ADP5520 is not set
# CONFIG_MFD_MAX77693 is not set
# CONFIG_MFD_MAX8925 is not set
# CONFIG_MFD_MAX8997 is not set
# CONFIG_MFD_MAX8998 is not set
# CONFIG_MFD_S5M_CORE is not set
# CONFIG_MFD_WM8400 is not set
# CONFIG_MFD_WM831X_I2C is not set
# CONFIG_MFD_WM831X_SPI is not set
# CONFIG_MFD_WM8350_I2C is not set
# CONFIG_MFD_WM8994 is not set
# CONFIG_MFD_PCF50633 is not set
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_ABX500_CORE is not set
# CONFIG_EZX_PCAP is not set
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_MFD_TPS65090 is not set
# CONFIG_MFD_AAT2870_CORE is not set
# CONFIG_MFD_RC5T583 is not set
# CONFIG_MFD_PALMAS is not set
CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
# CONFIG_REGULATOR_DUMMY is not set
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
# CONFIG_REGULATOR_GPIO is not set
# CONFIG_REGULATOR_AD5398 is not set
# CONFIG_REGULATOR_ISL6271A is not set
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_MAX8649 is not set
# CONFIG_REGULATOR_MAX8660 is not set
# CONFIG_REGULATOR_MAX8952 is not set
# CONFIG_REGULATOR_LP3971 is not set
# CONFIG_REGULATOR_LP3972 is not set
# CONFIG_REGULATOR_TPS62360 is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
# CONFIG_REGULATOR_TPS6524X is not set
# CONFIG_MEDIA_SUPPORT is not set

#
# Graphics support
#
# CONFIG_DRM is not set
# CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
# CONFIG_FB is not set
# CONFIG_EXYNOS_VIDEO is not set
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set

#
# Console display driver support
#
CONFIG_DUMMY_CONSOLE=y
CONFIG_SOUND=y
# CONFIG_SOUND_OSS_CORE is not set
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_JACK=y
# CONFIG_SND_SEQUENCER is not set
# CONFIG_SND_MIXER_OSS is not set
# CONFIG_SND_PCM_OSS is not set
# CONFIG_SND_HRTIMER is not set
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
# CONFIG_SND_RAWMIDI_SEQ is not set
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_ALOOP is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
CONFIG_SND_ARM=y
# CONFIG_SND_ARMAACI is not set
CONFIG_SND_SPI=y
CONFIG_SND_USB=y
# CONFIG_SND_USB_AUDIO is not set
# CONFIG_SND_USB_UA101 is not set
# CONFIG_SND_USB_CAIAQ is not set
# CONFIG_SND_USB_6FIRE is not set
CONFIG_SND_SOC=y
CONFIG_SND_SOC_DMAENGINE_PCM=y
CONFIG_SND_MXS_SOC=y
CONFIG_SND_SOC_MXS_SGTL5000=y
CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_ALL_CODECS is not set
CONFIG_SND_SOC_SGTL5000=y
# CONFIG_SND_SIMPLE_CARD is not set
# CONFIG_SOUND_PRIME is not set
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
# CONFIG_HIDRAW is not set

#
# USB Input Devices
#
CONFIG_USB_HID=y
# CONFIG_HID_PID is not set
# CONFIG_USB_HIDDEV is not set

#
# Special HID drivers
#
CONFIG_HID_GENERIC=y
CONFIG_HID_A4TECH=y
# CONFIG_HID_ACRUX is not set
CONFIG_HID_APPLE=y
# CONFIG_HID_AUREAL is not set
CONFIG_HID_BELKIN=y
CONFIG_HID_CHERRY=y
CONFIG_HID_CHICONY=y
# CONFIG_HID_PRODIKEYS is not set
CONFIG_HID_CYPRESS=y
# CONFIG_HID_DRAGONRISE is not set
# CONFIG_HID_EMS_FF is not set
CONFIG_HID_EZKEY=y
# CONFIG_HID_HOLTEK is not set
# CONFIG_HID_KEYTOUCH is not set
# CONFIG_HID_KYE is not set
# CONFIG_HID_UCLOGIC is not set
# CONFIG_HID_WALTOP is not set
# CONFIG_HID_GYRATION is not set
# CONFIG_HID_TWINHAN is not set
CONFIG_HID_KENSINGTON=y
# CONFIG_HID_LCPOWER is not set
CONFIG_HID_LOGITECH=y
CONFIG_HID_LOGITECH_DJ=m
# CONFIG_LOGITECH_FF is not set
# CONFIG_LOGIRUMBLEPAD2_FF is not set
# CONFIG_LOGIG940_FF is not set
# CONFIG_LOGIWHEELS_FF is not set
CONFIG_HID_MICROSOFT=y
CONFIG_HID_MONTEREY=y
# CONFIG_HID_MULTITOUCH is not set
# CONFIG_HID_NTRIG is not set
# CONFIG_HID_ORTEK is not set
# CONFIG_HID_PANTHERLORD is not set
# CONFIG_HID_PETALYNX is not set
# CONFIG_HID_PICOLCD is not set
# CONFIG_HID_PRIMAX is not set
# CONFIG_HID_ROCCAT is not set
# CONFIG_HID_SAITEK is not set
# CONFIG_HID_SAMSUNG is not set
# CONFIG_HID_SONY is not set
# CONFIG_HID_SPEEDLINK is not set
# CONFIG_HID_SUNPLUS is not set
# CONFIG_HID_GREENASIA is not set
# CONFIG_HID_SMARTJOYPLUS is not set
# CONFIG_HID_TIVO is not set
# CONFIG_HID_TOPSEED is not set
# CONFIG_HID_THRUSTMASTER is not set
# CONFIG_HID_ZEROPLUS is not set
# CONFIG_HID_ZYDACRON is not set
# CONFIG_USB_ARCH_HAS_OHCI is not set
# CONFIG_USB_ARCH_HAS_EHCI is not set
# CONFIG_USB_ARCH_HAS_XHCI is not set
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
# CONFIG_USB_DEBUG is not set
# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set

#
# Miscellaneous USB options
#
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_MON is not set
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1760_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_HOST=y
# CONFIG_USB_CHIPIDEA_DEBUG is not set

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
# CONFIG_USB_WDM is not set
# CONFIG_USB_TMC is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
# CONFIG_USB_STORAGE_DEBUG is not set
# CONFIG_USB_STORAGE_REALTEK is not set
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_FREECOM is not set
# CONFIG_USB_STORAGE_ISD200 is not set
# CONFIG_USB_STORAGE_USBAT is not set
# CONFIG_USB_STORAGE_SDDR09 is not set
# CONFIG_USB_STORAGE_SDDR55 is not set
# CONFIG_USB_STORAGE_JUMPSHOT is not set
# CONFIG_USB_STORAGE_ALAUDA is not set
# CONFIG_USB_STORAGE_ONETOUCH is not set
# CONFIG_USB_STORAGE_KARMA is not set
# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
# CONFIG_USB_STORAGE_ENE_UB6250 is not set
# CONFIG_USB_UAS is not set
# CONFIG_USB_LIBUSUAL is not set

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set

#
# USB port drivers
#
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYPRESS_CY7C63 is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
# CONFIG_USB_FTDI_ELAN is not set
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_LD is not set
# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_IOWARRIOR is not set
# CONFIG_USB_TEST is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_YUREX is not set

#
# USB Physical Layer drivers
#
# CONFIG_USB_ISP1301 is not set
# CONFIG_USB_GADGET is not set

#
# OTG and related infrastructure
#
CONFIG_USB_OTG_UTILS=y
# CONFIG_USB_GPIO_VBUS is not set
# CONFIG_USB_ULPI is not set
# CONFIG_NOP_USB_XCEIV is not set
CONFIG_USB_MXS_PHY=y
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set
# CONFIG_MMC_CLKGATE is not set

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_MINORS=8
CONFIG_MMC_BLOCK_BOUNCE=y
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_ARMMMCI is not set
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_SDHCI_PXAV3 is not set
# CONFIG_MMC_SDHCI_PXAV2 is not set
CONFIG_MMC_MXS=y
# CONFIG_MMC_SPI is not set
# CONFIG_MMC_DW is not set
# CONFIG_MMC_VUB300 is not set
# CONFIG_MMC_USHC is not set
# CONFIG_MEMSTICK is not set
CONFIG_LEDS_GPIO_REGISTER=y
# CONFIG_NEW_LEDS is not set
# CONFIG_ACCESSIBILITY is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
CONFIG_RTC_DRV_DS1307=m
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set

#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_M41T93 is not set
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1305 is not set
# CONFIG_RTC_DRV_DS1390 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_R9701 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_DS3234 is not set
# CONFIG_RTC_DRV_PCF2123 is not set

#
# Platform RTC drivers
#
# CONFIG_RTC_DRV_CMOS is not set
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_PL030 is not set
# CONFIG_RTC_DRV_PL031 is not set
# CONFIG_RTC_DRV_STMP is not set
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set

#
# DMA Devices
#
# CONFIG_AMBA_PL08X is not set
# CONFIG_DW_DMAC is not set
# CONFIG_TIMB_DMA is not set
# CONFIG_PL330_DMA is not set
CONFIG_MXS_DMA=y
CONFIG_DMA_ENGINE=y

#
# DMA Clients
#
# CONFIG_NET_DMA is not set
# CONFIG_ASYNC_TX_DMA is not set
# CONFIG_DMATEST is not set
# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set

#
# Virtio drivers
#
# CONFIG_VIRTIO_BALLOON is not set
# CONFIG_VIRTIO_MMIO is not set

#
# Microsoft Hyper-V guest support
#
# CONFIG_STAGING is not set
CONFIG_CLKDEV_LOOKUP=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_COMMON_CLK=y

#
# Common Clock Framework
#
# CONFIG_COMMON_CLK_DEBUG is not set

#
# Hardware Spinlock drivers
#
CONFIG_CLKSRC_MMIO=y
CONFIG_IOMMU_SUPPORT=y

#
# Remoteproc drivers (EXPERIMENTAL)
#

#
# Rpmsg drivers (EXPERIMENTAL)
#
# CONFIG_VIRT_DRIVERS is not set
# CONFIG_PM_DEVFREQ is not set
# CONFIG_EXTCON is not set
# CONFIG_MEMORY is not set
# CONFIG_IIO is not set

#
# File systems
#
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
CONFIG_EXT3_FS_XATTR=y
# CONFIG_EXT3_FS_POSIX_ACL is not set
# CONFIG_EXT3_FS_SECURITY is not set
# CONFIG_EXT4_FS is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
# CONFIG_DNOTIFY is not set
CONFIG_INOTIFY_USER=y
# CONFIG_FANOTIFY is not set
# CONFIG_QUOTA is not set
# CONFIG_QUOTACTL is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set
CONFIG_GENERIC_ACL=y

#
# Caches
#
CONFIG_FSCACHE=m
CONFIG_FSCACHE_STATS=y
# CONFIG_FSCACHE_HISTOGRAM is not set
# CONFIG_FSCACHE_DEBUG is not set
# CONFIG_FSCACHE_OBJECT_LIST is not set
CONFIG_CACHEFILES=m
# CONFIG_CACHEFILES_DEBUG is not set
# CONFIG_CACHEFILES_HISTOGRAM is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
# CONFIG_HUGETLB_PAGE is not set
# CONFIG_CONFIGFS_FS is not set
# CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_V4_1 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFSD is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_CEPH_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_MAC_ROMAN is not set
# CONFIG_NLS_MAC_CELTIC is not set
# CONFIG_NLS_MAC_CENTEURO is not set
# CONFIG_NLS_MAC_CROATIAN is not set
# CONFIG_NLS_MAC_CYRILLIC is not set
# CONFIG_NLS_MAC_GAELIC is not set
# CONFIG_NLS_MAC_GREEK is not set
# CONFIG_NLS_MAC_ICELAND is not set
# CONFIG_NLS_MAC_INUIT is not set
# CONFIG_NLS_MAC_ROMANIAN is not set
# CONFIG_NLS_MAC_TURKISH is not set
# CONFIG_NLS_UTF8 is not set

#
# Kernel hacking
#
CONFIG_PRINTK_TIME=y
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=2048
CONFIG_MAGIC_SYSRQ=y
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SHIRQ is not set
CONFIG_LOCKUP_DETECTOR=y
# CONFIG_HARDLOCKUP_DETECTOR is not set
# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_SLUB_DEBUG_ON is not set
# CONFIG_SLUB_STATS is not set
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_PROVE_LOCKING=y
# CONFIG_PROVE_RCU is not set
# CONFIG_SPARSE_RCU_POINTER is not set
CONFIG_LOCKDEP=y
# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_LOCKDEP is not set
CONFIG_TRACE_IRQFLAGS=y
# CONFIG_DEBUG_ATOMIC_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_INFO_REDUCED is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_WRITECOUNT is not set
CONFIG_DEBUG_MEMORY_INIT=y
# CONFIG_DEBUG_LIST is not set
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set
# CONFIG_BOOT_PRINTK_DELAY is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# CONFIG_LKDTM is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_EVENT_POWER_TRACING_DEPRECATED=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
# CONFIG_FUNCTION_TRACER is not set
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_SCHED_TRACER is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
# CONFIG_PROFILE_ALL_BRANCHES is not set
# CONFIG_STACK_TRACER is not set
CONFIG_BLK_DEV_IO_TRACE=y
# CONFIG_PROBE_EVENTS is not set
# CONFIG_FTRACE_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_DYNAMIC_DEBUG is not set
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
# CONFIG_TEST_KSTRTOX is not set
CONFIG_STRICT_DEVMEM=y
CONFIG_ARM_UNWIND=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_LL is not set
# CONFIG_OC_ETM is not set

#
# Security options
#
CONFIG_KEYS=y
# CONFIG_ENCRYPTED_KEYS is not set
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
# CONFIG_SECURITY is not set
# CONFIG_SECURITYFS is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=m
CONFIG_CRYPTO_ALGAPI2=m
CONFIG_CRYPTO_HASH=m
CONFIG_CRYPTO_HASH2=m
# CONFIG_CRYPTO_MANAGER is not set
# CONFIG_CRYPTO_MANAGER2 is not set
# CONFIG_CRYPTO_USER is not set
# CONFIG_CRYPTO_GF128MUL is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_CRYPTD is not set
# CONFIG_CRYPTO_AUTHENC is not set
# CONFIG_CRYPTO_TEST is not set

#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
# CONFIG_CRYPTO_SEQIV is not set

#
# Block modes
#
# CONFIG_CRYPTO_CBC is not set
# CONFIG_CRYPTO_CTR is not set
# CONFIG_CRYPTO_CTS is not set
# CONFIG_CRYPTO_ECB is not set
# CONFIG_CRYPTO_LRW is not set
# CONFIG_CRYPTO_PCBC is not set
# CONFIG_CRYPTO_XTS is not set

#
# Hash modes
#
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
CONFIG_CRYPTO_CRC32C=m
# CONFIG_CRYPTO_GHASH is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
# CONFIG_CRYPTO_RMD320 is not set
# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set

#
# Ciphers
#
# CONFIG_CRYPTO_AES is not set
# CONFIG_CRYPTO_ANUBIS is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_TWOFISH is not set

#
# Compression
#
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_ZLIB is not set
# CONFIG_CRYPTO_LZO is not set

#
# Random Number Generation
#
# CONFIG_CRYPTO_ANSI_CPRNG is not set
# CONFIG_CRYPTO_USER_API_HASH is not set
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
# CONFIG_CRYPTO_HW is not set
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IO=y
CONFIG_STMP_DEVICE=y
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
CONFIG_CRC_T10DIF=y
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
CONFIG_CRC7=m
# CONFIG_LIBCRC32C is not set
# CONFIG_CRC8 is not set
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
# CONFIG_XZ_DEC is not set
# CONFIG_XZ_DEC_BCJ is not set
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_DQL=y
CONFIG_NLATTR=y
CONFIG_GENERIC_ATOMIC64=y
# CONFIG_AVERAGE is not set
# CONFIG_CORDIC is not set
# CONFIG_DDR is not set
reviewer
#62 lore raw

v5 cover add imx usb driver for mx28/6x

Quoted 5 lines · Shawn Guo
Quoted 3 lines · Fabio Estevam

Can someone confirm that this patch series works on a mx28evk? If it does, please send me the .config that works.

The series works fine on my imx28-evk board with the .config attached.

Excellent! It works fine now ;-)

Thanks,

Fabio Estevam

#65 lore raw

v5 cover add imx usb driver for mx28/6x

In reply to Fabio Estevam

Dear Fabio Estevam,

Quoted 12 lines

Hi Shawn,

Quoted 6 lines · Shawn Guo
Quoted 1 line

Attached my .config file.

You haven't enabled the following two in your .config.

CONFIG_USB_CHIPIDEA
CONFIG_USB_CHIPIDEA_HOST

Please check my config file again:

Quoted 7 lines

It does have:

CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_HOST=y

Can someone confirm that this patch series works on a mx28evk? If it does, please send me the .config that works.

T-22 (+small delta) hours and counting ...

Quoted 3 lines

Thanks,

Fabio Estevam

Best regards,
Marek Vasut

#66 lore raw

v5 cover add imx usb driver for mx28/6x

In reply to Richard Zhao

Richard,

In case you are looking for Ack/Tested by for this patch set.

Applied this patch set and USB devices work with this patch, on mx28 based hardware that I have access to.

-Subodh

Quoted 61 lines · Richard Zhao

The work is based on ci13xxx rework done by Alexander Shishkin.

Status:
- this version only support host
- usbotg controler works at host role

Changes since last version:
- collect ack received.

Richard Zhao (13):
usb: otg: add notify_connect/notify_disconnect callback
USB: move transceiver from ehci_hcd and ohci_hcd to hcd and rename it
as phy
USB: notify phy when root hub port connect change
usb: chipidea: permit driver bindings pass phy pointer
usb: otg: add basic mxs phy driver support
usb: chipidea: add imx platform driver
ARM: imx6q: correct device name of usbphy and usb controller clock
export
ARM: imx6q: add config-on-boot gpios
ARM: imx6q: add usbphy clocks
ARM: imx6q: disable usb charger detector
ARM: dts: imx6q-sabrelite: add usb devices
ARM: mxs: clk_register_clkdev mx28 usb clocks
ARM: dts: imx28-evk: add usb devices

  .../devicetree/bindings/arm/config-on-boot.txt     |   12 ++
  .../devicetree/bindings/usb/ci13xxx-imx.txt        |   20 ++
  Documentation/devicetree/bindings/usb/mxs-phy.txt  |   13 ++
  arch/arm/boot/dts/imx28-evk.dts                    |   36 ++++
  arch/arm/boot/dts/imx28.dtsi                       |   12 +-
  arch/arm/boot/dts/imx6q-sabrelite.dts              |   35 ++++
  arch/arm/boot/dts/imx6q.dtsi                       |   36 +++-
  arch/arm/mach-imx/clk-imx6q.c                      |   12 +-
  arch/arm/mach-imx/mach-imx6q.c                     |   59 ++++++
  drivers/clk/mxs/clk-imx28.c                        |    4 +
  drivers/usb/chipidea/Makefile                      |    3 +
  drivers/usb/chipidea/ci.h                          |    2 +
  drivers/usb/chipidea/ci13xxx_imx.c                 |  189 ++++++++++++++++++
  drivers/usb/chipidea/core.c                        |    4 +
  drivers/usb/chipidea/host.c                        |    1 +
  drivers/usb/chipidea/udc.c                         |   11 +-
  drivers/usb/core/hub.c                             |    8 +
  drivers/usb/host/ehci-fsl.c                        |   21 +-
  drivers/usb/host/ehci-hub.c                        |    2 +-
  drivers/usb/host/ehci.h                            |    4 -
  drivers/usb/host/ohci-omap.c                       |   27 +--
  drivers/usb/host/ohci.h                            |    5 -
  drivers/usb/otg/Kconfig                            |    8 +
  drivers/usb/otg/Makefile                           |    1 +
  drivers/usb/otg/mxs-phy.c                          |  204 ++++++++++++++++++++
  include/linux/usb/chipidea.h                       |    3 +
  include/linux/usb/hcd.h                            |    6 +
  include/linux/usb/otg.h                            |   21 ++
  28 files changed, 715 insertions(+), 44 deletions(-)

create mode 100644 Documentation/devicetree/bindings/arm/config-on-boot.txt create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt create mode 100644 Documentation/devicetree/bindings/usb/mxs-phy.txt create mode 100644 drivers/usb/chipidea/ci13xxx_imx.c
create mode 100644 drivers/usb/otg/mxs-phy.c