HowTo create ipq40xx BDF files

Hi everyone,
I'm currently porting OpenWrt to a Linksys MR6350 and now I'm struggling with creating the BDF files for the device. I already had a look here:

But for me it's not yet clear how to create the files. Is there a HowTo for this topic?

Bootlog of my device (if required):

I also have the firmware files from the OEM image from lib/firmware:

└── IPQ4019
    ├── AH
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── AU
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── CN
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── EU
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── FCC
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── HK
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── hw.1 -> /tmp/IPQ4019/hw.1
    ├── hw_1
    │   ├── athwlan.bin
    │   ├── athwlan.codeswap.bin
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK01_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK01_5G.bin
    │   ├── boardData_1_0_IPQ4019_DK03_wifi0.bin
    │   ├── boardData_1_0_IPQ4019_DK03_wifi1.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G_neg_pwr.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G_neg_pwr.bin
    │   ├── boardData_1_0_IPQ4019_DK05_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK05_5G.bin
    │   ├── boardData_1_0_IPQ4019_DK06_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK06_5G.bin
    │   ├── boardData_1_0_IPQ4019_DK07_wifi0_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK07_wifi0_5G_HB.bin
    │   ├── boardData_1_0_IPQ4019_DK07_wifi1_5G_LB.bin
    │   ├── boardData_1_0_IPQ4019_DK08_wifi0_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK08_wifi1_5G_LB.bin
    │   ├── boardData_1_0_IPQ4019_Y9803_wifi0.bin
    │   ├── boardData_1_0_IPQ4019_Y9803_wifi1.bin
    │   ├── boardData_1_0_IPQ4019_YA131_wifi0.bin
    │   ├── boardData_1_0_IPQ4019_YA131_wifi1.bin
    │   ├── boarddata_1.bin
    │   ├── otp.bin
    │   ├── utf.bin
    │   └── utf.codeswap.bin
    ├── IC
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── IN
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── JP
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── KR
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── ME
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── PH
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    ├── SG
    │   ├── boarddata_0.bin
    │   ├── boardData_1_0_IPQ4019_DK04_2G.bin
    │   ├── boardData_1_0_IPQ4019_DK04_5G.bin
    │   └── boarddata_1.bin
    └── TH
        ├── boarddata_0.bin
        ├── boardData_1_0_IPQ4019_DK04_2G.bin
        ├── boardData_1_0_IPQ4019_DK04_5G.bin
        └── boarddata_1.bin

Question 1: Wireless is already working on my device and also on another one from a member of this forum. Are the BDFs still required?
Question 2: If answer to the previous question is yes, which files do I have to process in which way?

Thanks
Roland

One step ahead when creating the files:

[
    {
        "data": "firmware/AH/boardData_1_0_IPQ4019_DK04_2G.bin", 
        "names": [
            "bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=linksys-mr6350-ahm"
        ]
    }, 
    {
        "data": "firmware/AH/boardData_1_0_IPQ4019_DK04_5G.bin", 
        "names": [
            "bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=linksys-mr6350-ahm"
        ]
    },
    {
        "data": "firmware/EU/boardData_1_0_IPQ4019_DK04_2G.bin", 
        "names": [
            "bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=linksys-mr6350-eum"
        ]
    }, 
    {
        "data": "firmware/EU/boardData_1_0_IPQ4019_DK04_5G.bin", 
        "names": [
            "bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=linksys-mr6350-eum"
        ]
    },
    {
        "data": "firmware/FCC/boardData_1_0_IPQ4019_DK04_2G.bin", 
        "names": [
            "bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=linksys-mr6350-fcc"
        ]
    }, 
    {
        "data": "firmware/FCC/boardData_1_0_IPQ4019_DK04_5G.bin", 
        "names": [
            "bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=linksys-mr6350-fcc"
        ]
    },
    {
        "data": "firmware/IC/boardData_1_0_IPQ4019_DK04_2G.bin", 
        "names": [
            "bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=linksys-mr6350-ic"
        ]
    }, 
    {
        "data": "firmware/IC/boardData_1_0_IPQ4019_DK04_5G.bin", 
        "names": [
            "bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=linksys-mr6350-ic"
        ]
    }
]
  • Run command:
    python3 tools/scripts/ath10k/ath10k-bdencoder -c board.json
  • board-2.bin is created, it must be renamed according to the device, e.g. board-linksys_mr6350.qca4019
  • Looks like only the sections for AH, EU, FCC and IC must be present, not sure if it is correct. Just compared with other files in https://github.com/openwrt/firmware_qca-wireless. And in the DTS, only the FCC variant is referenced
2 Likes

There could be small differences in board construction and this could lead to worse range of WiFi if wrong BDF is used. And naturally, vendor BDFs were used for certification, so to be in line with limits, use ones provided with device.

OpenWrt doesn't have any logic to reload BDF depending on what country is set in configuration, so people include single BDF for each band covering most of the world. I, in contrary, did include all of BDFs that vendor provided, since there were only few of them (https://git.openwrt.org/?p=project/firmware/qca-wireless.git;a=commit;h=5e8d89f1b93ba2bd7cb7291f0f8e7272cfc86e6a), so "power users" could change them. This was also accepted upstream (https://lore.kernel.org/ath10k/874jqjli8o.fsf@kernel.org), so if You want to package more of them, go ahead.

Keep in mind to first compare md5sums with all variants of vendor provided ones, if they overlap. After (this one also applies if You want to package single BDF for each band), unpack OpenWrt ones from qca-wireless.git and upstream ones from linux-firmware.git and compare md5sums, maybe it's already there under different name.

1 Like