realtek: pci: add rtl9607 pcie controller support#5
realtek: pci: add rtl9607 pcie controller support#5jameywine wants to merge 1 commit intortl9607c-devfrom
Conversation
bc26335 to
66d8208
Compare
4f17bae to
433b025
Compare
66d8208 to
e74aa33
Compare
e74aa33 to
658b44e
Compare
433b025 to
be3cb6b
Compare
|
Applied suggested changes to move pinmux node to the board device tree. I have also made some cleanups to pcie and phy drivers
|
be3cb6b to
d0ace8c
Compare
|
forgot to add reset properties to the pcie phy nodes in my previous push. That should be fixed now. |
|
Can't find SoC revision checking... I'll need to test it on rev. A |
|
Can't find SoC revision checking
Yes, soc revision check would not be upstream friendly and so I discarded it
I'll need to test it on rev. A
That would be very nice since it was my original goal when I had created the driver. Don't need to bloat the driver if revB phy params work on revA..
|
480d74f to
959cc30
Compare
|
Tested the driver. Of course, it don't work with rev. A (but works with rev. C) |
|
Alright then, that was exactly what I was worried about.
We need to add 2 more compatibles to phy rtk pcie driver for both pcie revB and then split rtl960x.dtsi into a common, revB and revC files. That means board dts files need to include the rev version file of that corresponds to the SoC on their PCB.
|
8d05169 to
fce6dc0
Compare
|
added revA compatibles to the phy pcie driver, that should make pcie ports on RTL9607C rev A work.. |
| if (!rtk_phy->phy_cfg) | ||
| return dev_err_probe(dev, -ENOMEM, "Failed to allocate phy_cfg\n");; | ||
|
|
||
| memcpy(rtk_phy->phy_cfg, phy_cfg, sizeof(*phy_cfg)); |
There was a problem hiding this comment.
Why not referencing shared const struct?
There was a problem hiding this comment.
That is just how the phy-rtk-usb3 code had done it and i copied that
|
PCI on revA failing to bring link up, which indicating improper PHY initialization. Actual revision works fine |
just noticed that i have forgotten to change the numbers in the square brackets after copying some of the rows [15] = {0x0f, 0x000c},
[15] = {0x1b, 0xaea1},
[15] = {0x1e, 0x28eb},
....
[39] = {0x27, 0x011a},
[39] = {0x2f, 0x65bd}, },will fix it right away |
fce6dc0 to
66b9d9a
Compare
|
@ProMix0 hey, |
66b9d9a to
0257518
Compare
|
Seems to work now. I'll check again later RevA bootlog (PCI part) DetailsP.S. There is problem with BAR assignment on port1 (on both revisions). I guess, that's what |
9559390 to
cf16d4e
Compare
|
On the other day PCI works, it's good. But tests from anyone with revA are appreciated Also replaced |
|
But tests from anyone with Reva are appreciated
You could send a message to naseef as they also have revA chip
Maybe through OpenWrt forum though as they didn't seem to see/reply to my mention in the pull request message
|
I am watching this thread , I would like to test, but the main blocker for me is both the Wifi radio drivers are not supported by any of the Realtek wireless drivers . Earlier I was modfying compatible, but I am not sure it is 100% compatible since there were so many dmesg error outputs What about your devices? Do they have the wifi radio drivers? |
|
What about yours devices? Do they have the wifi radio drivers?
I personally haven't tried WiFi stuff yet. There is rtw89 driver present though and while rtl8832br and rtl8192xbr are not supposed, I am now curious to just add an entry to pci_device_id stuct in the rtw8851be.c file for 0xb832 and I see if it works at all.
|
cf16d4e to
84e5364
Compare
Yes, it doesn't allow proper PCIe testing, but for now we could test if everything before link up works. Main question right now - do you also have port 0 with PCIe 2.0? |
542fe8d to
606fbc3
Compare
84e5364 to
aec66bc
Compare
aec66bc to
0376ad3
Compare
So i did that, but i can't tell why rtw89 doesn't build even though i have enabled the respective configs +CONFIG_RTW89=y
+CONFIG_RTW89_8852B=y
+CONFIG_RTW89_8852B_COMMON=y
+CONFIG_RTW89_8852BE=y
+CONFIG_RTW89_CORE=y
+CONFIG_RTW89_DEBUG=y
+CONFIG_RTW89_DEBUGMSG=y
...
+CONFIG_WLAN=y
+CONFIG_WLAN_VENDOR_REALTEK=ysomething must be wrong with my setup... and yeah, here is the patch --- a/drivers/net/wireless/realtek/rtw89/rtw8852be.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852be.c
@@ -87,6 +87,10 @@ static const struct pci_device_id rtw89_
PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xb85b),
.driver_data = (kernel_ulong_t)&rtw89_8852be_info,
},
+ {
+ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xb832),
+ .driver_data = (kernel_ulong_t)&rtw89_8852be_info,
+ }
{},
};
MODULE_DEVICE_TABLE(pci, rtw89_8852be_id_table); |
|
@ProMix0 hey |
|
I think we shouldn't hurry with sending to upstream. For example, there is issues with pcie1 BAR. Personally I would prefer to send solid tested and working driver rather than driver that just... loads, you know No luck with rtw89 - no one firmware doesn't run smoothly. Tried to copy from my system - didn't go. Firmware from reference loads, but there are error while interacting with fw, but it should be solvable (you could move any fw .bin from DetailsPushed config for rtw89 here |
Could it be related to the same issue as in econet pcie? Looks similar https://lore.kernel.org/linux-pci/20260312165332.569772-4-cjd@cjdns.fr/#t |
|
Maybe, but I've applied patch, and it didn't help. Same bootlog |
0376ad3 to
8ea8d37
Compare
This commit adds support for PCIE controller on RTL9607C / RTL8198D. RTL9607C / RTL8198D has 2 PCIE ports for 2 wifi chipsets. It also comes with pcie phy driver companion which initializes phy and other misc stuff like ip controller using syscon nodes. Since it is very similar in the way phy writes are done in rtk usb3 phy driver, most of the structure was copied over to the pcie phy driver. Signed-off-by: Rustam Adilov <adilov@tutamail.com>
8ea8d37 to
a219bda
Compare
|
@jameywine can we try mailing the rtw88 maintainers through mailing list ( seems like they are from realtek team itself) on supporting the wifi in our devices at least? we would need the wifi drivers anyway down the road |
|
Yes, absolutely. And rtw89 along with it since they both are maintained by the same realtek person.
I was going to do it last week but I just keep putting away. Thanks for a reminder, maybe today after I am back home..
It would be really nice to get some help from realtek on this matter.
|
Have you tried loading the firmware from this directory? it appears they are for both rtl8192xb and rtl8832br by the presence of
given that, the Something i also want to do is to see what is behind the pci debug messages because only today have i noticed that there is |
No luck, same errors. I believe these firmware files use some another protocol for "handshake" between driver and FW. If it is slightly different, it might be easily fixed. If not... it will be harder |
What about the I have checked the https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtw89 binary files and the |
Forgot this one. But it doesn't work as well |
This commit adds support for PCIE controller on RTL9607C / RTL8198D.
RTL9607C / RTL8198D has 2 PCIE ports for 2 wifi chipsets.
It also comes with pcie phy driver companion which initializes phy and other misc stuff like ip controller using syscon nodes. Since it is very similar in the way phy writes are done in rtk usb3 phy driver, most of the structure was copied over to the pcie phy driver.
This pull request is just here so that people can test and see and discuss about it, as it is not really for merging to rtl9607c-dev_gpio branch.
Big thanks to naseef's work on pci as it allowed me to build upon it and make it more upstream friendly.
Hey @naseef , if you can, could you test it out on your end as well?