Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QCA9888: Board file for Kuwfi WB5G08 #56

Closed
wants to merge 1 commit into from
Closed

Conversation

grosjo
Copy link

@grosjo grosjo commented Dec 28, 2024

No description provided.

@hauke
Copy link
Member

hauke commented Jan 4, 2025

@Ansuel or @robimarko Is this looking fine?

It is related to this PR: openwrt/openwrt#17281

@grosjo
Copy link
Author

grosjo commented Jan 4, 2025

yes

@grosjo
Copy link
Author

grosjo commented Jan 5, 2025

@hauke once this PR is approved, what is the process to use the board file in my PR openwrt/openwrt#17281 ?

@grosjo grosjo changed the title QCA988x: Board file for Kuwfi WG5G08 QCA9888: Board file for Kuwfi WG5G08 Jan 5, 2025
@grosjo grosjo changed the title QCA9888: Board file for Kuwfi WG5G08 QCA9888: Board file for Kuwfi WB5G08 Jan 5, 2025
@testuser7
Copy link
Contributor

@hauke once this PR is approved, what is the process to use the board file in my PR openwrt/openwrt#17281 ?

You can then add a commit to your PR like this: https://github.com/openwrt/openwrt/pull/17254/commits

@grosjo
Copy link
Author

grosjo commented Jan 6, 2025

I still don't understand. Where should I place the board.bin file in my PR file tree to have it included ? Or are you referring to something else ?

@robimarko
Copy link
Contributor

This is not valid, its not even wrapped by ath10k-bdencoder, it just looks like plain BDF

@grosjo
Copy link
Author

grosjo commented Jan 7, 2025

This is not valid, its not even wrapped by ath10k-bdencoder, it just looks like plain BDF

This is the board.bin from the initial firmware

What should I do to make it valid ?

@robimarko
Copy link
Contributor

Yes, but its just plain BDF.

For use in OpenWrt you need to wrap it with ath10k-bdencoder

@grosjo
Copy link
Author

grosjo commented Jan 9, 2025

@robimarko Can you explain how ? No docs available here...

@testuser7
Copy link
Contributor

@grosjo ath10k-bdencoder tool: https://github.com/qca/qca-swiss-army-knife/blob/master/tools/scripts/ath10k/ath10k-bdencoder

  1. Rename your BDF to bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=KuWfi-WB5G08.bin (your board-id is 16)
  2. Create board-2.json file:
    [
        {
            "names": [
                "bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=KuWfi-WB5G08"
            ],
            "data": "bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=KuWfi-WB5G08.bin"
        }
    ]
    
  3. Run ath10k-bdencoder -c board-2.json -o board-kuwfi_wb5g08.qca9888

@grosjo
Copy link
Author

grosjo commented Jan 9, 2025

@robimarko @testuser7
Done

@grosjo
Copy link
Author

grosjo commented Jan 13, 2025

How to move forward ?

@grosjo
Copy link
Author

grosjo commented Jan 18, 2025

any way to move forward ?

@robimarko
Copy link
Contributor

Sorry, but this is not correct:

[
    {
     	"names": [
            "bus=pci,vendor=168c,device=0056,subsystem-vendor=0000,subsystem-device=0000"
        ],
	"data": "bus=pci,vendor=168c,device=0056,subsystem-vendor=0000,subsystem-device=0000.bin"
    }
]

How do you plan to match the variant when there is not one

@grosjo
Copy link
Author

grosjo commented Jan 20, 2025

What do you mean ? This is the board related to the PR associated

What do you want to say ?

@testuser7
Copy link
Contributor

testuser7 commented Jan 20, 2025

@grosjo The filename bus=pci,vendor=168c,device=0056,subsystem-vendor=0000,subsystem-device=0000 is invalid. Why didn't you use the name bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=KuWfi-WB5G08 that I gave you earlier?

The name you used is used for qca9889. But if you must use it, add a variant at the end: bus=pci,vendor=168c,device=0056,subsystem-vendor=0000,subsystem-device=0000,variant=KuWfi-WB5G08

