M2X Extender board issues

I have my M2X board mounted to the Edge-V, so I cannot check LAN right now. I will attempt to check SSD connected directly to the VIM3 tonight. I will use latest Krescue Ubuntu for the test.
To confirm, your SSD does not show up in Gparted’s devices?

Thanks - exactly what I have done - used the khadas builds, non work thus far.
Checked the NVMe on my laptop and desktop - no issues, just in the slot (its warm to the touch too).
Networks my biggest concern
I’m not seeing it in the system, so i wont show in gparted!

Can you take a photo and post here to show the connections between the M2X, VIM3, SSD, LAN Cable?

BTW, be note that the Ethernet on M2X is 100Mbps not Gigabit Ethernet.

This screenshot shows the Patriot Scorch 128GB mounted. The image I used can also be seen in the screenshot. I downloaded the image from here.

1 Like

@Gouwa sure thing, when I get home, here is some krescue output

Hi JamesT,
I meant a photo like this:

1 Like

Yeah, I understood but could not post until now @Gouwa :slightly_smiling_face:

Here you go, will downgrade to 4.* as someone mentioned a bug with 5 gen kernels.
My main need is both NICs operating the NVMe is a bonus if that also can start to work.

![image|666x500]

1 Like

One with the board powered on.

1 Like

Any idea’s @Gouwa - running 4.9 kernel, still nothing :frowning:
Even tried different power source with no luck.

both NICs operating its problem ! only one external or internal at this moment

i will try to check NVMe and add this feature in next krescue release

1 Like

Could you please let me know how to use the POE Ethernet instead of the OnBoard one so I can make some progress @hyphop :slight_smile:

Hello Is the problem with the POE Ethernet Port already fixed?
On my VIM3Pro with extension board, i cant bring up the POE Ethernet port.
Only the adapter on the main board is working.
The ssd on the extensionboard is working.

VIM3_Ubuntu-server-bionic_Linux-4.9_arm64_SD-USB_V20191231.7z

Thanks in advice for your answer.
Odi

No Sir, still not working even though I have near on asked for this 1000 times.
If you have found a solution or if @Frank or anyone else knows - add below please.
Its very frustrating and some misunderstanding be that on purpose or by accident, the port does not work.

Hello James
Maybe i have a solution for this problem.
I found it here.
https://lore.kernel.org/linux-amlogic/7hpnokd1bs.fsf@baylibre.com/T/

&ethmac {
status = “okay”;
phy-handle = <&internal_ephy>;
phy-mode = “rmii”;
};

I will change the vim3 dts file in mainline kernel and test during the next three days.
Maybe it works.

2 Likes

It doesn’t work like this. But maybe someone from Khadas could help.

The signals from the M2X Ethernet port are MDI_TXP,MDI_TXN,MDI_RXP,MDI_RXN

I think the problem could be in one of this files.
meson-g12-common.dtsi

  ethmac: ethernet@ff3f0000 {
  	compatible = "amlogic,meson-axg-dwmac",
  		     "snps,dwmac-3.70a",
  		     "snps,dwmac";
  	reg = <0x0 0xff3f0000 0x0 0x10000>,
  	      <0x0 0xff634540 0x0 0x8>;
  	interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
  	interrupt-names = "macirq";
  	clocks = <&clkc CLKID_ETH>,
  		 <&clkc CLKID_FCLK_DIV2>,
  		 <&clkc CLKID_MPLL2>;
  	clock-names = "stmmaceth", "clkin0", "clkin1";
  	rx-fifo-depth = <4096>;
  	tx-fifo-depth = <2048>;
  	status = "disabled";

  	mdio0: mdio {
  		#address-cells = <1>;
  		#size-cells = <0>;
  		compatible = "snps,dwmac-mdio";
  	};
  };
  	eth_phy: mdio-multiplexer@4c000 {
  		compatible = "amlogic,g12a-mdio-mux";
  		reg = <0x0 0x4c000 0x0 0xa4>;
  		clocks = <&clkc CLKID_ETH_PHY>,
  			 <&xtal>,
  			 <&clkc CLKID_MPLL_50M>;
  		clock-names = "pclk", "clkin0", "clkin1";
  		mdio-parent-bus = <&mdio0>;
  		#address-cells = <1>;
  		#size-cells = <0>;

  		ext_mdio: mdio@0 {
  			reg = <0>;
  			#address-cells = <1>;
  			#size-cells = <0>;
  		};

  		int_mdio: mdio@1 {
  			reg = <1>;
  			#address-cells = <1>;
  			#size-cells = <0>;

  			internal_ephy: ethernet_phy@8 {
  				compatible = "ethernet-phy-id0180.3301",
  					     "ethernet-phy-ieee802.3-c22";
  				interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
  				reg = <8>;
  				max-speed = <100>;
  			};
  		};
  	};

