From patchwork Wed Oct 16 11:31:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 176465 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp7234064ill; Wed, 16 Oct 2019 04:32:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxb/MBTHBa3bY2c7/nd3vYbIgSf7Qt7sjrx1iwPGerdKhNM0SizCaKvFylIo/Ed7BEwufqB X-Received: by 2002:aa7:c959:: with SMTP id h25mr38726352edt.216.1571225538886; Wed, 16 Oct 2019 04:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571225538; cv=none; d=google.com; s=arc-20160816; b=Ue5lUlIac+WfqRA4hNYIJsUG+JYiXK7PyqJGlC7uyeIrfnKtOaVQD5WIbRN+uf1neu 3Vn8k1D2Hs0ZJEvrWwiZ9J+meHeCpxw8WYKWRyHCGHszt/C9wNwx9kzJHSfeQlXu2haJ 6fO5h3IthhKFP6IwHq/gbUKby7KcVBu+e6dcyPkpl9Nt+ewVWHN8bCG2M+btAUiPANk0 PMDBBLnKAuj8qfZvjuAnXuY5IuE/oH3uZUKHHINy/6chD5v/3nuGZmqnfvxSrKNTwNEi Ihf1Rvjq+Acr/MvmRobP8y+/ufjPpUHVBx3XVi8fBjWx/6oMTByx1wHkIG36bed4mceZ Hj0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=0wNKaASInt1k8YuOc3I1egQn9FpeL+eFcyUOwrqISs4=; b=cY1VWWfe0A5pckL3UGl7HneyJIcY7i104ZGqO24SXo/c22x2cjRLJwikFtiFX7n0dZ tWKuLurtXOqM+uTymQholFEHyUl2z5lXAWH88R1Ewd3ZiHNNBK2hu9ymOL8kCuC5Foxf +zNx7wvyql99shcuDOymcARg4BQic7uaR4X0uiHi16CQ0XWcV48xiSD9qdQ5G3KYYZV3 njgZGG7oeqoXY+UyEhENNJlMbArjuFt5thMlzOW1GuVDgF8MSyfbA3DewNs0xmDT/Z3w QNSSIBRha7urq3xJsqprdi8HnJnHAtOPPTJBs2OKnPumPuzopb8kF+RNwYUA3SvAr56P y7nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lD4nJLSA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6si17083687edm.316.2019.10.16.04.32.18; Wed, 16 Oct 2019 04:32:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lD4nJLSA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405082AbfJPLcP (ORCPT + 26 others); Wed, 16 Oct 2019 07:32:15 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:50376 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405061AbfJPLcO (ORCPT ); Wed, 16 Oct 2019 07:32:14 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9GBWCi1097204; Wed, 16 Oct 2019 06:32:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571225532; bh=0wNKaASInt1k8YuOc3I1egQn9FpeL+eFcyUOwrqISs4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=lD4nJLSAoj2O/iX0oyUT3qrcugpojM4Zbk/iUS6inDn9tfNBiRDPraw0nU/rkXfW4 LXJsUsk6SP23vzfc6y+FYrczhvAUABSE3uvEDLHVVvKB9XmBYxneHWrU3xSD0zeF0x VR9gEDYqYqzwAd5uSrLIU/CClwwHfrsSHPuAQGjU= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9GBWCGP114125 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 16 Oct 2019 06:32:12 -0500 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 16 Oct 2019 06:32:05 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 16 Oct 2019 06:32:12 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9GBVkmE097485; Wed, 16 Oct 2019 06:32:10 -0500 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Roger Quadros , Jyri Sarha CC: Anil Varughese , , Subject: [PATCH 10/13] phy: cadence: Sierra: Change MAX_LANES of Sierra to 16 Date: Wed, 16 Oct 2019 17:01:14 +0530 Message-ID: <20191016113117.12370-11-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191016113117.12370-1-kishon@ti.com> References: <20191016113117.12370-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sierra SERDES IP supports upto 16 lanes (though not all of it will be enabled in a platform). Allow Sierra driver to support a maximum of upto 16 lanes. Signed-off-by: Kishon Vijay Abraham I --- drivers/phy/cadence/phy-cadence-sierra.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 82f7617b2dac..dd54a0ab89b7 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -139,7 +139,7 @@ #define SIERRA_PHY_PLL_CFG 0xe #define SIERRA_MACRO_ID 0x00007364 -#define SIERRA_MAX_LANES 4 +#define SIERRA_MAX_LANES 16 #define PLL_LOCK_TIME 100000 static const struct reg_field macro_id_type = @@ -197,6 +197,7 @@ struct cdns_sierra_phy { struct regmap_field *pllctrl_lock[SIERRA_MAX_LANES]; struct clk *clk; int nsubnodes; + u32 num_lanes; bool autoconf; }; @@ -233,6 +234,18 @@ static struct regmap_config cdns_sierra_lane_cdb_config[] = { SIERRA_LANE_CDB_REGMAP_CONF("1"), SIERRA_LANE_CDB_REGMAP_CONF("2"), SIERRA_LANE_CDB_REGMAP_CONF("3"), + SIERRA_LANE_CDB_REGMAP_CONF("4"), + SIERRA_LANE_CDB_REGMAP_CONF("5"), + SIERRA_LANE_CDB_REGMAP_CONF("6"), + SIERRA_LANE_CDB_REGMAP_CONF("7"), + SIERRA_LANE_CDB_REGMAP_CONF("8"), + SIERRA_LANE_CDB_REGMAP_CONF("9"), + SIERRA_LANE_CDB_REGMAP_CONF("10"), + SIERRA_LANE_CDB_REGMAP_CONF("11"), + SIERRA_LANE_CDB_REGMAP_CONF("12"), + SIERRA_LANE_CDB_REGMAP_CONF("13"), + SIERRA_LANE_CDB_REGMAP_CONF("14"), + SIERRA_LANE_CDB_REGMAP_CONF("15"), }; static struct regmap_config cdns_sierra_common_cdb_config = { @@ -546,6 +559,8 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) } } + sp->num_lanes += sp->phys[node].num_lanes; + gphy = devm_phy_create(dev, child, &ops); if (IS_ERR(gphy)) { @@ -559,6 +574,11 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) } sp->nsubnodes = node; + if (sp->num_lanes > SIERRA_MAX_LANES) { + dev_err(dev, "Invalid lane configuration\n"); + goto put_child2; + } + /* If more than one subnode, configure the PHY as multilink */ if (!sp->autoconf && sp->nsubnodes > 1) regmap_field_write(sp->phy_pll_cfg_1, 0x1);