Marvell SDIO wireless interface

Hi ,

I have a Marvell wi-Fi chip and trying to interface on to the SD slot but am not able to detect the device. I have built the kernel modules for the corresponding chip. I am using L4T R21.1. Are there any additional settings to be done ?

Any help would be really thankful.

I will add this feature to incoming grinch kernel. This will probably be tomorrow :)

Hi ,

Can you tell me whether any GPIO changes are required for the SDIO interrupt configuration?

Hi,

I am able to detect atheros SDIO modules but marvell throws error saying “Tap hole coeffs data missing”
and “Failed to get tuning constraints”. I see that some commands are exchanged and then fails . Attaching the logs for reference.

AW_wifi_logs.txt (29.4 KB)

Hi saiprasad3103

The sdmmc frequency tuning algorithm used on TK1 requires certain coefficients data to determine the right tap delay value. These coefficients are defined for certain frequencies. For SD slot(sdmmc3), the driver has the coefficients data defined for 204MHz, 200MHz, 136MHz, 100MHz and 81.6MHz. From the logs, the Marvel wifi chip frequency is set to 50MHz even though 208MHz is requested from sdio driver. Tuning algorithm doesn’t find any coeffs for 50MHz and fails resulting in enumeration failure.

Was there any platform clock limits are set which are resulting in 50MHz clock frequency to set even though 208MHz is requested from sdio driver?

Fixing the clock issue should automatically fix the tuning issue.

Thanks for the information youngk.

In my case Max clock limit was set to 50Mhz. I changed to 100Mhz now it is detecting as SDIO card. But the problem is it loads the marvell firmware and fails to initialize. It fails reading the data from Marvell chip. What could be the problem?

Hi saiprasad3103,

Can you provide more logs regarding “fail to initialize”?

Hi youngk,
I am using TK1 to bring up broadcom wlan device but failed.
The EVB can be identified by mmc host as high speed SDIO card at mmc1.
But when I try to enable EVB it always failed due to Data “CRC error, intmask: 200000”.
Even I force mmc speed to be 5M.

log.txt (13.6 KB)

Hi BillTsai,

Please provide the logs from boot at 0sec. The log you have shared does not tells which sdhci controller you are using for your development and what is the state of boot time tuning.

Hi BillTsai,

I do not see anything obvious to cause the Data CRC error from the log.txt.

Is it Jetson board? (SDMMC1 is not available on Jetson board.)
If custom designed board, did you follow the Table 96 of http://developer.download.nvidia.com/embedded/jetson/TK1/docs/3_HWDesignDev/TegraK1_Embedded_DG_v03.pdf?
ex) Max trace delay, Trace impedance, Max Trace delay skew in/between CLK & CMD/DAT

Hi BillTsai,

What is Broadcom WiFi chip number or share a link please if it is Broadcom WiFi SDIO module for Jetson SD slot?

Hi youngk,

I think I used sdmmc3 of jetsonTk1 to test Broadcom chip (43362).
attached console log file is created during my operation procedures:

  1. open console
  2. ssh to JetsonTK1
  3. insmod bcmdhd.ko
  4. ifconfig wlan0 up.
    then system crash.
    From the log file driver is inserted without problem.But When I use “ifconfig wlan0 up” to bring up wlan0 system crash with crc error as log file recorded.

Can SDMMC3 be used for SDIO?

log08213035.txt (67.8 KB)

Hi BillTsai,

SDMMC3 can be used for SDIO.

Is this some Wifi chip with SD card interface? If so can you share the part details?

Did you try changing platform data (pdata in board file) for sdhci.2 corresponding to SDcard to something similar to sdhci.0 corresponding to wifi?

Hi b2,

The wifi chip is SDIO interface.
I am not familiar with JetsonTk1, how can I check the platform data?

Hi BillSai,

I am sorry. I think my last question to you was not clear.

My understanding is you are using SDMMC3 to connect the Wifi chip. SDMMC3 is meant for SD card use.
My last question was how are you connecting the Wifi chip to SD card slot?
Have you done some hardware rework to connect the Wifi/SDIO chip to SDMMC3?
If rework is done can you share the rework details?

With below changes in arch/arm/mach-tegra/board-ardbeg-sdhci.c , the Wifi platform data
should get used for SDMMC3.

-regards,
b2

==

static struct tegra_sdhci_platform_data tegra_sdhci_platform_data0 = {
178 .mmc_data = {
179 .register_status_notify = ardbeg_wifi_status_register,
180#ifdef CONFIG_MMC_EMBEDDED_SDIO
181 .embedded_sdio = &embedded_sdio_data0,
182#endif
183 .built_in = 0,
184 .ocr_mask = MMC_OCR_1V8_MASK,
185 },
186 .cd_gpio = -1,
187 .wp_gpio = -1,
188 .power_gpio = -1,
189 .tap_delay = 0,
190 .trim_delay = 0x3, /* changed from 2 used for Wifi on SDMMC0 */
191 .ddr_clk_limit = 41000000,
192 .uhs_mask = MMC_UHS_MASK_DDR50,
193 .calib_3v3_offsets = 0x7676,
194 .calib_1v8_offsets = 0x7676,
195 .max_clk_limit = 136000000,
196};
197
1

