]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] Orion: add the option to support different ehci phy initialization
authorRonen Shitrit <rshitrit@marvell.com>
Wed, 17 Sep 2008 07:08:05 +0000 (10:08 +0300)
committerNicolas Pitre <nico@cam.org>
Thu, 4 Dec 2008 06:28:14 +0000 (01:28 -0500)
The Orion ehci driver serves the Orion, kirkwood and DD Soc families.
Since each of those integrate a different USB phy we should have the
ability to use few initialization sequences or to leave the boot loader
phy settings as is.

Signed-off-by: Ronen Shitrit <rshitrit@marvell.com>
arch/arm/mach-kirkwood/common.c
arch/arm/mach-mv78xx0/common.c
arch/arm/mach-orion5x/common.c
arch/arm/plat-orion/include/plat/ehci-orion.h
drivers/usb/host/ehci-orion.c

index 0bb1fbd84ccb9f561cbb6cb6ebc14cdc485f6784..b5c684d96e4e10501878af757ba153bccb4b9f75 100644 (file)
@@ -57,6 +57,7 @@ void __init kirkwood_map_io(void)
  ****************************************************************************/
 static struct orion_ehci_data kirkwood_ehci_data = {
        .dram           = &kirkwood_mbus_dram_info,
+       .phy_version    = EHCI_PHY_NA,
 };
 
 static u64 ehci_dmamask = 0xffffffffUL;
index 238a2f8c2d525b1f65b0579f86c9b0fc6e9761cb..b0e4e0d8f506af23f6abd53f2a6ab47d07e19daf 100644 (file)
@@ -167,6 +167,7 @@ void __init mv78xx0_map_io(void)
  ****************************************************************************/
 static struct orion_ehci_data mv78xx0_ehci_data = {
        .dram           = &mv78xx0_mbus_dram_info,
+       .phy_version    = EHCI_PHY_NA,
 };
 
 static u64 ehci_dmamask = 0xffffffffUL;
index 437065c25c9cdf4c6a902576c32ae15d3d3bdc20..0a623379789f03c4603cc43f33ebabcb2a8759b4 100644 (file)
@@ -72,6 +72,7 @@ void __init orion5x_map_io(void)
  ****************************************************************************/
 static struct orion_ehci_data orion5x_ehci_data = {
        .dram           = &orion5x_mbus_dram_info,
+       .phy_version    = EHCI_PHY_ORION,
 };
 
 static u64 ehci_dmamask = 0xffffffffUL;
index 64343051095ae03f729e30392ad156dc5b44348c..4ec668e774601920f8a6a4371391dd02fb02e781 100644 (file)
 
 #include <linux/mbus.h>
 
+enum orion_ehci_phy_ver {
+       EHCI_PHY_ORION,
+       EHCI_PHY_DD,
+       EHCI_PHY_KW,
+       EHCI_PHY_NA,
+};
+
 struct orion_ehci_data {
        struct mbus_dram_target_info    *dram;
+       enum orion_ehci_phy_ver phy_version;
 };
 
 
index 5416cf9690056a3f72c526255914fe992f00c0f0..9d487908012e56fb515d82576ccdbd5db71fa480 100644 (file)
@@ -33,8 +33,9 @@
 /*
  * Implement Orion USB controller specification guidelines
  */
-static void orion_usb_setup(struct usb_hcd *hcd)
+static void orion_usb_phy_v1_setup(struct usb_hcd *hcd)
 {
+       /* The below GLs are according to the Orion Errata document */
        /*
         * Clear interrupt cause and mask
         */
@@ -258,9 +259,19 @@ static int __init ehci_orion_drv_probe(struct platform_device *pdev)
                ehci_orion_conf_mbus_windows(hcd, pd->dram);
 
        /*
-        * setup Orion USB controller
+        * setup Orion USB controller.
         */
-       orion_usb_setup(hcd);
+       switch (pd->phy_version) {
+       case EHCI_PHY_NA:       /* dont change USB phy settings */
+               break;
+       case EHCI_PHY_ORION:
+               orion_usb_phy_v1_setup(hcd);
+               break;
+       case EHCI_PHY_DD:
+       case EHCI_PHY_KW:
+       default:
+               printk(KERN_WARNING "Orion ehci -USB phy version isn't supported.\n");
+       }
 
        err = usb_add_hcd(hcd, irq, IRQF_SHARED | IRQF_DISABLED);
        if (err)