Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2484850ybb; Mon, 30 Mar 2020 07:06:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtdlZlXGyq55hIpL2/tPnXxqhJaVGUD2I4qxZZ7ZHfCd1pQ6dEIzvtPJElC+QzlRLYxYyHj X-Received: by 2002:aca:682:: with SMTP id 124mr7742658oig.69.1585577190484; Mon, 30 Mar 2020 07:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585577190; cv=none; d=google.com; s=arc-20160816; b=lXhgJvjftyFzqPx9wyfkemq1FVWXZWQaQlSTrk/ql8a5eCIQpaBXDA79yJ2bmFWcsn Gx4Qcq+TWg9h4k2U4bMD/dQAk1ilgjHc4V1v0HNl3eCrAMGh7hKUM1EHQgHBct/VB1o0 pfi/u7xi7eNVwItb255GMRWZlepVH7tRUU/5DN5rx3l9Zear7VOLGbsB8+EWmuZdlsfr Yq9g2/t5K+kcgiGbyAq8UL3jZ3ZgHIcW7mjVuGEhAbWSQUmCnfKtN0wPyhjH3fJ1eQQl LteAC0SLyrwG0Cb15zPVKoQ/BZW2wP/eV6mfzAiyx+45KkEWvqlUZcktsQxHR+h3XWCO cmQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:dkim-signature:ironport-sdr; bh=+PeZ/LcXTYP0TDgjJDFxL8n+39bQtNbh8qkEGbC5FkA=; b=yWRMuBy7y83pvId2WSDBGjs1+RiaDRoLoVcf/DIhDgTwalWd4IONUPJfZUReeSWLn2 nk/ElypBrC47K9z/e2idS2zL0kwz991LkxuhAwlJBigGvIhRP2skBKMASPnGq+OcAi/L yGItgN6i8LE2mZdFiP/AF7u70cpT5R8qHXTJ2FSpEcSC/IZP4fqAth/h43Wxvt3hi2Lk TvzvhFrSz3K0nNvlmFR8j1CU1f6dHA3MlWfOERUx8Yrj6jqfLybD6qme9fwkGHer6YX5 bJHdYTvI3GZEgQRYNIda4x7v5+Nc89axH6bwHMXp0NEvo7veIuwr8ltpu1MoHlJ1EvPA uGzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tq-group.com header.s=key1 header.b=ddbV1GfR; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si6620632otn.91.2020.03.30.07.06.08; Mon, 30 Mar 2020 07:06:30 -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=fail header.i=@tq-group.com header.s=key1 header.b=ddbV1GfR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728658AbgC3Nyg (ORCPT + 99 others); Mon, 30 Mar 2020 09:54:36 -0400 Received: from mx1.tq-group.com ([62.157.118.193]:50882 "EHLO mx1.tq-group.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725268AbgC3Nyd (ORCPT ); Mon, 30 Mar 2020 09:54:33 -0400 IronPort-SDR: oGXIKI9EGh+fVJpyD9YJqx6xqBN/HkJd+f7H8MGqr/yMg66J4RJlUaWzREy5ukW2jHssjHSOH5 KN/87vYXunlmHP9YSKOc+LafTYwLheRfAF+VfXx+gkRO975yZ9MO4sEhQ8llW5K3bB4R2am7TM pQp1spHPlzl985T9kSsCQnvLpV1+A8y1oUFA1gi4+9txd/dIQ9KJlezlUVSah0xbiVb6Q3Umkb dgTQQnq5hinHLJwucWR7NB9SoI4zGSt46vDr+mwYyE+ErqJaLDG0W4DqWNHzHHIpl6e2VU205I 4kg= X-IronPort-AV: E=Sophos;i="5.72,324,1580770800"; d="scan'208";a="11606920" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 30 Mar 2020 15:54:28 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Mon, 30 Mar 2020 15:54:28 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Mon, 30 Mar 2020 15:54:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1585576468; x=1617112468; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=RTtPPxYYq8t3b00GlV/IZO1O9+uF2d8Ca1m7XVY2DW8=; b=ddbV1GfRNFhkyoePnNIkP+HO9J9SPiPr7qDzp0GIL7e1I/VvDKRS0krh ExHbo3c7+lDhmrA5lyreeo4ZgBSRKFB7zPEcYBy+WqKdNc5o2qMfwMgXW ZpdfXTUxVjlxGvbrc18NQUU41TWqFVJ5Bn0Wbd4cfQIGyRh90eR6c30UQ +uC8gZ74kELRI43lxyGJJnex84fv2Pc99sa6LHUz6IMt1xHQej+f2r2PG YrUAgkApjVn3JTIMfGDTgWE56tX/v7RljAqDhG0IlZkczLN5xI0nrYmOW y0tkR35dN4YQH8PUk0GwlluAG3InlD4+9Q/S7gljawvNOqCjwdOW6Fapw Q==; IronPort-SDR: flzfqq2x4NGX/BErTh3OgyX0pn0uX7s4Q9Hda0z7nZUTPqUV5qa7agyhmFK4aRPEIsMxM5J+tM QqEuetvKOjw8NG2Y1VDDxwQWMu/FRfM7xHRGpqFq1xM4d3YiiWH88VVUAAL/9dUmzBe42XiGDf b0ZTFwW0V/I6eVwFgd4vbgLoPjhY/4111MVRa77oBV/FYO94fy330moDmmzcsyGHjkcmaquCjx 5PmPyR+nm/GTy8yRiEZcpebnR7mQisrhvw6k+a+Svo8qvbWzDPQje4Y714l8lWBXkNmGxmzrkY TwA= X-IronPort-AV: E=Sophos;i="5.72,324,1580770800"; d="scan'208";a="11606919" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 30 Mar 2020 15:54:28 +0200 Received: from schifferm-ubuntu4.tq-net.de (schifferm-ubuntu4.tq-net.de [10.117.49.26]) by vtuxmail01.tq-net.de (Postfix) with ESMTPA id 1FCFE280065; Mon, 30 Mar 2020 15:54:33 +0200 (CEST) From: Matthias Schiffer To: andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Matthias Schiffer Subject: [PATCH net-next 3/4] net: dsa: mv88e6xxx: implement get_phy_address Date: Mon, 30 Mar 2020 15:53:44 +0200 Message-Id: <20200330135345.4361-3-matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200330135345.4361-1-matthias.schiffer@ew.tq-group.com> References: <20200330135345.4361-1-matthias.schiffer@ew.tq-group.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid the need to specify a PHY for each physical port in the device tree when phy_base_addr is not 0 (6250 and 6341 families). This change should be backwards-compatible with existing device trees, as it only adds sensible defaults where explicit definitions were required before. Signed-off-by: Matthias Schiffer --- drivers/net/dsa/mv88e6xxx/chip.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 221593261e8f..228c1b085b66 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -5379,6 +5379,13 @@ static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds, return chip->info->tag_protocol; } +static int mv88e6xxx_get_phy_address(struct dsa_switch *ds, int port) +{ + struct mv88e6xxx_chip *chip = ds->priv; + + return chip->phy_base_addr + port; +} + static int mv88e6xxx_port_mdb_prepare(struct dsa_switch *ds, int port, const struct switchdev_obj_port_mdb *mdb) { @@ -5509,6 +5516,7 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = { .get_tag_protocol = mv88e6xxx_get_tag_protocol, .setup = mv88e6xxx_setup, .teardown = mv88e6xxx_teardown, + .get_phy_address = mv88e6xxx_get_phy_address, .phylink_validate = mv88e6xxx_validate, .phylink_mac_link_state = mv88e6xxx_serdes_pcs_get_state, .phylink_mac_config = mv88e6xxx_mac_config, -- 2.17.1