Broadcom WiFi module bringup

Hello! I’m trying to bring up Ampak AP6256 chip, which uses BCM43456 chip for WiFi but I’m having weird problems with the driver. I have connected everything and the pins have voltages as they should but none of the Broadcom drivers (brcmfc or bcmdhd) work for me.

This is how I set up SDMMC device tree:

        wifi_pwrseq: wifi-pwrseq {
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(C, 1) GPIO_ACTIVE_LOW>;
		post-power-on-delay-ms = <300>;
		power-off-delay-us = <300>;
	};

...

&sdmmc3 {
	#address-cells = <1>;
	#size-cells = <0>;
	mmc-pwrseq = <&wifi_pwrseq>;
	uhs-mask = <0x8>;
	only-1-8-v;
	non-removable;
	force-non-removable-rescan;
	no-sd;
	max-clk-limit = <25000000>;
	status = "okay";
};

Here’s bcmdhd log and device tree - it fails on power up but it clearly does pull the wlan-pwr-gpio pin correctly, when checked with multimeter:

bcmdhd_wlan {
		compatible = "android,bcmdhd_wlan";
		interrupt-parent = <&tegra_main_gpio>;
		interrupts = <TEGRA_MAIN_GPIO(L, 0) IRQ_TYPE_LEVEL_HIGH>;
		wlan-pwr-gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(C, 1) 0>;
		fw_path = "/lib/firmware/brcm/fw_bcmdhd.bin";
		nv_path = "/lib/firmware/brcm/nvram.txt";
		sdhci-host = <&sdmmc3>;
		pwr-retry-cnt = <3>;
		status = "okay";
	};
[   99.857230] dhd_module_init in
[   99.857299] found wifi platform device bcmdhd_wlan
[   99.858171] Failed to request wlan_pwr gpio 337
[   99.858204] wifi_platform_get_country_code_map: could not get country_code_map
[   99.858207] wifi_plat_dev_drv_probe:platform country code map is not available
[   99.858223] Power-up adapter 'DHD generic adapter'
[   99.858229] wifi_platform_set_power = 1
[  100.062596] wifi_platform_bus_enumerate device present 1
[  102.066489] failed to power up DHD generic adapter, 3 retry left
[  102.082746] wifi_platform_set_power = 0
[  102.290528] wifi_platform_bus_enumerate device present 0
[  102.290561] wifi_platform_set_power = 1
[  102.498524] wifi_platform_bus_enumerate device present 1
[  102.501092] mmc1: card 0001 removed
[  102.501197] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 230
[  102.967383] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 230
[  102.977659] mmc1: new ultra high speed SDR104 SDIO card at address 0001
[  104.530508] failed to power up DHD generic adapter, 2 retry left
[  104.546698] wifi_platform_set_power = 0
[  104.754514] wifi_platform_bus_enumerate device present 0
[  104.754540] wifi_platform_set_power = 1
[  104.962573] wifi_platform_bus_enumerate device present 1
[  104.965360] mmc1: card 0001 removed
[  104.965446] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 230
[  105.432519] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 230
[  105.443410] mmc1: new ultra high speed SDR104 SDIO card at address 0001
[  106.994536] failed to power up DHD generic adapter, 1 retry left
[  107.010797] wifi_platform_set_power = 0
[  107.218553] wifi_platform_bus_enumerate device present 0
[  107.218587] wifi_platform_set_power = 1
[  107.426604] wifi_platform_bus_enumerate device present 1
[  107.428595] mmc1: card 0001 removed
[  107.428671] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 230
[  107.894563] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 230
[  107.905434] mmc1: new ultra high speed SDR104 SDIO card at address 0001
[  107.905881] Exceeded the total number of cards allowed
[  107.911106] mmcblk: probe of mmc1:0001 failed with error -22

As for brcmfmac driver - it can’t even get the platform data:

[  227.163203] brcmfmac: brcmfmac_module_init No platform data available.

brcmfmac dtsi:

&sdmmc3 {
	#address-cells = <1>;
	#size-cells = <0>;
	mmc-pwrseq = <&wifi_pwrseq>;
	uhs-mask = <0x8>;
	only-1-8-v;
	non-removable;
	force-non-removable-rescan;
	no-sd;
	max-clk-limit = <25000000>;
	status = "okay";

    brcmfmac: brcmfmac@1 {
			reg = <1>;
			compatible = "brcm,bcm4329-fmac";
	};
};

Thanks in advance!

Sorry for the late response, is this still an issue to support?

Thanks

Hello!

I solved this already :)