Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332240
b: refs/heads/master
c: 00ffed5
h: refs/heads/master
v: v3
  • Loading branch information
Gabor Juhos authored and John Crispin committed Aug 28, 2012
1 parent a956e57 commit a4b4244
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d3e03e186cb94a333d0176fe8b22a6df200fcc7
refs/heads/master: 00ffed582fe8a3f7556593c0e8baaf3da3df85b0
28 changes: 28 additions & 0 deletions trunk/arch/mips/ath79/dev-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,32 @@ static void __init ar933x_usb_setup(void)
platform_device_register(&ath79_ehci_device);
}

static void __init ar934x_usb_setup(void)
{
u32 bootstrap;

bootstrap = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP);
if (bootstrap & AR934X_BOOTSTRAP_USB_MODE_DEVICE)
return;

ath79_device_reset_set(AR934X_RESET_USBSUS_OVERRIDE);
udelay(1000);

ath79_device_reset_clear(AR934X_RESET_USB_PHY);
udelay(1000);

ath79_device_reset_clear(AR934X_RESET_USB_PHY_ANALOG);
udelay(1000);

ath79_device_reset_clear(AR934X_RESET_USB_HOST);
udelay(1000);

ath79_usb_init_resource(ath79_ehci_resources, AR934X_EHCI_BASE,
AR934X_EHCI_SIZE, ATH79_CPU_IRQ_USB);
ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v2;
platform_device_register(&ath79_ehci_device);
}

void __init ath79_register_usb(void)
{
if (soc_is_ar71xx())
Expand All @@ -205,6 +231,8 @@ void __init ath79_register_usb(void)
ar913x_usb_setup();
else if (soc_is_ar933x())
ar933x_usb_setup();
else if (soc_is_ar934x())
ar934x_usb_setup();
else
BUG();
}
7 changes: 7 additions & 0 deletions trunk/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@

#define AR934X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000)
#define AR934X_WMAC_SIZE 0x20000
#define AR934X_EHCI_BASE 0x1b000000
#define AR934X_EHCI_SIZE 0x200

/*
* DDR_CTRL block
Expand Down Expand Up @@ -288,6 +290,11 @@
#define AR933X_RESET_USB_PHY BIT(4)
#define AR933X_RESET_USBSUS_OVERRIDE BIT(3)

#define AR934X_RESET_USB_PHY_ANALOG BIT(11)
#define AR934X_RESET_USB_HOST BIT(5)
#define AR934X_RESET_USB_PHY BIT(4)
#define AR934X_RESET_USBSUS_OVERRIDE BIT(3)

#define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0)

#define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23)
Expand Down

0 comments on commit a4b4244

Please sign in to comment.