and meson-khadas-vim3.dtsi

&ext_mdio {
external_phy: ethernet-phy@0 {
/* Realtek RTL8211F (0x001cc916) */
reg = <0>;
max-speed = <1000>;

  interrupt-parent = <&gpio_intc>;
  /* MAC_INTR on GPIOZ_14 */
  interrupts = <26 IRQ_TYPE_LEVEL_LOW>;

};
};

&ethmac {
pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
pinctrl-names = “default”;
status = “okay”;
phy-mode = “rgmii”;
phy-handle = <&external_phy>;
amlogic,tx-delay-ns = <2>;
};

I think that the ethmac should point to the int_mdio and internal_ephy but i could not solve the puzzle.

Thanks in advice for your help.

Hello

Good news. The ethernet port on the m2x extension board is working. :slight_smile:
Not with mainline kernel. But with Khadas Kernel 4.9.

You need an image newer then 25.08.2020. Or create one with fenix.

You can enable it in /boot/env.txt at the end of the file.
overlays=m2x-eth

Then reboot and then
[ 23.744549@5] meson6-dwmac ff3f0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx

Thank you numbqq


I have also found a solution for mainline kernel.
But it needs a small patch for mdio driver.
In file drivers/net/phy/mdio-mux-meson-g12a.c

It needs a 10ms delay before return 0;
Thats all :slight_smile:

static int g12a_enable_internal_mdio(struct g12a_mdio_mux *priv)
{
int ret;

/* Enable the phy clock */
if (!priv->pll_is_enabled) {
ret = clk_prepare_enable(priv->pll);
if (ret)
return ret;
}

priv->pll_is_enabled = true;

/* Initialize ephy control */
writel(EPHY_G12A_ID, priv->regs + ETH_PHY_CNTL0);
writel(FIELD_PREP(PHY_CNTL1_ST_MODE, 3) |
FIELD_PREP(PHY_CNTL1_ST_PHYADD, EPHY_DFLT_ADD) |
FIELD_PREP(PHY_CNTL1_MII_MODE, EPHY_MODE_RMII) |
PHY_CNTL1_CLK_EN |
PHY_CNTL1_CLKFREQ |
PHY_CNTL1_PHY_ENB,
priv->regs + ETH_PHY_CNTL1);
writel(PHY_CNTL2_USE_INTERNAL |
PHY_CNTL2_SMI_SRC_MAC |
PHY_CNTL2_RX_CLK_EPHY,
priv->regs + ETH_PHY_CNTL2);

/* wait phy to reset cause Power Up Reset need 5.2~2.6 ms */
mdelay(10);

return 0;
}

And after this you could activate it with this script in dts file.

&ethmac {
status = “okay”;
pinctrl-0 = <&eth_leds_pins>;
pinctrl-names = “default”;
phy-handle = <&internal_ephy>;
phy-mode = “rmii”;
};

Or add this to the boot.int file after section echo “Booting mainline kernel…”;.

fdt get value eth0_phy /soc/bus@ff600000/mdio-multiplexer@4c000/mdio@0/ethernet-phy@0 phandle;
fdt set /soc/bus@ff600000/mdio-multiplexer@4c000/mdio@1/ethernet_phy@8 phandle <${eth0_phy}>;
fdt rm /soc/bus@ff600000/mdio-multiplexer@4c000/mdio@0/ethernet-phy@0 phandle

fdt get value eth0_pins /soc/bus@ff600000/bus@34400/pinctrl@40/eth phandle;
fdt set /soc/bus@ff600000/bus@34400/pinctrl@40/eth-leds phandle <${eth0_pins}>;
fdt rm /soc/bus@ff600000/bus@34400/pinctrl@40/eth phandle
fdt rm /soc/bus@ff600000/bus@34400/pinctrl@40/eth-rgmii phandle

fdt set /soc/ethernet@ff3f0000 phy-mode “rmii”;
fdt set /soc/ethernet@ff3f0000 pinctrl-0 <${eth0_pins}>;
fdt set /soc/ethernet@ff3f0000 phy-handle <${eth0_phy}>;

4 Likes

How about HDMI - is it still mandatory to plug HDMI monitor to make NVMe disk work with M2X Externder board?

Do we have any updates for that?
Does it is still required to patch the driver to be able to use ethernet with mainline linux?

@odibox may be you have any updates?