Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1268431ybg; Wed, 23 Oct 2019 13:03:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVYwH8obLyrqdcjyITS+TPhxfQFSRvLoBQij6zNsVDgWsZEWsZDlbtGoZAwIwgPpSXsrWy X-Received: by 2002:a05:6402:794:: with SMTP id d20mr40481871edy.240.1571861003851; Wed, 23 Oct 2019 13:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571861003; cv=none; d=google.com; s=arc-20160816; b=pZkQpYe1VKkGRvJJMqTYpA8TIrB99YNUG7BTUEDRFKvP4cX7TsQhhr1QhhYH1Tj7GK 8qUasmnqfA+derGgfOUyjqU3N3QPDYkodJ7H2tC63mkdndel9ZCpHmc6nNuS3SML64Dh bcXwiJ/T7SqikXWg0FHBbu+oWwCnESa/5gZ+3GyRP2WQUZiyWMKRj/hyCvi7468TSyuw WfTy2RwP9pENevccnk4dZKOhKwgNFTk9ylmxd0IsXQbKHBCV5HdKIKBrJKB7+upmdgqu Lj1C29Qi019s26zIAtK2rk4hvTnH3Mx7XxtJ/a79S+ULl/toA1ki3P5UmqLeiT0qPbnM FKhQ== 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=0YJDlY3wagJFmMY5tpnsaRFvcgMBf07B547mOAUNBAOahLJ2qrUECNiF8y9dGtZDJW Cc+BwM2BwIjOcdAbGIfmYDx/atjPEU2ytlf0COKkeHVjm7gRmkLaWFHln0CfwG8UGUAN Y1yQ4RMbVl3gV0dUkgizjKflWb7B7VTzLtdL7QjtOL3gaFO+1Lq0hKiksNV/1Vk6rL7G /7oUrz2XPJJK07SjtiHW7ATnHiERHRhgh7evMHzbxABIn+gWlEfQA/z5OlPrZl/9ajjI 66LV0cSps60A9Z8nO7aL9EC7bIONFPgt2YhKO6U9wbPR8aVjJmxGdgvEe9NIWeHWCCqW +K9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=l1JQE5C3; 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 17si12824034ejt.431.2019.10.23.13.02.55; Wed, 23 Oct 2019 13:03:23 -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=l1JQE5C3; 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 S2405455AbfJWM6i (ORCPT + 99 others); Wed, 23 Oct 2019 08:58:38 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:59294 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405427AbfJWM6f (ORCPT ); Wed, 23 Oct 2019 08:58:35 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9NCwWd7048082; Wed, 23 Oct 2019 07:58:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571835512; bh=0wNKaASInt1k8YuOc3I1egQn9FpeL+eFcyUOwrqISs4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=l1JQE5C3aWW7yVYhShj9uouFzz3QI0VDPiY6VYGUB57V5WOYTxX0jGVo02szOJcI9 95HaIJh5MtOHg7Q3NNJojoyqgUDT/AGaBJ5UNYXXOlXRn/u6XO07smeZQKNare4Su7 C7UIGcuR+0FSf7swN7CiPQL/8FPrn6y+XDsMugm8= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9NCwWOA070367 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 23 Oct 2019 07:58:32 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 23 Oct 2019 07:58:22 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE108.ent.ti.com (157.170.170.38) 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, 23 Oct 2019 07:58:22 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9NCw5oE061147; Wed, 23 Oct 2019 07:58:30 -0500 From: Kishon Vijay Abraham I To: Rob Herring , Kishon Vijay Abraham I , Roger Quadros , Jyri Sarha CC: Anil Varughese , , Subject: [PATCH v2 10/14] phy: cadence: Sierra: Change MAX_LANES of Sierra to 16 Date: Wed, 23 Oct 2019 18:27:31 +0530 Message-ID: <20191023125735.4713-11-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023125735.4713-1-kishon@ti.com> References: <20191023125735.4713-1-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain 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(-) 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); -- 2.17.1