Welcome! Log In Create A New Profile

Advanced

GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)

Posted by bodhi 
yes i am running systemd.

shutdown -h now

gave me same results
Re: GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)
January 23, 2024 10:45PM
Is your RN102 connected to a switch behind a bridge ? or is it connected to the same switch with the box running etherwake?

At the box that you use to run etherwake, try running nmap to see if the RN102 MAC address is visible.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
I'm connected to same switch. On Original Netgear NAS OS software wake on lan is working enabled via GUI.

nmap (I've changed MAC to that wriiten on RN102 housing)

Nmap scan report for 192.168.77.124
Host is up (0.066s latency).
MAC Address: 28:C6:8E:35:5A:F7 (Netgear)
Re: GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)
January 24, 2024 12:50PM
I don't have the RN102 box so I've sent Trond a PM about this topic.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Thank you!
i found interestin patch in Netgear ReadyNASOS kernel, is this patch included in newest kernel?

static void orion_mdio_shutdown(struct platform_device *pdev)
{
	struct mii_bus *bus = platform_get_drvdata(pdev);
	u16 rega, regb;
	int i;

	/* replaces /proc/power_mode_2 */
	/* Force 10Mbps half duplex, disable autoneg */
	for (i = 0; i < 2; i++) {
		orion_mdio_write(bus, i, 0x16, 0x0);
		orion_mdio_write(bus, i, 0x0, 0x8000);
	}
	if (system_state == SYSTEM_RESTART) {
		/* Clear MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW, or the system
		** will not reboot.  RN2120 appears to rely on a PHY link change
		** interrupt to "reboot", so make sure it's enabled. */
		orion_mdio_write(bus, 0, 0x16, 0x3);
		rega = orion_mdio_read(bus, 0, 0x12);
		regb = (rega | BIT(7)) & ~(BIT(11));
	} else {
		/* WoL enabled? */
		orion_mdio_write(bus, 0, 0x16, 0x11);
		rega = orion_mdio_read(bus, 0, 0x10);
		if (rega & BIT(14)) {
			/* Enable interrupt only on WOL event.
			** We get an immediate poweron with large MTU without this */
			for (i = 0; i < 2; i++) {
				orion_mdio_write(bus, i, 0x16, 0x0);
				orion_mdio_write(bus, i, 0x12, 0x80);
			}
			/* Magic packet enable, Clear WOL status, ..., 10BT LPM */
			regb = BIT(14) | BIT(12) | BIT(10) | BIT(8) | BIT(7);
			pr_debug("MII_88E1318S_PHY_WOL_CTRL: 0x%x => 0x%x\n",
				rega, regb);
			for (i = 0; i < 2; i++) {
				orion_mdio_write(bus, i, 0x16, 0x11);
				orion_mdio_write(bus, i, 0x10, regb);
				orion_mdio_write(bus, i, 0x16, 0x3);
			}
			rega = orion_mdio_read(bus, 0, 0x12);
			regb = rega | BIT(11) | BIT(7);
		} else {
			for (i = 0; i < 2; i++) {
				orion_mdio_write(bus, i, 0x16, 0x0);
				orion_mdio_write(bus, i, 0x0, BMCR_PDOWN);
				orion_mdio_write(bus, i, 0x12, 0x0);
				orion_mdio_write(bus, i, 0x16, 0x3);
			}
			rega = orion_mdio_read(bus, 0, 0x12);
			regb = rega & ~(BIT(11) | BIT(7));
		}
	}
	pr_debug("MII_88E1318S_LED_TCR: 0x%x => 0x%x\n", rega, regb);
	for (i = 0; i < 2; i++) {
		orion_mdio_write(bus, 0, 0x12, regb);
		orion_mdio_write(bus, 0, 0x16, 0x0);
	}
}

whole patch attached
Attachments:
open | download - 0010-add-orion_mdio_shutdown-function-for-arm-shutdown-qu.patch (3.1 KB)
Re: GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)
January 25, 2024 11:55PM
pczerepaniak,

Quote

i found interestin patch in Netgear ReadyNASOS kernel, is this patch included in newest kernel?

Usually, stock kernel is old, and it would need out-of tree patches like that. Since this Armada 370 SoC and the Marvell chip 88E1318S have been in the mainline Linux for quite a long time, there should be support for things like WOL.

However, there are NAS boxes, such as the ZyXEL NSA326, in which WOL can only be activated by I2C. So the issue here is if the RN102 use the same approach. By the look of the patch you posted, it might not.

I'd like to hear from Trond after he's done some WOL testing.

===========

The released tarball includes everything you need to build your own 6.5.7 kernel (the config-6.5.7-mvebu-370xp-tld-1 and the linux-6.5.7-mvebu-370xp-tld-1.patch are all you'll need).

Quote

This tarball contains 6 files:
linux-image-6.5.7-mvebu-370xp-tld-1_1_armhf.deb
linux-headers-6.5.7-mvebu-370xp-tld-1_1_armhf.deb
zImage-6.5.7-mvebu-370xp-tld-1
config-6.5.7-mvebu-370xp-tld-1
linux-dtb-6.5.7-mvebu-370xp-tld-1.tar
linux-6.5.7-mvebu-370xp-tld-1.patch

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 01/26/2024 06:48PM by bodhi.
actually, I think it was a few years ago:
https://github.com/torvalds/linux/blob/master/drivers/power/reset/linkstation-poweroff.c

I had mostly forgotten about that, I should really see if I can submit a patch to make it work for some of the kirkwood devices that use the same restart mechanism.

I've been doing the equivalent from userspace by setting the desired default values in the device tree and then setting the needed value with phytool as part of a shutdown script:


For example
&mdio
{
	phy0: ethernet-phy@0
	{
		reg = <0>;
		//LED0: on/blink on act, LED1: off (not connected) LED2: Force off (connected to power button gpio, signals shutdown/restart)
		marvell,reg-init = <0x3 0x10 0xf000 0x0881>;
	};
};

phy_restart.sh
$phytool write eth0/0/22 3
if [ "$1" == "halt" ] || [ "$1" == "poweroff" ]; then
    $phytool write eth0/0/16 0x0881
else
    $phytool write eth0/0/16 0x0981
fi
$phytool write eth0/0/22 0
I tried phy_restart.sh script with modifed devices tree and wake on lan is still not working on RN102 :/
I’d say start by confirming you can read some registers with phytool before going for a full test, somethings may need tweaking
Re: GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)
February 24, 2024 02:11AM
Hi Trond,

