Commit c4b34a3b authored by George Cherian's avatar George Cherian Committed by Felipe Balbi

usb: phy: omap: Add omap-control Support for AM437x

This adds omap control module support for USBSS in AM437x SoC.
Update DT binding information to reflect these changes.
Acked-by: default avatarRoger Quadros <rogerq@ti.com>
Signed-off-by: default avatarGeorge Cherian <george.cherian@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent db67bc04
...@@ -87,6 +87,8 @@ Required properties: ...@@ -87,6 +87,8 @@ Required properties:
e.g. USB3 PHY and SATA PHY on OMAP5. e.g. USB3 PHY and SATA PHY on OMAP5.
"ti,control-phy-dra7usb2" - if it has power down register like USB2 PHY on "ti,control-phy-dra7usb2" - if it has power down register like USB2 PHY on
DRA7 platform. DRA7 platform.
"ti,control-phy-am437usb2" - if it has power down register like USB2 PHY on
AM437 platform.
- reg : Address and length of the register set for the device. It contains - reg : Address and length of the register set for the device. It contains
the address of "otghs_control" for control-phy-otghs or "power" register the address of "otghs_control" for control-phy-otghs or "power" register
for other types. for other types.
......
...@@ -84,6 +84,20 @@ void omap_control_usb_phy_power(struct device *dev, int on) ...@@ -84,6 +84,20 @@ void omap_control_usb_phy_power(struct device *dev, int on)
else else
val |= OMAP_CTRL_USB2_PHY_PD; val |= OMAP_CTRL_USB2_PHY_PD;
break; break;
case OMAP_CTRL_TYPE_AM437USB2:
if (on) {
val &= ~(AM437X_CTRL_USB2_PHY_PD |
AM437X_CTRL_USB2_OTG_PD);
val |= (AM437X_CTRL_USB2_OTGVDET_EN |
AM437X_CTRL_USB2_OTGSESSEND_EN);
} else {
val &= ~(AM437X_CTRL_USB2_OTGVDET_EN |
AM437X_CTRL_USB2_OTGSESSEND_EN);
val |= (AM437X_CTRL_USB2_PHY_PD |
AM437X_CTRL_USB2_OTG_PD);
}
break;
default: default:
dev_err(dev, "%s: type %d not recognized\n", dev_err(dev, "%s: type %d not recognized\n",
__func__, control_usb->type); __func__, control_usb->type);
...@@ -197,6 +211,7 @@ static const enum omap_control_usb_type otghs_data = OMAP_CTRL_TYPE_OTGHS; ...@@ -197,6 +211,7 @@ static const enum omap_control_usb_type otghs_data = OMAP_CTRL_TYPE_OTGHS;
static const enum omap_control_usb_type usb2_data = OMAP_CTRL_TYPE_USB2; static const enum omap_control_usb_type usb2_data = OMAP_CTRL_TYPE_USB2;
static const enum omap_control_usb_type pipe3_data = OMAP_CTRL_TYPE_PIPE3; static const enum omap_control_usb_type pipe3_data = OMAP_CTRL_TYPE_PIPE3;
static const enum omap_control_usb_type dra7usb2_data = OMAP_CTRL_TYPE_DRA7USB2; static const enum omap_control_usb_type dra7usb2_data = OMAP_CTRL_TYPE_DRA7USB2;
static const enum omap_control_usb_type am437usb2_data = OMAP_CTRL_TYPE_AM437USB2;
static const struct of_device_id omap_control_usb_id_table[] = { static const struct of_device_id omap_control_usb_id_table[] = {
{ {
...@@ -215,6 +230,10 @@ static const struct of_device_id omap_control_usb_id_table[] = { ...@@ -215,6 +230,10 @@ static const struct of_device_id omap_control_usb_id_table[] = {
.compatible = "ti,control-phy-dra7usb2", .compatible = "ti,control-phy-dra7usb2",
.data = &dra7usb2_data, .data = &dra7usb2_data,
}, },
{
.compatible = "ti,control-phy-am437usb2",
.data = &am437usb2_data,
},
{}, {},
}; };
MODULE_DEVICE_TABLE(of, omap_control_usb_id_table); MODULE_DEVICE_TABLE(of, omap_control_usb_id_table);
......
...@@ -24,6 +24,7 @@ enum omap_control_usb_type { ...@@ -24,6 +24,7 @@ enum omap_control_usb_type {
OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */
OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */
OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */
OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */
}; };
struct omap_control_usb { struct omap_control_usb {
...@@ -64,6 +65,11 @@ enum omap_control_usb_mode { ...@@ -64,6 +65,11 @@ enum omap_control_usb_mode {
#define OMAP_CTRL_USB2_PHY_PD BIT(28) #define OMAP_CTRL_USB2_PHY_PD BIT(28)
#define AM437X_CTRL_USB2_PHY_PD BIT(0)
#define AM437X_CTRL_USB2_OTG_PD BIT(1)
#define AM437X_CTRL_USB2_OTGVDET_EN BIT(19)
#define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20)
#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB)
extern void omap_control_usb_phy_power(struct device *dev, int on); extern void omap_control_usb_phy_power(struct device *dev, int on);
extern void omap_control_usb_set_mode(struct device *dev, extern void omap_control_usb_set_mode(struct device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment