[PATCH 1/4] arm: mvebu: dts: uDPU: update DTS

Update the uDPU DTS to the version that is pending upstream [1][2].
[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20220322105857.1... [2] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20220322105857.1...
Signed-off-by: Robert Marko robert.marko@sartura.hr --- arch/arm/dts/armada-3720-uDPU.dts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/arch/arm/dts/armada-3720-uDPU.dts b/arch/arm/dts/armada-3720-uDPU.dts index 95d46e8d08..1f534c0c65 100644 --- a/arch/arm/dts/armada-3720-uDPU.dts +++ b/arch/arm/dts/armada-3720-uDPU.dts @@ -99,7 +99,7 @@ pinctrl-names = "default"; pinctrl-0 = <&spi_quad_pins>;
- m25p80@0 { + spi-flash@0 { compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <54000000>; @@ -108,10 +108,15 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - /* only bootloader is located on the SPI */ + partition@0 { - label = "uboot"; - reg = <0 0x400000>; + label = "firmware"; + reg = <0x0 0x180000>; + }; + + partition@180000 { + label = "u-boot-env"; + reg = <0x180000 0x10000>; }; }; }; @@ -148,15 +153,15 @@ scl-gpios = <&gpionb 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; sda-gpios = <&gpionb 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
- lm75@48 { + nct375@48 { status = "okay"; - compatible = "lm75"; + compatible = "ti,tmp75c"; reg = <0x48>; };
- lm75@49 { + nct375@49 { status = "okay"; - compatible = "lm75"; + compatible = "ti,tmp75c"; reg = <0x49>; }; };

Add support for handling SFP TX disable for MVNETA in the same fashion as to what MVPP2 is doing in order to enable using SFP-s.
This allows using ethernet on SFP only boards.
Signed-off-by: Robert Marko robert.marko@sartura.hr --- drivers/net/mvneta.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 4a4268c2b2..53989d9f46 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -286,6 +286,7 @@ struct mvneta_port { struct phy_device *phydev; #if CONFIG_IS_ENABLED(DM_GPIO) struct gpio_desc phy_reset_gpio; + struct gpio_desc phy_tx_disable_gpio; #endif struct mii_dev *bus; }; @@ -1770,11 +1771,17 @@ static int mvneta_probe(struct udevice *dev) gpio_request_by_name(dev, "phy-reset-gpios", 0, &pp->phy_reset_gpio, GPIOD_IS_OUT);
+ gpio_request_by_name(dev, "marvell,sfp-tx-disable-gpio", 0, + &pp->phy_tx_disable_gpio, GPIOD_IS_OUT); + if (dm_gpio_is_valid(&pp->phy_reset_gpio)) { dm_gpio_set_value(&pp->phy_reset_gpio, 1); mdelay(10); dm_gpio_set_value(&pp->phy_reset_gpio, 0); } + + if (dm_gpio_is_valid(&pp->phy_tx_disable_gpio)) + dm_gpio_set_value(&pp->phy_tx_disable_gpio, 0); #endif
return board_network_enable(bus);

On Wed, 23 Mar 2022 14:39:01 +0100 Robert Marko robert.marko@sartura.hr wrote:
Add support for handling SFP TX disable for MVNETA in the same fashion as to what MVPP2 is doing in order to enable using SFP-s.
This allows using ethernet on SFP only boards.
Can't you parse sfp node as defined in SFP binding?
Marek

On Wed, Mar 23, 2022 at 4:20 PM Marek Behún marek.behun@nic.cz wrote:
On Wed, 23 Mar 2022 14:39:01 +0100 Robert Marko robert.marko@sartura.hr wrote:
Add support for handling SFP TX disable for MVNETA in the same fashion as to what MVPP2 is doing in order to enable using SFP-s.
This allows using ethernet on SFP only boards.
Can't you parse sfp node as defined in SFP binding?
Honestly, I did not even think of it. Yeah, that's a better option as it does not use nonstandard binding.
Will do it in v2.
Regards, Robert
Marek

uDPU is a bit of a specific device in that it does not have any copper ports nor any ethernet PHY-s but 2 SFP ports.
This is an issue since MVNETA requires a PHY phandle or a fixed-link to be defined under its node. Since U-boot has no SFP support this is reasonable in order to know how to configure the MAC.
However this also means that networking does not work on uDPU at all currently, and fails with:
uDPU>> dhcp Could not get PHY for neta@30000: addr 0 phy_connect failed Could not get PHY for neta@40000: addr 1 phy_connect failed
So, to provide working networking using only SFP-s let add the fixed-link at 1G which is much more common than 2.5G SFP-s as well as disable the TX_DISABLE pins like done on Armada 7040 and 8040 platforms.
Since uDPU is not using any of the GPIO-s on the SB controller for any purpose other than GPIO, a call to the pinctrl must be made in order for it to get probed and thus register the SB GPIO bank, otherwise SB GPIO-s are not registered at all.
Signed-off-by: Robert Marko robert.marko@sartura.hr --- arch/arm/dts/armada-3720-uDPU-u-boot.dtsi | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/arch/arm/dts/armada-3720-uDPU-u-boot.dtsi b/arch/arm/dts/armada-3720-uDPU-u-boot.dtsi index cf8ae4412b..14c4fe1aff 100644 --- a/arch/arm/dts/armada-3720-uDPU-u-boot.dtsi +++ b/arch/arm/dts/armada-3720-uDPU-u-boot.dtsi @@ -31,3 +31,30 @@ &sdhci0 { u-boot,dm-pre-reloc; }; + +&pinctrl_sb { + sfp_pins: sfp-pins { + groups = "pcie1_clkreq"; + function = "gpio"; + }; +}; + +ð0 { + pinctrl-names = "default"; + pinctrl-0 = <&sfp_pins>; + marvell,sfp-tx-disable-gpio = <&gpiosb 4 GPIO_ACTIVE_HIGH>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +ð1 { + marvell,sfp-tx-disable-gpio = <&gpiosb 9 GPIO_ACTIVE_HIGH>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +};

Update the current uDPU defconfig with following changes: * Disable CONFIG_SPI_BOOT, its not needed for booting and the device boots from eMMC anyway. * Disable CONFIG_SYS_CONSOLE_INFO_QUIET, there is no need to diverge from other boards by not priting the console device * Enable CONFIG_CMD_MTD in order to allow use of the MTD tool * Disable CONFIG_CMD_MTDPARTS, with MTD now being able to parse partitions from DTS there is no need for it, the default MTDPARTS were incorrect anyway * Enable CONFIG_MMC_HS200_SUPPORT, the eMMC used support both HS200 and HS400 modes, so enable at least HS200 because Xenon driver does not support HS400 currently * Replace CONFIG_SPI_FLASH_BAR with CONFIG_SPI_FLASH_SFDP_SUPPORT Utilize SFDP parsing instead of relying on the extended address registers
Signed-off-by: Robert Marko robert.marko@sartura.hr --- configs/uDPU_defconfig | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/configs/uDPU_defconfig b/configs/uDPU_defconfig index b5f2115e63..1a2182b823 100644 --- a/configs/uDPU_defconfig +++ b/configs/uDPU_defconfig @@ -16,9 +16,8 @@ CONFIG_DISTRO_DEFAULTS=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SYS_LOAD_ADDR=0x6000000 CONFIG_FIT=y -CONFIG_SPI_BOOT=y +CONFIG_FIT_VERBOSE=y CONFIG_USE_PREBOOT=y -CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y @@ -32,6 +31,7 @@ CONFIG_SYS_PROMPT="uDPU>> " CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y +CONFIG_CMD_MTD=y CONFIG_CMD_PCI=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y @@ -41,9 +41,6 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y CONFIG_CMD_MVEBU_BUBT=y CONFIG_CMD_EXT4_WRITE=y -CONFIG_CMD_MTDPARTS=y -CONFIG_MTDIDS_DEFAULT="nor0=spi0" -CONFIG_MTDPARTS_DEFAULT="mtdparts=spi0:4m(uboot),-(rootfs)" CONFIG_MAC_PARTITION=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y @@ -56,12 +53,13 @@ CONFIG_DM_I2C=y CONFIG_DM_I2C_GPIO=y CONFIG_SYS_I2C_MV=y CONFIG_MISC=y +CONFIG_MMC_HS200_SUPPORT=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_XENON=y CONFIG_MTD=y CONFIG_DM_MTD=y -CONFIG_SPI_FLASH_BAR=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y CONFIG_SPI_FLASH_MACRONIX=y CONFIG_SPI_FLASH_SPANSION=y CONFIG_SPI_FLASH_STMICRO=y
participants (2)
-
Marek Behún
-
Robert Marko