All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josua Mayer <josua@solid-run.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Gregory Clement <gregory.clement@bootlin.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Yazan Shhady <yazan.shhady@solid-run.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] arm64: dts: add description for solidrun cn9130 som and clearfog boards
Date: Fri, 22 Mar 2024 09:54:19 +0000	[thread overview]
Message-ID: <0d1afbcc-948e-4aff-8296-42f7166d318d@solid-run.com> (raw)
In-Reply-To: <e24e78a6-852c-4458-987c-3601908a71f0@lunn.ch>

Am 21.03.24 um 22:59 schrieb Andrew Lunn:
> On Thu, Mar 21, 2024 at 10:47:12PM +0100, Josua Mayer wrote:
>> Add description for the SolidRun CN9130 SoM, and Clearfog Base / Pro
>> reference boards.
>>
>> The SoM has been designed as a pin-compatible replacement for the older
>> Armada 388 based SoM. Therefore it supports the same boards and a
>> similar feature set.
>>
>> Most notable upgrades:
>> - 4x Cortex-A72
>> - 10Gbps SFP
>> - Both eMMC and SD supported at the same time
>>
>> The developer first supporting this product at SolidRun decided to use
>> different filenames for the DTBs: Armada 388 uses the full
>> "clearfog" string while cn9130 uses the abbreviation "cf".
>> This name is already hard-coded in pre-installed vendor u-boot and can
>> not be changed easily.
>>
>> NOTICE IN CASE ANYBODY WANTS TO SELF-UPGRADE:
>> CN9130 SoM has a different footprint from Armada 388 SoM.
>> Components on the carrier board below the SoM may collide causing
>> damage, such as on Clearfog Base.
>>
>> Signed-off-by: Josua Mayer <josua@solid-run.com>
>> ---
>>  arch/arm64/boot/dts/marvell/Makefile           |   2 +
>>  arch/arm64/boot/dts/marvell/cn9130-cf-base.dts | 138 ++++++++++++++
>>  arch/arm64/boot/dts/marvell/cn9130-cf-pro.dts  | 249 +++++++++++++++++++++++++
>>  arch/arm64/boot/dts/marvell/cn9130-cf.dtsi     | 198 ++++++++++++++++++++
>>  arch/arm64/boot/dts/marvell/cn9130-sr-som.dtsi | 160 ++++++++++++++++
>>  5 files changed, 747 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/marvell/Makefile b/arch/arm64/boot/dts/marvell/Makefile
>> index 99b8cb3c49e1..019f2251d696 100644
>> --- a/arch/arm64/boot/dts/marvell/Makefile
>> +++ b/arch/arm64/boot/dts/marvell/Makefile
>> @@ -28,3 +28,5 @@ dtb-$(CONFIG_ARCH_MVEBU) += cn9130-crb-A.dtb
>>  dtb-$(CONFIG_ARCH_MVEBU) += cn9130-crb-B.dtb
>>  dtb-$(CONFIG_ARCH_MVEBU) += ac5x-rd-carrier-cn9131.dtb
>>  dtb-$(CONFIG_ARCH_MVEBU) += ac5-98dx35xx-rd.dtb
>> +dtb-$(CONFIG_ARCH_MVEBU) += cn9130-cf-base.dtb
>> +dtb-$(CONFIG_ARCH_MVEBU) += cn9130-cf-pro.dtb
>> diff --git a/arch/arm64/boot/dts/marvell/cn9130-cf-base.dts b/arch/arm64/boot/dts/marvell/cn9130-cf-base.dts
>> new file mode 100644
>> index 000000000000..b0067940d5e4
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/marvell/cn9130-cf-base.dts
>> @@ -0,0 +1,138 @@
>> +// SPDX-License-Identifier: GPL-2.0+
>> +/*
>> + * Copyright (C) 2024 Josua Mayer <josua@solid-run.com>
>> + *
>> + * DTS for SolidRun CN9130 Clearfog Base.
>> + *
>> + */
>> +
>> +/dts-v1/;
>> +
>> +#include <dt-bindings/input/input.h>
>> +
>> +#include "cn9130.dtsi"
>> +#include "cn9130-sr-som.dtsi"
>> +#include "cn9130-cf.dtsi"
>> +
>> +/ {
>> +	model = "SolidRun CN9130 Clearfog Base";
>> +	compatible = "solidrun,clearfog-base-a1", "solidrun,clearfog-a1",
>> +		     "solidrun,cn9130-sr-som","marvell,cn9130",
>> +		     "marvell,armada-ap807-quad", "marvell,armada-ap807";
>> +
>> +	gpio-keys {
>> +		compatible = "gpio-keys";
>> +		pinctrl-0 = <&rear_button_pins>;
>> +		pinctrl-names = "default";
>> +
>> +		button-0 {
>> +			/* The rear SW3 button */
>> +			label = "Rear Button";
>> +			gpios = <&cp0_gpio1 31 GPIO_ACTIVE_LOW>;
>> +			linux,can-disable;
>> +			linux,code = <BTN_0>;
>> +		};
>> +	};
>> +
>> +	rfkill-m2-gnss {
>> +		compatible = "rfkill-gpio";
>> +		label = "m.2 GNSS";
>> +		radio-type = "gps";
>> +		/* rfkill-gpio inverts internally */
>> +		shutdown-gpios = <&expander0 9 GPIO_ACTIVE_HIGH>;
>> +	};
>> +
>> +	/* M.2 is B-keyed, so w-disable is for WWAN */
>> +	rfkill-m2-wwan {
>> +		compatible = "rfkill-gpio";
>> +		label = "m.2 WWAN";
>> +		radio-type = "wwan";
>> +		/* rfkill-gpio inverts internally */
>> +		shutdown-gpios = <&expander0 8 GPIO_ACTIVE_HIGH>;
>> +	};
>> +};
>> +
>> +/* SRDS #3 - SGMII 1GE */
>> +&cp0_eth1 {
>> +	phy = <&phy1>;
>> +	phys = <&cp0_comphy3 1>;
>> +	phy-mode = "sgmii";
>> +	status = "okay";
>> +};
>> +
>> +&cp0_eth2_phy {
>> +	/*
>> +	 * Configure LEDs:
>> +	 * - LED[0]: link/activity: On/blink (green)
>> +	 * - LED[1]: link is 100/1000Mbps: On (yellow)
>> +	 * - LED[2]: high impedance (floating)
>> +	 */
>> +	marvell,reg-init = <3 16 0xf000 0x0a61>;
> Sorry, but no. List the LEDs in the PHY node, and they can then be
> controlled via /sys/class/leds.
May I ask more precisely the motivation?
Does this replace the phy's builtin automatic led control?
> arch/arm/boot/dts/marvell/armada-370-rd.dts is an example.

I will investigate it.

My main motivation for tweaking the led controls was to make them all consistent across the two boards:
- LEDs under control of PHYs on cpu mdio bus
- LEDs under control of ethernet switch on mdio bus
- LEDs under control of ethernet phy on external mdio bus behind ethernet switch

It looks as if the marvell phy driver supports led subnodes,
The switch driver does not.
Finally one phy can only be written to but not read,
the cpu can never know its link state.

So I prefer (for the Clearfog Pro) board to explicitly use the phys
autonomous management of LEDs.
Is that still possible if I added led subnodes?


WARNING: multiple messages have this Message-ID (diff)
From: Josua Mayer <josua@solid-run.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Gregory Clement <gregory.clement@bootlin.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Yazan Shhady <yazan.shhady@solid-run.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] arm64: dts: add description for solidrun cn9130 som and clearfog boards
Date: Fri, 22 Mar 2024 09:54:19 +0000	[thread overview]
Message-ID: <0d1afbcc-948e-4aff-8296-42f7166d318d@solid-run.com> (raw)
In-Reply-To: <e24e78a6-852c-4458-987c-3601908a71f0@lunn.ch>

