From 980f518539c14fff42c646d597334a0b722dfa53 Mon Sep 17 00:00:00 2001 From: gwl Date: Mon, 18 Mar 2013 11:57:12 +0800 Subject: [PATCH] add broadcom AP series wifi --- arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c | 6 ++-- .../board-rk3188-ds1006h-sdmmc-config.c | 2 +- drivers/net/wireless/Kconfig | 30 ++++++++++++++----- drivers/net/wireless/rkwifi/rk_wifi_config.c | 29 ++++++++++++++++++ .../net/wireless/wifi_sys/rkwifi_sys_iface.c | 25 ++++++++++++++++ 5 files changed, 81 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c b/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c index 1e39f38e2362..1d1b3146ffcc 100755 --- a/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c +++ b/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c @@ -138,7 +138,7 @@ #define RK30SDK_WIFI_GPIO_POWER_PIN_NAME "wifi_power" #define RK30SDK_WIFI_GPIO_POWER_IOMUX_FGPIO GPIO3_D0 - #elif defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) || defined(CONFIG_RK903) || defined(CONFIG_RK901) + #elif defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) || defined(CONFIG_RKWIFI) #define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PD0 #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_HIGH #define RK30SDK_WIFI_GPIO_POWER_PIN_NAME "wifi_power" @@ -178,7 +178,7 @@ #elif defined(CONFIG_ARCH_RK2928) //refer to file ./arch/arm/mach-rk2928/include/mach/iomux.h #define WIFI_HOST_WAKE RK2928_PIN3_PC0 - #if defined(CONFIG_RK903) || defined(CONFIG_RK901) || defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) + #if defined(CONFIG_RKWIFI) || defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) #define RK30SDK_WIFI_GPIO_POWER_N RK2928_PIN0_PD6 #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_HIGH #define RK30SDK_WIFI_GPIO_POWER_PIN_NAME GPIO0D6_MMC1_PWREN_NAME @@ -214,7 +214,7 @@ // refer to file /arch/arm/mach-rk30/include/mach/Iomux.h #define WIFI_HOST_WAKE RK30_PIN3_PD2 - #if defined(CONFIG_RK903) || defined(CONFIG_RK901) || defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU) + #if defined(CONFIG_RKWIFI) || defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU) //power #define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PD0 #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_HIGH diff --git a/arch/arm/mach-rk3188/board-rk3188-ds1006h-sdmmc-config.c b/arch/arm/mach-rk3188/board-rk3188-ds1006h-sdmmc-config.c index 827fa7f95cd8..70c02e65bbcb 100644 --- a/arch/arm/mach-rk3188/board-rk3188-ds1006h-sdmmc-config.c +++ b/arch/arm/mach-rk3188/board-rk3188-ds1006h-sdmmc-config.c @@ -74,7 +74,7 @@ int rk31sdk_get_sdmmc0_pin_io_voltage(void) #define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PD0 #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_LOW//GPIO_HIGH -#elif defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) || defined(CONFIG_RK903) || defined(CONFIG_RK901) +#elif defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) || defined(CONFIG_RKWIFI) #define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PD0 #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_HIGH diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 607f78b9eefa..8300172767f9 100755 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig @@ -100,10 +100,6 @@ choice prompt "Select the wifi module" default RK903 -# config BCM4329 -# bool "BCM4329" -# depends on RKWIFI && WLAN_80211 - config BCM4330 bool "BCM4330" depends on RKWIFI && WLAN_80211 @@ -115,21 +111,41 @@ choice config RK901 bool "RK901" depends on RKWIFI && WLAN_80211 + + config AP6181 + bool "AP6181" + depends on RKWIFI && WLAN_80211 + + config AP6210 + bool "AP6210" + depends on RKWIFI && WLAN_80211 + + config AP6330 + bool "AP6330" + depends on RKWIFI && WLAN_80211 + + config AP6476 + bool "AP6476" + depends on RKWIFI && WLAN_80211 + + config AP6494 + bool "AP6493" + depends on RKWIFI && WLAN_80211 endchoice choice - depends on RKWIFI && WLAN_80211 + depends on RKWIFI && WLAN_80211 && RK903 prompt "Select the wifi module crystal freq" default RKWIFI_37_4M config RKWIFI_37_4M bool "37_4M" - depends on RKWIFI && WLAN_80211 + depends on RKWIFI && WLAN_80211 && RK903 config RKWIFI_26M bool "26M" - depends on RKWIFI && WLAN_80211 + depends on RKWIFI && WLAN_80211 && RK903 endchoice diff --git a/drivers/net/wireless/rkwifi/rk_wifi_config.c b/drivers/net/wireless/rkwifi/rk_wifi_config.c index d052e4145594..82a0192c0676 100644 --- a/drivers/net/wireless/rkwifi/rk_wifi_config.c +++ b/drivers/net/wireless/rkwifi/rk_wifi_config.c @@ -51,6 +51,35 @@ int rkwifi_set_firmware(char *fw, char *nvram) sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_4330.txt"); #endif +#ifdef CONFIG_AP6181 + sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin"); + sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6181.txt"); +#endif + +#ifdef CONFIG_AP6210 + sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin"); + sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6210.txt"); +#endif + +#ifdef CONFIG_AP6476 + sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin"); + sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6476.txt"); +#endif + +#ifdef CONFIG_AP6493 + sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903.bin"); + sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6493.txt"); +#endif + +#ifdef CONFIG_AP6330 + sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903_ag.bin"); + sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6330.txt"); +#endif + +#ifdef CONFIG_GB86302I + sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903_ag.bin"); + sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_GB86302I.txt"); +#endif return 0; } diff --git a/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c b/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c index 498406ac1c9e..7cbf9baf922f 100755 --- a/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c +++ b/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c @@ -45,6 +45,31 @@ static ssize_t wifi_chip_read(struct class *cls, char *_buf) printk("Current WiFi chip is RK903.\n"); #endif +#ifdef CONFIG_AP6181 + count = sprintf(_buf, "%s", "RK901"); + printk("Current WiFi chip is AP6181.\n"); +#endif + +#ifdef CONFIG_AP6210 + count = sprintf(_buf, "%s", "RK901"); + printk("Current WiFi chip is AP6210.\n"); +#endif + +#ifdef CONFIG_AP6330 + count = sprintf(_buf, "%s", "RK903"); + printk("Current WiFi chip is AP6330.\n"); +#endif + +#ifdef CONFIG_AP6476 + count = sprintf(_buf, "%s", "RK901"); + printk("Current WiFi chip is AP6476.\n"); +#endif + +#ifdef CONFIG_AP6493 + count = sprintf(_buf, "%s", "RK903"); + printk("Current WiFi chip is AP6493.\n"); +#endif + #ifdef CONFIG_MTK_COMBO count = sprintf(_buf, "%s", "MT6620"); printk("Current WiFi chip is MT6620.\n"); -- 2.34.1