]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
usb: ehci-hcd: add enum usb_init_type parameter to ehci_hcd_init.
authorTroy Kisky <troy.kisky@boundarydevices.com>
Thu, 10 Oct 2013 22:27:57 +0000 (15:27 -0700)
committerMarek Vasut <marex@denx.de>
Sun, 20 Oct 2013 21:46:27 +0000 (23:46 +0200)
This paramter will later be used to initialize OTG ports in
host or device mode.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
26 files changed:
board/compulab/cm_t35/cm_t35.c
board/htkw/mcx/mcx.c
board/technexion/twister/twister.c
board/teejet/mt_ventoux/mt_ventoux.c
board/ti/beagle/beagle.c
board/ti/omap5_uevm/evm.c
board/ti/panda/panda.c
drivers/usb/host/ehci-armada100.c
drivers/usb/host/ehci-atmel.c
drivers/usb/host/ehci-exynos.c
drivers/usb/host/ehci-faraday.c
drivers/usb/host/ehci-fsl.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-ixp4xx.c
drivers/usb/host/ehci-marvell.c
drivers/usb/host/ehci-mpc512x.c
drivers/usb/host/ehci-mx5.c
drivers/usb/host/ehci-mx6.c
drivers/usb/host/ehci-mxc.c
drivers/usb/host/ehci-mxs.c
drivers/usb/host/ehci-pci.c
drivers/usb/host/ehci-ppc4xx.c
drivers/usb/host/ehci-spear.c
drivers/usb/host/ehci-tegra.c
drivers/usb/host/ehci-vct.c
drivers/usb/host/ehci.h

index 7626abc02e67f7a0cd82a8591af01fb34d0881f9..19945c105e5ae7d8fc8dda30aa76f84e1429e80b 100644 (file)
@@ -565,7 +565,8 @@ struct omap_usbhs_board_data usbhs_bdata = {
 };
 
 #define SB_T35_USB_HUB_RESET_GPIO      167
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        u8 val;
        int offset;
index 6f85b47a0f0ff788aaa50a04bf3b3972e74531d8..4330cf0ddb51e1df072eacd00752d64feee041d2 100644 (file)
@@ -40,7 +40,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
        .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
 };
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
 }
index 6f2ff55a126b7c1730f1f2638cf53106aba5566f..054e7ccdedf9bf4f222b22ecaab0fa2805b4d68f 100644 (file)
@@ -51,7 +51,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
        .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
 };
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
 }
index df873f52a371325c2341d7dc486653024afca949..c32d554ea429c601dc33234be013583351f8cbc0 100644 (file)
@@ -102,7 +102,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
        .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
 };
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
 }
index 41fed54fdb43b418c9bb493212e23fa064ffab4c..9669a32fc13b8d122c4e51067dbbbbcf23f5fe86 100644 (file)
@@ -521,7 +521,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
        .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
 };
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
 }
index 0044c229b03c96eedd6c354d7b6556fdba52cfe8..9458104604e164edb20bae498793904c37a658a0 100644 (file)
@@ -179,7 +179,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
        .port_mode[2] = OMAP_EHCI_PORT_MODE_HSIC,
 };
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        int ret;
 
index 3724e816c22fa2ba3a852dc8883363e04b1faee9..c104024b1007b1cc7dc307842d014ce6a4d231f1 100644 (file)
@@ -269,7 +269,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
        .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
 };
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        int ret;
        unsigned int utmi_clk;
index 636b6e5da026794843104c85e614a2e9d595300e..012eb3a1a44d8c353a0877e811c7a360f8fcffcc 100644 (file)
@@ -22,7 +22,8 @@
 /*
  * EHCI host controller init
  */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        if (utmi_init() < 0)
                return -1;
index 67444b26ef9d067ecb5d1ace327ee54ff760a241..9ffe5010be959270f6e483d8572bff4141a0d475 100644 (file)
@@ -21,7 +21,8 @@
  */
 #define EN_UPLL_TIMEOUT        500UL
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
        ulong start_time, tmp_time;
