Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
- index a286873..77a589c 100644
- --- a/arch/arm/boot/dts/imx23-olinuxino.dts
- +++ b/arch/arm/boot/dts/imx23-olinuxino.dts
- @@ -31,6 +31,21 @@
- bus-width = <4>;
- status = "okay";
- };
- +
- + pinctrl@80018000 {
- + pinctrl-names = "default";
- + pinctrl-0 = <&hog_pins_a>;
- +
- + hog_pins_a: hog-gpios@0 {
- + reg = <0>;
- + fsl,pinmux-ids = <
- + 0x0113 /* MX23_PAD_GPMI_ALE__GPIO_0_17 */
- + >;
- + fsl,drive-strength = <2>;
- + fsl,voltage = <1>;
- + fsl,pull-up = <1>;
- + };
- + };
- };
- apbx@80040000 {
- @@ -45,6 +60,32 @@
- pinctrl-0 = <&auart0_2pins_a>;
- status = "okay";
- };
- +
- + usbphy0: usbphy@8007c000 {
- + status = "okay";
- + };
- + };
- +
- + };
- +
- + ahb@80080000 {
- + usb0: usb@80080000 {
- + vbus-supply = <®_usb0_vbus>;
- + status = "okay";
- + };
- + };
- +
- + regulators {
- + compatible = "simple-bus";
- +
- + reg_usb0_vbus: usb0_vbus {
- + compatible = "regulator-fixed";
- + regulator-name = "usb0_vbus";
- + regulator-min-microvolt = <5000000>;
- + regulator-max-microvolt = <5000000>;
- + enable-active-high;
- + startup-delay-us = <300>; /* LAN9215 requires a POR of 200us minimum */
- + gpio = <&gpio0 17 0>;
- };
- };
- };
- diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
- index 9700872..5710630 100644
- --- a/arch/arm/boot/dts/imx23.dtsi
- +++ b/arch/arm/boot/dts/imx23.dtsi
- @@ -425,7 +425,8 @@
- status = "disabled";
- };
- - usbphy@8007c000 {
- + usbphy0: usbphy@8007c000 {
- + compatible = "fsl,imx23-usbphy";
- reg = <0x8007c000 0x2000>;
- status = "disabled";
- };
- @@ -439,8 +440,11 @@
- reg = <0x80080000 0x80000>;
- ranges;
- - usbctrl@80080000 {
- + usb0: usb@80080000 {
- + compatible = "fsl,imx23-usb", "fsl,imx27-usb";
- reg = <0x80080000 0x40000>;
- + interrupts = <11>;
- + fsl,usbphy = <&usbphy0>;
- status = "disabled";
- };
- };
- diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
- index c1a67cb..abacd3d 100644
- --- a/drivers/usb/otg/mxs-phy.c
- +++ b/drivers/usb/otg/mxs-phy.c
- @@ -24,10 +24,20 @@
- #define DRIVER_NAME "mxs_phy"
- #define HW_USBPHY_PWD 0x00
- +#define HW_USBPHY_PWD_SET 0x04
- +#define HW_USBPHY_PWD_CLR 0x08
- #define HW_USBPHY_CTRL 0x30
- #define HW_USBPHY_CTRL_SET 0x34
- #define HW_USBPHY_CTRL_CLR 0x38
- +#define BM_USBPHY_PWD_RXPWDRX BIT(20)
- +#define BM_USBPHY_PWD_RXPWDIFF BIT(19)
- +#define BM_USBPHY_PWD_RXPWD1PT1 BIT(18)
- +#define BM_USBPHY_PWD_RXPWDENV BIT(17)
- +#define BM_USBPHY_PWD_TXPWDV2I BIT(12)
- +#define BM_USBPHY_PWD_TXPWDIBIAS BIT(11)
- +#define BM_USBPHY_PWD_TXPWDFS BIT(10)
- +
- #define BM_USBPHY_CTRL_SFTRST BIT(31)
- #define BM_USBPHY_CTRL_CLKGATE BIT(30)
- #define BM_USBPHY_CTRL_ENUTMILEVEL3 BIT(15)
- @@ -43,14 +53,33 @@ struct mxs_phy {
- static void mxs_phy_hw_init(struct mxs_phy *mxs_phy)
- {
- + int reset_sts;
- void __iomem *base = mxs_phy->phy.io_priv;
- - stmp_reset_block(base + HW_USBPHY_CTRL);
- -
- - /* Power up the PHY */
- - writel_relaxed(0, base + HW_USBPHY_PWD);
- + /* Use global device reset function. Side effect of this
- + is to soft reset USBPHY_PWD, USBPHY_TX, USBPHY_RX,
- + and USBPHY_CTRL registers. */
- + reset_sts = stmp_reset_block(base + HW_USBPHY_CTRL);
- + if (reset_sts) {
- + dev_err(mxs_phy->phy.dev, "USB PHY reset failed!\n");
- + }
- - /* enable FS/LS device */
- + /* Enable the PHY clock after reset. */
- + writel_relaxed(BM_USBPHY_CTRL_SFTRST |
- + BM_USBPHY_CTRL_CLKGATE,
- + base + HW_USBPHY_CTRL_CLR);
- +
- + /* Power up the PHY after reset. */
- + writel_relaxed(BM_USBPHY_PWD_RXPWDRX |
- + BM_USBPHY_PWD_RXPWDIFF |
- + BM_USBPHY_PWD_RXPWD1PT1 |
- + BM_USBPHY_PWD_RXPWDENV |
- + BM_USBPHY_PWD_TXPWDV2I |
- + BM_USBPHY_PWD_TXPWDIBIAS |
- + BM_USBPHY_PWD_TXPWDFS,
- + base + HW_USBPHY_PWD_CLR);
- +
- + /* Enable FS/LS device. Not supported on i.MX23. */
- writel_relaxed(BM_USBPHY_CTRL_ENUTMILEVEL2 |
- BM_USBPHY_CTRL_ENUTMILEVEL3,
- base + HW_USBPHY_CTRL_SET);
- @@ -70,6 +99,17 @@ static void mxs_phy_shutdown(struct usb_phy *phy)
- {
- struct mxs_phy *mxs_phy = to_mxs_phy(phy);
- + /* Power down USB receivers and transmitters. */
- + writel_relaxed(BM_USBPHY_PWD_RXPWDRX |
- + BM_USBPHY_PWD_RXPWDIFF |
- + BM_USBPHY_PWD_RXPWD1PT1 |
- + BM_USBPHY_PWD_RXPWDENV |
- + BM_USBPHY_PWD_TXPWDV2I |
- + BM_USBPHY_PWD_TXPWDIBIAS |
- + BM_USBPHY_PWD_TXPWDFS,
- + phy->io_priv + HW_USBPHY_PWD_SET);
- +
- + /* Disable clock. */
- writel_relaxed(BM_USBPHY_CTRL_CLKGATE,
- phy->io_priv + HW_USBPHY_CTRL_SET);
- @@ -81,8 +121,6 @@ static int mxs_phy_on_connect(struct usb_phy *phy, int port)
- dev_dbg(phy->dev, "Connect on port %d\n", port);
- mxs_phy_hw_init(to_mxs_phy(phy));
- - writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
- - phy->io_priv + HW_USBPHY_CTRL_SET);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement