From patchwork Sat Jun 1 10:45:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 165565 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1969640ili; Sat, 1 Jun 2019 03:46:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6j8Dx0vqgAMRj7JAXqBri7CcuE/RzAtnqQXMFImW5f9y7KaGk+gKK6iUa+udwXNk7+xHQ X-Received: by 2002:a63:4621:: with SMTP id t33mr14644354pga.246.1559385960331; Sat, 01 Jun 2019 03:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559385960; cv=none; d=google.com; s=arc-20160816; b=Rzfe8IRxqSSfdaOEWZAw3jg3E8KlJ2vK+YbmN4309Bf61Cg7BxelT3HuAOAiHLCsYw 5FMemAMcgycg2bSxhMDNH+wCcihw/vw0ztfm+ICpYH+O4ls8pLB98CX7ZIhojOvjj/aj 5/mdMmGwgaTDCiqSoeLUOWvF0qXTv2QjqB1mIS5IBsMDbueIusoRWAh/HJihw1vKyEBp zgxROEgwvmEswRP69mUXwE7YejDH7QreeFClNkv/Z151G+aQFAM0POt+k4YIo0dI3Byb cGt3hs4DluI3A0hJA9l98s2pLtATxs3JAGfbBdXQ2AteSpNVAxfZs4Vj+5N9LNP+LHMN Sgeg== 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=bf1JSQ3o+4GDGCtl8ezINMDggnzBuxoGXO5FYeY/4Us=; b=JHa8dPMOx+9jLizOCNY80LiKfo+NzMVnTfOdDzbInCai5KMyNZX/10eU68Exgx+z38 N56GNBTqArtV5VVO4TsWytNzMi5LZDlMZ6cmTpoSpnEob5BFDVdVduimlObg3GBpr8NO WLDnFK1wgMiR56rmf7drbLVDZ3XPG+3Tv0YnIqjRs8fWUP/sP8fzI5PrGmI4tRL7osMQ 4tPbVG2LAkJogbkWeNpZtbKWKMdEuw0ygwE5QOCL22f5vJBc7WlYulozO5I3xIspHbAX FpYmPs5lmfzbpEb7EH/wzy4OMsmvhmMcdRubVI8D3vbYEh4LNfhp+iR6vrqanMYEzmMI v9Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="gnkB/3MM"; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 l6si8578442pgp.382.2019.06.01.03.46.00; Sat, 01 Jun 2019 03:46:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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="gnkB/3MM"; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S1726921AbfFAKp7 (ORCPT + 7 others); Sat, 1 Jun 2019 06:45:59 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:43784 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbfFAKp6 (ORCPT ); Sat, 1 Jun 2019 06:45:58 -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 x51Ajqjw017215; Sat, 1 Jun 2019 05:45:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559385952; bh=bf1JSQ3o+4GDGCtl8ezINMDggnzBuxoGXO5FYeY/4Us=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=gnkB/3MMf5QBf6L8L+KiWPEu0bmO3jO9L/Cq6HyDL8HWzBnOhWt5UHpYWrIYCEaPI OnIS3gPI0OJsjqpXDKnmGyb/C4r+BqTL0DwBVUNXQdbtF1cVQEtcbf5Wj+E6kfrj3M XdX2bp3bb7Ac3mwH/SxcAuHg0DDJTz77wqm9QdRg= Received: from DLEE110.ent.ti.com (dlee110.ent.ti.com [157.170.170.21]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x51AjqYf022690 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 1 Jun 2019 05:45:52 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE110.ent.ti.com (157.170.170.21) 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:51 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) 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; Sat, 1 Jun 2019 05:45:51 -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 x51Ajobp051295; Sat, 1 Jun 2019 05:45:50 -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 01/10] dt-bindings: doc: net: keystone-netcp: document cpts Date: Sat, 1 Jun 2019 13:45:25 +0300 Message-ID: <20190601104534.25790-2-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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The Keystone 2 66AK2HK/E/L 1G Ethernet Switch Subsystems contains The Common Platform Time Sync (CPTS) module which is in general compatible with CPTS module found on TI AM3/4/5 SoCs. So, the basic support for Keystone 2 CPTS is available by default, but not documented. The Keystone 2 CPTS module supports also some additional features like time sync reference (RFTCLK) clock selection through CPTS_RFTCLK_SEL register (offset: x08) in CPTS module, which is modelled as multiplexer clock. This patch adds missed binding documentation for Keystone 2 66AK2HK/E/L CPTS module. Signed-off-by: Grygorii Strashko --- .../bindings/net/keystone-netcp.txt | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) -- 2.17.1 diff --git a/Documentation/devicetree/bindings/net/keystone-netcp.txt b/Documentation/devicetree/bindings/net/keystone-netcp.txt index 6262c2f293b0..24f11e042f8d 100644 --- a/Documentation/devicetree/bindings/net/keystone-netcp.txt +++ b/Documentation/devicetree/bindings/net/keystone-netcp.txt @@ -104,6 +104,23 @@ Required properties: - 10Gb mac<->mac forced mode : 11 ----phy-handle: phandle to PHY device +- cpts: sub-node time synchronization (CPTS) submodule configuration +-- clocks: CPTS reference clock. Should point on cpts-refclk-mux clock. +-- clock-names: should be "cpts" +-- cpts-refclk-mux: multiplexer clock definition sub-node for CPTS reference (RFTCLK) clock +--- #clock-cells: should be 0 +--- clocks: list of CPTS reference (RFTCLK) clock's parents as defined in Data manual +--- ti,mux-tbl: array of multiplexer indexes as defined in Data manual +--- assigned-clocks: should point on cpts-refclk-mux clock +--- assigned-clock-parents: should point on required RFTCLK clock parent to be selected +-- cpts_clock_mult: (optional) Numerator to convert input clock ticks + into nanoseconds +-- cpts_clock_shift: (optional) Denominator to convert input clock ticks into + nanoseconds. + Mult and shift will be calculated basing on CPTS + rftclk frequency if both cpts_clock_shift and + cpts_clock_mult properties are not provided. + Optional properties: - enable-ale: NetCP driver keeps the address learning feature in the ethernet switch module disabled. This attribute is to enable the address @@ -168,6 +185,23 @@ netcp: netcp@2000000 { tx-queue = <648>; tx-channel = <8>; + 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>; @@ -219,3 +253,13 @@ netcp: netcp@2000000 { }; }; }; + +CPTS board configuration - select external CPTS RFTCLK: + +&tsrefclk{ + clock-frequency = <500000000>; +}; + +&cpts_refclk_mux { + assigned-clock-parents = <&tsrefclk>; +}; From patchwork Sat Jun 1 10:45:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 165567 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1970017ili; Sat, 1 Jun 2019 03:46:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNAn0y22aTgI+OjIUeE+BbRKGSbgQKgJEKKi51pwm6vZcP1JHLynyw4256GgI/SwCu61Tp X-Received: by 2002:a17:90a:c58b:: with SMTP id l11mr15447042pjt.56.1559385985216; Sat, 01 Jun 2019 03:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559385985; cv=none; d=google.com; s=arc-20160816; b=HWQod5rO6W5D8BSyGDHITV4DJzD4v0K0hcLV2yQ6Z3FJE4lot2GW3QiJSFEEeOpzot Cda5fwDN3aOehSJ4FbC/iAvf9C0nYLMnc8Iv5gGt54gyHwDzDptvT9svH5Dr1hKPJ65w /5sTwZBplH4HQ0a9nQoKCLTbgjeuWMNuY0v479XUjBkjNH2FYZJNZ/OjdHY0EJZgnpaL 8NvRiu13IW7/93VUW/CNGRfHZsLysmpdra8Bne+iKZq0Tk884N397jywqPaGpT9WUKr4 m5D8VPe+zM3teJlBC3Wy5X+Ci80cb+gxhOauDmY6Uedu5MaumsSfjnKsyaanholhjjuv FiRA== 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=xOoaKx9o5FlnhqYsn2s7qWsDLieqnTarTfTPiAJFeVM=; b=xYNiR/oVTwN/Vt8Cs9u1HJBvnsH2aejlyuSFhPc/xcZNX7ZkgQw8chDOpyAUekbQC+ ME8UT5KS/q8IUJxFU0rdzqlItN97g51NwMeTYTkBkPYIoomf9q1RcaeIYgJa1RYuRVl1 odqwJB1H4z+qb6cUhK8T9kOJS5kWfuWt/ufD5uHDgaXL8iCE4NVUIJJRT1kpyHzjToO2 wpVPnFmdYtoU18hC58mJekmfxoBN95DHy4RmC12QJVfQwiMYmsV/mmHTyv46SkF/u8Fz jvmWEEuIkiJC5TjGf/FMNGhYE4AUFYeW+i65fLUFslQjsXmDYdxQtW68sDJWddFLYNz4 KPLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="RErV/cQr"; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 c1si9351765plo.203.2019.06.01.03.46.25; Sat, 01 Jun 2019 03:46:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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="RErV/cQr"; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S1726988AbfFAKqY (ORCPT + 7 others); Sat, 1 Jun 2019 06:46:24 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:35344 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbfFAKqY (ORCPT ); Sat, 1 Jun 2019 06:46:24 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x51Ak6vH028766; Sat, 1 Jun 2019 05:46:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559385966; bh=xOoaKx9o5FlnhqYsn2s7qWsDLieqnTarTfTPiAJFeVM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=RErV/cQr5f0Z7wNtc7Z6xPwsuu7J3KCp/gvV0JKUBGBoZFwssWSnZ/NeNaDgJ5FH2 CBc/5/X24z+K+T4tIsr1nBjW30rJeHhEkRYCoutx1NPhPbc3pcpd2wUV0c5eNXzdzF 4FsJmy8Hdyn+Pc5b1+sE1+7ALMAq45Qz5U521Vl4= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x51Ak6uY023049 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 1 Jun 2019 05:46:06 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE111.ent.ti.com (10.64.6.32) 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:06 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE105.ent.ti.com (10.64.6.26) 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:06 -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 x51Ak4rr128211; Sat, 1 Jun 2019 05:46:05 -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 03/10] net: ethernet: ti: netcp_ethss: add support for child cpts node Date: Sat, 1 Jun 2019 13:45:27 +0300 Message-ID: <20190601104534.25790-4-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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Allow to place CPTS properties in the child "cpts" DT node. For backward compatibility - roll-back and read CPTS DT properties from parent node if "cpts" node is not present. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/netcp_ethss.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c index ec179700c184..2c1fac33136c 100644 --- a/drivers/net/ethernet/ti/netcp_ethss.c +++ b/drivers/net/ethernet/ti/netcp_ethss.c @@ -3554,7 +3554,7 @@ static int set_gbenu_ethss_priv(struct gbe_priv *gbe_dev, static int gbe_probe(struct netcp_device *netcp_device, struct device *dev, struct device_node *node, void **inst_priv) { - struct device_node *interfaces, *interface; + struct device_node *interfaces, *interface, *cpts_node; struct device_node *secondary_ports; struct cpsw_ale_params ale_params; struct gbe_priv *gbe_dev; @@ -3713,7 +3713,12 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev, dev_dbg(gbe_dev->dev, "Created a gbe ale engine\n"); } - gbe_dev->cpts = cpts_create(gbe_dev->dev, gbe_dev->cpts_reg, node); + cpts_node = of_get_child_by_name(node, "cpts"); + if (!cpts_node) + cpts_node = of_node_get(node); + + gbe_dev->cpts = cpts_create(gbe_dev->dev, gbe_dev->cpts_reg, cpts_node); + of_node_put(cpts_node); if (IS_ENABLED(CONFIG_TI_CPTS) && IS_ERR(gbe_dev->cpts)) { ret = PTR_ERR(gbe_dev->cpts); goto free_sec_ports;