Wifi not getting up

We are working on a product based on the APQ8016E and linaro-18 subsystem. We signed binaries successfully and flashed below list


However,we are facing issues related to wifi module. Wifi is not working on signed binaries whereas it was working fine before signing.

Below are the logs:
root@linaro-alip:~# dmesg | grep -i wcnss
[ 10.661702] qcom-wcnss-pil a204000.wcnss: a204000.wcnss supply vddcx not found, using dummy regulator
[ 10.673169] remoteproc remoteproc0: a204000.wcnss is available
[ 10.674066] remoteproc remoteproc0: powering up a204000.wcnss
[ 10.674074] remoteproc remoteproc0: Booting fw image wcnss.mdt, size 7260
[ 10.713965] qcom-wcnss-pil a204000.wcnss: segment outside memory range

We tried to debugge issue from our end by putting debug statement:

— a/drivers/soc/qcom/mdt_loader.c
+++ b/drivers/soc/qcom/mdt_loader.c
@@ -168,6 +168,7 @@ int qcom_mdt_load(struct device *dev, const struct firmware *fw,
offset = phdr->p_paddr - mem_reloc;

  •           printk("%s p_paddr %x mem_reloc %x offset %x p_memsz %x mem_size %x\n", __func__, phdr->p_paddr, mem_reloc, offset, phdr->p_memsz, mem_size);
              if (offset < 0 || offset + phdr->p_memsz > mem_size) {
                      dev_err(dev, "segment outside memory range\n");
                      ret = -EINVAL;

We got these debug statements where as it is a failed case:
[ 10.638186] qcom_mdt_load p_paddr f500000 mem_reloc f500000 offset 0 p_memsz ee0f0 mem_size 600000
[ 10.646824] qcom_mdt_load p_paddr f5ef000 mem_reloc f500000 offset ef000 p_memsz 405000 mem_size 600000
[ 10.657681] qcom_mdt_load p_paddr f9ff000 mem_reloc f500000 offset 4ff000 p_memsz 20 mem_size 600000
[ 10.897127] qcom_mdt_load p_paddr 8b600000 mem_reloc 89300000 offset 2300000 p_memsz 3438 mem_size c00000

For debugging purpose when we also checked these logs on unsigned binaries, below are the logs for positive case:
root@linaro-alip:~# dmesg | grep -i offset
[ 10.827598] qcom_mdt_load p_paddr f500000 mem_reloc f500000 offset 0 p_memsz ee0f0 mem_size 600000
[ 10.838568] qcom_mdt_load p_paddr f5ef000 mem_reloc f500000 offset ef000 p_memsz 405000 mem_size 600000
[ 10.843325] qcom_mdt_load p_paddr f9ff000 mem_reloc f500000 offset 4ff000 p_memsz 20 mem_size 600000
[ 11.046518] qcom_mdt_load p_paddr 8b600000 mem_reloc 8b600000 offset 0 p_memsz 3438 mem_size c00000
[ 11.047279] qcom_mdt_load p_paddr 8b604000 mem_reloc 8b600000 offset 4000 p_memsz 8000 mem_size c00000
[ 11.058506] qcom_mdt_load p_paddr 8b60c000 mem_reloc 8b600000 offset c000 p_memsz f000 mem_size c00000
[ 11.065030] qcom_mdt_load p_paddr 8b61b000 mem_reloc 8b600000 offset 1b000 p_memsz e000 mem_size c00000
[ 11.073109] qcom_mdt_load p_paddr 8b629000 mem_reloc 8b600000 offset 29000 p_memsz 4c43b0 mem_size c00000
[ 11.111372] qcom_mdt_load p_paddr 8baed400 mem_reloc 8b600000 offset 4ed400 p_memsz 37cf8 mem_size c00000
[ 11.112415] qcom_mdt_load p_paddr 8baed400 mem_reloc 8b600000 offset 4ed400 p_memsz 21c44 mem_size c00000
[ 11.123402] qcom_mdt_load p_paddr 8bb30000 mem_reloc 8b600000 offset 530000 p_memsz 1b0 mem_size c00000
[ 11.125760] qcom_mdt_load p_paddr 8bb31000 mem_reloc 8b600000 offset 531000 p_memsz a0000 mem_size c00000
[ 11.137589] qcom_mdt_load p_paddr 8bbd1000 mem_reloc 8b600000 offset 5d1000 p_memsz edc0 mem_size c00000

Can anyone please help us to find the root cause of this issue.

Thank You,

can you attach the output of:

readelf -Whl /lib/firmware/qcom/msm8916/wcnss.mdt

Hi @Loic,
Thank You for reply.
Here is output for requested command.

root@linaro-alip:~# readelf -Whl /lib/firmware/wcnss.mdt
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2’s complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x8b6018d4
Start of program headers: 52 (bytes into file)
Start of section headers: 0 (bytes into file)
Flags: 0x5000002, Version5 EABI,
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 12
Size of section headers: 40 (bytes)
Number of section headers: 0
Section header string table index: 0

Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
NULL 0x000000 0x00000000 0x00000000 0x001b4 0x00000 0
NULL 0x001000 0x8bbe0000 0x8bbe0000 0x01aa8 0x02000 0x1000
LOAD 0x003000 0x8b600000 0x8b600000 0x03308 0x03438 RWE 0x8
LOAD 0x00afcc 0x8b604000 0x8b604000 0x00000 0x08000 RW 0x4000
LOAD 0x00afcc 0x8b60c000 0x8b60c000 0x0f000 0x0f000 RW 0x4
LOAD 0x019fcc 0x8b61b000 0x8b61b000 0x00000 0x0e000 RW 0x4
LOAD 0x019fcc 0x8b629000 0x8b629000 0x32f134 0x4c6df0 RWE 0x80
LOAD 0x349100 0x8baefe00 0x8baefe00 0x00000 0x37cf8 RW 0x8
LOAD 0x349100 0x8baefe00 0x8baefe00 0x00000 0x21c44 RW 0x4
LOAD 0x349100 0x8bb30000 0x8bb30000 0x00034 0x001b0 RW 0x8
LOAD 0x34afcc 0x8bb31000 0x8bb31000 0xa0000 0xa0000 RW 0x1000
LOAD 0x3eafcc 0x8bbd1000 0x8bbd1000 0x0ac0c 0x0edc0 RWE 0x1000

We store our binaries at /lib/firmware not at /lib/firmware/qcom/msm8916/ as we are using the linaro platform.

Thank You,

I think your firmware is no relocatable and expect a physical location (0x8b600000) outside of the wcnss reserved memory (0x89300000). So either regenerate a relocatable firmware or modify the wcnss reserved memory (in devicetree) to start at 0x8b600000.

We tried below patch:

--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -78,12 +78,12 @@
                 wcnss_mem: wcnss@89300000 {
-                       reg = <0x0 0x89300000 0x0 0x600000>;
+                       reg = <0x0 0x89300000 0x0 0xC00000>;
-               venus_mem: venus@89900000 {
-                       reg = <0x0 0x89900000 0x0 0x600000>;
+               venus_mem: venus@89f00000 {
+                       reg = <0x0 0x89f00000 0x0 0x600000>;

Should we change 89300000 to 0x8b600000?
And are there any specific steps to “regenerate a relocatable firmware”?

Hi @Loic

We also tried this solution :
wcnss_mem: wcnss@8b600000 {
reg = <0x0 0x8b600000 0x0 0x600000>;
venus_mem: venus@8bc00000 {
reg = <0x0 0x8bc00000 0x0 0x600000>;
But getting the same below error:
root@linaro-alip:~# dmesg | grep -i wcnss
[ 11.168394] qcom-wcnss-pil a204000.wcnss: no memory-region specified
[ 11.168423] remoteproc0: releasing a204000.wcnss
[ 11.183052] qcom-wcnss-pil: probe of a204000.wcnss failed with error -22

Can you please share how to relocate the firmware?

You dont’ need to change the venus node. ‘relocatable’ is a sectool parameter.