Archer MR200, MiniPCIe for Wifi card? // solved, wont work

Hi All,
after longer period of using Archer MR200 I changed my router to different one. Instead of making trash of it I decided to put another Mnipcie card inside (3rd and 4th wifi) and gine it another life.

But Openwrt cannot detect new card.
I tried old Intel Cetrino Wireless-N 1000, loaded all kmods I think are necessary, but I cannot see the card.

lspci -v gives:

00:00.0 PCI bridge: Ralink corp. Device 0801 (rev 01) (prog-if 00 [Normal decode])
	Device tree node: /sys/firmware/devicetree/base/pcie@10140000/pcie@0,0
	Flags: bus master, fast devsel, latency 0, IRQ 255
	Memory at 20200000 (32-bit, non-prefetchable) [size=64K]
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
	I/O behind bridge: None
	Memory behind bridge: 20000000-201fffff [size=2M]
	Prefetchable memory behind bridge: None
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Root Port (Slot-), MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [140] Virtual Channel
lspci: Unable to load libkmod resources: error -12

01:00.0 Network controller: MEDIATEK Corp. Device 7650
	Subsystem: MEDIATEK Corp. Device 7650
	Device tree node: /sys/firmware/devicetree/base/pcie@10140000/pcie@0,0/mt76@0,0
	Flags: bus master, fast devsel, latency 0, IRQ 4
	Memory at 20000000 (32-bit, non-prefetchable) [size=1M]
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [140] Device Serial Number 00-00-ff-ff-ff-ff-ff-ff
	Capabilities: [150] Latency Tolerance Reporting
	Kernel driver in use: mt76x0e

01:00.1 Bluetooth: MEDIATEK Corp. Device 8650
	Subsystem: MEDIATEK Corp. Device 8650
	Flags: fast devsel, IRQ 255
	Memory at 20100000 (32-bit, non-prefetchable) [disabled] [size=1M]
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [140] Device Serial Number 00-00-ff-ff-ff-ff-ff-ff
	Capabilities: [150] Latency Tolerance Reporting

Any idea what I can do in order to use the card?

Thanks!

Jan.

can it be seen in dmesg ?

Nope... :frowning:

