Adding OpenWrt support for the Notion R281 Cat.6 LTE CPE

Hi,

I could use some assistance in adding mainline support for this device https://www.notioni.com/productinfo/759146.html

It is running some fork of OpenWrt Chaos Calmer that isn't publicly accessible. The specs are:

CPU: MediaTek MT7621 880MHz
WIFI0: MediaTek MT7663 2T2R 802.11nac
WIFI1: Mediatek MT7603 2T2R 802.11 bgn
RAM: DDR3L 128MB
FLA: NAND 128MB
LTE: Marvel PXA1826 Cat.6 LTE
LAN: 4x GbE

I have made some progress and successfully built and ran a preliminary image, but there are a couple of issues:

1.) Wireless interfaces are inoperable, even when kmods have been loaded for it.
2.) The LTE module doesn't get initialized for some reason, thus no USB interfaces for it are detected.
3.) I managed to check the GPIO mapping for the LEDs from stock, but they don't seem to work in the compiled image. I don't have any known way of checking for the GPIO button mappings (wifi and reset) on stock.

Here's the serial output of the stock firmware:

And here's the output from OpenWrt:

Here's the dts file:

// Copyright (c) 2022 Ian Pangilinan

#include "mt7621.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "notion,r281", "mediatek,mt7621-soc";
	model = "Notion R281";

	aliases {
		led-boot = &led_red;
		led-failsafe = &led_red;
		led-running = &led_red;
		led-upgrade = &led_red;
	};

/*TODO keys {
		compatible = "gpio-keys";

		wifi {
			label = "wifi";
			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RFKILL>;
		};

		reset {
			label = "reset";
			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	}; */

	leds {
		compatible = "gpio-leds";

		data_ok {
			label = "white:data";
			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
		};

        /* this LED is located on the board
         * the same as above
         */
		led_red: data_nok {
			label = "red:data";
			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
		};

		wifi {
			label = "white:wifi";
			gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy1tpt";
		};

        /* this is not a physical LED, but a GPIO
         * to reset the LTE module, set this up
         * the same as on stock
         *
         * to reset, echo -n 1 > shot
         */
		reset_cp {
			label = "none:reset_cp";
			gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "oneshot";
		};
	};

	reg_usb_vbus: regulator {
		compatible = "regulator-fixed";
		regulator-name = "usb_vbus";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		gpio = <&gpio 10 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};
};

&xhci {
	vbus-supply = <&reg_usb_vbus>;
};

&pcie {
	status = "okay";
};

&pcie0 {
	wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x8000>;
		ieee80211-freq-limit = <5000000 6000000>;
	};
};

&pcie1 {
	wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x0>;
		ieee80211-freq-limit = <2400000 2500000>;
	};
};

&switch0 {
	ports {

        /* this port is labeled LAN/WAN
         * on the device, set this up as LAN
         * the same as on stock
         */
		port@0 {
			status = "okay";
			label = "lan1";
		};

		port@1 {
			status = "okay";
			label = "lan2";
		};

		port@2 {
			status = "okay";
			label = "lan3";
		};

		port@3 {
			status = "okay";
			label = "lan4";
		};
	};
};

&state_default {
	gpio {
		groups = "wdt";
		function = "gpio";
	};
};

&nand {
	status = "okay";

	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "u-boot";
			reg = <0x0 0x80000>;
			read-only;
		};

		/* allow setting u-boot-env vars */
		partition@80000 {
			label = "u-boot-env";
			reg = <0x80000 0x20000>;
		};

		factory: partition@100000 {
			label = "factory";
			reg = <0x100000 0x40000>;
			read-only;
		};

        /* set kernel mtdsize to 4MB */
		partition@140000 {
			label = "kernel";
			reg = <0x140000 0x400000>;
		};

        /* convert firmware1, firmware2, and ota mtdparts
         * from stock into UBI rootfs, 133.2MB total
         */
		partition@540000 {
			label = "ubi";
			reg = <0x540000 0x79c0000>;
		};

		partition@7f00000 {
			label = "configbak";
			reg = <0x7f00000 0x80000>;
			read-only;
		};
	};
};

&gmac0 {
	nvmem-cells = <&macaddr_factory_4>;
	nvmem-cell-names = "mac-address";
};

&factory {
	compatible = "nvmem-cells";
	#address-cells = <1>;
	#size-cells = <1>;

	macaddr_factory_4: macaddr@4 {
		reg = <0x4 0x6>;
	};
};

And here's the make file:

define Device/notion_r281
  $(Device/dsa-migration)
  BLOCKSIZE := 128k
  PAGESIZE := 2048
  FILESYSTEMS := squashfs
  KERNEL_SIZE := 4096k
  IMAGE_SIZE := 136396k
  UBINIZE_OPTS := -E 5
  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  DEVICE_VENDOR := Notion
  DEVICE_MODEL := R281
  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap kmod-usb3 \
  kmod-usb-net-rndis kmod-usb-acm comgt-ncm uboot-envtools
endef
TARGET_DEVICES += notion_r281

I hope someone could provide assistance in progressing this port. Please note that I have zero experience in adding a device into OpenWrt, so I made a lot of inferences from the available device dts and make files, choosing some that is as close to hardware as mine.

-ianp

1 Like

I have already sent in the patch.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.