index 15926c43365f3d0a7f9e4da2eecef959c253a82f..66b4de0b2d05d7a33ca6a11acabeb8fdf1d2537a 100644 (file)
@@ -141,7 +141,8 @@ static void reset_usb_phy(struct exynos_usb_phy *usb)
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
  */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        struct exynos_ehci *ctx = &exynos;
 
index 4a36acdaeccd1a125138f5d181888fdee9e57084..3b761bc326a2a44fc53169cd1853278ec00d0aad 100644 (file)
@@ -33,8 +33,8 @@ static inline int ehci_is_fotg2xx(union ehci_faraday_regs *regs)
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
  */
-int ehci_hcd_init(int index, struct ehci_hccr **ret_hccr,
-               struct ehci_hcor **ret_hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **ret_hccr, struct ehci_hcor **ret_hcor)
 {
        struct ehci_hccr *hccr;
        struct ehci_hcor *hcor;
index 0ef6f238d5cc19d9eccca97c4547d00e8ebfdad1..8f009191a9febafe5934ea2ef7462eb9f77b0b1e 100644 (file)
@@ -35,7 +35,8 @@ static int usb_phy_clk_valid(struct usb_ehci *ehci)
  *
  * Excerpts from linux ehci fsl driver.
  */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        struct usb_ehci *ehci;
        const char *phy_type = NULL;
index 6c21f47413baff2618005b44e5ee3d2ab4018aec..8bd1eb8a99836f16f95113ac6d2e68b339cf5489 100644 (file)
@@ -926,17 +926,22 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
        struct QH *qh_list;
        struct QH *periodic;
        int i;
+       int rc;
 
-       if (ehci_hcd_init(index, &ehcic[index].hccr, &ehcic[index].hcor))
-               return -1;
+       rc = ehci_hcd_init(index, init, &ehcic[index].hccr, &ehcic[index].hcor);
+       if (rc)
+               return rc;
+       if (init == USB_INIT_DEVICE)
+               goto done;
 
        /* EHCI spec section 4.1 */
        if (ehci_reset(index))
                return -1;
 
 #if defined(CONFIG_EHCI_HCD_INIT_AFTER_RESET)
-       if (ehci_hcd_init(index, &ehcic[index].hccr, &ehcic[index].hcor))
-               return -1;
+       rc = ehci_hcd_init(index, init, &ehcic[index].hccr, &ehcic[index].hcor);
+       if (rc)
+               return rc;
 #endif
        /* Set the high address word (aka segment) for 64-bit controller */
        if (ehci_readl(&ehcic[index].hccr->cr_hccparams) & 1)
@@ -1037,7 +1042,7 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
        printf("USB EHCI %x.%02x\n", reg >> 8, reg & 0xff);
 
        ehcic[index].rootdev = 0;
-
+done:
        *controller = &ehcic[index];
        return 0;
 }
index 56ef7e6c138691c58b05dec33af28a6affc29c06..646e815e71d1ba841346f6f5d1c0a6b6b0c626cd 100644 (file)
@@ -14,7 +14,8 @@
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
  */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        *hccr = (struct ehci_hccr *)(0xcd000100);
        *hcor = (struct ehci_hcor *)((uint32_t) *hccr
index ee97fd2745fd168445aaab18a15b8e725935a66d..52c43fdc5aaa1fdc2a99ed3177c65c35b3a2c979 100644 (file)
@@ -74,7 +74,8 @@ static void usb_brg_adrdec_setup(void)
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
  */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        usb_brg_adrdec_setup();
 
index bb6e7ac97fd555bb1b437568a66a1ac21ff37719..a22109099068c54b13a2b8d08cb12940ce520bf5 100644 (file)
@@ -32,7 +32,8 @@ static void usb_platform_dr_init(volatile struct usb_ehci *ehci);
  * This code is derived from EHCI FSL USB Linux driver for MPC5121
  *
  */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        volatile struct usb_ehci *ehci;
 
index dd11f535adc5937c3fdd6ea2da52cbf53dd24455..7566c61284eb2c29d2a0fc1cc423e4fd219570f1 100644 (file)
@@ -218,7 +218,8 @@ void __weak board_ehci_hcd_postinit(struct usb_ehci *ehci, int port)
 {
 }
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        struct usb_ehci *ehci;
 
index eb24af5974fc0e6b716a5e20723a2a7923f41644..4d7da52882c37e9f164e475d414dac640e721fd3 100644 (file)
@@ -155,7 +155,8 @@ int __weak board_ehci_hcd_init(int port)
        return 0;
 }
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        struct usb_ehci *ehci;
 
