From patchwork Mon Jan 16 09:16:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 643217 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 0DE01C678D6 for ; Mon, 16 Jan 2023 09:17:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232361AbjAPJRN (ORCPT ); Mon, 16 Jan 2023 04:17:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232376AbjAPJQz (ORCPT ); Mon, 16 Jan 2023 04:16:55 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 608546EA3 for ; Mon, 16 Jan 2023 01:16:48 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id o15so19476698wmr.4 for ; Mon, 16 Jan 2023 01:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jQqy7tmNPC1sLB0qog9J3nsScKuE7+zMY2apGe1a7LY=; b=kaf9ULVPufRZua7B4XdDJbK0fz0YS33wTnOyjdev+zPeRS3mCSGhZ1fBQcXM+0SA44 DxXiGtm93SWoxgCmvT1tqQxqKkwAgNe1jRaTTD+HBIyqoYMoczZdGTtRcvUsNq2Q00km ATPU3q/WopXzNMdW3hvoempiWeKgzZ1ogoM4xX6ggPfannwE/kUDhU4ZfVtw2Mr6Yy86 LFbaB+VILy7tLIaAJQQBMSd7KyGxE9lLikfNe36hkLmjMC1lppCszlTbIkXSwD7rm+49 4LcsoyLkZGFuB1ZtlgtZizWit7vJOmL3z8Qz4X9frXYEeSpoGAkFksS66WciG6GmID79 xg1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jQqy7tmNPC1sLB0qog9J3nsScKuE7+zMY2apGe1a7LY=; b=KlFQ3zgaGIDgRqXtMP0ilMgXuA4sLetb+w0vE8K69EZ/vOI7HXfr8xlkoCV0YbGF3y GiR/hr5xuKVYG5XkpZxmbxSJcyOuM1bD0iATTqasmYFQN/IZn3Hm7hLe4uALrTIDc1BS TgdDxkvAGtoZXCtVyZ0N2YIha4xGAJ+k/ZScPJSdY+lbiUuRS5oZkxiOLU+JC4BNezu0 uDEaG6GEXbQ+rUyxzMnJCdY9EmDbRizxNErlrwY30wIXWDv0KAofobeoJ/hQOdWS2JGS 25DIzBzfFle8xqD6NCrp2vw3h//lJamOZnyH0QeW+B/NucPV1cS9isC4aoXc+wRox72p GH6Q== X-Gm-Message-State: AFqh2kpZ8QdlZO82l1/LKmJ6YIhfuvQ+9tLV/aouK8EOotyftDiuj83P fuk6Kw63rTs0zCpuuDY36c9log== X-Google-Smtp-Source: AMrXdXu9LWONh81BHjCmB6gNIdUCS0z8SVL3vdAXL+JwO2VJt70ZV99BaV8Tt983HoGGK8orA9dUWg== X-Received: by 2002:a05:600c:1c03:b0:3db:13f:c86c with SMTP id j3-20020a05600c1c0300b003db013fc86cmr669081wms.41.1673860606919; Mon, 16 Jan 2023 01:16:46 -0800 (PST) Received: from localhost.localdomain (82-65-169-74.subs.proxad.net. [82.65.169.74]) by smtp.googlemail.com with ESMTPSA id h19-20020a05600c351300b003d9a86a13bfsm35923491wmq.28.2023.01.16.01.16.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 01:16:46 -0800 (PST) From: Jerome Brunet To: netdev@vger.kernel.org, "David S. Miller" Cc: Jerome Brunet , linux-amlogic@lists.infradead.org, Kevin Hilman , Neil Armstrong , Da Xue , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 0/2] net: mdio: add amlogic gxl mdio mux support Date: Mon, 16 Jan 2023 10:16:34 +0100 Message-Id: <20230116091637.272923-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Patchwork-Bot: notify Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add support for the MDIO multiplexer found in the Amlogic GXL SoC family. This multiplexer allows to choose between the external (SoC pins) MDIO bus, or the internal one leading to the integrated 10/100M PHY. This multiplexer has been handled with the mdio-mux-mmioreg generic driver so far. When it was added, it was thought the logic was handled by a single register. It turns out more than a single register need to be properly set. As long as the device is using the Amlogic vendor bootloader, or upstream u-boot with net support, it is working fine since the kernel is inheriting the bootloader settings. Without net support in the bootloader, this glue comes unset in the kernel and only the external path may operate properly. With this driver (and the associated DT update), the kernel no longer relies on the bootloader to set things up, fixing the problem. This has been tested on the aml-s905x-cc (LePotato) for the internal path and the aml-s912-pc (Tartiflette) for the external path. Jerome Brunet (2): dt-bindings: net: add amlogic gxl mdio multiplexer net: mdio: add amlogic gxl mdio mux support .../bindings/net/amlogic,gxl-mdio-mux.yaml | 64 +++++++ drivers/net/mdio/Kconfig | 11 ++ drivers/net/mdio/Makefile | 1 + drivers/net/mdio/mdio-mux-meson-gxl.c | 160 ++++++++++++++++++ 4 files changed, 236 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/amlogic,gxl-mdio-mux.yaml create mode 100644 drivers/net/mdio/mdio-mux-meson-gxl.c