Hello everybody! Tell me if there is an OpenWRT image for R2 in which SATA and PCi-E work ? I will be very grateful for the link. I want to install Samba+transmission + wi fi(Atheros AR928X)
You can activate sata (and disable 1 pcie) by running this:
The other pcie should still work
I asked about R2 on it 1 PCIe
Ah,sorry. On r2 sata and pcie can be both used with mainline kernel. Limitation to choose between pcie1 or sata is only on r64
Thank you for your work! I don’t have a good knowledge of linux, OpenWRT. using the image OpenWRT SNAPSHOT r 164-e887049fbb / LuCI Master git-21.088.74150-ba4e214 was able to install wi fi(Atheros AR928X) but it is not possible to mount a sata HDD. The HDD is not detected by the system. Perhaps someone has a ready-made Openwrt image for R2 where SATA and wifi work out of the box ?
I do not use openwrt,but with mainline kernel i had no problems with sata in debian and my hdd (currently using 5.4)
Anything related in logs/dmesg?
[ 7.880334] ahci 0000:02:00.0: version 3.0
[ 7.880359] ahci 0000:02:00.0: enabling device (0140 -> 0143)
[ 7.886271] ahci 0000:02:00.0: SSS flag set, parallel bus scan disabled
[ 7.892939] ahci 0000:02:00.0: AHCI 0001.0200 32 slots 2 ports 6 Gbps 0x3 impl IDE mode
[ 7.900955] ahci 0000:02:00.0: flags: 64bit ncq sntf stag led clo pmp pio slum part ccc sxs
[ 7.910562] scsi host0: ahci
[ 7.914184] scsi host1: ahci
[ 7.917367] ata1: SATA max UDMA/133 abar m512@0x60100000 port 0x60100100 irq 224
[ 7.924808] ata2: SATA max UDMA/133 abar m512@0x60100000 port 0x60100180 irq 224
[ 8.262067] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 8.269097] ata1.00: ATA-8: TOSHIBA DT01ACA050, MS1OA750, max UDMA/133
[ 8.275640] ata1.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 32), AA
[ 8.283354] ata1.00: configured for UDMA/133
[ 8.288035] scsi 0:0:0:0: Direct-Access ATA TOSHIBA DT01ACA0 A750 PQ: 0 ANSI: 5
[ 8.297310] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[ 8.304840] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 8.310118] sd 0:0:0:0: [sda] Write Protect is off
[ 8.314924] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 8.315006] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 8.348114] sda: sda1 sda2 sda3
[ 8.352654] sd 0:0:0:0: [sda] Attached SCSI disk
Looks good so far…have you tried mounting sdaX?
Thank you, everything works. Strangely, the processor became very hot, I did not notice this before
Which processor? From r2 (mt7623,mt7530,asmxxx),hdd,…
The processor MT7622 and especially the switch MT7531 are very hot (60°C) also on my board. I attached heatsinks on top of these chips. I can touch the heatsink of the CPU but the switch for not long time. The board nicely fits in the case of an old Wyse Cx0 thin client PC.
I’m using Openwrt with 5.10 kernel but can not get PCIe working.
lspci just gives nothing.
GPIO 499 stays in low level, I can’t switch it to high. Suppose this is the reason.
Also tried a build from BPi 20210501 but getting jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985
on load
on r64 gpio 90 is used for switching between sata (low)/pcie (high)
additional to this your codebase needs the pcie-splitting patches to use both pcie-slots
I got GPIO number from here.
It says that we should sum 409+xx, where xx - GPIO number we need.
But anyways, I get write error: Resource busy
gpio90 can be set only on bootup via Devicetree (asmsel)
see activation of sata in my repo:
the base+XX calculation is imho only for gpio-header (attention base differs from board to board)
In OpenWrt I solved the mPCIe/SATA switch using device-tree overlay. In that way you can specify the desired configuration in the bootloader environment which is accessible inside OpenWrt using the fw_printenv
and fw_setenv
commands. By default it is set to enable mPCIe.
fw_printenv bootconf
bootconf=config-mt7622-bananapi-bpi-r64-pcie1
To use the SATA port instead you can run
fw_setenv bootconf config-mt7622-bananapi-bpi-r64-sata
There is no need to make any low-level changes yourself. If bootconf
is already set to config-mt7622-bananapi-bpi-r64-pcie1
and your mPCIe module is not detected, there must be another reason for that. I’m using my BPi-R64 board with an MT7615E mPCIe module installed in the 2nd slot and it has been working great so far (it’s an over-sized module and cannot fit into the first slot which I have actually never tried).
Also note that the one of the mPCIe slots (the one closer to the Ethernet ports) always works, even in case SATA configuration is selected.
Thank you, I checked bootconf and it loads pcie, but still lspci gives empty reply. Dmesg
root@OpenWrt:/# dmesg |grep pci
[ 2.936248] mtk-pcie 1a143000.pcie: host bridge /pcie@1a143000 ranges:
[ 2.942787] mtk-pcie 1a143000.pcie: Parsing ranges property...
[ 2.948641] mtk-pcie 1a143000.pcie: MEM 0x0020000000..0x0027ffffff -> 0x0020000000
[ 3.058185] mtk-pcie 1a143000.pcie: Port0 link down
[ 3.067274] mtk-pcie 1a143000.pcie: PCI host bridge to bus 0000:00
[ 3.073452] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 3.078955] pci_bus 0000:00: root bus resource [mem 0x20000000-0x27ffffff]
[ 3.085827] pci_bus 0000:00: scanning bus
[ 3.091122] pci_bus 0000:00: fixups for bus
[ 3.095297] pci_bus 0000:00: bus scan returning with max=00
[ 3.102408] mtk-pcie 1a145000.pcie: host bridge /pcie@1a145000 ranges:
[ 3.108979] mtk-pcie 1a145000.pcie: Parsing ranges property...
[ 3.114815] mtk-pcie 1a145000.pcie: MEM 0x0028000000..0x002fffffff -> 0x0028000000
[ 3.223032] mtk-pcie 1a145000.pcie: Port1 link down
[ 3.228049] mtk-pcie 1a145000.pcie: PCI host bridge to bus 0001:00
[ 3.234228] pci_bus 0001:00: root bus resource [bus 00-ff]
[ 3.239719] pci_bus 0001:00: root bus resource [mem 0x28000000-0x2fffffff]
[ 3.246591] pci_bus 0001:00: scanning bus
[ 3.251886] pci_bus 0001:00: fixups for bus
[ 3.256071] pci_bus 0001:00: bus scan returning with max=00
Which kind of mPCIe hardware are you using? And have you tried both slots?
I have 2 wifi cards: QCA9882 and QCA9984. Both from Compex WLE600VX and WLE1216v5. They are 100% working cards, I tested both of them in another PC. I’v tried both slots, alone and together, mixed vice-a-versa.
Also I loaded board with Openwrt snapshot built, my own build, 21rc build. And got no luck.
Even without any cards at all I should get something from lspci.
No, this is not true. If I have both slots empty, lspci
also doesn’t show anything, not even host bridges. So what you are seeing is (from software point of view) just both slots empty and/or link down.
With both slots populated, it looks like this on my board:
0000:00:00.0 PCI bridge: MEDIATEK Corp. Device 3258
0000:01:00.0 Network controller: Intel Corporation Wi-Fi 6 AX200 (rev 1a)
0001:00:01.0 PCI bridge: MEDIATEK Corp. Device 3258
0001:01:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7615
I don’t have any QCA modules here for testing, but I’ve heard that the R64 is picky about mPCIe modules. (the AX200 is sitting in mPCIe to NGFF adapter and works fine. it can only do client mode, like all Intel wifi NICs, though…)
Update: The Compex modules you mentioned seem to be problematic, see also [BPI-R64] PCIe issues