ar71xx: use the RLE library for RB751

SVN-Revision: 33338
This commit is contained in:
Gabor Juhos 2012-09-08 17:51:56 +00:00
parent 73df240bb3
commit 88a5478781
4 changed files with 17 additions and 42 deletions

View file

@ -188,7 +188,7 @@ CONFIG_PCI_DOMAINS=y
CONFIG_PERF_USE_VMALLOC=y CONFIG_PERF_USE_VMALLOC=y
CONFIG_PHYLIB=y CONFIG_PHYLIB=y
# CONFIG_PREEMPT_RCU is not set # CONFIG_PREEMPT_RCU is not set
# CONFIG_RLE_DECOMPRESS is not set CONFIG_RLE_DECOMPRESS=y
CONFIG_RTL8306_PHY=y CONFIG_RTL8306_PHY=y
CONFIG_RTL8366RB_PHY=y CONFIG_RTL8366RB_PHY=y
CONFIG_RTL8366S_PHY=y CONFIG_RTL8366S_PHY=y

View file

@ -14,6 +14,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/ar8216_platform.h> #include <linux/ar8216_platform.h>
#include <linux/rle.h>
#include <asm/mach-ath79/ar71xx_regs.h> #include <asm/mach-ath79/ar71xx_regs.h>
#include <asm/mach-ath79/ath79.h> #include <asm/mach-ath79/ath79.h>
@ -276,45 +277,16 @@ static void __init rb750gr3_setup(void)
MIPS_MACHINE(ATH79_MACH_RB_750G_R3, "750Gr3", "MikroTik RouterBOARD 750GL", MIPS_MACHINE(ATH79_MACH_RB_750G_R3, "750Gr3", "MikroTik RouterBOARD 750GL",
rb750gr3_setup); rb750gr3_setup);
static int decode_rle(char *output, int len, char *in)
{
char *ptr = output;
char *end = output + len;
if (!output || !in)
return -EINVAL;
while (*in) {
if (*in < 0) {
int i = -*in++;
while (i-- > 0) {
if (ptr >= end)
return -EINVAL;
*ptr++ = *in++;
}
} else if (*in > 0) {
int i = *in++;
while (i-- > 0) {
if (ptr >= end)
return -EINVAL;
*ptr++ = *in;
}
in++;
}
}
return ptr - output;
}
#define RB751_HARDCONFIG 0x1f00b000 #define RB751_HARDCONFIG 0x1f00b000
#define RB751_MAC_ADDRESS_OFFSET 0xE80 #define RB751_MAC_ADDRESS_OFFSET 0xE80
#define RB751_CALDATA_OFFSET 0x27C #define RB751_CALDATA_OFFSET 0x27C
#define RB751_CALDATA_SIZE 0xc00
static void __init rb751_wlan_setup(void) static void __init rb751_wlan_setup(void)
{ {
u8 *hardconfig = (u8 *) KSEG1ADDR(RB751_HARDCONFIG); u8 *hardconfig = (u8 *) KSEG1ADDR(RB751_HARDCONFIG);
struct ath9k_platform_data *wmac_data; struct ath9k_platform_data *wmac_data;
int dec_size; int err;
wmac_data = ap9x_pci_get_wmac_data(0); wmac_data = ap9x_pci_get_wmac_data(0);
if (!wmac_data) { if (!wmac_data) {
@ -324,10 +296,12 @@ static void __init rb751_wlan_setup(void)
ap9x_pci_setup_wmac_led_pin(0, 9); ap9x_pci_setup_wmac_led_pin(0, 9);
dec_size = decode_rle((char *) wmac_data->eeprom_data, err = rle_decode(hardconfig + RB751_CALDATA_OFFSET,
RB751_CALDATA_SIZE,
(unsigned char *) wmac_data->eeprom_data,
sizeof(wmac_data->eeprom_data), sizeof(wmac_data->eeprom_data),
hardconfig + RB751_CALDATA_OFFSET); NULL, NULL);
if (dec_size != sizeof(wmac_data->eeprom_data)) { if (err) {
pr_err("rb75x: unable to decode wlan eeprom data\n"); pr_err("rb75x: unable to decode wlan eeprom data\n");
return; return;
} }

View file

@ -189,7 +189,7 @@
config ATH79_MACH_PB44 config ATH79_MACH_PB44
bool "Atheros PB44 reference board" bool "Atheros PB44 reference board"
select SOC_AR71XX select SOC_AR71XX
@@ -66,6 +137,427 @@ config ATH79_MACH_PB44 @@ -66,6 +137,428 @@ config ATH79_MACH_PB44
Say 'Y' here if you want your kernel to support the Say 'Y' here if you want your kernel to support the
Atheros PB44 reference board. Atheros PB44 reference board.
@ -379,6 +379,7 @@
+ select ATH79_DEV_ETH + select ATH79_DEV_ETH
+ select ATH79_DEV_AP9X_PCI if PCI + select ATH79_DEV_AP9X_PCI if PCI
+ select ATH79_DEV_USB + select ATH79_DEV_USB
+ select RLE_DECOMPRESS
+ +
+config ATH79_MACH_WNDR3700 +config ATH79_MACH_WNDR3700
+ bool "NETGEAR WNDR3700 board support" + bool "NETGEAR WNDR3700 board support"
@ -617,7 +618,7 @@
config ATH79_MACH_UBNT_XM config ATH79_MACH_UBNT_XM
bool "Ubiquiti Networks XM (rev 1.0) board" bool "Ubiquiti Networks XM (rev 1.0) board"
select SOC_AR724X select SOC_AR724X
@@ -79,6 +571,24 @@ config ATH79_MACH_UBNT_XM @@ -79,6 +572,24 @@ config ATH79_MACH_UBNT_XM
Say 'Y' here if you want your kernel to support the Say 'Y' here if you want your kernel to support the
Ubiquiti Networks XM (rev 1.0) board. Ubiquiti Networks XM (rev 1.0) board.
@ -642,7 +643,7 @@
endmenu endmenu
config SOC_AR71XX config SOC_AR71XX
@@ -114,10 +624,6 @@ config SOC_QCA955X @@ -114,10 +625,6 @@ config SOC_QCA955X
select PCI_AR724X if PCI select PCI_AR724X if PCI
def_bool n def_bool n
@ -653,7 +654,7 @@
config ATH79_DEV_AP9X_PCI config ATH79_DEV_AP9X_PCI
select ATH79_PCI_ATH9K_FIXUP select ATH79_PCI_ATH9K_FIXUP
def_bool n def_bool n
@@ -128,7 +634,14 @@ config ATH79_DEV_DSA @@ -128,7 +635,14 @@ config ATH79_DEV_DSA
config ATH79_DEV_ETH config ATH79_DEV_ETH
def_bool n def_bool n
@ -669,7 +670,7 @@
def_bool n def_bool n
config ATH79_DEV_GPIO_BUTTONS config ATH79_DEV_GPIO_BUTTONS
@@ -153,4 +666,7 @@ config ATH79_NVRAM @@ -153,4 +667,7 @@ config ATH79_NVRAM
config ATH79_PCI_ATH9K_FIXUP config ATH79_PCI_ATH9K_FIXUP
def_bool n def_bool n

View file

@ -1,6 +1,6 @@
--- a/arch/mips/ath79/Kconfig --- a/arch/mips/ath79/Kconfig
+++ b/arch/mips/ath79/Kconfig +++ b/arch/mips/ath79/Kconfig
@@ -549,6 +549,16 @@ config ATH79_MACH_TEW_673GRU @@ -550,6 +550,16 @@ config ATH79_MACH_TEW_673GRU
select ATH79_DEV_USB select ATH79_DEV_USB
select ATH79_NVRAM select ATH79_NVRAM