From patchwork Sat Jun 1 10:45:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 165566 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1969735ili; Sat, 1 Jun 2019 03:46:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxF4LOQ1MrUqMB4Xba2hoFaotn+LjvBlqS4JdceOr3hju3KAiDu2LYXKRtIfFbJ5bYs7DF X-Received: by 2002:aa7:864e:: with SMTP id a14mr16389172pfo.132.1559385966636; Sat, 01 Jun 2019 03:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559385966; cv=none; d=google.com; s=arc-20160816; b=o2YJ9WQjJM6IdzY/3YgpUk47Rlcx7h+/hlVjkCjvMR5fxYkJl6DyX5dJ69ShvgD2jP PObAluUujZ3p736G+DjQYyYXNIiFIiPp177qW0ecEBn+JXIcslmuE5ABwSmLrF6AOYEb QVKya1za9uAHk3Z5+EpWhDbHmsm8EbTIqQIwzrkWqfeG8awWQvSMLfdFq4s5w39qj2Xj X0i+OWN3vrb9/Vm5UYeXCCKvAqmjd0wcqeI6G6VfiPvkpFqE0icg6iO0r4kzsnoCKwjk LzESh2mG5C2KN9l9Vh3jYM8T+doao5UZDquldUUYHLfFLNLiLgsWOdimhk7i341RO7a6 pvRA== 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=L7uklZmMbV0m9TN5brUsgpv6/7OEksAfjjG7mTgS2po=; b=kQ01JOlMUYNZP4RrlDo0hy9qBL96Y8HOpDIwqq4sZgX3+AcMNZmSJu58x2Vjtxra9G TmYAv3rLt2X7MMEPgpFnP4XOJWR2Frehy3b3CKGOT6mpeO9LyCUggV20HJ4OlCP45JGC NqTz+k9UJ3WiZ8nxuG3JMvaKHQc0PvCKrfq9y7GSkIzoWSmw94y9agaVl30pK5VB1oVW iGmemRSjabzyBLPoDvj1lCZ5TlH4IIlkH3GOov4QHAUkQv4rl6OJzgAHcXhAdGtU5WTD EKCwGE8SeVyyI4R6YYITYMcrPdMIb6kAVL7p9m5zsVMWpcX75t1tVQKFgfN1+6JokkMT qRkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=zUlLODtl; 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 j19si11144868pfd.189.2019.06.01.03.46.06; Sat, 01 Jun 2019 03:46:06 -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=zUlLODtl; 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 S1727221AbfFAKqF (ORCPT + 30 others); Sat, 1 Jun 2019 06:46:05 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:43796 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbfFAKqD (ORCPT ); Sat, 1 Jun 2019 06:46:03 -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 x51AjxK0017225; Sat, 1 Jun 2019 05:45:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559385959; bh=L7uklZmMbV0m9TN5brUsgpv6/7OEksAfjjG7mTgS2po=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=zUlLODtlwrtkBzEg1UaoQcBZkx1PSOlplIMd92dinK+oFyttTDAESpgBnPHFimpBn 9wjDPfpSMdqhEwyxVXIuPOapty7euJdaJ8SW9yVNDvOPpoJmNyKb5aCS4oS5gHnjns 19X8ga1D0laiY53jnEZk1paKpC9urIkpDVper4N0= 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 x51Ajwwt022721 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 1 Jun 2019 05:45:59 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) 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; Sat, 1 Jun 2019 05:45:58 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE101.ent.ti.com (157.170.170.31) 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; Sat, 1 Jun 2019 05:45:58 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x51AjvrX127852; Sat, 1 Jun 2019 05:45:58 -0500 From: Grygorii Strashko To: "David S. Miller" , Santosh Shilimkar , Richard Cochran , Rob Herring CC: Sekhar Nori , Murali Karicheri , Wingman Kwok , , , , , Grygorii Strashko Subject: [PATCH net-next 02/10] net: ethernet: ti: cpts: use devm_get_clk_from_child Date: Sat, 1 Jun 2019 13:45:26 +0300 Message-ID: <20190601104534.25790-3-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190601104534.25790-1-grygorii.strashko@ti.com> References: <20190601104534.25790-1-grygorii.strashko@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 Use devm_get_clk_from_child() instead of devm_clk_get() and this way allow to group CPTS DT properties in sub-node for better code readability and maintenance. Roll-back to devm_clk_get() if devm_get_clk_from_child() fails for backward compatibility. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpts.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c index e257018ada71..0e79f9743c19 100644 --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c @@ -572,9 +572,14 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs, if (ret) return ERR_PTR(ret); - cpts->refclk = devm_clk_get(dev, "cpts"); + cpts->refclk = devm_get_clk_from_child(dev, node, "cpts"); + if (IS_ERR(cpts->refclk)) + /* try get clk from dev node for compatibility */ + cpts->refclk = devm_clk_get(dev, "cpts"); + if (IS_ERR(cpts->refclk)) { - dev_err(dev, "Failed to get cpts refclk\n"); + dev_err(dev, "Failed to get cpts refclk %ld\n", + PTR_ERR(cpts->refclk)); return ERR_CAST(cpts->refclk); } From patchwork Sat Jun 1 10:45:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 165568 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1970117ili; Sat, 1 Jun 2019 03:46:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS3NUKR9sh3LTQ+C/aN7EJSw4/hGcQsuF/D0RbrYbqkTvLOxcboeRp1AmLTXQKb0rC9AMM X-Received: by 2002:a62:34c3:: with SMTP id b186mr356460pfa.201.1559385991544; Sat, 01 Jun 2019 03:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559385991; cv=none; d=google.com; s=arc-20160816; b=hToLsrhO86c/D21BR/5wUuJy0N3gG1TN51d5ApTQCCUS0GqyLXQI7b7aZLINR6zVzA pKuYwr9zFczc0LeK8onMawjWlGq126wkLbC2hUeDm0HFfJnYFPHmLpSzDwuDZIDecnTm sfEk5aCsHbOQqew2xWirrFD4jOZr9nxBwKJ6dPd/6eqPzv3Hfv2ayH3PNjDo0O8EKZZy 432QvxH0YUJmOR+yH+MFyFO62z8jggkMCLQCTpEIVM2rjKITpff1Upk1EmcnIJ8Bzol3 eagkqvRlBk3bBisYwoFdLmDZu/Lf5q96tuIrxUR9p2xFnVNvZ2c0f/gHUqf6dAk5arw3 t4fw== 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=BJWt2Gvc7QpU0VaGfTOe51Gq7OLN9SWlxXnnfBBg1Ck=; b=He8hxUrJNcu/zxw4KHs/Jc5gWIaUInnOBFhH3PnYuU9H708PE+NkOOGH0+Ll6YLdqs DdStfsVLXJTp/BZEoJIlOKZudaWv0Cd2GPs+YCWYfN9FeKYJ4soJBVcCjUiMgXUcaQjs hpCXHxDJRT14uXXHeboy2xTxN1EmYSB+Pdc5xzXncnp1DfQlpmiFPn3Xx3o3lijPkZAY EM5vskDgF5Fy01NQqZmdLRkY5u4Ic9N4FiN6z9kcRIyGeT7Cj1WN1bRCRrgqsHYq9sMM 2LT8Q1lrO9WsJwz52b2nKZ+WFhropwl6UeeqaNqCKqdtHWEL3BpiCBpaGrjJ6DLFQGQ6 Rd6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="OeZ/Lw12"; 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 e39si3497052plg.103.2019.06.01.03.46.31; Sat, 01 Jun 2019 03:46:31 -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="OeZ/Lw12"; 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 S1727295AbfFAKqa (ORCPT + 30 others); Sat, 1 Jun 2019 06:46:30 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:43834 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbfFAKq2 (ORCPT ); Sat, 1 Jun 2019 06:46:28 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x51AkDxi017310; Sat, 1 Jun 2019 05:46:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559385973; bh=BJWt2Gvc7QpU0VaGfTOe51Gq7OLN9SWlxXnnfBBg1Ck=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=OeZ/Lw127zwMqtQc+InsTr4oKs1m0Pkr9pFGvIUAVLekxSP9raW0nc6ntmk0kNqv+ 9yljPNDNMOD74aDcyV/rsYjlRYO6SiIgIOFYkCYVKeKw+pi/h+jRToJHRHfl6nxOQq 9BrPIKN7Qx6eaHQ9Twsn4zg+XpOsEn69405cmqwc= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x51AkDvt026493 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 1 Jun 2019 05:46:13 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Sat, 1 Jun 2019 05:46:13 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE112.ent.ti.com (157.170.170.23) 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; Sat, 1 Jun 2019 05:46:13 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x51AkC1S051947; Sat, 1 Jun 2019 05:46:12 -0500 From: Grygorii Strashko To: "David S. Miller" , Santosh Shilimkar , Richard Cochran , Rob Herring CC: Sekhar Nori , Murali Karicheri , Wingman Kwok , , , , , Grygorii Strashko Subject: [PATCH net-next 04/10] net: ethernet: ti: cpts: add support for rftclk selection Date: Sat, 1 Jun 2019 13:45:28 +0300 Message-ID: <20190601104534.25790-5-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190601104534.25790-1-grygorii.strashko@ti.com> References: <20190601104534.25790-1-grygorii.strashko@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 Some CPTS instances, which can be found on KeyStone 2 1G Ethernet Switch Subsystems, can control an external multiplexer that selects one of up to 32 clocks as time sync reference (RFTCLK) clock. This feature can be configured through CPTS_RFTCLK_SEL register (offset: x08) in CPTS module and can be represented as multiplexer clock. Hence, introduce support for optional cpts-refclk-mux clock, which, once defined will allow to select required CPTS RFTCLK by using assigned-clock-parents DT property in board files. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpts.c | 79 +++++++++++++++++++++++++++++++++- drivers/net/ethernet/ti/cpts.h | 2 +- 2 files changed, 79 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c index 0e79f9743c19..1f67b25d7932 100644 --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c @@ -5,6 +5,7 @@ * Copyright (C) 2012 Richard Cochran * */ +#include #include #include #include @@ -532,6 +533,82 @@ static void cpts_calc_mult_shift(struct cpts *cpts) freq, cpts->cc.mult, cpts->cc.shift, (ns - NSEC_PER_SEC)); } +static int cpts_of_mux_clk_setup(struct cpts *cpts, struct device_node *node) +{ + unsigned int num_parents; + const char **parent_names; + struct device_node *refclk_np; + struct clk_hw *clk_hw; + u32 *mux_table; + int ret = -EINVAL; + + refclk_np = of_get_child_by_name(node, "cpts-refclk-mux"); + if (!refclk_np) + /* refclk selection supported not for all SoCs */ + return 0; + + num_parents = of_clk_get_parent_count(refclk_np); + if (num_parents < 1) { + dev_err(cpts->dev, "mux-clock %s must have parents\n", + refclk_np->name); + goto mux_fail; + } + + parent_names = devm_kzalloc(cpts->dev, (sizeof(char *) * num_parents), + GFP_KERNEL); + + mux_table = devm_kzalloc(cpts->dev, sizeof(*mux_table) * num_parents, + GFP_KERNEL); + if (!mux_table || !parent_names) { + ret = -ENOMEM; + goto mux_fail; + } + + of_clk_parent_fill(refclk_np, parent_names, num_parents); + + ret = of_property_read_variable_u32_array(refclk_np, "ti,mux-tbl", + mux_table, + num_parents, num_parents); + if (ret < 0) + goto mux_fail; + + clk_hw = clk_hw_register_mux_table(cpts->dev, refclk_np->name, + parent_names, num_parents, + 0, + &cpts->reg->rftclk_sel, 0, 0x1F, + 0, mux_table, NULL); + if (IS_ERR(clk_hw)) { + ret = PTR_ERR(clk_hw); + goto mux_fail; + } + + ret = devm_add_action_or_reset(cpts->dev, + (void(*)(void *))clk_hw_unregister_mux, + clk_hw); + if (ret) { + dev_err(cpts->dev, "add clkmux unreg action %d", ret); + goto mux_fail; + } + + ret = of_clk_add_hw_provider(refclk_np, of_clk_hw_simple_get, clk_hw); + if (ret) + goto mux_fail; + + ret = devm_add_action_or_reset(cpts->dev, + (void(*)(void *))of_clk_del_provider, + refclk_np); + if (ret) { + dev_err(cpts->dev, "add clkmux provider unreg action %d", ret); + goto mux_fail; + } + + return ret; + +mux_fail: + of_node_put(refclk_np); + return ret; +} + static int cpts_of_parse(struct cpts *cpts, struct device_node *node) { int ret = -EINVAL; @@ -547,7 +624,7 @@ static int cpts_of_parse(struct cpts *cpts, struct device_node *node) (!cpts->cc.mult && cpts->cc.shift)) goto of_error; - return 0; + return cpts_of_mux_clk_setup(cpts, node); of_error: dev_err(cpts->dev, "CPTS: Missing property in the DT.\n"); diff --git a/drivers/net/ethernet/ti/cpts.h b/drivers/net/ethernet/ti/cpts.h index 024aab6af12f..bb997c11ee15 100644 --- a/drivers/net/ethernet/ti/cpts.h +++ b/drivers/net/ethernet/ti/cpts.h @@ -24,7 +24,7 @@ struct cpsw_cpts { u32 idver; /* Identification and version */ u32 control; /* Time sync control */ - u32 res1; + u32 rftclk_sel; /* Reference Clock Select Register */ u32 ts_push; /* Time stamp event push */ u32 ts_load_val; /* Time stamp load value */ u32 ts_load_en; /* Time stamp load enable */ From patchwork Sat Jun 1 10:45:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 165569 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1970222ili; Sat, 1 Jun 2019 03:46:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiGBvZPCB3/k9i3gyl9kTAkvf5sL3GtqEbBI1dGGeprnZxOAhfAckfJlqyANPb9AGNqCfP X-Received: by 2002:a17:902:f082:: with SMTP id go2mr15595528plb.279.1559385999169; Sat, 01 Jun 2019 03:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559385999; cv=none; d=google.com; s=arc-20160816; b=zp3DELQuKEN/FAcxF0K9cVc5y33YqEhE+kpA5gdkHu1PhP9v+kbzP8sl6DawMHJyMs JgSdr+6wkdOjPz1BJ/c5ABUsyrN0mNQg3LOgKREJ5zswO17HYOJab8pmOykyRGr81ABT Oj+/44oGIMg34F6DkMyYf9vHUGbAtdMUcv9HWsN6/+xZv1Fg61aJfVqu5eWR5rQ4JzGn vu2Kt3GI8dZrHS3BJh4qdHryvswMmypAoHU6KpQw/ljqXVkvcBmk3LcJ0nkgHywRyHR+ +NzhYfQRZAJvLz2GmViCO967aeSwCjLck0G8WCqHvE6yVrGYJ6X2ALbXZw2JkOTtWPN8 Asqg== 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=Z3348jTxSQPyURwc46vrJOUi9hMLdEHin3sWtU/Y7iY=; b=eMatHIrTbnAxrSCLYtN5OYFuDXcHlgOFuFXDWg90CgneFhFctzgRCW9lW1R1/tHtXh gJmznsFS+8NzBjjnL69UR9cWyfxmrK0BzENln8uo1z4/RoZjeHTKWIm70YIIJNrAOstv wVNdNRC+MDvpygFno6QxbI3kkF/4OGGNt9y3uPIih6FH2bwOxwmpmTCMlUpi2gpfvFGg fxWU17Iwz7/DUI7ioG4KFVU7VT9SnTM9Ggce0C6n9visTAt8wd4KfFZ4I1umy2mES5pJ cwI7MHCo/6VabemEnSjHYbdiiwVVeb/uyAjOlmPcDkgcb9ywwKGqMKxtlfKyrSUpH96Z ev/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=c5zXDeuW; 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 15si9343397pgk.227.2019.06.01.03.46.38; Sat, 01 Jun 2019 03:46:39 -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=c5zXDeuW; 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 S1727331AbfFAKqh (ORCPT + 30 others); Sat, 1 Jun 2019 06:46:37 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:36336 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbfFAKqe (ORCPT ); Sat, 1 Jun 2019 06:46:34 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x51AkLOd092075; Sat, 1 Jun 2019 05:46:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559385981; bh=Z3348jTxSQPyURwc46vrJOUi9hMLdEHin3sWtU/Y7iY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=c5zXDeuWj1HgCV3eSHncr2UCDRotKVZJPwmkjAbv6KppEe3wmUWZAmARuSzy1ME05 uJFEtAfikKZN4uvhphZXeVziN6Ic2ffrzbxaaMCJitSIXZhCa8GWzhFotEZIxpJyZl xhEEMJ1J+0msgPmVGT2jsSfGrAb8u0e7k9+wSfAI= 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 x51AkKfb023307 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 1 Jun 2019 05:46:20 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) 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; Sat, 1 Jun 2019 05:46:20 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE106.ent.ti.com (157.170.170.36) 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; Sat, 1 Jun 2019 05:46:20 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x51AkJN7077632; Sat, 1 Jun 2019 05:46:20 -0500 From: Grygorii Strashko To: "David S. Miller" , Santosh Shilimkar , Richard Cochran , Rob Herring CC: Sekhar Nori , Murali Karicheri , Wingman Kwok , , , , , Grygorii Strashko Subject: [PATCH net-next 05/10] ARM: dts: keystone-clocks: add input fixed clocks Date: Sat, 1 Jun 2019 13:45:29 +0300 Message-ID: <20190601104534.25790-6-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190601104534.25790-1-grygorii.strashko@ti.com> References: <20190601104534.25790-1-grygorii.strashko@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 Add set of fixed, external input clocks definitions for TIMI0, TIMI1, TSREFCLK clocks. Such clocks can be used as reference clocks for some HW modules (as cpts, for example) by configuring corresponding clock muxes. For these clocks real frequencies have to be defined in board files. Signed-off-by: Grygorii Strashko --- arch/arm/boot/dts/keystone-clocks.dtsi | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) -- 2.17.1 diff --git a/arch/arm/boot/dts/keystone-clocks.dtsi b/arch/arm/boot/dts/keystone-clocks.dtsi index 457515b0736a..0397c3423d2d 100644 --- a/arch/arm/boot/dts/keystone-clocks.dtsi +++ b/arch/arm/boot/dts/keystone-clocks.dtsi @@ -408,4 +408,31 @@ clocks { reg-names = "control", "domain"; domain-id = <0>; }; + + /* + * Below are set of fixed, input clocks definitions, + * for which real frequencies have to be defined in board files. + * Those clocks can be used as reference clocks for some HW modules + * (as cpts, for example) by configuring corresponding clock muxes. + */ + timi0: timi0 { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; + clock-output-names = "timi0"; + }; + + timi1: timi1 { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; + clock-output-names = "timi1"; + }; + + tsrefclk: tsrefclk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; + clock-output-names = "tsrefclk"; + }; }; From patchwork Sat Jun 1 10:45:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 165570 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1970267ili; Sat, 1 Jun 2019 03:46:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7A/59JD33menT1pDav498mNWUpDH6Qjg8yOc4gLTrOPnRPc1GcDExzBEeG12sOra5YrdR X-Received: by 2002:a17:902:8c82:: with SMTP id t2mr15291855plo.256.1559386001773; Sat, 01 Jun 2019 03:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559386001; cv=none; d=google.com; s=arc-20160816; b=M+HBDTaLT94F+4IuqLoBwrtj+YRRW1FYcD/b0S5/s5vtm60xAnw/xiIHVxEOfvs1oO XUsRUw3NMGtaIhSII48TXNxYfFHrHNobchGF3X0OcJE7HTv/0gLH8hSNctXadFIyCjG0 gKhhAYqfjjXf1gdxzT9AEukUpLK/gzI1UpIfxGZvBVstVlO94TSejv/+J9c70xHSK9xw CFdvTpw7EQT0CO94Y81QZPhhY/PORmTuEeiP4BPJoAfPAdywvfZDlWxdNj06q0DmMxCa N/AQyEsJsg3PBE0tSFzSZhTHUyQ0g7rRDovJmsQx7F5wsX8UaYsAlBGsvDrUKLmTnGkT USNw== 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=R9/ML2By2Vb9VJ9ig9TmuZ+7bbZ0eArmGw/7g8VKZyU=; b=e+Lc7QE8KmvqAXR+xYqnsyD+zeLkATELsFM3Ibu2kfIndIJaKaDwBjtQc5Z1PLbu3f mgvcZsAQB89rTw0E82yXE1qh/Vr6yE31UU8K3xl75YGK7zGJmONH1LD4uMzocls4n1nk kWFn2wU6lKqtGPEjiE2QD+ux0gbOc1EtSxqmp77ZP8ACHdkwqdDVdHwItph2QontjQzP xtoW2cMewyB9Gjt92PhrfRP1zFXhHGmHDTb98raXrVjGnEG4hjq+vlPfuBR7Tlqthv0V HMuLwvHUL/O5XErhfA99dqtz3pXJFdpiEGAIP51czilXYUj1wPTf1doruOTBi/n/+HuW 4O3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Rqoy4yQq; 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 15si9343397pgk.227.2019.06.01.03.46.41; Sat, 01 Jun 2019 03:46:41 -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=Rqoy4yQq; 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 S1727354AbfFAKqk (ORCPT + 30 others); Sat, 1 Jun 2019 06:46:40 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:43852 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727329AbfFAKqh (ORCPT ); Sat, 1 Jun 2019 06:46:37 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x51AkSNN017493; Sat, 1 Jun 2019 05:46:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559385988; bh=R9/ML2By2Vb9VJ9ig9TmuZ+7bbZ0eArmGw/7g8VKZyU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Rqoy4yQqfntNV9wn3oF6xv29w7Ux9/NJrwavUei1ZYfx0XgsJrHpsUusM5ui/A5yp m4mYMvTae3+6MSxgDO3XTucl9doHbecbMzUQuoNMNce3jcealcA2HVHQrHIEn99XBE UJrnO6hsxrGLy3kxjLmoDrp0/vBbYRF4YjbawMVQ= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x51AkS36037265 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 1 Jun 2019 05:46:28 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) 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; Sat, 1 Jun 2019 05:46:27 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE104.ent.ti.com (157.170.170.34) 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; Sat, 1 Jun 2019 05:46:27 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x51AkQms077729; Sat, 1 Jun 2019 05:46:27 -0500 From: Grygorii Strashko To: "David S. Miller" , Santosh Shilimkar , Richard Cochran , Rob Herring CC: Sekhar Nori , Murali Karicheri , Wingman Kwok , , , , , Grygorii Strashko Subject: [PATCH net-next 06/10] ARM: dts: k2e-clocks: add input ext. fixed clocks tsipclka/b Date: Sat, 1 Jun 2019 13:45:30 +0300 Message-ID: <20190601104534.25790-7-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190601104534.25790-1-grygorii.strashko@ti.com> References: <20190601104534.25790-1-grygorii.strashko@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 Add set of fixed, external input clocks definitions for TSIPCLKA, TSIPCLKB clocks. Such clocks can be used as reference clocks for some HW modules (as cpts, for example) by configuring corresponding clock muxes. For these clocks real frequencies have to be defined in board files. Signed-off-by: Grygorii Strashko --- arch/arm/boot/dts/keystone-k2e-clocks.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.17.1 diff --git a/arch/arm/boot/dts/keystone-k2e-clocks.dtsi b/arch/arm/boot/dts/keystone-k2e-clocks.dtsi index f7592155a740..cf30e007fea3 100644 --- a/arch/arm/boot/dts/keystone-k2e-clocks.dtsi +++ b/arch/arm/boot/dts/keystone-k2e-clocks.dtsi @@ -71,4 +71,24 @@ clocks { reg-names = "control", "domain"; domain-id = <29>; }; + + /* + * Below are set of fixed, input clocks definitions, + * for which real frequencies have to be defined in board files. + * Those clocks can be used as reference clocks for some HW modules + * (as cpts, for example) by configuring corresponding clock muxes. + */ + tsipclka: tsipclka { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; + clock-output-names = "tsipclka"; + }; + + tsipclkb: tsipclkb { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; + clock-output-names = "tsipclkb"; + }; }; From patchwork Sat Jun 1 10:45:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 165573 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1970707ili; Sat, 1 Jun 2019 03:47:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzs74RowXiFD5dcTYjzuA5SCC5KhN+zjRTR7FOqk3L9QF/3NdD4++bOnsb/JDuNCjP5SjQZ X-Received: by 2002:a65:64d9:: with SMTP id t25mr14565204pgv.130.1559386028224; Sat, 01 Jun 2019 03:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559386028; cv=none; d=google.com; s=arc-20160816; b=amMU0Dj+Gpoz0gdqyMJBP9ZLpFiuGwaUkopVw/6DfBKXt98Q/VLGyMQoTjdTsOrSnp 5Jy9Nmi4hbTHouqOWJ4ItXx42LZA+dhum0SmC0+OpS3m+hXojH/Mc9khUDS/vMP/mmcN h6PrXRKUdy8DD1iimKqn0ldHqVBNqil/1RhFoDIcvfwJqh0YKwicgH0ijQePYa1jUefv 8UYxQ0J/r1uBOJeP3kEWgh2vr62tc3/vOrlv+WrHjyE4xKqwyL1KJuRI8T1IRxmL3Hb0 /Yc7lpnbuVFKfdONlevt89Ye+AVuLGqbhtmVL5+2oeXTWCLol99N2TuSy8H4ouRi5Dd5 DrzQ== 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=xdHvCdOlgRH9td30gOXrpwOJLLdGgZhCVDyggJQOTdQ=; b=F4VheasLxRfGxSzov5uXtBkro2WiIjwUgvxjpSZsSSh5qOYvgkekjk2jRXeU0AaThj S6SIcW5Lq0SlRFIqrCvT9shyfuc2yKH/XST4uWPfLz9v0V2s8YLk2XJYeS3TNpdSCN6H RkTCUVh0gjwuIBbFQCdVs6LLq2VLPGUNoRJBbmwlOwQP69k5CtOh5cMcDkmD+JYaYh8b nIUfT0PtkI3BR0aQcmXNmW0KbJczAd0L8q/KUWhpmFDWjmOKP7qFRjBYV5k0sgAsXO0o 6RQuiPIJknpt+uSxgeBu4z+9mqw+L52qkajhK9guMXu/h5dYHfAjBKuMso8pdi3C1we9 BM0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="a7tRfjz/"; 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 q138si10002598pfq.149.2019.06.01.03.47.07; Sat, 01 Jun 2019 03:47:08 -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="a7tRfjz/"; 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 S1727428AbfFAKrH (ORCPT + 30 others); Sat, 1 Jun 2019 06:47:07 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:34836 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727184AbfFAKrF (ORCPT ); Sat, 1 Jun 2019 06:47:05 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x51AkZnS018652; Sat, 1 Jun 2019 05:46:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559385995; bh=xdHvCdOlgRH9td30gOXrpwOJLLdGgZhCVDyggJQOTdQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=a7tRfjz/j5Y14w7/dLNQ7ripYiqKCVW+zhA6TgsbwtRhllhoXd2bNHrvrfAIoDVd8 lbUaI/5YQt1PZ34OSM6vnFroHMHgLDCjmBLhyAmFW7AdcpEZ4Ju8JyET7lAYeuzUcy uhUIsZWNSUuifrVxg3nfM6cn8gbQIySD2jrUvtEs= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x51AkZEH037345 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 1 Jun 2019 05:46:35 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Sat, 1 Jun 2019 05:46:35 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Sat, 1 Jun 2019 05:46:35 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x51AkXnT112900; Sat, 1 Jun 2019 05:46:34 -0500 From: Grygorii Strashko To: "David S. Miller" , Santosh Shilimkar , Richard Cochran , Rob Herring CC: Sekhar Nori , Murali Karicheri , Wingman Kwok , , , , , Grygorii Strashko Subject: [PATCH net-next 07/10] ARM: dts: k2e-netcp: add cpts refclk_mux node Date: Sat, 1 Jun 2019 13:45:31 +0300 Message-ID: <20190601104534.25790-8-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190601104534.25790-1-grygorii.strashko@ti.com> References: <20190601104534.25790-1-grygorii.strashko@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 KeyStone 66AK2E 1G Ethernet Switch Subsystems, can control an external multiplexer that selects one of up to 32 clocks for time sync reference (RFTCLK) clock. This feature can be configured through CPTS_RFTCLK_SEL register (offset: x08) in CPTS module and modelled as multiplexer clock. Hence, add cpts-refclk-mux clock node which allows to mux one of SYSCLK2, SYSCLK3, TIMI0, TIMI1, TSIPCLKA, TSREFCLK, TSIPCLKB clocks as CPTS reference clock [1] and group all CPTS properties under "cpts" subnode. [1] http://www.ti.com/lit/gpn/66ak2e05 Signed-off-by: Grygorii Strashko --- arch/arm/boot/dts/keystone-k2e-netcp.dtsi | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/arch/arm/boot/dts/keystone-k2e-netcp.dtsi b/arch/arm/boot/dts/keystone-k2e-netcp.dtsi index 1db17ec744b1..ad15e77874b1 100644 --- a/arch/arm/boot/dts/keystone-k2e-netcp.dtsi +++ b/arch/arm/boot/dts/keystone-k2e-netcp.dtsi @@ -135,8 +135,8 @@ netcp: netcp@24000000 { /* NetCP address range */ ranges = <0 0x24000000 0x1000000>; - clocks = <&clkpa>, <&clkcpgmac>, <&chipclk12>; - clock-names = "pa_clk", "ethss_clk", "cpts"; + clocks = <&clkpa>, <&clkcpgmac>; + clock-names = "pa_clk", "ethss_clk"; dma-coherent; ti,navigator-dmas = <&dma_gbe 0>, @@ -156,6 +156,23 @@ netcp: netcp@24000000 { tx-queue = <896>; tx-channel = "nettx"; + cpts { + clocks = <&cpts_refclk_mux>; + clock-names = "cpts"; + + cpts_refclk_mux: cpts-refclk-mux { + #clock-cells = <0>; + clocks = <&chipclk12>, <&chipclk13>, + <&timi0>, <&timi1>, + <&tsipclka>, <&tsrefclk>, + <&tsipclkb>; + ti,mux-tbl = <0x0>, <0x1>, <0x2>, + <0x3>, <0x4>, <0x8>, <0xC>; + assigned-clocks = <&cpts_refclk_mux>; + assigned-clock-parents = <&chipclk12>; + }; + }; + interfaces { gbe0: interface-0 { slave-port = <0>; From patchwork Sat Jun 1 10:45:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 165571 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1970433ili; Sat, 1 Jun 2019 03:46:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7nklJxfasObapB/lELflQU6fVLUCztzwR6RnhqTrcrrJo6zgEO3IsAKRjrYMlmIiwuLQq X-Received: by 2002:a63:3141:: with SMTP id x62mr14810521pgx.282.1559386011773; Sat, 01 Jun 2019 03:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559386011; cv=none; d=google.com; s=arc-20160816; b=i1lo2TnaCize718EO9i9UvXLXhYf/Ogh2OXqRVWZ79vncLw9xDMToGQSU2nlC1hn/T vw4tSXY77WQ8TDhKODZum6mxvM6YRA9moMJeZNUwgB++U5Gqscsu14Y1wCwa3wXJZiFz l6eLjwsUytCs064SB++i56nnsdslYGhOk0Rg9YCIIO3hVk85nq83otqE3LIGKBNJgOcV WZrr5T3GW2eUVZLxl8gabBYIFHDRPVZ9Q4zEDt+tgIj7r9R6rpI/rQdxn4FxGhXaTX2V j6YE2MhgdlUVVI56eQhEfkn4lxSPRxc1z/3R1rNRO7p6cYfQ7z5sR0zGUr2sWsBxsjRH +ibg== 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=AznSeI2qecv3FPLBtJdM/efVn5C8LoHjb0YeI/MvakI=; b=TYZx/idLY02z4ff27M0Xx5YfrVqSFuCePH6RHLUEzdyjXmmXZSLSzjRffmTPELOjcU tjQXAl4nRloqyNF/j4cKBWMWg2a04/k7dawOOj8d5bo3H9ASimAYLwVPkh8EoOtMpLq4 F+q8iFvMLbcF+xEO8yaCMOYUdQyUABtMpd4QWUzpVZVY4y1zPeEWeNIw4xZT5oUEpyVu 1L7zYZLGYMk9rUPfj7e+EloRsJCPnlaG9uLv/4cJ0SWONnbRTDx4C5jPBPBdvjEGGFTD 9vq0JUo243BIzpp09JlxNk6xEgzrrjbp1Y1Y494fvaUgGx6KdlY5xXOWarRaH5fLmn9O K3Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ZgUPu+8u; 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 s11si9205783pgm.376.2019.06.01.03.46.51; Sat, 01 Jun 2019 03:46:51 -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=ZgUPu+8u; 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 S1727376AbfFAKqu (ORCPT + 30 others); Sat, 1 Jun 2019 06:46:50 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:36358 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727318AbfFAKqs (ORCPT ); Sat, 1 Jun 2019 06:46:48 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x51Akg5O092119; Sat, 1 Jun 2019 05:46:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559386002; bh=AznSeI2qecv3FPLBtJdM/efVn5C8LoHjb0YeI/MvakI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ZgUPu+8u6pBE7NbmPZkyvCLhT+lkuvwkk5A4NW0SZ57TEN3rCZ6IdR+k840VKF4+z 03HWHWoR/aOxJx6sT1ujKFLOklsU4UrQso9ohVfS6pnLEzwMVLr8j/9QnG4CO6XsIU weis0+8+NMUrnYYDzGb3qxgvsQ7IcsL3Ff7zSTwk= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x51Akgs1026699 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 1 Jun 2019 05:46:42 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Sat, 1 Jun 2019 05:46:42 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE105.ent.ti.com (157.170.170.35) 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; Sat, 1 Jun 2019 05:46:42 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x51Akflv052292; Sat, 1 Jun 2019 05:46:41 -0500 From: Grygorii Strashko To: "David S. Miller" , Santosh Shilimkar , Richard Cochran , Rob Herring CC: Sekhar Nori , Murali Karicheri , Wingman Kwok , , , , , Grygorii Strashko Subject: [PATCH net-next 08/10] ARM: dts: k2hk-netcp: add cpts refclk_mux node Date: Sat, 1 Jun 2019 13:45:32 +0300 Message-ID: <20190601104534.25790-9-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190601104534.25790-1-grygorii.strashko@ti.com> References: <20190601104534.25790-1-grygorii.strashko@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 KeyStone 66AK2H/K 1G Ethernet Switch Subsystems, can control an external multiplexer that selects one of up to 32 clocks for time sync reference (RFTCLK) clock. This feature can be configured through CPTS_RFTCLK_SEL register (offset: x08) in CPTS module and modelled as multiplexer clock. Hence, add cpts-refclk-mux clock node which allows to mux one of SYSCLK2, SYSCLK3, TIMI0, TIMI1, TSREFCLK clocks as CPTS reference clock [1] and group all CPTS properties under "cpts" subnode. [1] http://www.ti.com/lit/gpn/66ak2h14 Signed-off-by: Grygorii Strashko --- arch/arm/boot/dts/keystone-k2hk-netcp.dtsi | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/arch/arm/boot/dts/keystone-k2hk-netcp.dtsi b/arch/arm/boot/dts/keystone-k2hk-netcp.dtsi index e203145acbea..d5a6c1f5633c 100644 --- a/arch/arm/boot/dts/keystone-k2hk-netcp.dtsi +++ b/arch/arm/boot/dts/keystone-k2hk-netcp.dtsi @@ -152,8 +152,8 @@ netcp: netcp@2000000 { /* NetCP address range */ ranges = <0 0x2000000 0x100000>; - clocks = <&clkpa>, <&clkcpgmac>, <&chipclk12>; - clock-names = "pa_clk", "ethss_clk", "cpts"; + clocks = <&clkpa>, <&clkcpgmac>; + clock-names = "pa_clk", "ethss_clk"; dma-coherent; ti,navigator-dmas = <&dma_gbe 22>, @@ -175,6 +175,22 @@ netcp: netcp@2000000 { tx-queue = <648>; tx-channel = "nettx"; + cpts { + clocks = <&cpts_refclk_mux>; + clock-names = "cpts"; + + cpts_refclk_mux: cpts-refclk-mux { + #clock-cells = <0>; + clocks = <&chipclk12>, <&chipclk13>, + <&timi0>, <&timi1>, + <&tsrefclk>; + ti,mux-tbl = <0x0>, <0x1>, <0x2>, + <0x3>, <0x8>; + assigned-clocks = <&cpts_refclk_mux>; + assigned-clock-parents = <&chipclk12>; + }; + }; + interfaces { gbe0: interface-0 { slave-port = <0>; From patchwork Sat Jun 1 10:45:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 165572 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1970662ili; Sat, 1 Jun 2019 03:47:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCdM0ktYykIgvKUnxbA/j2xH0fGRu5InobxSDehMIYWz/WWXzm7nMlQdWj+ntnlesYVl9R X-Received: by 2002:a17:902:d695:: with SMTP id v21mr3666193ply.342.1559386024660; Sat, 01 Jun 2019 03:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559386024; cv=none; d=google.com; s=arc-20160816; b=RxBmsJG4/SLtg17uEYTDRQKHKfKtZIFznJeSa8lJajpxHWqH7pGk6hrTt1/V/7j54C ePowq9tBHkBPwqPLvt0kbmzbcDivB5rJDsj3MTibMpNv5atg20wFJoBlilKdpN3UHV73 n6tzNjNGYWq/D3TTO0/9XVjnMYNzY1JdUr6lC6LDSX+L1iTSDyRMvzM8bOh1KW9bC+8c hrNxR8PpzjN8te0xokr0ORm8jyBlWKNuhhfERia/pndQB1LMnEIiygFwcnMFnzYcrIPS l7QZbncExnBqh7F5V027qDEuFzjx7PlNzMp2RfqFma9hJd47r2snfCbjG6KaxNBnJQ8N ZKcA== 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=X5SQUumkW58Zgp2FI1ph9B4uenobpRYKTZ55G7V38jk=; b=S6Et3ztAmcbGSIOkRJT0k0QlkamPspkOLLFPJ5yAF79y06WvvKKNKXoquvDdeH0sMa Y5yKKXGjAyoeooBmqS4mc/OhFl5PtW77LSr3vEjZR3W/f1DEPKl81HWxRrimiK6y2L0e MG0s69LZpKS46M6lILVG3Yrkw2DGtuldP1GBxg4rBW9aGl5Qi5qmpE+njXyh1r8YU3ZM +3O2lYhdty3sdjy1eKf2V0D0MvPxNcfZsDncHiF8+4WWOtthMphy4ahnTvTNfbb/xvHp uvqIK/Qsez5lmiymNIvjvEb+0Ryh7v6UBYwFUVY+CbHkV6WnAzmlUyen5oGBpgotkrEe +xIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=s+zSHjQr; 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 q138si10002598pfq.149.2019.06.01.03.47.04; Sat, 01 Jun 2019 03:47:04 -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=s+zSHjQr; 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 S1727404AbfFAKrD (ORCPT + 30 others); Sat, 1 Jun 2019 06:47:03 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:43890 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727184AbfFAKrC (ORCPT ); Sat, 1 Jun 2019 06:47:02 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x51AkvkA017551; Sat, 1 Jun 2019 05:46:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559386017; bh=X5SQUumkW58Zgp2FI1ph9B4uenobpRYKTZ55G7V38jk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=s+zSHjQr8j7LzP7xkz9QMs65WHK8SIQ1VLS3n4K1+4Ww/WgVwdd7X+BRxzeAw8NjC XgUsnQ8YRkdywMTMq2qJpTqxro1fspa4jOQ7hu7P2a8efbeXTY7GWfn7kKfeJiYeB3 a3/mdpcMljhrIHCL63rkhbB8yyk++ekW5cFYOIYA= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x51AkvYP127980 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 1 Jun 2019 05:46:57 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Sat, 1 Jun 2019 05:46:56 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE103.ent.ti.com (10.64.6.24) 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; Sat, 1 Jun 2019 05:46:56 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x51Akt93052539; Sat, 1 Jun 2019 05:46:56 -0500 From: Grygorii Strashko To: "David S. Miller" , Santosh Shilimkar , Richard Cochran , Rob Herring CC: Sekhar Nori , Murali Karicheri , Wingman Kwok , , , , , Grygorii Strashko Subject: [PATCH net-next 10/10] ARM: configs: keystone: enable cpts Date: Sat, 1 Jun 2019 13:45:34 +0300 Message-ID: <20190601104534.25790-11-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190601104534.25790-1-grygorii.strashko@ti.com> References: <20190601104534.25790-1-grygorii.strashko@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 Enable CPTS support which is present in Network Coprocessor Gigabit Ethernet (GbE) Switch Subsystem. Signed-off-by: Grygorii Strashko --- arch/arm/configs/keystone_defconfig | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig index 72fee57aad2f..0b2281407ecf 100644 --- a/arch/arm/configs/keystone_defconfig +++ b/arch/arm/configs/keystone_defconfig @@ -136,6 +136,7 @@ CONFIG_BLK_DEV_SD=y CONFIG_NETDEVICES=y CONFIG_TI_KEYSTONE_NETCP=y CONFIG_TI_KEYSTONE_NETCP_ETHSS=y +CONFIG_TI_CPTS=y CONFIG_MARVELL_PHY=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y