root@OpenWrt:~# dmesg
[    0.000000] Linux version 4.14.221 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11306-c4a6851c72)) #0 Mon Feb 15 15:22:37 2021
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620A ver:2 eco:6
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is TP-Link Archer MR200
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 804805e0, node_mem_map 81000040
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] random: get_random_bytes called from 0x80483740 with crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=0007f085
[    0.000000] Readback ErrCtl register=0007f085
[    0.000000] Memory: 58804K/65536K available (3923K kernel code, 184K rwdata, 504K rodata, 1204K init, 215K bss, 6732K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000010] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.007602] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.073554] pid_max: default: 32768 minimum: 301
[    0.078271] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.084660] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.097925] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.107474] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.113444] pinctrl core: initialized pinctrl subsystem
[    0.119804] NET: Registered protocol family 16
[    0.604802] PCI host bridge /pcie@10140000 ranges:
[    0.609425]  MEM 0x0000000020000000..0x000000002fffffff
[    0.614469]   IO 0x0000000010160000..0x000000001016ffff
[    0.637335] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.642795] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.649118] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.654539] rt2880_gpio 10000638.gpio: registering 16 irq handlers
[    0.660814] rt2880_gpio 10000660.gpio: registering 32 gpios
[    0.666236] rt2880_gpio 10000660.gpio: registering 32 irq handlers
[    0.672506] rt2880_gpio 10000688.gpio: registering 1 gpios
[    0.677843] rt2880_gpio 10000688.gpio: registering 1 irq handlers
[    0.684556] PCI host bridge to bus 0000:00
[    0.688534] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.695150] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.700916] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.707492] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.715241] pci 0000:00:00.0: [1814:0801] type 01 class 0x060400
[    0.715283] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    0.715298] pci 0000:00:00.0: reg 0x14: [mem 0x00000000-0x0000ffff]
[    0.715381] pci 0000:00:00.0: supports D1
[    0.715393] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.715665] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.723554] pci 0000:01:00.0: [14c3:7650] type 00 class 0x028000
[    0.723602] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
[    0.723745] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    0.724003] pci 0000:01:00.1: [14c3:8650] type 00 class 0x0d1100
[    0.724053] pci 0000:01:00.1: reg 0x10: [mem 0x00000000-0x000fffff]
[    0.724192] pci 0000:01:00.1: supports D1
[    0.724204] pci 0000:01:00.1: PME# supported from D0 D1 D3hot D3cold
[    0.724426] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.724443] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.724495] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.730914] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.737623] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x201fffff]
[    0.744233] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.750816] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff]
[    0.757423] pci 0000:01:00.1: BAR 0: assigned [mem 0x20100000-0x201fffff]
[    0.763997] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.768831] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x201fffff]
[    0.780871] clocksource: Switched to clocksource systick
[    0.787152] NET: Registered protocol family 2
[    0.792371] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.799095] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.805328] TCP: Hash tables configured (established 1024 bind 1024)
[    0.811614] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.817240] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.823618] NET: Registered protocol family 1
[    0.827858] PCI: CLS 0 bytes, default 32
[    0.830568] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    0.837282] Crashlog allocated RAM at address 0x3f00000
[    0.844090] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.856280] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.861935] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.881776] io scheduler noop registered
[    0.885523] io scheduler deadline registered (default)
[    0.891519] gpio-export gpio_export: 1 gpio(s) exported
[    0.896795] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.905932] console [ttyS0] disabled
[    0.909386] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    0.919066] console [ttyS0] enabled
[    0.926109] bootconsole [early0] disabled
[    0.942479] spi spi0.0: force spi mode3
[    0.947181] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    0.952278] 5 fixed-partitions partitions found on MTD device spi0.0
[    0.958759] Creating 5 MTD partitions on "spi0.0":
[    0.963693] 0x000000000000-0x000000020000 : "u-boot"
[    0.969676] 0x000000020000-0x0000007d0000 : "firmware"
[    0.978252] 2 tplink-fw partitions found on MTD device firmware
[    0.984373] Creating 2 MTD partitions on "firmware":
[    0.989455] 0x000000000000-0x00000017ee57 : "kernel"
[    0.995443] 0x00000017ee58-0x0000007b0000 : "rootfs"
[    1.001355] mtd: device 3 (rootfs) set to be root filesystem
[    1.008703] 1 squashfs-split partitions found on MTD device rootfs
[    1.015098] 0x0000004b8000-0x0000007b0000 : "rootfs_data"
[    1.021565] 0x0000007d0000-0x0000007e0000 : "rom"
[    1.027213] 0x0000007e0000-0x0000007f0000 : "romfile"
[    1.033306] 0x0000007f0000-0x000000800000 : "radio"
[    1.039918] libphy: Fixed MDIO Bus: probed
[    1.054679] gsw: setting port4 to ephy mode
[    1.058998] mtk_soc_eth 10100000.ethernet eth0 (uninitialized): port 2 link up (100Mbps/Full duplex)
[    1.068586] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    1.075348] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.084345] rt2880_wdt 10000120.watchdog: Initialized
[    1.090928] NET: Registered protocol family 10
[    1.099473] Segment Routing with IPv6
[    1.103405] NET: Registered protocol family 17
[    1.107995] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.121246] 8021q: 802.1Q VLAN Support v1.8
[    1.141752] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    1.155549] Freeing unused kernel memory: 1204K
[    1.160172] This architecture does not have kernel memory protection.
[    2.700846] random: fast init done
[    2.875865] init: Console is alive
[    2.879592] init: - watchdog -
[    5.021766] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.110057] usbcore: registered new interface driver usbfs
[    5.115822] usbcore: registered new interface driver hub
[    5.121409] usbcore: registered new device driver usb
[    5.132974] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.141550] ehci-platform: EHCI generic platform driver
[    5.157262] phy phy-usbphy.0: remote usb device wakeup disabled
[    5.163331] phy phy-usbphy.0: UTMI 16bit 30MHz
[    5.167884] ehci-platform 101c0000.ehci: EHCI Host Controller
[    5.173810] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[    5.182043] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[    5.195986] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[    5.203329] hub 1-0:1.0: USB hub found
[    5.207686] hub 1-0:1.0: 1 port detected
[    5.218061] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.226890] init: - preinit -
[    6.740606] 8021q: adding VLAN 0 to HW filter on device eth0
[    6.761319] random: procd: uninitialized urandom read (4 bytes read)
[    8.424318] jffs2: notice: (427) jffs2_build_xattr_subsystem: complete building xattr subsystem, 5 of xdatum (3 unchecked, 2 orphan) and 54 of xref (2 dead, 0 orphan) found.
[    8.451365] mount_root: switching to jffs2 overlay
[    8.489360] overlayfs: upper fs does not support tmpfile.
[    8.556222] urandom-seed: Seeding with /etc/urandom.seed
[    9.831344] procd: - early -
[    9.835226] procd: - watchdog -
[   10.549459] procd: - watchdog -
[   10.553029] procd: - ubus -
[   11.023964] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.036867] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.046046] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.053679] procd: - init -
[   12.787160] urngd: jent-rng init failed, err: 2
[   13.944650] kmodloader: loading kernel modules from /etc/modules.d/*
[   14.093805] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[   14.101082] e1000: Copyright (c) 1999-2006 Intel Corporation.
[   14.184593] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   14.198380] ehci-pci: EHCI PCI platform driver
[   14.205787] Netfilter messages via NETLINK v0.30.
[   14.245560] ip_set: protocol 6
[   14.704352] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[   14.712492] ohci-platform: OHCI generic platform driver
[   14.718129] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[   14.725163] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[   14.733356] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[   14.770495] hub 2-0:1.0: USB hub found
[   14.783620] hub 2-0:1.0: 1 port detected
[   14.791507] ohci-pci: OHCI PCI platform driver
[   14.818177] Loading modules backported from Linux version v4.19.161-0-gdaefdc9eb24b
[   14.826089] Backport generated by backports.git v4.19.161-1-0-g4bb568fe
[   14.856784] ip_tables: (C) 2000-2006 Netfilter Core Team
[   15.088903] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   15.173994] usbcore: registered new interface driver usbserial
[   15.180030] usbcore: registered new interface driver usbserial_generic
[   15.186845] usbserial: USB Serial support registered for generic
[   15.386152] wireguard: WireGuard 1.0.20200611 loaded. See www.wireguard.com for information.
[   15.394852] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[   15.447519] xt_time: kernel timezone is -0000
[   15.454811] usbcore: registered new interface driver cdc_ether
[   15.610615] PPP generic driver version 2.4.2
[   15.618471] NET: Registered protocol family 24
[   15.626058] usbcore: registered new interface driver rndis_host
[   15.652274] mt76x0e 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[   15.658841] mt76x0e 0000:01:00.0: ASIC revision: 76100002
[   15.666327] mt76x0e 0000:01:00.0: Firmware Version: 0.1.00
[   15.881856] mt76x0e 0000:01:00.0: EEPROM ver:02 fae:00
[   15.891395] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   15.918473] usbcore: registered new interface driver option
[   15.924275] usbserial: USB Serial support registered for GSM modem (1-port)
[   16.071751] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "radio"
[   16.079026] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[   16.086963] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 7620 detected
[   16.094805] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[   16.105111] kmodloader: done loading kernel modules from /etc/modules.d/*
[   29.808705] 8021q: adding VLAN 0 to HW filter on device eth0
[   29.831164] br-lan: port 1(eth0.1) entered blocking state
[   29.836948] br-lan: port 1(eth0.1) entered disabled state
[   29.842816] device eth0.1 entered promiscuous mode
[   29.847774] device eth0 entered promiscuous mode
[   29.880883] br-lan: port 1(eth0.1) entered blocking state
[   29.886411] br-lan: port 1(eth0.1) entered forwarding state
[   29.892390] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   30.826938] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   64.480592] random: crng init done
[   64.484084] random: 6 urandom warning(s) missed due to ratelimiting

Hi all,
next, small and useless step was change in dts

file: mt7620a.dtsi, where I changed value in pcie status from "disabled" to "okay".

Unfortunatelly no change.

	pcie: pcie@10140000 {
		compatible = "mediatek,mt7620-pci";
		reg = <0x10140000 0x100
			0x10142000 0x100>;

		#address-cells = <3>;
		#size-cells = <2>;

		resets = <&rstctrl 26>;
		reset-names = "pcie0";

		clocks = <&clkctrl 26>;
		clock-names = "pcie0";

		interrupt-parent = <&cpuintc>;
		interrupts = <4>;

		pinctrl-names = "default";
		pinctrl-0 = <&pcie_pins>;

		device_type = "pci";

		bus-range = <0 255>;
		ranges = <
			0x02000000 0 0x00000000 0x20000000 0 0x10000000 /* pci memory */
			0x01000000 0 0x00000000 0x10160000 0 0x00010000 /* io space */
		>;

		status = "okay";

		pcie0: pcie@0,0 {
			reg = <0x0000 0 0 0 0>;

			#address-cells = <3>;
			#size-cells = <2>;

			device_type = "pci";

			ranges;
		};
	};

Honestly, I'm quite sure it is not so easy, any hints what should be in this section in order to autodetect minipcie card?

Thanks,

Jan.

Are you trying to replace the LTE modem with a WiFi card? If so, then the problem is most likely PCIe signals missing on the mini-PCIe slot. LTE modems use USB, so wiring up PCIe is not neccessary for them and therefore likely dropped.

Yes, that's exactly my intention.

I somehow did not expect HW feature like this and you're right. Double checked the PCB and PCI lanes seems to be not connected at all.

Shame.

Thanks for good hint,
Jan.