From patchwork Thu Feb 15 23:48:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 201844 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp193217dyb; Thu, 15 Feb 2024 15:50:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX9nw3Pow3o+FlD2a/7U5NLleailDwYCtwf08/d4KWA+D5HGfcLd6JQWOkRNAPjbKn2xbjgllAVDkqM5mdD5GxAzMAX+Q== X-Google-Smtp-Source: AGHT+IG3qGX2tBt9iWWJdFgI6J5mFkIpHiPnSIt/zB5s7NIIenbobP18ORsRhuFTpVutGMnZJlBX X-Received: by 2002:a05:6214:2503:b0:68c:8667:f77f with SMTP id gf3-20020a056214250300b0068c8667f77fmr5095982qvb.18.1708041043986; Thu, 15 Feb 2024 15:50:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708041043; cv=pass; d=google.com; s=arc-20160816; b=DxajrmGR/Kunt7hpghM8nySNQbFv90N/DlPCmuHUgG1sSKhad4cA8dRvNC7asF3Maf pvcIB6vspI80JZ8nJpgM4De3dQIsnkM8U1J4z8XIu0jXmU+9FTN6aHLoqiQXjDR/qAVT tIVuKS6gdLLTnGh/3IswuRsKVMxy4n9eiJdbTj7z8vpx+LoTXQo0q8/Jyb8l0NhyeUq0 QUjJmBEnd4TpX7l3nmBFh3xy2F786KZ1CHog45qtIN4JSe+IJQ5uE7Ckbu0MLQEkEsaC 0h0gEdHl25j5+LeybwBdzfD/ydV9sEKOWFUcN9J4GOOb3YFbzbwrhGmgyUnqzixvLUHZ 2uYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=ORhPo7S0wqL8iupWL48BPhP40HKUF4hfB/lfEdzyNCo=; fh=YUyCOKAW57vGpD9UsAB1Jf96lQXTx0J/i1SlBxoko4U=; b=lsIF4K41EgRScI+T9xyRQgUizbBh2ano4TaogWfoNAHLpj7YTdJNBKXYLbrKmeM/1d JvoXf5gXlPn0iISkHTRf6/p8Yz0tQ20teZvfjg0InwODWOmUtJG1vW/Gxn7cNymOK+9I ospqafbrBpfndV9nMnDX1Kn0ALz/lYe52yDeUy0tJ6flBEOabNHq9UOv0IigUpDfDhv1 KYv9QEELeyShGr2g3UihSCUj6LkXIa2jeUuiJbIGzV/5EKufMqNeEGM/BK8R9cFDO2ho EC4pYu7PfNXSh4LIKCTPcYNm0ZWQlC4b++qZNQ8Q/4ALlI75pXLuMnQeK0ktdufVzS6l axyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uqWuSeSW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67855-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67855-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q7-20020a05621419e700b0068cc29e26e3si2539290qvc.267.2024.02.15.15.50.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 15:50:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67855-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uqWuSeSW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67855-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67855-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C78A51C22473 for ; Thu, 15 Feb 2024 23:50:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 567391487D9; Thu, 15 Feb 2024 23:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uqWuSeSW" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B1BC145B18; Thu, 15 Feb 2024 23:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708040933; cv=none; b=J81JbDeWtIWamxX/A30j5Xg7JstLBb1RhAzU1yv7Jkz5EzaK/olkA9IwwjDFKi1noYKI990XPy1Px2zwwg/8j2uFpEUJ70lcVjadMA4dqd67lohaaql4e/VlgCTB02ULZCHwhMBaB0qB+b85lsvRrjoqoFAOR1CoOqQ2x0I0H5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708040933; c=relaxed/simple; bh=dwG+Zq2OviJrgx903WZkhrqBopa6+N02UuKRpguueHo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c6Ybmfb2eOyTHbQED27s9ujPCfr1+Cs0GEkHjVhOG8d2ENWaluLGkgvASewbZMZllGQ4tk20mEt/5PiHXilfLqxsrYP81fN8DEvhrUEgZRTu6Bt5LkCTJM2CYgVkcTFEhUuvGQiN7T98SNBgXJcmm4gCLMHEAczBPUPDIBgL6mE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uqWuSeSW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id ECC9AC43142; Thu, 15 Feb 2024 23:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708040933; bh=dwG+Zq2OviJrgx903WZkhrqBopa6+N02UuKRpguueHo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uqWuSeSWrhv2TjeFqs8wGgEjOEp4Kf3BHin9D57H+IQH4H7yJ3wkYZEpWtt4qnpk6 bKEix9cEsHcchGvzD3uIDZTmIVC+wAoyk3PlL9tFRfmcZO4H4pMxjvk51q2+GxVz+E fP5e6YC03J071YSoAqhHwYUBJ24qcSbijac1E5b8NKGItA9YQCtRAfaJE3HhPxiRh7 oNtO5P/A9aP4wyq7cxCEc0GFpmgGZfZZ9p51HSNkY5M5+u5y934pn0BoQhDM5tlU8k F4KDDtSKvnKX1y1hmnQZPL9slQn751HDvgISf59L24A7vk1x2iBaOXuNtaEpDINFEJ wXAHJrYQdqTAA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D60E3C48BC4; Thu, 15 Feb 2024 23:48:52 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Fri, 16 Feb 2024 07:48:56 +0800 Subject: [PATCH 4/6] dt-bindings: net: add hisilicon-femac Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240216-net-v1-4-e0ad972cda99@outlook.com> References: <20240216-net-v1-0-e0ad972cda99@outlook.com> In-Reply-To: <20240216-net-v1-0-e0ad972cda99@outlook.com> To: Yisen Zhuang , Salil Mehta , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yang Xiwen , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708040932; l=3806; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=DJxzgsmEBlHh9lBL/uI/3VbIKC/AIol7DNEC5Vfzj9E=; b=1sKSohKyPR+wipV8br+qVxleQc6iVOq6lcuPziMYN1mgVhfUH/LZcoGTSerKMi8Cz3Tyhj/BP wPzw2KeWGxmCJgzdeNSAaYOWYrio54EqlcaNBY9DPLMllyoFHgae/py X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791010846171809079 X-GMAIL-MSGID: 1791010846171809079 From: Yang Xiwen This binding gets rewritten. Compared to previous txt based binding doc, the following changes are made: - No "hisi-femac-v1/2" binding anymore - Remove unused Hi3516 SoC, add Hi3798MV200 - add MDIO subnode - add phy clock and reset Signed-off-by: Yang Xiwen --- .../devicetree/bindings/net/hisilicon-femac.yaml | 125 +++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/Documentation/devicetree/bindings/net/hisilicon-femac.yaml b/Documentation/devicetree/bindings/net/hisilicon-femac.yaml new file mode 100644 index 000000000000..008127e148aa --- /dev/null +++ b/Documentation/devicetree/bindings/net/hisilicon-femac.yaml @@ -0,0 +1,125 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/hisilicon-femac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hisilicon Fast Ethernet MAC controller + +maintainers: + - Yang Xiwen + +allOf: + - $ref: ethernet-controller.yaml + +properties: + compatible: + enum: + - hisilicon,hi3798mv200-femac + + reg: + minItems: 2 + maxItems: 2 + description: | + The first region is the MAC core register base and size. + The second region is the global MAC control register. + + ranges: + maxItems: 1 + + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 3 + maxItems: 3 + + clock-names: + items: + - const: mac + - const: macif + - const: phy + + resets: + minItems: 2 + maxItems: 2 + + reset-names: + items: + - const: mac + - const: phy + + hisilicon,phy-reset-delays-us: + minItems: 3 + maxItems: 3 + description: | + The 1st cell is reset pre-delay in micro seconds. + The 2nd cell is reset pulse in micro seconds. + The 3rd cell is reset post-delay in micro seconds. + +patternProperties: + '^mdio@[0-9a-f]+$': + type: object + description: See ./hisi-femac-mdio.txt + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - resets + - reset-names + - phy-connection-type + - phy-handle + - hisilicon,phy-reset-delays-us + +unevaluatedProperties: false + +examples: + - | + #include + #include + + #ifndef HISTB_ETH0_PHY_CLK + #define HISTB_ETH0_PHY_CLK 0 + #endif + femac: ethernet@9c30000 { + compatible = "hisilicon,hi3798mv200-femac"; + reg = <0x9c30000 0x1000>, <0x9c31300 0x200>; + ranges = <0x0 0x9c30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + interrupts = ; + clocks = <&crg HISTB_ETH0_MAC_CLK>, + <&crg HISTB_ETH0_MACIF_CLK>, + <&crg HISTB_ETH0_PHY_CLK>; + clock-names = "mac", "macif", "phy"; + resets = <&crg 0xd0 3>, <&crg 0x388 4>; + reset-names = "mac", "phy"; + phy-handle = <&fephy>; + phy-connection-type = "mii"; + // To be filled by bootloader + mac-address = [00 00 00 00 00 00]; + hisilicon,phy-reset-delays-us = <10000 10000 500000>; + status = "okay"; + + mdio: mdio@1100 { + compatible = "hisilicon,hisi-femac-mdio"; + reg = <0x1100 0x20>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + fephy: ethernet-phy@1 { + reg = <1>; + #phy-cells = <0>; + }; + }; + };