@grosjo
Copy link
Author

grosjo commented Jan 20, 2025

I have not done anything, this is just the bin file from the OEM board

@testuser7
Copy link
Contributor

So you need to change the name inside bard file to bus=pci,vendor=168c,device=0056,subsystem-vendor=0000,subsystem-device=0000,variant=KuWfi-WB5G08.

@grosjo
Copy link
Author

grosjo commented Jan 23, 2025

How can I do that ?

@grosjo grosjo force-pushed the main branch 2 times, most recently from 461e4d0 to 4a03a92 Compare January 23, 2025 05:21
@grosjo
Copy link
Author

grosjo commented Jan 23, 2025

I tried something, I have no real clue what I am doing, but maybe it has worked ?

@grosjo
Copy link
Author

grosjo commented Jan 23, 2025

@robimarko @testuser7 Looks good now ?

@grosjo
Copy link
Author

grosjo commented Jan 25, 2025

What is your feedback ?

@testuser7
Copy link
Contributor

You have now used the name bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=KuWfi-WB5G08. Can you show the system logs from when the BDF file is read? Is the name recognized correctly?

@grosjo
Copy link
Author

grosjo commented Feb 4, 2025

No, as tested already before, it does not

@grosjo
Copy link
Author

grosjo commented Feb 5, 2025

There are only 2 options
1 - raw BDF as board.bin without precal/calibration input in the DTS
2 - "embedded" board-2.bin with precal/cal

Usage of the 2 (precal and cal) is actually what they are doing in the initial OEM firmware (wifi0.cal and wifi1.cal)

Can we now move forward ? What would be the step to have this board-2.bin merged in the compilation tree ?

@grosjo
Copy link
Author

grosjo commented Feb 6, 2025

@testuser7 @robimarko what would be the next step ?

@grosjo
Copy link
Author

grosjo commented Feb 8, 2025

How to move forward ?

@testuser7
Copy link
Contributor

The current implementation cannot be accepted because it is incorrect. Check the comments in the main PR.
What MAC address do you have for this radio interface in OpenWrt?

@grosjo
Copy link
Author

grosjo commented Feb 8, 2025

What is incorrect ?

@grosjo
Copy link
Author

grosjo commented Feb 8, 2025

# hexdump /dev/mtdblock6
0000000 7c27007c 3c5a003c edf400ed ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff
0000010 ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff
*
0001000 ffff00ff 7c27007c 3c5a003c edf500ed ffff00ff ffff00ff ffff00ff ffff00ff
0001010 ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff
*
0005000 202f0020 e80000 1010001 7c27007c 3c5a003c edf600ed 0000 20000020
0005010 15e00015 20000 600000 0000 15770015 2000002 0000 0000
0005020 10000010 20000 33000033 0000 20000 5030005 4d43004d 4e5f004e
0005030 4e4f004e 545f0054 464f0046 554e0055 44000044 0000 0000 0000
0005040 c3e000c 10000 0000 0000 330000 33330033 f4f200f4 f20000f2
0005050 4b14004b c00000c ffff00ff ff3f00ff ffff00ff ff3f00ff ffff00ff ff3f00ff
0005060 3140003 0000 0000 0000 0000 0000 0000 0000
0005070 0000 0000 0000 0000 0000 0000 0000 0000
*
(..)

# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
    link/ether 7c:27:3c:5a:ed:f4 brd ff:ff:ff:ff:ff:ff
3: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 7c:27:3c:5a:ed:f4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever
4: phy0-ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether 12:34:56:78:90:12 brd ff:ff:ff:ff:ff:ff

@grosjo
Copy link
Author

grosjo commented Feb 8, 2025

To avoid the 12345678901 mac, I need to change my board.json as follows:

[
    {
        "names": [
            "bus=pci,vendor=168c,device=0056,subsystem-vendor=0000,subsystem-device=0000,variant=KuWfi-WB5G08",
            "bus=pci,bmi-chip-id=0,bmi-board-id=31,variant=KuWfi-WB5G08",
            "bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=KuWfi-WB5G08"
        ],
        "data": "boardData_2_0_QCA9888_5G_Y9690.bin"
    }
]