Am 21.03.24 um 22:59 schrieb Andrew Lunn:
> On Thu, Mar 21, 2024 at 10:47:12PM +0100, Josua Mayer wrote:
>> Add description for the SolidRun CN9130 SoM, and Clearfog Base / Pro
>> reference boards.
>>
>> The SoM has been designed as a pin-compatible replacement for the older
>> Armada 388 based SoM. Therefore it supports the same boards and a
>> similar feature set.
>>
>> Most notable upgrades:
>> - 4x Cortex-A72
>> - 10Gbps SFP
>> - Both eMMC and SD supported at the same time
>>
>> The developer first supporting this product at SolidRun decided to use
>> different filenames for the DTBs: Armada 388 uses the full
>> "clearfog" string while cn9130 uses the abbreviation "cf".
>> This name is already hard-coded in pre-installed vendor u-boot and can
>> not be changed easily.
>>
>> NOTICE IN CASE ANYBODY WANTS TO SELF-UPGRADE:
>> CN9130 SoM has a different footprint from Armada 388 SoM.
>> Components on the carrier board below the SoM may collide causing
>> damage, such as on Clearfog Base.
>>
>> Signed-off-by: Josua Mayer <josua@solid-run.com>
>> ---
>>  arch/arm64/boot/dts/marvell/Makefile           |   2 +
>>  arch/arm64/boot/dts/marvell/cn9130-cf-base.dts | 138 ++++++++++++++
>>  arch/arm64/boot/dts/marvell/cn9130-cf-pro.dts  | 249 +++++++++++++++++++++++++
>>  arch/arm64/boot/dts/marvell/cn9130-cf.dtsi     | 198 ++++++++++++++++++++
>>  arch/arm64/boot/dts/marvell/cn9130-sr-som.dtsi | 160 ++++++++++++++++
>>  5 files changed, 747 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/marvell/Makefile b/arch/arm64/boot/dts/marvell/Makefile
>> index 99b8cb3c49e1..019f2251d696 100644
>> --- a/arch/arm64/boot/dts/marvell/Makefile
>> +++ b/arch/arm64/boot/dts/marvell/Makefile
>> @@ -28,3 +28,5 @@ dtb-$(CONFIG_ARCH_MVEBU) += cn9130-crb-A.dtb
>>  dtb-$(CONFIG_ARCH_MVEBU) += cn9130-crb-B.dtb
>>  dtb-$(CONFIG_ARCH_MVEBU) += ac5x-rd-carrier-cn9131.dtb
>>  dtb-$(CONFIG_ARCH_MVEBU) += ac5-98dx35xx-rd.dtb
>> +dtb-$(CONFIG_ARCH_MVEBU) += cn9130-cf-base.dtb
>> +dtb-$(CONFIG_ARCH_MVEBU) += cn9130-cf-pro.dtb
>> diff --git a/arch/arm64/boot/dts/marvell/cn9130-cf-base.dts b/arch/arm64/boot/dts/marvell/cn9130-cf-base.dts
>> new file mode 100644
>> index 000000000000..b0067940d5e4
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/marvell/cn9130-cf-base.dts
>> @@ -0,0 +1,138 @@
>> +// SPDX-License-Identifier: GPL-2.0+
>> +/*
>> + * Copyright (C) 2024 Josua Mayer <josua@solid-run.com>
>> + *
>> + * DTS for SolidRun CN9130 Clearfog Base.
>> + *
>> + */
>> +
>> +/dts-v1/;
>> +
>> +#include <dt-bindings/input/input.h>
>> +
>> +#include "cn9130.dtsi"
>> +#include "cn9130-sr-som.dtsi"
>> +#include "cn9130-cf.dtsi"
>> +
>> +/ {
>> +	model = "SolidRun CN9130 Clearfog Base";
>> +	compatible = "solidrun,clearfog-base-a1", "solidrun,clearfog-a1",
>> +		     "solidrun,cn9130-sr-som","marvell,cn9130",
>> +		     "marvell,armada-ap807-quad", "marvell,armada-ap807";
>> +
>> +	gpio-keys {
>> +		compatible = "gpio-keys";
>> +		pinctrl-0 = <&rear_button_pins>;
>> +		pinctrl-names = "default";
>> +
>> +		button-0 {
>> +			/* The rear SW3 button */
>> +			label = "Rear Button";
>> +			gpios = <&cp0_gpio1 31 GPIO_ACTIVE_LOW>;
>> +			linux,can-disable;
>> +			linux,code = <BTN_0>;
>> +		};
>> +	};
>> +
>> +	rfkill-m2-gnss {
>> +		compatible = "rfkill-gpio";
>> +		label = "m.2 GNSS";
>> +		radio-type = "gps";
>> +		/* rfkill-gpio inverts internally */
>> +		shutdown-gpios = <&expander0 9 GPIO_ACTIVE_HIGH>;
>> +	};
>> +
>> +	/* M.2 is B-keyed, so w-disable is for WWAN */
>> +	rfkill-m2-wwan {
>> +		compatible = "rfkill-gpio";
>> +		label = "m.2 WWAN";
>> +		radio-type = "wwan";
>> +		/* rfkill-gpio inverts internally */
>> +		shutdown-gpios = <&expander0 8 GPIO_ACTIVE_HIGH>;
>> +	};
>> +};
>> +
>> +/* SRDS #3 - SGMII 1GE */
>> +&cp0_eth1 {
>> +	phy = <&phy1>;
>> +	phys = <&cp0_comphy3 1>;
>> +	phy-mode = "sgmii";
>> +	status = "okay";
>> +};
>> +
>> +&cp0_eth2_phy {
>> +	/*
>> +	 * Configure LEDs:
>> +	 * - LED[0]: link/activity: On/blink (green)
>> +	 * - LED[1]: link is 100/1000Mbps: On (yellow)
>> +	 * - LED[2]: high impedance (floating)
>> +	 */
>> +	marvell,reg-init = <3 16 0xf000 0x0a61>;
> Sorry, but no. List the LEDs in the PHY node, and they can then be
> controlled via /sys/class/leds.
May I ask more precisely the motivation?
Does this replace the phy's builtin automatic led control?
> arch/arm/boot/dts/marvell/armada-370-rd.dts is an example.

I will investigate it.

My main motivation for tweaking the led controls was to make them all consistent across the two boards:
- LEDs under control of PHYs on cpu mdio bus
- LEDs under control of ethernet switch on mdio bus
- LEDs under control of ethernet phy on external mdio bus behind ethernet switch

It looks as if the marvell phy driver supports led subnodes,
The switch driver does not.
Finally one phy can only be written to but not read,
the cpu can never know its link state.

So I prefer (for the Clearfog Pro) board to explicitly use the phys
autonomous management of LEDs.
Is that still possible if I added led subnodes?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-03-22  9:54 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 21:47 [PATCH 0/2] arm64: dts: add description for solidrun cn9130 som and clearfog boards Josua Mayer
2024-03-21 21:47 ` Josua Mayer
2024-03-21 21:47 ` [PATCH 1/2] dt-bindings: arm64: marvell: add solidrun cn9130 " Josua Mayer
2024-03-21 21:47   ` Josua Mayer
2024-03-22  2:16   ` Rob Herring
2024-03-22  2:16     ` Rob Herring
2024-03-22 10:08   ` Josua Mayer
2024-03-22 10:08     ` Josua Mayer
2024-03-25 19:34     ` Krzysztof Kozlowski
2024-03-25 19:34       ` Krzysztof Kozlowski
2024-03-25 20:12       ` Josua Mayer
2024-03-25 20:12         ` Josua Mayer
2024-03-26  6:41         ` Krzysztof Kozlowski
2024-03-26  6:41           ` Krzysztof Kozlowski
2024-03-26 19:26           ` Josua Mayer
2024-03-26 19:26             ` Josua Mayer
2024-03-27 10:19             ` Krzysztof Kozlowski
2024-03-27 10:19               ` Krzysztof Kozlowski
2024-03-27 10:55               ` Josua Mayer
2024-03-27 10:55                 ` Josua Mayer
2024-03-28  9:14                 ` Krzysztof Kozlowski
2024-03-28  9:14                   ` Krzysztof Kozlowski
2024-03-28  9:33                   ` Josua Mayer
2024-03-28  9:33                     ` Josua Mayer
2024-03-28  9:41                     ` Krzysztof Kozlowski
2024-03-28  9:41                       ` Krzysztof Kozlowski
2024-03-28  9:46                       ` Josua Mayer
2024-03-28  9:46                         ` Josua Mayer
2024-03-28 16:22   ` Josua Mayer
2024-03-28 16:22     ` Josua Mayer
2024-03-21 21:47 ` [PATCH 2/2] arm64: dts: add description for solidrun cn9130 som and " Josua Mayer
2024-03-21 21:47   ` Josua Mayer
2024-03-21 21:59   ` Andrew Lunn
2024-03-21 21:59     ` Andrew Lunn
2024-03-22  9:54     ` Josua Mayer [this message]
2024-03-22  9:54       ` Josua Mayer
2024-03-22 13:11       ` Andrew Lunn
2024-03-22 13:11         ` Andrew Lunn
2024-03-22 15:38         ` Josua Mayer
2024-03-22 15:38           ` Josua Mayer
2024-03-22 15:49           ` Andrew Lunn
2024-03-22 15:49             ` Andrew Lunn
2024-03-22 15:58             ` Josua Mayer
2024-03-22 15:58               ` Josua Mayer
2024-03-22 18:14           ` Josua Mayer
2024-03-22 18:14             ` Josua Mayer
2024-03-22 18:27             ` Andrew Lunn
2024-03-22 18:27               ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d1afbcc-948e-4aff-8296-42f7166d318d@solid-run.com \
    --to=josua@solid-run.com \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregory.clement@bootlin.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=yazan.shhady@solid-run.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.