forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIPS: ath79: Add AR933x specific WMAC setup code
The wireless MAC of the AR933x SoCs uses different base address, and requires different setup code. Signed-off-by: Gabor Juhos <[email protected]> Cc: Imre Kaloz <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/3030/ Signed-off-by: Ralf Baechle <[email protected]>
- Loading branch information
1 parent
6903bb4
commit 34cfcd2
Showing
3 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]> | ||
* Copyright (C) 2008-2011 Gabor Juhos <[email protected]> | ||
* Copyright (C) 2008 Imre Kaloz <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
|
@@ -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(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]> | ||
* Copyright (C) 2008-2011 Gabor Juhos <[email protected]> | ||
* Copyright (C) 2008 Imre Kaloz <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters