arm: mvebu: turris_omnia: Add support for USB3.0 mode in WWAN MiniPCIe slot
authorPali Rohár <pali@kernel.org>
Wed, 2 Mar 2022 11:47:58 +0000 (12:47 +0100)
committerStefan Roese <sr@denx.de>
Mon, 2 May 2022 05:28:25 +0000 (07:28 +0200)
commit73c7db73e8f1a1e6ea59f0e5bdd8e825792eb41c
tree48d33d927411aef17278acdd69ed0afeb2565ec4
parent72a9dd264c15e287ac5168d387cfa77710d22982
arm: mvebu: turris_omnia: Add support for USB3.0 mode in WWAN MiniPCIe slot

PCIe Mini CEM 2.1 spec added support for USB3.0 mode on MiniPCIe cards.
USB3.0 and PCIe share same pins and only one function can be active at the
same time. PCIe Mini CEM 2.1 spec says that determining function is
platform specific and spec does not define any dedicated pin which could
say if card is USB3.0-based or PCIe-based.

Implement this platform specific decision (USB3.0 vs PCIe) for WWAN
MiniPCIe slot on Turris Omnia via U-Boot env variable "omnia_wwan_slot",
similarly like is implemented forced mode for MiniPCIe/mSATA slot via
"omnia_msata_slot" env variable. Value "usb3" for "omnia_wwan_slot" would
mean to set USB3.0 mode and value "pcie" original PCIe mode.

A385 SoC on Turris Omnia has configurable fifth SerDes line (exported to
MiniPCIe WWAN slot with SIM card) either to USB3.0 or PCIe functionality,
so implementation of this new PCIe Mini CEM 2.1 feature is simple, by just
configuring SerDes to USB 3.0 mode.

Other twos MiniPCIe slots on Turris Omnia do not have this new
functionality as their SerDes lines cannot be switched to USB3.0
functionality.

Note that A385 SoC does not have too many USB3.0 blocks, so activating
USB3.0 in MiniPCIe cause that one external USB3.0 USB-A port would loose
USB3.0 functionality and would be downgraded just to USB2.0.

By default this MiniPCIe WWAN slot is in PCIe mode, like before.

To set this MiniPCIe WWAN slot to USB3.0 mode, call U-Boot commands:

  => setenv omnia_wwan_slot usb3
  => saveenv
  => reset

Signed-off-by: Pali Rohár <pali@kernel.org>
board/CZ.NIC/turris_omnia/turris_omnia.c