socsvn commit: r240214 - in soc2012/aleek/beaglexm-armv6/sys/arm:
conf ti/usb
aleek at FreeBSD.org
aleek at FreeBSD.org
Thu Aug 9 16:14:08 UTC 2012
Author: aleek
Date: Thu Aug 9 16:14:05 2012
New Revision: 240214
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=240214
Log:
working od omap ehci driver. Its still not working
Modified:
soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM
soc2012/aleek/beaglexm-armv6/sys/arm/ti/usb/omap_ehci.c
Modified: soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM Thu Aug 9 15:11:38 2012 (r240213)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM Thu Aug 9 16:14:05 2012 (r240214)
@@ -107,8 +107,8 @@
# USB support
device usb
options USB_DEBUG
-options USB_REQ_DEBUG
-options USB_VERBOSE
+options USB_REQ_DEBUG
+options USB_VERBOSE
device musb
device ehci
device umass
Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/usb/omap_ehci.c
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/ti/usb/omap_ehci.c Thu Aug 9 15:11:38 2012 (r240213)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/usb/omap_ehci.c Thu Aug 9 16:14:05 2012 (r240214)
@@ -102,6 +102,9 @@
#include <arm/ti/ti_prcm.h>
#include <arm/ti/ti_scm.h>
+#include <arm/ti/twl/twl.h>
+#include <arm/ti/twl/twl_vreg.h>
+
#include <arm/ti/usb/omap_usb.h>
#include "gpio_if.h"
@@ -111,6 +114,7 @@
device_t sc_dev;
device_t sc_gpio_dev;
+ device_t sc_vreg_dev;
/* TLL register set */
struct resource* tll_mem_res;
@@ -352,6 +356,11 @@
/* Enable Clocks for high speed USBHOST */
ti_prcm_clk_enable(USBHSHOST_CLK);
+
+ /* enabling TWL4030/TPS95950 voltage regulator */
+ twl_vreg_set_voltage(isc->sc_vreg_dev, "vusb1v5", 1800);
+ twl_vreg_set_voltage(isc->sc_vreg_dev, "vusb1v8", 1800);
+ twl_vreg_set_voltage(isc->sc_vreg_dev, "vusb3v1", 1800);
/* Hold the PHY in reset while configuring */
for (int i = 0; i < 3; i++) {
@@ -381,6 +390,8 @@
/* Enable the USB TLL */
ti_prcm_clk_enable(USBTLL_CLK);
+ //omap_ehci_write_4(isc, OMAP_USBHOST_INSNREG04, OMAP_USBHOST_INSNREG04_DISABLE_UNSUSPEND);
+
/* Perform TLL soft reset, and wait until reset is complete */
omap_tll_write_4(isc, OMAP_USBTLL_SYSCONFIG, TLL_SYSCONFIG_SOFTRESET);
@@ -414,7 +425,7 @@
TLL_SYSCONFIG_CACTIVITY);
} else if (isc->ehci_rev == OMAP_EHCI_REV2) {
-
+#if 0
/* For OMAP44xx devices you have to enable the per-port clocks:
* PHY_MODE - External ULPI clock
* TTL_MODE - Internal UTMI clock
@@ -437,6 +448,7 @@
else if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_HSIC)
ti_prcm_clk_enable(USBP2_HSIC_CLK);
}
+#endif
}
/* Put UHH in SmartIdle/SmartStandby mode */
@@ -533,6 +545,13 @@
omap_ehci_utmi_init(isc, tll_ch_mask);
}
+ /* Soft reset the PHY using PHY reset command over ULPI */
+ if (isc->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY)
+ omap_ehci_soft_phy_reset(isc, 0);
+ if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY)
+ omap_ehci_soft_phy_reset(isc, 1);
+
+ //ehci_reset( isc->base );
/* Release the PHY reset signal now we have configured everything */
if (reset_performed) {
@@ -560,11 +579,6 @@
reg |= (1 << 16);
omap_ehci_write_4(isc, OMAP_USBHOST_USBCMD, reg);
- /* Soft reset the PHY using PHY reset command over ULPI */
- if (isc->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY)
- omap_ehci_soft_phy_reset(isc, 0);
- if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY)
- omap_ehci_soft_phy_reset(isc, 1);
return(0);
@@ -785,6 +799,7 @@
/* save the device */
isc->sc_dev = dev;
+ isc->sc_vreg_dev = devclass_get_device(devclass_find("twl_vreg"), 0);
/* get all DMA memory */
if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(dev),
@@ -895,7 +910,6 @@
/* Setup the interrupt */
- device_printf( dev, "%s:%d\n", __func__, __LINE__ );
err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
if (err) {
@@ -905,10 +919,8 @@
}
- device_printf( dev, "%s:%d\n", __func__, __LINE__ );
/* Finally we are ready to kick off the ECHI host controller */
err = 0; //ehci_init(sc);
- device_printf( dev, "%s:%d\n", __func__, __LINE__ );
if (err == 0) {
err = device_probe_and_attach(sc->sc_bus.bdev);
}
More information about the svn-soc-all
mailing list