index a3048d105a55e9cdb07ab72c5662f9667044294a..f09c75a9b64d3f5750f4ae8b7f4d16e80a0bd8a8 100644 (file)
@@ -208,7 +208,8 @@ static int mxc_set_usbcontrol(int port, unsigned int flags)
        return 0;
 }
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        struct usb_ehci *ehci;
 #ifdef CONFIG_MX31
index 286a380de21134585e65004d8fce1ccb040a7d2a..4d652b32dbed2effd493e6d495f1fd8d9b3f276c 100644 (file)
@@ -77,7 +77,8 @@ static int ehci_mxs_toggle_clock(const struct ehci_mxs_port *port, int enable)
        return 0;
 }
 
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
 
        int ret;
index 90d7a6feb56c5a1b3dc648435e2e43c05ed5bca9..7a1ffe5e28bbc1fd6bf9dc806649e49a30d1ec2c 100644 (file)
@@ -69,8 +69,8 @@ static pci_dev_t ehci_find_class(int index)
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
  */
-int ehci_hcd_init(int index, struct ehci_hccr **ret_hccr,
-               struct ehci_hcor **ret_hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **ret_hccr, struct ehci_hcor **ret_hcor)
 {
        pci_dev_t pdev;
        uint32_t cmd;
index 462fcfbe4ffa7548a12c299f7324ced9b1e0f5f3..9aee3ff786cba830eda534cdec6933eaa71e31d2 100644 (file)
@@ -15,7 +15,8 @@
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
  */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        *hccr = (struct ehci_hccr *)(CONFIG_SYS_PPC4XX_USB_ADDR);
        *hcor = (struct ehci_hcor *)((uint32_t) *hccr +
index 6758316f7fb8da62036d5e44a9a67de98a69703b..210ee9e88e2c758d75458ea95c0dcdf1b03aed88 100644 (file)
@@ -20,7 +20,8 @@
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
  */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        *hccr = (struct ehci_hccr *)(CONFIG_SYS_UHC0_EHCI_BASE + 0x100);
        *hcor = (struct ehci_hcor *)((uint32_t)*hccr
index cc23133f8c4ee5bac8f309203f4593ce695d3322..0b42aa5b383ae7b6c7692a4edcaadc6adc4aa462 100644 (file)
@@ -734,7 +734,8 @@ int usb_process_devicetree(const void *blob)
  * @param hcor         returns start address of EHCI HCOR registers
  * @return 0 if ok, -1 on error (generally invalid port number)
  */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        struct fdt_usb *config;
        struct usb_ctlr *usbctlr;
index 4252c272cfb6ed5413d97c97c2d0f3e2dff1336b..512ad3fb78d36f2a6cd5cfc53a0fbcbafb78104a 100644 (file)
@@ -15,7 +15,8 @@ int vct_ehci_hcd_init(u32 *hccr, u32 *hcor);
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
  */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        int ret;
        u32 vct_hccr;
index 3e1c3123c962c5b043863683482d397b9a7d4adf..093eb4b83235629d27191ef982e7509c1a7496e2 100644 (file)
@@ -250,7 +250,8 @@ struct ehci_ctrl {
 };
 
 /* Low level init functions */
-int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor);
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor);
 int ehci_hcd_stop(int index);
 
 #endif /* USB_EHCI_H */