Porting UBNT Nanostation M loco XW to ath79

The loco series (also includes the Nanobeam M XW) is very similar to the Bullet M XW except that its single Ethernet port has a different PHY. The loco has an AR8032 chip connected to MDIO address 1.

https://openwrt.org/toh/ubiquiti/nanostationm5
The wiki pages on these models are not really clear. The M2 and M5 versions are on different pages even though they use the same OpenWrt firmware, the only difference is the radio band. The regular Nanostation with two Ethernet ports is on the same page as the loco, even though they need different firmware because of the port difference. Installing the non-loco firmware on a loco or vice versa will make Ethernet unusable and thus technically a brick. I'm considering editing the wiki but I'm not an expert on all of these models since I don't own all of them.

Anyway, back to the port. Replacing the mdio and eth definition in target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts with the code below made a build that works on the Loco XW. Everything else is the same as for the Bullet XW.

&mdio0 {
	status = "okay";

	phy1: ethernet-phy@1 {
		phy-mode = "mii";
		reg = <1>;
		reset-gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
	};
};

&eth0 {
	status = "okay";

	phy-mode = "mii";
	phy-handle = <&phy1>;
};

I would like some guidance on how to formally prepare and submit this to the project.

I'm not sure what level of advice you're looking for.

https://openwrt.org/submitting-patches and, from what I've seen, the most common requests seem to be:

  • Signed-off-by with a real name and email
  • Squash all commits (that are related to a given change)

I'd also make sure your whitespace is "Linux-style" (tabs, no trailing whitespace)

patchwork, which extracts patches from mailing-list messages hasn't been the friendliest to me, but many use it and apparently prefer it. A pull request on GitHub is another option that others use.