]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl: airoha: fix wrong MDIO function bitmaks
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 8 Sep 2025 11:37:19 +0000 (13:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Oct 2025 11:48:37 +0000 (13:48 +0200)
commit238f33bb3f6fac8ed79c610593b73d4602ddf9fd
tree57b9d8ebd1a03e1b1767c91a190bb217aa0cb1b6
parentcda80b7937bb5695e0b019783e41f0f3530d0552
pinctrl: airoha: fix wrong MDIO function bitmaks

commit a061e739d36220c002da8b2429d5f16f637eb59a upstream.

With further testing with an attached Aeonsemi it was discovered that
the pinctrl MDIO function applied the wrong bitmask. The error was
probably caused by the confusing documentation related to these bits.

Inspecting what the bootloader actually configure, the SGMII_MDIO_MODE
is never actually set but instead it's set force enable to the 2 GPIO
(gpio 1-2) for MDC and MDIO pin.

The usage of GPIO might be confusing but this is just to instruct the
SoC to not mess with those 2 PIN and as Benjamin reported it's also an
Errata of 7581. The FORCE_GPIO_EN doesn't set them as GPIO function
(that is configured by a different register) but it's really to actually
""enable"" those lines.

Normally the SoC should autodetect this by HW but it seems AN7581 have
problem with this and require this workaround to force enable the 2 pin.

Applying this configuration permits correct functionality of any
externally attached PHY.

Cc: stable@vger.kernel.org
Fixes: 1c8ace2d0725 ("pinctrl: airoha: Add support for EN7581 SoC")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Acked-by: Benjamin Larsson <benjamin.larsson@genexis.eu>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/mediatek/pinctrl-airoha.c