static struct platform_device tegra_sdhci_device2 = {
240 .name = “sdhci-tegra”,
241 .id = 2,
242 .resource = sdhci_resource2,
243 .num_resources = ARRAY_SIZE(sdhci_resource2),
244 .dev = {
245 .dma_mask = &tegra_sdhci_dmamask,
246 .coherent_dma_mask = DMA_BIT_MASK(64),
247 .platform_data = &tegra_sdhci_platform_data0, /* changed from SDcard platform data2 to data0 for Wifi */
248 },
249};

Hi b2,

I used the following patch on R21.3 to enable SD slot support SDIO WIFI device:

diff --git a/arch/arm/mach-tegra/board-ardbeg-sdhci.c b/arch/arm/mach-tegra/board-ardbeg-sdhci.c
index 265fddc..4f218c8 100644
--- a/arch/arm/mach-tegra/board-ardbeg-sdhci.c
+++ b/arch/arm/mach-tegra/board-ardbeg-sdhci.c
@@ -468,9 +468,14 @@ int __init ardbeg_sdhci_init(void)
                tegra_sdhci_platform_data3.boot_vcore_mv = boot_vcore_mv;
        }

        if (of_machine_is_compatible("nvidia,laguna") ||
            of_machine_is_compatible("nvidia,jetson-tk1"))
                tegra_sdhci_platform_data2.wp_gpio = ARDBEG_SD_WP;

        tegra_get_board_info(&board_info);
        if (board_info.board_id == BOARD_E1780)
@@ -532,7 +537,16 @@ int __init ardbeg_sdhci_init(void)
        }

        platform_device_register(&tegra_sdhci_device3);

+       if (board_info.board_id == BOARD_PM375) {
+               tegra_sdhci_platform_data2.disable_clock_gate = 1;
+               platform_device_register(&tegra_sdhci_device2);
+               ardbeg_wifi_init();
+       } else {
+               platform_device_register(&tegra_sdhci_device2);
+       }

        if (board_info.board_id != BOARD_PM359 &&
                        board_info.board_id != BOARD_PM375) {
                platform_device_register(&tegra_sdhci_device0);

After the above patch, TK1 could detect WIFI SDIO device status on SD slot.

Jun 25 18:53:23 tegra-ubuntu kernel: [13765.810901] mmc1: card 0001 removed
Jun 25 18:53:30 tegra-ubuntu kernel: [13772.707831] mmc1: new high speed SDIO card at address 0001

The mmc1 information:

root@tegra-ubuntu:~# cat /sys/kernel/debug/mmc1/ios 
clock:		50000000 Hz
actual clock:	50000000 Hz
vdd:		18 (3.0 ~ 3.1 V)
bus mode:	2 (push-pull)
chip select:	0 (don't care)
power mode:	2 (on)
bus width:	2 (4 bits)
timing spec:	2 (sd high-speed)
signal voltage:	0 (3.30 V)

Verification Process:

  1. insert SDIO wifi into sd slot.
  2. insmod driver
  3. ifocnfig wlanX up
  4. use wpa_cli to do scan process and get scan results.

Best Regards,
shonmou

Hi,shonmou

I no use TK1 here,but I try to find a solution to get my SDIO wifi module detected.

I used Marvel SD8782 module (88W8782-NAP2).

Is it compatible with 8787 driver and firmware(sd8787_uapsta.bin)?

Because I don’t find any driver and firmware named “sd8782”.

If answer is “yes”…

I tried to add the “mvsdio” drivers as a part of kernel, “mwifiex” and “mwifiex_sdio” drivers as modules

I compiled it with the Kernel 3.14.43, and board is compatible with BBB

I used this configurations(mmc3 channel) for the EVB335X DTS:

wlan_fixed: fixedregulator@0 {
compatible = “regulator-fixed”;
regulator-name = “wlan_fixed”;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};

    mmc3_pins: pinmux_mmc3_pins {
    pinctrl-single,pins = <
        0x30 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad12.mmc2_dat0 */
        0x34 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad13.mmc2_dat1 */
        0x38 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad14.mmc2_dat2 */
        0x3c (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad15.mmc2_dat3 */
        0x88 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_csn3.mmc2_cmd */
        0x8C (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_clk.mmc2_clk */
        0x78 (PIN_INPUT_PULLUP | MUX_MODE7) /* mcasp0_aclkr.gpio1_28 */
    >;
};

&mmc3 {
status = “okay”;
vmmc-supply = <&wlan_fixed>;
bus-width = <0x4>;
pinctrl-names = “default”;
pinctrl-0 = <&mmc3_pins>;
dmas = <&edma 12>,<&edma 13>;
dma-names = “tx”, “rx”;
ti,non-removable;
enable-sdio-wakeup;
};

When I upload to the board, reboot the system

modprobe mwifiex_sdio

Nothing happened, and no error message and driver start message.

I can find “mvsdio” at /sys/bus/platform/drivers,and “mwifiex”,“mwifiex_sdio” at /sys/modules

dmesg | grep mmc2

mmc2: mmc_rescan_try_freq: trying to init card at 400000 Hz

mmc2: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0

mmc2: clock 50000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 2

mmc2: new high speed SDIO card at address 0001

Any suggestion will be appreciated.