Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284732
b: refs/heads/master
c: 34cfcd2
h: refs/heads/master
v: v3
  • Loading branch information
Gabor Juhos authored and Ralf Baechle committed Dec 7, 2011
1 parent ff88481 commit 1f48edc
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6903bb49da18e0bf3e2909e6b1342ee9a26b78ff
refs/heads/master: 34cfcd26bd34884e9bcbbfae4f87b36e42931c30
43 changes: 41 additions & 2 deletions trunk/arch/mips/ath79/dev-ar913x-wmac.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Atheros AR913X SoC built-in WMAC device support
* Atheros AR913X/AR933X SoC built-in WMAC device support
*
* Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
*
* This program is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -55,10 +55,49 @@ static void __init ar913x_wmac_setup(void)
ath79_wmac_resources[0].end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1;
}


static int ar933x_wmac_reset(void)
{
ath79_device_reset_clear(AR933X_RESET_WMAC);
ath79_device_reset_set(AR933X_RESET_WMAC);

return 0;
}

static int ar933x_r1_get_wmac_revision(void)
{
return ath79_soc_rev;
}

static void __init ar933x_wmac_setup(void)
{
u32 t;

ar933x_wmac_reset();

ath79_wmac_device.name = "ar933x_wmac";

ath79_wmac_resources[0].start = AR933X_WMAC_BASE;
ath79_wmac_resources[0].end = AR933X_WMAC_BASE + AR933X_WMAC_SIZE - 1;

t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
if (t & AR933X_BOOTSTRAP_REF_CLK_40)
ath79_wmac_data.is_clk_25mhz = false;
else
ath79_wmac_data.is_clk_25mhz = true;

if (ath79_soc_rev == 1)
ath79_wmac_data.get_mac_revision = ar933x_r1_get_wmac_revision;

ath79_wmac_data.external_reset = ar933x_wmac_reset;
}

void __init ath79_register_wmac(u8 *cal_data)
{
if (soc_is_ar913x())
ar913x_wmac_setup();
if (soc_is_ar933x())
ar933x_wmac_setup();
else
BUG();

Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/mips/ath79/dev-ar913x-wmac.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Atheros AR913X SoC built-in WMAC device support
* Atheros AR913X/AR933X SoC built-in WMAC device support
*
* Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
*
* This program is free software; you can redistribute it and/or modify it
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@

#define AR933X_UART_BASE (AR71XX_APB_BASE + 0x00020000)
#define AR933X_UART_SIZE 0x14

#define AR933X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000)
#define AR933X_WMAC_SIZE 0x20000
#define AR933X_EHCI_BASE 0x1b000000
#define AR933X_EHCI_SIZE 0x1000

Expand Down Expand Up @@ -233,6 +234,7 @@
#define AR913X_RESET_USB_HOST BIT(5)
#define AR913X_RESET_USB_PHY BIT(4)

#define AR933X_RESET_WMAC BIT(11)
#define AR933X_RESET_USB_HOST BIT(5)
#define AR933X_RESET_USB_PHY BIT(4)
#define AR933X_RESET_USBSUS_OVERRIDE BIT(3)
Expand Down

0 comments on commit 1f48edc

Please sign in to comment.