From patchwork Wed Mar 24 14:06:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1457912 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=YCAY38Rb; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F599b6H5Fz9sRR for ; Thu, 25 Mar 2021 01:10:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8D131828FE; Wed, 24 Mar 2021 15:08:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1616594896; bh=LZCrzTG0FD2aTgw5tXw7SK5yf3gZzzfTAy6c+F4Vg6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YCAY38RbCjFKEc9NcWSWG3kVsk/CfJh6QbxOrRpJ0imWEoiAk7f5ly3VryNLtkoEy wHLSObH44ryMgSi6udkgl8PEycCuYLLftRcWkWtSYM4KLFiD1ZLsIk9NKjKbpYpaU1 Z/Et7SSDoa6tFjkIp3xvHkot3Ebyhcyj1jweAqohskbT3fUf1jqWVFyxtH0LsF8okA moqixwjUNqS+/mfu/VAU24cckKpj14oXDt+nFOvkptVycL/QHRa9olP0NzGEqUMob8 ohsSRrihJe4QPjyLxAgMoZP7w6krelENE06Mwicq/Twc2Lwn8LcbW8AcNYEQ94vSNN t/Evt9H6FbshA== Received: by phobos.denx.de (Postfix, from userid 109) id 6604082873; Wed, 24 Mar 2021 15:07:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:1::465:204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AD27A82838 for ; Wed, 24 Mar 2021 15:07:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4F595y37wVzQjpF; Wed, 24 Mar 2021 15:07:02 +0100 (CET) Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id Cpn_pkOpvycw; Wed, 24 Mar 2021 15:06:59 +0100 (CET) From: Stefan Roese To: u-boot@lists.denx.de Cc: Nadav Haklai , =?utf-8?q?Pali_Roh=C3=A1r?= , Kostya Porotchkin , =?utf-8?q?Marek_Beh=C3=BAn?= , Grzegorz Jaszczyk , Igal Liberman , Baruch Siach Subject: [PATCH v1 21/23] phy: marvell: add support for SFI1 Date: Wed, 24 Mar 2021 15:06:47 +0100 Message-Id: <20210324150325.v1.21.If9176222e0080424ba67347fe4d320215b1ba0c0@changeid> In-Reply-To: <20210324140649.1413122-1-sr@denx.de> References: <20210324140649.1413122-1-sr@denx.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: X-Rspamd-Score: -0.36 / 15.00 / 15.00 X-Rspamd-Queue-Id: 5CCBB1808 X-Rspamd-UID: d99f96 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: Igal Liberman In CP115, comphy4 can be configured into SFI port1 (in addition to SFI0). This patch adds the option described above. In addition, rename all existing SFI/XFI references: COMPHY_TYPE_SFI --> COMPHY_TYPE_SFI0 No functional change for exsiting configuration. Signed-off-by: Igal Liberman Signed-off-by: Konstantin Porotchkin Signed-off-by: Stefan Roese --- arch/arm/dts/armada-7040-db.dts | 3 ++- arch/arm/dts/armada-8040-clearfog-gt-8k.dts | 4 ++-- arch/arm/dts/armada-8040-db.dts | 4 ++-- arch/arm/dts/armada-8040-mcbin.dts | 4 ++-- arch/arm/dts/armada-8040-puzzle-m801.dts | 4 ++-- arch/arm/dts/cn9130-crb-A.dts | 2 +- arch/arm/dts/cn9130-crb-B.dts | 2 +- drivers/phy/marvell/comphy_core.c | 2 +- drivers/phy/marvell/comphy_cp110.c | 14 ++++++++------ include/dt-bindings/comphy/comphy_data.h | 9 +++++---- 10 files changed, 26 insertions(+), 22 deletions(-) diff --git a/arch/arm/dts/armada-7040-db.dts b/arch/arm/dts/armada-7040-db.dts index f475fb361071..b158f9234917 100644 --- a/arch/arm/dts/armada-7040-db.dts +++ b/arch/arm/dts/armada-7040-db.dts @@ -132,7 +132,8 @@ }; phy2 { - phy-type = ; + phy-type = ; + phy-speed = ; }; phy3 { diff --git a/arch/arm/dts/armada-8040-clearfog-gt-8k.dts b/arch/arm/dts/armada-8040-clearfog-gt-8k.dts index ce5832c2fbd7..6a586dbbba12 100644 --- a/arch/arm/dts/armada-8040-clearfog-gt-8k.dts +++ b/arch/arm/dts/armada-8040-clearfog-gt-8k.dts @@ -154,7 +154,7 @@ * CP0 Serdes Configuration: * Lane 0: PCIe0 (x1) * Lane 1: Not connected - * Lane 2: SFI (10G) + * Lane 2: SFI0 (10G) * Lane 3: Not connected * Lane 4: USB 3.0 host port1 (can be PCIe) * Lane 5: Not connected @@ -166,7 +166,7 @@ phy-type = ; }; phy2 { - phy-type = ; + phy-type = ; }; phy3 { phy-type = ; diff --git a/arch/arm/dts/armada-8040-db.dts b/arch/arm/dts/armada-8040-db.dts index 1edfaab682eb..51c2f23f4dbf 100644 --- a/arch/arm/dts/armada-8040-db.dts +++ b/arch/arm/dts/armada-8040-db.dts @@ -95,7 +95,7 @@ phy-type = ; }; phy2 { - phy-type = ; + phy-type = ; }; phy3 { phy-type = ; @@ -194,7 +194,7 @@ phy-type = ; }; phy2 { - phy-type = ; + phy-type = ; }; phy3 { phy-type = ; diff --git a/arch/arm/dts/armada-8040-mcbin.dts b/arch/arm/dts/armada-8040-mcbin.dts index a6ef40138da3..218464831863 100644 --- a/arch/arm/dts/armada-8040-mcbin.dts +++ b/arch/arm/dts/armada-8040-mcbin.dts @@ -183,7 +183,7 @@ phy-type = ; }; phy4 { - phy-type = ; + phy-type = ; }; phy5 { phy-type = ; @@ -299,7 +299,7 @@ phy-type = ; }; phy4 { - phy-type = ; + phy-type = ; }; phy5 { phy-type = ; diff --git a/arch/arm/dts/armada-8040-puzzle-m801.dts b/arch/arm/dts/armada-8040-puzzle-m801.dts index 0becc4ff0d34..510fb84d5a95 100644 --- a/arch/arm/dts/armada-8040-puzzle-m801.dts +++ b/arch/arm/dts/armada-8040-puzzle-m801.dts @@ -234,7 +234,7 @@ phy-speed = ; }; phy4 { - phy-type = ; + phy-type = ; }; phy5 { phy-type = ; @@ -380,7 +380,7 @@ phy-speed = ; }; phy4 { - phy-type = ; + phy-type = ; }; phy5 { phy-type = ; diff --git a/arch/arm/dts/cn9130-crb-A.dts b/arch/arm/dts/cn9130-crb-A.dts index 5c5e0fb2eb1e..fcfcd15d8de6 100644 --- a/arch/arm/dts/cn9130-crb-A.dts +++ b/arch/arm/dts/cn9130-crb-A.dts @@ -31,7 +31,7 @@ }; phy4 { - phy-type = ; + phy-type = ; phy-speed = ; }; diff --git a/arch/arm/dts/cn9130-crb-B.dts b/arch/arm/dts/cn9130-crb-B.dts index 6041084a2c87..b681b6032d69 100644 --- a/arch/arm/dts/cn9130-crb-B.dts +++ b/arch/arm/dts/cn9130-crb-B.dts @@ -31,7 +31,7 @@ }; phy4 { - phy-type = ; + phy-type = ; phy-speed = ; }; diff --git a/drivers/phy/marvell/comphy_core.c b/drivers/phy/marvell/comphy_core.c index 929360792630..2c9d7b2288d7 100644 --- a/drivers/phy/marvell/comphy_core.c +++ b/drivers/phy/marvell/comphy_core.c @@ -41,7 +41,7 @@ static const char *get_type_string(u32 type) "UNCONNECTED", "PEX0", "PEX1", "PEX2", "PEX3", "SATA0", "SATA1", "SGMII0", "SGMII1", "SGMII2", "USB3", "USB3_HOST0", "USB3_HOST1", - "USB3_DEVICE", "RXAUI0", "RXAUI1", "SFI", "AP", + "USB3_DEVICE", "RXAUI0", "RXAUI1", "SFI0", "SFI1", "AP", "IGNORE" }; diff --git a/drivers/phy/marvell/comphy_cp110.c b/drivers/phy/marvell/comphy_cp110.c index 349109b6dc08..576538feb706 100644 --- a/drivers/phy/marvell/comphy_cp110.c +++ b/drivers/phy/marvell/comphy_cp110.c @@ -109,10 +109,11 @@ int comphy_cp110_sfi_rx_training(struct chip_serdes_phy_config *ptr_chip_cfg, u32 lane) { int ret; + u32 type = ptr_chip_cfg->comphy_map_data[lane].type; debug_enter(); - if (ptr_chip_cfg->comphy_map_data[lane].type != COMPHY_TYPE_SFI) { + if (type != COMPHY_TYPE_SFI0 && type != COMPHY_TYPE_SFI1) { pr_err("Comphy %d isn't configured to SFI\n", lane); return 0; } @@ -630,13 +631,14 @@ int comphy_cp110_init(struct chip_serdes_phy_config *ptr_chip_cfg, ptr_chip_cfg->comphy_base_addr, lane, mode); break; - case COMPHY_TYPE_SFI: - mode = COMPHY_FW_FORMAT(COMPHY_SFI_MODE, - COMPHY_UNIT_ID0, + case COMPHY_TYPE_SFI0: + case COMPHY_TYPE_SFI1: + /* Calculate SFI id */ + id = ptr_comphy_map->type - COMPHY_TYPE_SFI0; + mode = COMPHY_FW_FORMAT(COMPHY_SFI_MODE, id, ptr_comphy_map->speed); ret = comphy_smc(MV_SIP_COMPHY_POWER_ON, - ptr_chip_cfg->comphy_base_addr, lane, - mode); + ptr_chip_cfg->comphy_base_addr, lane, mode); break; case COMPHY_TYPE_RXAUI0: case COMPHY_TYPE_RXAUI1: diff --git a/include/dt-bindings/comphy/comphy_data.h b/include/dt-bindings/comphy/comphy_data.h index 8e9270598924..8353a7874050 100644 --- a/include/dt-bindings/comphy/comphy_data.h +++ b/include/dt-bindings/comphy/comphy_data.h @@ -32,10 +32,11 @@ #define COMPHY_TYPE_USB3_DEVICE 13 #define COMPHY_TYPE_RXAUI0 14 #define COMPHY_TYPE_RXAUI1 15 -#define COMPHY_TYPE_SFI 16 -#define COMPHY_TYPE_AP 17 -#define COMPHY_TYPE_IGNORE 18 -#define COMPHY_TYPE_MAX 19 +#define COMPHY_TYPE_SFI0 16 +#define COMPHY_TYPE_SFI1 17 +#define COMPHY_TYPE_AP 18 +#define COMPHY_TYPE_IGNORE 19 +#define COMPHY_TYPE_MAX 20 #define COMPHY_TYPE_INVALID 0xff #define COMPHY_POLARITY_NO_INVERT 0