Skip to content

Commit

Permalink
[ARM] Orion: add the option to support different ehci phy initialization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ronen Shitrit authored and Nicolas Pitre committed Dec 4, 2008
1 parent 061e41f commit fb6f552
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-kirkwood/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mv78xx0/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-orion5x/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/plat-orion/include/plat/ehci-orion.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@

#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;
};


Expand Down
17 changes: 14 additions & 3 deletions drivers/usb/host/ehci-orion.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fb6f552

Please sign in to comment.