summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNikita Yushchenko <nikita.yoush@cogentembedded.com>2018-06-22 19:46:57 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2018-06-26 06:56:40 +0200
commit9d7d333c33e5a932b66cc0f5f3ed7fa28a651819 (patch)
treeae43bac20589eb14e68a08fbd76c3e1b85a46a8c /include
parent782dd520ad67bf5d85fefd3f08149969f00c86f7 (diff)
downloadbarebox-9d7d333c33e5a932b66cc0f5f3ed7fa28a651819.tar.gz
barebox-9d7d333c33e5a932b66cc0f5f3ed7fa28a651819.tar.xz
usb: imx: implement support for limiting host to full speed
This is needed when host is known to not work properly in high speed mode. In linux, chipidea driver supports 'maximum-speed' device tree property. When that is set to "full-speed", driver sets PFSC bit in PORTSC register, which disallows use of high speed mode. This patch implements same support for barebox. Important technical detail is that PFSC bit is cleared by port reset, thus setting it has to be done in ehci->init() callback which is called after ehci_reset(). Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/usb/ch9.h6
-rw-r--r--include/usb/chipidea-imx.h1
-rw-r--r--include/usb/usb.h3
3 files changed, 10 insertions, 0 deletions
diff --git a/include/usb/ch9.h b/include/usb/ch9.h
index ab5d531925..b44d41e85f 100644
--- a/include/usb/ch9.h
+++ b/include/usb/ch9.h
@@ -1004,6 +1004,12 @@ struct usb_set_sel_req {
*/
const char *usb_speed_string(enum usb_device_speed speed);
+/**
+ * usb_speed_by_string() - Get speed from human readable name.
+ * @string: The human readable name for the speed. If it is not one of known
+ * names, USB_SPEED_UNKNOWN will be returned.
+ */
+enum usb_device_speed usb_speed_by_string(const char *string);
/**
* usb_state_string - Returns human readable name for the state.
diff --git a/include/usb/chipidea-imx.h b/include/usb/chipidea-imx.h
index 640ae06944..973aee6a0e 100644
--- a/include/usb/chipidea-imx.h
+++ b/include/usb/chipidea-imx.h
@@ -13,6 +13,7 @@
#define MXC_EHCI_MODE_ULPI (2 << 30)
#define MXC_EHCI_MODE_HSIC (1 << 25)
#define MXC_EHCI_MODE_SERIAL (3 << 30)
+#define MXC_EHCI_PFSC (1 << 24)
/*
* USB misc flags
diff --git a/include/usb/usb.h b/include/usb/usb.h
index 93308cec00..9aab06c87c 100644
--- a/include/usb/usb.h
+++ b/include/usb/usb.h
@@ -438,6 +438,9 @@ enum usb_dr_mode {
enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np,
const char *propname);
+enum usb_device_speed of_usb_get_maximum_speed(struct device_node *np,
+ const char *propname);
+
extern struct list_head usb_device_list;
#endif /*_USB_H_ */