From 3bcfb01a01faf8ecc3d1d1ca19eee98c33d39a25 Mon Sep 17 00:00:00 2001 From: Nitin Bindal Date: Thu, 26 Apr 2012 15:18:59 +0530 Subject: arch: arm: tegra: Add support for marvell 8797 If bootloader specify that marvell wifi chip is present on the board, then create marvell wifi device, else create broadcom wifi device. Bug 954218 Change-Id: Ia0515e70b6d4b239a165b8d8629e3b90c19666b6 Signed-off-by: Nitin Bindal Reviewed-on: http://git-master/r/98490 Reviewed-by: Simone Willett Tested-by: Simone Willett --- arch/arm/mach-tegra/board-cardhu-sdhci.c | 18 ++++++++++++++++-- arch/arm/mach-tegra/board.h | 9 +++++++++ arch/arm/mach-tegra/common.c | 17 +++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-tegra/board-cardhu-sdhci.c b/arch/arm/mach-tegra/board-cardhu-sdhci.c index 35541e4d27ae..73bd1f2c308a 100644 --- a/arch/arm/mach-tegra/board-cardhu-sdhci.c +++ b/arch/arm/mach-tegra/board-cardhu-sdhci.c @@ -63,7 +63,7 @@ static struct resource wifi_resource[] = { }, }; -static struct platform_device cardhu_wifi_device = { +static struct platform_device broadcom_wifi_device = { .name = "bcm4329_wlan", .id = 1, .num_resources = 1, @@ -73,6 +73,15 @@ static struct platform_device cardhu_wifi_device = { }, }; +static struct platform_device marvell_wifi_device = { + .name = "mrvl8797_wlan", + .id = 1, + .num_resources = 0, + .dev = { + .platform_data = &cardhu_wifi_control, + }, +}; + static struct resource sdhci_resource0[] = { [0] = { .start = INT_SDMMC1, @@ -257,6 +266,7 @@ static int cardhu_wifi_reset(int on) static int __init cardhu_wifi_init(void) { int rc; + int commchip_id = tegra_get_commchip_id(); rc = gpio_request(CARDHU_WLAN_PWR, "wlan_power"); if (rc) @@ -282,7 +292,11 @@ static int __init cardhu_wifi_init(void) if (rc) pr_err("WLAN_WOW gpio direction configuration failed:%d\n", rc); - platform_device_register(&cardhu_wifi_device); + if (commchip_id == COMMCHIP_MARVELL_SD8797) + platform_device_register(&marvell_wifi_device); + else + platform_device_register(&broadcom_wifi_device); + return 0; } diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index 0c1355550ed1..c7ab065bc195 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h @@ -68,6 +68,14 @@ } #endif +/* This information is passed by bootloader */ +#define COMMCHIP_UNKNOWN 0 +#define COMMCHIP_NOCHIP 1 +#define COMMCHIP_BROADCOM_BCM4329 2 +#define COMMCHIP BROADCOM_BCM4330 3 +#define COMMCHIP_MARVELL_SD8797 4 + + struct memory_accessor; void tegra_assert_system_reset(char mode, const char *cmd); @@ -162,6 +170,7 @@ void cpufreq_set_conservative_governor_param(char *name, int value); int get_core_edp(void); enum panel_type get_panel_type(void); int tegra_get_modem_id(void); +int tegra_get_commchip_id(void); enum power_supply_type get_power_supply_type(void); enum audio_codec_type get_audio_codec_type(void); int get_maximum_cpu_current_supported(void); diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 98fb3dcfa95f..f0c0cb69896f 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -141,6 +141,7 @@ void tegra_assert_system_reset(char mode, const char *cmd) #endif } static int modem_id; +static int commchip_id; static int sku_override; static int debug_uart_port_id; static enum audio_codec_type audio_codec_name; @@ -710,6 +711,22 @@ int tegra_get_modem_id(void) __setup("modem_id=", tegra_modem_id); +static int __init tegra_commchip_id(char *id) +{ + char *p = id; + + if (get_option(&p, &commchip_id) != 1) + return 0; + return 1; +} + +int tegra_get_commchip_id(void) +{ + return commchip_id; +} + +__setup("commchip_id=", tegra_commchip_id); + /* * Tegra has a protected aperture that prevents access by most non-CPU * memory masters to addresses above the aperture value. Enabling it -- cgit v1.2.3