I was chasing the problem in the wrong place. After more
testing it turned out that Linux has exactly the same problem.
That should probably be one of my early steps, to verify hands
on, does the problem affect any other operating systems.
I found following GitHub issue:
https://github.com/pcengines/apu2-documentation/issues/115
and it seems the source of the problem is hardware / firmware related.
Long story short, to make Sierra Wireless MC7455 LTE modem work on
PC Engines APU2 I did following AT commands on the modem:
AT!PCOFFEN=2
AT!USBSPEED=0
AT!RESET
and that makes device visible across system reboots. I'm testing the
modem on umb(4) driver, by disabling umsm(4) as the latter has preference
over the former.
I've tested following diff and it works as I expected, device attaches
as umb(4):
Index: dev/usb/umsm.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/umsm.c,v
retrieving revision 1.118
diff -u -p -u -r1.118 umsm.c
--- dev/usb/umsm.c 31 Jul 2020 10:49:33 -0000 1.118
+++ dev/usb/umsm.c 8 Sep 2020 22:34:00 -0000
@@ -255,7 +255,6 @@ static const struct umsm_type umsm_devs[
{{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8355}, 0},
{{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD_340U}, 0},
{{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD_770S}, 0},
- {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC7455}, 0},
{{ USB_VENDOR_SIMCOM, USB_PRODUCT_SIMCOM_SIM7600E}, 0},
but I'm not sure is this the way to go, as it doesn't allow to perform
initial configuration over cua(4) with AT commands. Anyway, that part is
for a different email thread.
# dmesg | grep -i sierra | cat -v
umb0 at uhub2 port 3 configuration 1 interface 12 "Sierra Wireless,
Incorporated Sierra Wireless MC7455 Qualcomm\M-. Snapdragon? X7 LTE-A" rev
2.00/0.06 addr 3
ugen1 at uhub2 port 3 configuration 1 "Sierra Wireless, Incorporated Sierra
Wireless MC7455 Qualcomm\M-. Snapdragon? X7 LTE-A" rev 2.00/0.06 addr 3
OpenBSD 6.8-beta (GENERIC.MP) #64: Sun Sep 6 18:19:41 MDT 2020
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
On Mon, Aug 10, 2020 at 08:34:36PM +0000, Mikolaj Kucharski wrote:
> >Synopsis: LTE mini-PCIe modem not showing up after reboot
> >Category: kernel
> >Environment:
> System : OpenBSD 6.7
> Details : OpenBSD 6.7-current (GENERIC.MP) #15: Sun Aug 9 17:48:40
> MDT 2020
>
> [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>
> Architecture: OpenBSD.amd64
> Machine : amd64
> >Description:
> I have PC Engines APU2 board with Sierra Wireless MC7455 LTE modem on
> mini-PCIe.
> When I cold boot the system, device is properly detected:
>
> uhub2 at uhub1 port 1 configuration 1 interface 0 "Advanced Micro Devices
> Hub" rev 2.00/0.18 addr 2
> umsm0 at uhub2 port 4 configuration 1 interface 0 "Sierra Wireless,
> Incorporated Sierra Wireless MC7455 Qualcomm\M-. Snapdragon? X7 LTE-A" rev
> 2.10/0.06 addr 3
> ucom0 at umsm0
> umsm1 at uhub2 port 4 configuration 1 interface 2 "Sierra Wireless,
> Incorporated Sierra Wireless MC7455 Qualcomm\M-. Snapdragon? X7 LTE-A" rev
> 2.10/0.06 addr 3
> ucom1 at umsm1
> umsm2 at uhub2 port 4 configuration 1 interface 3 "Sierra Wireless,
> Incorporated Sierra Wireless MC7455 Qualcomm\M-. Snapdragon? X7 LTE-A" rev
> 2.10/0.06 addr 3
> ucom2 at umsm2
> umsm3 at uhub2 port 4 configuration 1 interface 8 "Sierra Wireless,
> Incorporated Sierra Wireless MC7455 Qualcomm\M-. Snapdragon? X7 LTE-A" rev
> 2.10/0.06 addr 3
> ucom3 at umsm3
> umsm4 at uhub2 port 4 configuration 1 interface 10 "Sierra Wireless,
> Incorporated Sierra Wireless MC7455 Qualcomm\M-. Snapdragon? X7 LTE-A" rev
> 2.10/0.06 addr 3
> ucom4 at umsm4
>
> However when I reboot OpenBSD Sierra Wireless card is no longer detected by
> the OS and
> is not visible any more from the system:
>
> uhub2 at uhub1 port 1 configuration 1 interface 0 "Advanced Micro Devices
> Hub" rev 2.00/0.18 addr 2
>
> >How-To-Repeat:
> Cold boot APU2 with 1199:9071 Sierra Wireless card, then reboot the OS
> and card is missing.
>
> >Fix:
> Unknown. I've looked around and found following resources:
>
> - OpenBSD misc, broken EHCI USB on AMD chipset?
> https://marc.info/?t=151192838800001&r=1&w=2
>
> - PCI: Workaround AMD EHCI controller PME bug
> https://patchwork.kernel.org/patch/9797105/
>
> - usb: host: ehci: workaround PME bug on AMD EHCI controller
> https://patchwork.kernel.org/patch/9783041/
>
> - Linux kernel, pci_fixup_amd_ehci_pme() function
> https://github.com/torvalds/linux/blob/fc80c51fd4b23ec007e88d4c688f2cac1b8648e7/arch/x86/pci/fixup.c#L580-L593
>
> - SB700 Family Product Errata
> https://www.amd.com/system/files/TechDocs/46837.pdf
>
> - AMD SB700/710/750 Register Programming Requirements
> http://ftp.loongnix.org/doc/02data%20sheet/loongson3a/SB/42413_sb7xx_rpr_pub_1.00.pdf
>
> Unfortunately, I don't know how to apply solution from Linux code to OpenBSD
> :/
>
--
Regards,
Mikolaj