From patchwork Mon Mar 20 15:50:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 13181529 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 79EB5C76195 for ; Mon, 20 Mar 2023 16:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233413AbjCTQBN (ORCPT ); Mon, 20 Mar 2023 12:01:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233562AbjCTQAW (ORCPT ); Mon, 20 Mar 2023 12:00:22 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87D173E098; Mon, 20 Mar 2023 08:50:38 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id t17-20020a05600c451100b003edc906aeeaso1726006wmo.1; Mon, 20 Mar 2023 08:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679327429; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4WowCy7T0H+njmwrpybA4xHuDLSu+Hwz5aLcZi6Vxww=; b=kd+30FD1OD+jrXvzXKpCPBrsvUQpndE/ohh32I8bnf+Mq7tGL/fzCno/sNvQOggJkv iOMXTik9K10LefkzWNufRbIkV/cNEQPnN6fqNArPUAHv6NcS14H6dB92u2S/lkmjxj79 QQk1y2Lg4QfKCGQXZOuHlFdyuJ/QioX+xSK+jKuBz0N0NQS/duwsmVglMrhS20da/17Q sc6tZowjzzXxNNgZp5mWheJB1civrE+Mp4180YEUenqg7Qz1tUypZxh/9q/3RmdNwK+4 B2muT45W0/mePyY3mpy05nqmRW2l+B9ssXW0fMBFMLnd+6/qYk60WtS9ZWlNBKr4MWOp QJKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679327429; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4WowCy7T0H+njmwrpybA4xHuDLSu+Hwz5aLcZi6Vxww=; b=RlVGCuDkb4raTUiJX4WibUqKbsm9TCM8tJ7lA0FTozyx7MbFHA+5ewd5O7tvQ3Kqj6 WSvh7MMWifXTqM80r9qVhAFM3zT8dj1J2KF/KPz3L7bU+QYYCZRAbwevIn+pvP8NO2Ur zMcPNr3BsAs6Zi7IMSe7iJyd1ogNyNW11krY+Iw4cdP7GInULxLU5MLmS/L9VD0liCQN YereUJk7YOUcyecy+3niOiWqJsHCuiAfu1zMgoIFcCKR6GnmdRBQU1fix36sBD4DfdoJ eGJun/b3f34L0wo36FTWU8+hfBFXa860UUwaQVVUNGzoqBOvoGUISeE6AeOqpPYKI10u 41Iw== X-Gm-Message-State: AO0yUKWf/Q3ebQiFtsN4zh5dOkOmKdWQ8fu2t5qcdDF16zun6g9gpq7Q NfP+TxopIX5HDx7/ekF6zcc= X-Google-Smtp-Source: AK7set86QvkM5ncFkafXcXRdyFB+9Y3Qn8kU8UkN8z/voSwFKxjgAJVrAN0Fwh5YpjFVr7Z8M3QrDw== X-Received: by 2002:a05:600c:40c:b0:3ed:358e:c1ec with SMTP id q12-20020a05600c040c00b003ed358ec1ecmr80342wmb.0.1679327429411; Mon, 20 Mar 2023 08:50:29 -0700 (PDT) Received: from atlantis.lan (255.red-79-146-124.dynamicip.rima-tde.net. [79.146.124.255]) by smtp.gmail.com with ESMTPSA id 3-20020a05600c020300b003eddefd8792sm4812333wmi.14.2023.03.20.08.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 08:50:29 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: f.fainelli@gmail.com, andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Subject: [PATCH 1/4] dt-bindings: net: dsa: b53: add more 63xx SoCs Date: Mon, 20 Mar 2023 16:50:21 +0100 Message-Id: <20230320155024.164523-2-noltari@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230320155024.164523-1-noltari@gmail.com> References: <20230320155024.164523-1-noltari@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org BCM6318, BCM6362 and BCM63268 are SoCs with a B53 MMAP switch. Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Simon Horman Reviewed-by: Florian Fainelli Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml index 5bef4128d175..57e0ef93b134 100644 --- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml +++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml @@ -57,8 +57,11 @@ properties: - items: - enum: - brcm,bcm3384-switch + - brcm,bcm6318-switch - brcm,bcm6328-switch + - brcm,bcm6362-switch - brcm,bcm6368-switch + - brcm,bcm63268-switch - const: brcm,bcm63xx-switch required: From patchwork Mon Mar 20 15:50:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 13181527 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 70553C6FD1D for ; Mon, 20 Mar 2023 16:01:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233364AbjCTQA5 (ORCPT ); Mon, 20 Mar 2023 12:00:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233532AbjCTQAP (ORCPT ); Mon, 20 Mar 2023 12:00:15 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A422B3E0B3; Mon, 20 Mar 2023 08:50:37 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id t17-20020a05600c451100b003edc906aeeaso1726035wmo.1; Mon, 20 Mar 2023 08:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679327430; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NmGOzoXiGILw8p8HpY3VfgsDYOA5bH4v8OqaYevH4J4=; b=KptaZem0Zxnxtwy+VdrvXw5NY/HSYmbxmV8+mSnoXZgQGHLjW/gCyDXpzRqcSBXIGV fvtFTanvZcTCA4f/cyoAkEsqIkmQyDHwEshHutyJEaWN9q3yB5eTAnUcq4z3e7P4nTu2 +ZOho9zDyRb4r24J6UbiN9ZUzcsuYVQwm1Qz0zJ+63dx+gD20hgCL+7775pvqoFYwgpP 1ABgO6OngXBB42/L8+ZBwsg3mXy06HuqMLEQK/FmtcXjTml0OaO3S5cJvUdNGsdNrvx+ kaTtRBBzqin3DRExaIekr/jPzOB3X1oV2TzhInT4SPhtULIah750U4ljBqf92PwnjvHc 6JDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679327430; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NmGOzoXiGILw8p8HpY3VfgsDYOA5bH4v8OqaYevH4J4=; b=GsByHVP16hADSORlzScxFXsjTNWGBbyYNiWQHZzojsE/ffOZrXokZWDNH4GTlB7uv4 4Gs1NNLT8Bk95OjDvHAm5bJxZGwyfeHZeTqxBpBlGapyqb2D9XGxpYXbF9VaQgd7oKjN v7Si3AKtD8g7o//OkdsslkT8JxzhdjmHK0pJN9ssxhHMePGutYkZH+n7JlIrQVaDs7iU nvg1lcFLNvn+MrLpNE5r8KMIPdTwGMIOQAuZ1tqttHrGRkfi92KF1p93p/Qn8uDIGO/B ocZHPyMlXDh/Q7Qjsy/BihOrW3+cSZm7OomPh8vWhppGKwkxLYCZAsKeDGOjLvfdV2Rf lZwQ== X-Gm-Message-State: AO0yUKW2wNtd5kSfm2dxbqnhxVZrNkzLVVdLsO0eADsnjtWufqMWFS0a ZubXW4z6gV3Oqv2lPuWyQDU= X-Google-Smtp-Source: AK7set8bMf4RMiUM14onDSGmYFsmJuDQ+P9yadvVBWt05IjyUwc/8tNalTsC2hQ62KhoCUpBfCEb7g== X-Received: by 2002:a05:600c:468c:b0:3eb:38b0:e748 with SMTP id p12-20020a05600c468c00b003eb38b0e748mr10091873wmo.13.1679327430592; Mon, 20 Mar 2023 08:50:30 -0700 (PDT) Received: from atlantis.lan (255.red-79-146-124.dynamicip.rima-tde.net. [79.146.124.255]) by smtp.gmail.com with ESMTPSA id 3-20020a05600c020300b003eddefd8792sm4812333wmi.14.2023.03.20.08.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 08:50:30 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: f.fainelli@gmail.com, andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Subject: [PATCH 2/4] net: dsa: b53: mmap: add more BCM63xx SoCs Date: Mon, 20 Mar 2023 16:50:22 +0100 Message-Id: <20230320155024.164523-3-noltari@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230320155024.164523-1-noltari@gmail.com> References: <20230320155024.164523-1-noltari@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org BCM6318, BCM6362 and BCM63268 are SoCs with a B53 MMAP switch. Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Florian Fainelli --- drivers/net/dsa/b53/b53_mmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c index 70887e0aece3..464c77e10f60 100644 --- a/drivers/net/dsa/b53/b53_mmap.c +++ b/drivers/net/dsa/b53/b53_mmap.c @@ -331,8 +331,11 @@ static void b53_mmap_shutdown(struct platform_device *pdev) static const struct of_device_id b53_mmap_of_table[] = { { .compatible = "brcm,bcm3384-switch" }, + { .compatible = "brcm,bcm6318-switch" }, { .compatible = "brcm,bcm6328-switch" }, + { .compatible = "brcm,bcm6362-switch" }, { .compatible = "brcm,bcm6368-switch" }, + { .compatible = "brcm,bcm63268-switch" }, { .compatible = "brcm,bcm63xx-switch" }, { /* sentinel */ }, }; From patchwork Mon Mar 20 15:50:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 13181525 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 AA605C7618D for ; Mon, 20 Mar 2023 16:00:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233060AbjCTQAk (ORCPT ); Mon, 20 Mar 2023 12:00:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233508AbjCTQAL (ORCPT ); Mon, 20 Mar 2023 12:00:11 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8A523E0BA; Mon, 20 Mar 2023 08:50:37 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id fm20-20020a05600c0c1400b003ead37e6588so9459945wmb.5; Mon, 20 Mar 2023 08:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679327432; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=16/AUEfT4/3aNTDuWfjKv1lfTz12+h3pg0SmLHFA5Y8=; b=n+22dPTXjE1jqw2beYW8Kqab5uczPETidauati8u3xeWTbKyfCENVVcYJBQgNPM3pw BeH+srFpkROFpxJ+btOlNSEZA4pIuBf2EOOU4AWrlPTWglRDxVHZ3X7kVDptJnxVGvre zNQ31LP8wxHP9XSFxYbkK9ybYYC8WP3fQZwcGcAgliP2cbKQMwuUP/i2w3Hqml8t6rP1 5HaZgmWt9wdh8c76nCWP03IuNM9oJ9qa3YWDBrVVN2eMe0mGxZmKR+Wb/BZj3o5ezJmu q41drXRwHBC6vF1K+HHeOgAcMlTKIJUAo2daNVm/UBTXj2SXsvfh4nfgrWVAexOpd/uP elYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679327432; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=16/AUEfT4/3aNTDuWfjKv1lfTz12+h3pg0SmLHFA5Y8=; b=6ZfI8DXxxDA2NF5hw1Mfoc/pGgW+OfRfwgMoE4jB/ABbQg8zdQ/Ja7FGIqVPbi2hZe fvd7j+dw8CZvNbkRbsYQvMTwRfDRonn8aAwJBBNkMyTcm8s3D5BRURzVpe0ScyzPYvxQ 0cXZASSL+EXA7Fyf51y4emSNy6Xb3nY0pjKWFUphqra9TdFQzhtnpdlN3tTwXFN9jlEu 3Se1FWEiQP5FRtqXIU/oefh5FMXoJEDCKq8geZ04mouAdeVxZd/FUBR754EY6uNAhMVG hef4iX7HeDpTCJLCprNVFgQ80bbl/uh+QnBtEVGlDFcH4GR7csGSIp2g/3Qzj/m78rkz ml1Q== X-Gm-Message-State: AO0yUKUPCBZQSCICZA8m4nHTp32xYgPPzQnSGO9a0aop0wLJeOUszuYx hH7zNhPrx7BZWaytny88AN0= X-Google-Smtp-Source: AK7set9y2vPkyUF0Tln19u08/DwcR4L11U6iFXPmpi6kdzFhq0OrCiFNu8aAeCvisP/C/rvYvKH9Lw== X-Received: by 2002:a05:600c:310e:b0:3e9:f15b:935b with SMTP id g14-20020a05600c310e00b003e9f15b935bmr34745262wmo.32.1679327432097; Mon, 20 Mar 2023 08:50:32 -0700 (PDT) Received: from atlantis.lan (255.red-79-146-124.dynamicip.rima-tde.net. [79.146.124.255]) by smtp.gmail.com with ESMTPSA id 3-20020a05600c020300b003eddefd8792sm4812333wmi.14.2023.03.20.08.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 08:50:31 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: f.fainelli@gmail.com, andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Subject: [PATCH 3/4] net: dsa: b53: mmap: allow passing a chip ID Date: Mon, 20 Mar 2023 16:50:23 +0100 Message-Id: <20230320155024.164523-4-noltari@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230320155024.164523-1-noltari@gmail.com> References: <20230320155024.164523-1-noltari@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org BCM63268 SoCs require a special handling for their RGMIIs, so we should be able to identify them as a special BCM63xx switch. Signed-off-by: Álvaro Fernández Rojas --- drivers/net/dsa/b53/b53_mmap.c | 32 +++++++++++++++++++++++--------- drivers/net/dsa/b53/b53_priv.h | 9 ++++++++- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c index 464c77e10f60..706df04b6cee 100644 --- a/drivers/net/dsa/b53/b53_mmap.c +++ b/drivers/net/dsa/b53/b53_mmap.c @@ -248,7 +248,7 @@ static int b53_mmap_probe_of(struct platform_device *pdev, return -ENOMEM; pdata->regs = mem; - pdata->chip_id = BCM63XX_DEVICE_ID; + pdata->chip_id = (u32)device_get_match_data(dev); pdata->big_endian = of_property_read_bool(np, "big-endian"); of_ports = of_get_child_by_name(np, "ports"); @@ -330,14 +330,28 @@ static void b53_mmap_shutdown(struct platform_device *pdev) } static const struct of_device_id b53_mmap_of_table[] = { - { .compatible = "brcm,bcm3384-switch" }, - { .compatible = "brcm,bcm6318-switch" }, - { .compatible = "brcm,bcm6328-switch" }, - { .compatible = "brcm,bcm6362-switch" }, - { .compatible = "brcm,bcm6368-switch" }, - { .compatible = "brcm,bcm63268-switch" }, - { .compatible = "brcm,bcm63xx-switch" }, - { /* sentinel */ }, + { + .compatible = "brcm,bcm3384-switch", + .data = (void *)BCM63XX_DEVICE_ID, + }, { + .compatible = "brcm,bcm6318-switch", + .data = (void *)BCM63XX_DEVICE_ID, + }, { + .compatible = "brcm,bcm6328-switch", + .data = (void *)BCM63XX_DEVICE_ID, + }, { + .compatible = "brcm,bcm6362-switch", + .data = (void *)BCM63XX_DEVICE_ID, + }, { + .compatible = "brcm,bcm6368-switch", + .data = (void *)BCM63XX_DEVICE_ID, + }, { + .compatible = "brcm,bcm63268-switch", + .data = (void *)BCM63268_DEVICE_ID, + }, { + .compatible = "brcm,bcm63xx-switch", + .data = (void *)BCM63XX_DEVICE_ID, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, b53_mmap_of_table); diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h index 4cf9f540696e..a689a6950189 100644 --- a/drivers/net/dsa/b53/b53_priv.h +++ b/drivers/net/dsa/b53/b53_priv.h @@ -70,6 +70,7 @@ enum { BCM53125_DEVICE_ID = 0x53125, BCM53128_DEVICE_ID = 0x53128, BCM63XX_DEVICE_ID = 0x6300, + BCM63268_DEVICE_ID = 0x63268, BCM53010_DEVICE_ID = 0x53010, BCM53011_DEVICE_ID = 0x53011, BCM53012_DEVICE_ID = 0x53012, @@ -191,7 +192,13 @@ static inline int is531x5(struct b53_device *dev) static inline int is63xx(struct b53_device *dev) { - return dev->chip_id == BCM63XX_DEVICE_ID; + return dev->chip_id == BCM63XX_DEVICE_ID || + dev->chip_id == BCM63268_DEVICE_ID; +} + +static inline int is63268(struct b53_device *dev) +{ + return dev->chip_id == BCM63268_DEVICE_ID; } static inline int is5301x(struct b53_device *dev) From patchwork Mon Mar 20 15:50:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 13181526 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 93F5BC6FD1D for ; Mon, 20 Mar 2023 16:00:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233333AbjCTQAy (ORCPT ); Mon, 20 Mar 2023 12:00:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233519AbjCTQAM (ORCPT ); Mon, 20 Mar 2023 12:00:12 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA2C438B53; Mon, 20 Mar 2023 08:50:38 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id iw17so2507691wmb.0; Mon, 20 Mar 2023 08:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679327433; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WlRvHn65p7ApqB1hkWXEl334dlDtfL7sexIylSD7RF8=; b=Xb9J1kzvH/7/KC9kfFPe5nfM0jOx0VqmPqlTVHQ2ICuE/eznYiDnZR2GROkiEBeSW5 aj8nTpjx/Zgj9GE1Ere9JmGDP4qH6Ms4GG1dcgxiwCZUubj8EmKPPzq+xRYgui52JXXZ GG9yZPfp/eWkFHvSgIPzHyC1iWc88F8XSN7+xdXyC7MOoEWIbvy0y04VrbuO9p8+RjCl XbF+dk2kkZAseZ7QMlgJZ2Bt8HfHx2I4D6+r4BhyVy6oIsdzkMTei+drCezAB5fFzerw y3GD2qAHDRRSrMpv7wTUuM9Erg/6k7sGs+HKjLlgmmAwT7LMqxNkXvmZeU5IucnlPzyQ zxGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679327433; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WlRvHn65p7ApqB1hkWXEl334dlDtfL7sexIylSD7RF8=; b=mx+DrcUS/RrkssaKZwtjxNb1RtQP6+pwhyW7/EaPvgWZPMBZeDHy7B+x5GRw7gA8l5 lIqtZ41yhnrcZ8wp6SSyG+pJJ2Xn4q0N8W3NJS8vZz5/ORmoRdLxyNY8IdlTQlmjV9YT jY1LCVegFoErlMPP49XZ1fzJtRPIeFv0MZphvdw7nXk5yhg4+vpnfCPKzOJdOmpEgfut GnIW/BBXCezqjF0GT9Lmp61lPf1j0PCq8lmrcrZtKwI11zyVmOPqgdWmkRh+YirD5L0P ORDeuqwz5SkyDZ+Sw+dahSLeLtZ/VB+58nFWPpxF4yUw/sKPrhpkZfGzo/VN/jDL1ZfN 1t3w== X-Gm-Message-State: AO0yUKVurWpxXw8kQLLJFFk7zmIVuc+hSmpXM9lpLIB/ByDuw5z3fAds TZs+QVHvNnvyK9ovwNMJwU0= X-Google-Smtp-Source: AK7set8fEPc92nUNA58HgNEL8eOH1DCae42kd5S11MkuO5+TV9yIVNP77n+5gS3XrTpCzsFfJmaf/A== X-Received: by 2002:a05:600c:470e:b0:3eb:42fc:fb30 with SMTP id v14-20020a05600c470e00b003eb42fcfb30mr34204824wmo.32.1679327433327; Mon, 20 Mar 2023 08:50:33 -0700 (PDT) Received: from atlantis.lan (255.red-79-146-124.dynamicip.rima-tde.net. [79.146.124.255]) by smtp.gmail.com with ESMTPSA id 3-20020a05600c020300b003eddefd8792sm4812333wmi.14.2023.03.20.08.50.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 08:50:32 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: f.fainelli@gmail.com, andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Subject: [PATCH 4/4] net: dsa: b53: add BCM63268 RGMII configuration Date: Mon, 20 Mar 2023 16:50:24 +0100 Message-Id: <20230320155024.164523-5-noltari@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230320155024.164523-1-noltari@gmail.com> References: <20230320155024.164523-1-noltari@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org BCM63268 requires special RGMII configuration to work. Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Florian Fainelli Reviewed-by: Simon Horman --- drivers/net/dsa/b53/b53_common.c | 6 +++++- drivers/net/dsa/b53/b53_regs.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 6e212f6f1cb9..d0a22c8a55c9 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1240,8 +1240,12 @@ static void b53_adjust_63xx_rgmii(struct dsa_switch *ds, int port, break; } - if (port != dev->imp_port) + if (port != dev->imp_port) { + if (is63268(dev)) + rgmii_ctrl |= RGMII_CTRL_MII_OVERRIDE; + rgmii_ctrl |= RGMII_CTRL_ENABLE_GMII; + } b53_write8(dev, B53_CTRL_PAGE, off, rgmii_ctrl); diff --git a/drivers/net/dsa/b53/b53_regs.h b/drivers/net/dsa/b53/b53_regs.h index b2c539a42154..bfbcb66bef66 100644 --- a/drivers/net/dsa/b53/b53_regs.h +++ b/drivers/net/dsa/b53/b53_regs.h @@ -138,6 +138,7 @@ #define B53_RGMII_CTRL_IMP 0x60 #define RGMII_CTRL_ENABLE_GMII BIT(7) +#define RGMII_CTRL_MII_OVERRIDE BIT(6) #define RGMII_CTRL_TIMING_SEL BIT(2) #define RGMII_CTRL_DLL_RXC BIT(1) #define RGMII_CTRL_DLL_TXC BIT(0)