@grosjo
Copy link
Author

grosjo commented Feb 8, 2025

Then I get

# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
    link/ether 7c:27:3c:5a:ed:f4 brd ff:ff:ff:ff:ff:ff
3: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 7c:27:3c:5a:ed:f4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fe80::7e27:3cff:fe5a:edf4/64 scope link 
       valid_lft forever preferred_lft forever
4: phy0-ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether 7c:27:3c:5a:ed:f6 brd ff:ff:ff:ff:ff:ff

@grosjo grosjo force-pushed the main branch 3 times, most recently from 505481b to 8efcd92 Compare February 8, 2025 15:55
@grosjo grosjo closed this Feb 9, 2025
@grosjo grosjo reopened this Feb 9, 2025
@grosjo grosjo force-pushed the main branch 2 times, most recently from 703da4f to ae77e2e Compare February 9, 2025 14:42
@grosjo
Copy link
Author

grosjo commented Feb 10, 2025

How to proceed further?

@grosjo
Copy link
Author

grosjo commented Feb 14, 2025

Ping

@testuser7
Copy link
Contributor

testuser7 commented Feb 14, 2025

Share a dump of the mtd6 partition. Sometimes you get this result:

hexdump /dev/mtd6
0000000 7c27007c 3c5a003c edeb00ed ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff
0000010 ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff
*
0001000 ffff00ff 7c27007c 3c5a003c edec00ed ffff00ff ffff00ff ffff00ff ffff00ff
0001010 ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff
*
0005000 ffff00ff 526f0052 ffff00ff 7c27007c 3c5a003c eded00ed ffff00ff ffff00ff
0005010 ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff
*
0010000

and other times this:

# hexdump /dev/mtdblock6
0000000 7c27007c 3c5a003c edf400ed ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff
0000010 ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff
*
0001000 ffff00ff 7c27007c 3c5a003c edf500ed ffff00ff ffff00ff ffff00ff ffff00ff
0001010 ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff ffff00ff
*
0005000 202f0020 e80000 1010001 7c27007c 3c5a003c edf600ed 0000 20000020
0005010 15e00015 20000 600000 0000 15770015 2000002 0000 0000
0005020 10000010 20000 33000033 0000 20000 5030005 4d43004d 4e5f004e
0005030 4e4f004e 545f0054 464f0046 554e0055 44000044 0000 0000 0000
0005040 c3e000c 10000 0000 0000 330000 33330033 f4f200f4 f20000f2
0005050 4b14004b c00000c ffff00ff ff3f00ff ffff00ff ff3f00ff ffff00ff ff3f00ff
0005060 3140003 0000 0000 0000 0000 0000 0000 0000
0005070 0000 0000 0000 0000 0000 0000 0000 0000
*
(..)

In the second case there are correct calibration data in the art partition.

@grosjo
Copy link
Author

grosjo commented Feb 14, 2025

different devices, different data

@testuser7
Copy link
Contributor

The problem is that one of your devices does not have calibration data. Such cases are not supported.
The only thing you can do is copy calibration data from one device to another (you need to change the MAC address in the calibration data).

I have added some comments to the main PR.

This one PR is not needed and can be closed.

@grosjo
Copy link
Author

grosjo commented Feb 15, 2025

Why closed ? Devices are not starting up without the board file

@testuser7
Copy link
Contributor

What is the result of the commands?

ls -la /lib/firmware/ath10k/QCA9888/hw2.0/
hexdump -C -n 224 /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
hexdump -C -n 224 /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin

@grosjo
Copy link
Author

grosjo commented Feb 15, 2025

I remove those files and put the one from firmware to make the device work

@grosjo
Copy link
Author

grosjo commented Feb 15, 2025

Latest changes in DTS (see very latest comment) allow indeed use of the default baord-2.bin

@grosjo grosjo closed this Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants