From patchwork Mon Apr 18 23:35:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luiz Angelo Daros de Luca X-Patchwork-Id: 12817162 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD58AC433EF for ; Mon, 18 Apr 2022 23:36:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235505AbiDRXjC (ORCPT ); Mon, 18 Apr 2022 19:39:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235478AbiDRXjA (ORCPT ); Mon, 18 Apr 2022 19:39:00 -0400 Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23A2C27FF8; Mon, 18 Apr 2022 16:36:19 -0700 (PDT) Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-e5e433d66dso4456574fac.5; Mon, 18 Apr 2022 16:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xiiRzsI3K3MJOoT1BFbBBI2gKgU/fIkJXjdOpkTK3rY=; b=FYpU59LSL4ZaXSLnZ1Gd7jQCWeukDl4ixeXQZzNZf5ZzOfwl2nxmN3wEacS4HhBrf7 qpbLuow8crfFle5Dq517LYX2HcYhw8Ep/kl93b1BmdW/vmAPcvYfuT6+L4LrX0gNm43Z nOd9AglT7G+txihqop6EdszMhRPZkDUXLkUGhmE9pGVLHgFLLP+3xjcHrlarxuQKcmnY OB7nz2EDQkSc0aLl80DtjE/Dkm3vR4EMBhqrn+bjIQpn5rb9scDErzTcLPwprtSrQdOd YK69LtQLGAWepPPgzvNKJamF56R1wjlzfAWb+PNIENkCllke5O3eIueXtr3xQAY/cJgh p9Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xiiRzsI3K3MJOoT1BFbBBI2gKgU/fIkJXjdOpkTK3rY=; b=rPLxX3n8yA/pbZ+NPoddZhdah6pXeo3Gpp4mFwPDqf/GEONUgCJLW8D6EbHRd8lmJz N+mAk0wm1b1l3Q65cH9yPCTM1Fl9Rq0ORF0ON63cCFTLk3rcjTVd4dmw9yRC+thk3dmo KtZzSMu44bwjd4fGwxCJiDvsRhRiD7KuTbHVLiWA+CmpAGLg4r/G376b04JK7F6jsHV6 D5OF4k4vCWMMtVaHBLJc9h/k0OXUchfEx0EGdsp01HPuCFonEider8R3SfgFGhRneUu/ l2JZVUSBlerfZ0OJSiOt2jJaYb88wwzsdR3HZdx+vKygKzyjem3GyvM6CpxbpGK0QD+e 8aZA== X-Gm-Message-State: AOAM533KQNh5bXvV9LN1zIT+d5Cv+IGccTyOMjzK5zENLXPhFomlsspw E6UioWP/rZZVdUHUaMHUvNj7g3INsZLOyw== X-Google-Smtp-Source: ABdhPJwJLOFdCI61l2bkT2pcmVq1eliFK9y7l6GNPggUwYjzNFe39zKPYCylxsgs8ayOE1yD2YlH5Q== X-Received: by 2002:a05:6870:b408:b0:dd:ed4f:b1c7 with SMTP id x8-20020a056870b40800b000dded4fb1c7mr5611715oap.41.1650324978163; Mon, 18 Apr 2022 16:36:18 -0700 (PDT) Received: from tresc043793.tre-sc.gov.br (187-049-235-234.floripa.net.br. [187.49.235.234]) by smtp.gmail.com with ESMTPSA id k14-20020a0568080e8e00b003224d35c729sm3674179oil.3.2022.04.18.16.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 16:36:17 -0700 (PDT) From: Luiz Angelo Daros de Luca To: netdev@vger.kernel.org Cc: linus.walleij@linaro.org, alsi@bang-olufsen.dk, andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzk+dt@kernel.org, arinc.unal@arinc9.com, Luiz Angelo Daros de Luca , devicetree@vger.kernel.org Subject: [PATCH net v2 1/2] dt-bindings: net: dsa: realtek: cleanup compatible strings Date: Mon, 18 Apr 2022 20:35:57 -0300 Message-Id: <20220418233558.13541-1-luizluca@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Compatible strings are used to help the driver find the chip ID/version register for each chip family. After that, the driver can setup the switch accordingly. Keep only the first supported model for each family as a compatible string and reference other chip models in the description. The removed compatible strings have never been used in a released kernel. CC: devicetree@vger.kernel.org Link: https://lore.kernel.org/netdev/20220414014055.m4wbmr7tdz6hsa3m@bang-olufsen.dk/ Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Andrew Lunn Acked-by: Arınç ÜNAL Reviewed-by: Alvin Šipraga --- .../devicetree/bindings/net/dsa/realtek.yaml | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index 8756060895a8..99ee4b5b9346 100644 --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml @@ -27,32 +27,25 @@ description: The realtek-mdio driver is an MDIO driver and it must be inserted inside an MDIO node. + The compatible string is only used to identify which (silicon) family the + switch belongs to. Roughly speaking, a family is any set of Realtek switches + whose chip identification register(s) have a common location and semantics. + The different models in a given family can be automatically disambiguated by + parsing the chip identification register(s) according to the given family, + avoiding the need for a unique compatible string for each model. + properties: compatible: enum: - realtek,rtl8365mb - - realtek,rtl8366 - realtek,rtl8366rb - - realtek,rtl8366s - - realtek,rtl8367 - - realtek,rtl8367b - - realtek,rtl8367rb - - realtek,rtl8367s - - realtek,rtl8368s - - realtek,rtl8369 - - realtek,rtl8370 description: | - realtek,rtl8365mb: 4+1 ports - realtek,rtl8366: 5+1 ports - realtek,rtl8366rb: 5+1 ports - realtek,rtl8366s: 5+1 ports - realtek,rtl8367: - realtek,rtl8367b: - realtek,rtl8367rb: 5+2 ports - realtek,rtl8367s: 5+2 ports - realtek,rtl8368s: 8 ports - realtek,rtl8369: 8+1 ports - realtek,rtl8370: 8+2 ports + realtek,rtl8365mb: + Use with models RTL8363NB, RTL8363NB-VB, RTL8363SC, RTL8363SC-VB, + RTL8364NB, RTL8364NB-VB, RTL8365MB, RTL8366SC, RTL8367RB-VB, RTL8367S, + RTL8367SB, RTL8370MB, RTL8310SR + realtek,rtl8366rb: + Use with models RTL8366RB, RTL8366S mdc-gpios: description: GPIO line for the MDC clock line. @@ -335,7 +328,7 @@ examples: #size-cells = <0>; switch@29 { - compatible = "realtek,rtl8367s"; + compatible = "realtek,rtl8365mb"; reg = <29>; reset-gpios = <&gpio2 20 GPIO_ACTIVE_LOW>; From patchwork Mon Apr 18 23:35:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luiz Angelo Daros de Luca X-Patchwork-Id: 12817163 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34C7FC433EF for ; Mon, 18 Apr 2022 23:36:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235507AbiDRXjE (ORCPT ); Mon, 18 Apr 2022 19:39:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235478AbiDRXjD (ORCPT ); Mon, 18 Apr 2022 19:39:03 -0400 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15FFE2125E for ; Mon, 18 Apr 2022 16:36:23 -0700 (PDT) Received: by mail-oi1-x235.google.com with SMTP id q129so16418006oif.4 for ; Mon, 18 Apr 2022 16:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O6J3ecYFHWqnaENNBasINK4rCLNlZJW9ysI1Bv27bf4=; b=F8S0dd3fM88Bl747EAP6b5KVTx2QBb250piBejarrfWT8GhUkJWhTIZTDjF3DR+EN8 tl86YvtQvlJD5K/Yq2Bg6nWl3O+JsIdaunLf9ZOMI7kdxqVabS4xAFkm/JTUYE1P+rwq uBa0XOZJ1oa9aLndQCOMtcRtrW+hb+Cdhe//Vv+F9DHPfH8dKdquEoZtBvq39wgF2kVR A5zJ/Kn0Mo8zt6Z3fxE1yJ5yWP5Z+feWM1T6nO9TvTdR+uvsCx09t2KzeGFdSI4DAjR6 FHQlh2tsPgxlpXuJC5bQDH2wdgvY8g47EWSFMFCz3GIAs6MWzWXqo55VSdSq6+M2Fm0A +zwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O6J3ecYFHWqnaENNBasINK4rCLNlZJW9ysI1Bv27bf4=; b=ZaP+8WxPF7QK/x/Qy1Hw/kJKUH2vsNKfz6dHOlAojurLsFA1uUJK2mZTYPViVZdLTv KlDjoSPgcdtyEKgHlGyo+C39lXKFsH0JOKBvt23NL1S7o1qq1X9rTNSaheX1JQlk3Umw ZnVLOeJLX5mCpds5fy6AXpFEpqM/61ZzeNOZ+cagKxsUfJgyjZE3ufc6/mGztIfFhBnG sEM+WrWBN14n59k23xzVGGAB6eZpo7jR9n4FGvuWMaAVO2fLTfwKO5uJftnTh48onCOL QtVL+H6ZbXh8MULJJwvA1KSkBiaDgSJNzEidX5KA/gXihgt0AWr4kQBZgvDtxbtQYkNC lTEQ== X-Gm-Message-State: AOAM530zE3hxz3ADY02m/1yj3wOV07giOta71immsgfj7kNBbiK+JTbK 0d07kmxUum+QM+XEdwq0IbZGqwSpr6eaWg== X-Google-Smtp-Source: ABdhPJyl650RS1S8ncTg43mq0ZD506aWc0vvNNXjUmrhEuHowxwz6ll34mt8GlhOJmCmlgfwyFpe8Q== X-Received: by 2002:a05:6808:1884:b0:2da:5cc2:2bbb with SMTP id bi4-20020a056808188400b002da5cc22bbbmr8303072oib.72.1650324982078; Mon, 18 Apr 2022 16:36:22 -0700 (PDT) Received: from tresc043793.tre-sc.gov.br (187-049-235-234.floripa.net.br. [187.49.235.234]) by smtp.gmail.com with ESMTPSA id k14-20020a0568080e8e00b003224d35c729sm3674179oil.3.2022.04.18.16.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 16:36:21 -0700 (PDT) From: Luiz Angelo Daros de Luca To: netdev@vger.kernel.org Cc: linus.walleij@linaro.org, alsi@bang-olufsen.dk, andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzk+dt@kernel.org, arinc.unal@arinc9.com, Luiz Angelo Daros de Luca Subject: [PATCH net v2 2/2] net: dsa: realtek: remove realtek,rtl8367s string Date: Mon, 18 Apr 2022 20:35:58 -0300 Message-Id: <20220418233558.13541-2-luizluca@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220418233558.13541-1-luizluca@gmail.com> References: <20220418233558.13541-1-luizluca@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There is no need to add new compatible strings for each new supported chip version. The compatible string is used only to select the subdriver (rtl8365mb.c or rtl8366rb.c). Once in the subdriver, it will detect the chip model by itself, ignoring which compatible string was used. Link: https://lore.kernel.org/netdev/20220414014055.m4wbmr7tdz6hsa3m@bang-olufsen.dk/ Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Alvin Šipraga Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Acked-by: Arınç ÜNAL --- drivers/net/dsa/realtek/realtek-mdio.c | 1 - drivers/net/dsa/realtek/realtek-smi.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/drivers/net/dsa/realtek/realtek-mdio.c b/drivers/net/dsa/realtek/realtek-mdio.c index 31e1f100e48e..c58f49d558d2 100644 --- a/drivers/net/dsa/realtek/realtek-mdio.c +++ b/drivers/net/dsa/realtek/realtek-mdio.c @@ -267,7 +267,6 @@ static const struct of_device_id realtek_mdio_of_match[] = { #endif #if IS_ENABLED(CONFIG_NET_DSA_REALTEK_RTL8365MB) { .compatible = "realtek,rtl8365mb", .data = &rtl8365mb_variant, }, - { .compatible = "realtek,rtl8367s", .data = &rtl8365mb_variant, }, #endif { /* sentinel */ }, }; diff --git a/drivers/net/dsa/realtek/realtek-smi.c b/drivers/net/dsa/realtek/realtek-smi.c index 6cec559c90ce..45992f79ec8d 100644 --- a/drivers/net/dsa/realtek/realtek-smi.c +++ b/drivers/net/dsa/realtek/realtek-smi.c @@ -551,10 +551,6 @@ static const struct of_device_id realtek_smi_of_match[] = { .compatible = "realtek,rtl8365mb", .data = &rtl8365mb_variant, }, - { - .compatible = "realtek,rtl8367s", - .data = &rtl8365mb_variant, - }, #endif { /* sentinel */ }, };