Here is the new kernel. I've reconfigured this kernel to deselect I2S, SPDIF... (basically no sound capability). Please give it a try before I release it.

Download at Dropbox

linux-6.7.5-mvebu-370xp-tld-2-bodhi.tar.bz2
md5:
e5911eb470ecfb07b3264cb79b418673  
sha256:
fc24f03aefe8da9bf0ef4287ff6f03942ef7064c0d65b09243ed9cc272ad0f57
This tarball contains 6 files:
linux-image-6.7.5-mvebu-370xp-tld-2_2_armhf.deb
linux-headers-6.7.5-mvebu-370xp-tld-2_2_armhf.deb
zImage-6.7.5-mvebu-370xp-tld-2
config-6.7.5-mvebu-370xp-tld-2
linux-dtb-6.7.5-mvebu-370xp-tld-2.tar
linux-6.7.5-mvebu-370xp-tld-2.patch

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Hi bodhi,

Following your directions in the first post of this thread, I have successfully installed Linux kernel version 6.7.5 on one of my Netgear RN102 file servers (mainly used as a dlna server). The root file system is on an SSD connected to the rear eSata port. This new kernel works as expected. Thanks!

The lagging system clock issue (https://forum.doozan.com/read.php?2,133814) still remains, though. I notice that there are no changes to 'dts/armada-370-netgear-rn102.dtb' since version 6.5.7 except for it's time stamp. Is this intentionally?

Is it possible to also disable TDM and the Device Bus Controller for RN102 and RN104?

For comparison with your GTI Mirabox , I have attached the RN102 'dmesg' output.

Regards,
Trond Melen
Attachments:
open | download - dmesg.log (28.3 KB)
Re: GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)
February 25, 2024 01:49PM
Hi Trond,

Thanks for testing!

> The lagging system clock issue
> (https://forum.doozan.com/read.php?2,133814) still
> remains, though.

Bummer.

> I notice that there are no
> changes to 'dts/armada-370-netgear-rn102.dtb'
> since version 6.5.7 except for it's time stamp. Is
> this intentionally?

Yes, I did not change the DTS, so the DTB is the same.

> Is it possible to also disable TDM and the Device
> Bus Controller for RN102 and RN104?

These are harder to do. I need to dig a bit into the kernel code for this Armada 370 SoC to see it is possible. Sound devices are easily configurable so I tried that first! Will let you know.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)
February 25, 2024 01:55PM
Trond & pczerepaniak,

Also I am wondering about WOL for these RN120/140. Do you see the Ethernet port LED lighted up? amber or green? And with WOL set in ethtool, when you shutdown the box, does the LED turn (or stay) amber or OFF ?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)
February 25, 2024 02:39PM
Hi Trond,

> > I notice that there are no
> > changes to 'dts/armada-370-netgear-rn102.dtb'
> > since version 6.5.7 except for it's time stamp.
> Is
> > this intentionally?
>
> Yes, I did not change the DTS, so the DTB is the
> same.

Perhaps I should remove those sound specific nodes in the DTS too.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)
February 26, 2024 03:33PM
Please use this new DTB with kernel 6.7.5-mvebu-370xp-tld-2. I've removed audio controller nodes.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - armada-370-netgear-rn102.dtb (14.9 KB)
open | download - armada-370-netgear-rn102.dts (5.3 KB)
Hi bodhi,

Where do I find the new DTB with the audio controller nodes removed?

Regards,
Trond Melen
Re: GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)
February 26, 2024 05:13PM
Hi Trond,

Sorry, was being sidetracked and forgot! it is uploaded now in the post above.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Hi bodhi,

Booting my RN102 with the new DTB with the audio controller nodes removed failed with the message:
Error: invalid dtb and unrecognized/unsupported machine ID

The full log is attached. Did I do something wrong?

Regards,
Trond Melen
Attachments:
open | download - 2024-02-29-RN102-bootlog.log (1.7 KB)
Re: GTI Mirabox and Netgear RN120/RN104 (Armada 370) Installation & Kernel Upgrade (Linux-6.5.7)
February 29, 2024 01:31AM
Hi Trond,

It seems there was no DTB embedded in uImage.

The zImage size is the same as your uImage in the boot log. The uImage size should be a bit larger with the DTB in it.

-rwxr-xr-x 1 root root  5099248 Feb 21 15:13 zImage-6.7.5-mvebu-370xp-tld-2

## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-6.7.5-mvebu-370xp-tld-2
   Created:      2024-02-28  21:24:10 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5099248 Bytes = 4.9 MiB

So look in your kernel installation log, perhaps you've missed that step. Recreate the uImage on the rootfs /boot will sove this.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: