From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D16DC433F5 for ; Wed, 2 Mar 2022 11:49:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6ADAD83CAE; Wed, 2 Mar 2022 12:49:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="DQ0Uf37/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9BC7C83CA5; Wed, 2 Mar 2022 12:49:38 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 29F1883BCA for ; Wed, 2 Mar 2022 12:49:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4821561864; Wed, 2 Mar 2022 11:49:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CB33C004E1; Wed, 2 Mar 2022 11:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646221772; bh=s1UZvCpwe/4eD783CVrTZTdKcqL45zt2wEUyTs9/5+E=; h=From:To:Cc:Subject:Date:From; b=DQ0Uf37/zVGbvj0MegRt4gJO7iw4ncpD3bk2YzQtnfe5a/Tf8rLsohrNW0lKLULdm vsZA6/RLOxaztde0H9IOXrCn6D0MOgHXatXYEn1pR4SiW0i9dN+8S9/ygJI2Lwgz46 0tsvy2qOycdKm7hKTtHSx9WDqyuq0Ojywbel7I2xdL222ere0jtKKm4vcwQvdSaTBQ O8sXV4w/cKe6ntxq9f9acfwIJf1TONtKPFSUKGIofit7lFHHBOWvUmAc9A9dsDyLQq q3eVwouET5tIRHQ1mnBEgUvm0CLF/c10vUzrS8Q+RCgNLDhFEPnfWOgobMnTNOy6aY c22NlF/gMuMcg== Received: by pali.im (Postfix) id 8D41A677; Wed, 2 Mar 2022 12:49:29 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , =?UTF-8?q?Marek=20Beh=C3=BAn?= Cc: u-boot@lists.denx.de Subject: [PATCH u-boot-marvell 0/8] Turris Omnia: Add support for configuring mSATA and WWAN slots via env variables Date: Wed, 2 Mar 2022 12:47:50 +0100 Message-Id: <20220302114758.21787-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Some mPCIe cards are broken and their PIN 43 incorrectly that card is mSATA. U-Boot SPL on Turris Omnia is using PIN 43 for configuring PCIe vs SATA functionality on SerDes. Allow to configure functionality via additional env variable "omnia_msata_slot" which may override PIN 43. To force PCIe mode for broken MiniPCIe cards, call U-Boot commands: => setenv omnia_msata_slot pcie => saveenv => reset PCI-SIG in PCIe Mini CEM 2.1 spec added support for USB3.0 mode to mPCIe cards. PCIe and USB3.0 functions share same pins (like SATA pins on mSATA with PCIe on mPCIe) and therefore only one function may be active at the same time. This mode was introduced by PCI-SIG specially for LTE/5G modems. One mPCIe slot on Turris Omnia is connected to A385 CPU SerDes which can be configured for PCIe or USB3.0 function. It is the slot with SIM card suitable for cellular modems. As PCIe Mini CEM 2.1 spec say that detection of PCIe vs USB3.0 functionality is platform specific, add a new U-Boot variable "omnia_wwan_slot" for configuring functionality in this slot. By default PCIe is used like before. To set this WWAN slot to USB3.0 mode, call U-Boot commands: => setenv omnia_wwan_slot usb3 => saveenv => reset Pali Rohár (8): env: sf: Allow to use env_sf_init_addr() at any stage arm: mvebu: turris_omnia: Provide env_sf_get_env_addr() function arm: mvebu: turris_omnia: Enable ENV support in SPL arm: mvebu: turris_omnia: Define only one serdes map variable arm: mvebu: turris_omnia: Allow to configure mSATA slot via env variable arm: mvebu: turris_omnia: Extract code for disabling sata/pcie arm: mvebu: turris_omnia: Signal error when sata/pcie DT mode arm: mvebu: turris_omnia: Add support for USB3.0 mode in WWAN MiniPCIe slot board/CZ.NIC/turris_omnia/turris_omnia.c | 207 +++++++++++++++++------ configs/turris_omnia_defconfig | 1 + env/sf.c | 22 +-- 3 files changed, 163 insertions(+), 67 deletions(-) -- 2.20.1