Adding OpenWrt support for Linksys MX5300

This is not at all about 'testing' at this point, but very basic/ initial development starting from zero.

Looks like I will have to get my hands on this bad boy too. We'll see here in a bit.

1 Like

Deleted my original because I missed Ray's comment about it being OpenWRT already....

@kirdes Is support for this router you mention here available anywhere?

Sorry, I'm not in the possession of that device any more.

Regarding adding support for this router (most of the work has already been done here), how to solve the problem of different board files depending on the country/region?

Here is the /etc/system/wait script used by the vendor:

#!/bin/sh

#------------------------------------------------------------------
# © 2013 Belkin International, Inc. and/or its affiliates. All rights reserved.
#------------------------------------------------------------------


#------------------------------------------------------------------
#  This file contains the code run by init process during the wait target
#  It starts the sysevent daemon, and then runs through all of the sysevent
#  registration scripts
#------------------------------------------------------------------
source /etc/init.d/syscfg_api.sh
#init_hotplug2() {
#    [ -c /dev/console ] || mknod /dev/console c 5 1
#    /sbin/hotplug2 --set-worker /lib/hotplug2/worker_fork.so --set-rules-file /etc/hotplug2-init.rules --no-persistent --set-coldplug-cmd /sbin/udevtrigger
#    /sbin/hotplug2 --set-worker /lib/hotplug2/worker_fork.so --set-rules-file /etc/hotplug2-init.rules --persistent &
#}

find_mtd_part() {
        local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')"
        local PREFIX=/dev/mtdblock

        PART="${PART##mtd}"
        [ -d /dev/mtdblock ] && PREFIX=/dev/mtdblock/
        echo "${PART:+$PREFIX$PART}"
}

#03847295
enable_rps()
{
	irq_nss_rps=`grep nss_queue1 /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`
	for entry in $irq_nss_rps
	do
		echo 2 > /proc/irq/$entry/smp_affinity
	done

	irq_nss_rps=`grep nss_queue2 /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`
	for entry in $irq_nss_rps
	do
		echo 4 > /proc/irq/$entry/smp_affinity
	done

	irq_nss_rps=`grep nss_queue3 /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`
	for entry in $irq_nss_rps
	do
		echo 8 > /proc/irq/$entry/smp_affinity
	done

	# Enable NSS RPS
	sysctl -w dev.nss.rps.enable=1 >/dev/null 2>/dev/null
}


# create our passwd/shadow/group files
mkdir -p /tmp/etc/.root
chmod 711 /tmp/etc/.root

if [ -f "/tmp/etc/.root/passwd" ] ; then chmod 644 /tmp/etc/.root/passwd; else touch /tmp/etc/.root/passwd; chmod 644 /tmp/etc/.root/passwd; fi
if [ -f "/tmp/etc/.root/shadow" ] ; then chmod 600 /tmp/etc/.root/shadow; else touch /tmp/etc/.root/shadow; chmod 600 /tmp/etc/.root/shadow; fi
if [ -f "/tmp/etc/.root/group" ] ; then chmod 600 /tmp/etc/.root/group; else touch /tmp/etc/.root/group; chmod 600 /tmp/etc/.root/group; fi

# create the default profile. This is linked to by /etc/profile
echo "export setenv PATH=/bin:/sbin:/usr/sbin:/usr/bin:/opt/sbin:/opt/bin" > /tmp/profile
echo "export setenv LD_LIBRARY_PATH=/lib:/usr/lib:/opt/lib" >> /tmp/profile
#echo "export setenv LD_LIBRARY_PATH=/lib:/usr/lib:/opt/lib:/usr/local/lib/lua/5.1/" >> /tmp/profile

# create other files that are linked to by etc
mkdir -p /tmp/udev/rules.d
echo -n > /tmp/hosts
echo -n > /tmp/hostname
echo -n > /tmp/resolv.conf
echo -n > /tmp/igmpproxy.conf
echo -n > /tmp/ez-ipupdate.conf
echo -n > /tmp/ez-ipupdate.out
echo -n > /tmp/TZ
echo -n > /tmp/.htpasswd
echo -n > /tmp/dnsmasq.conf
echo -n > /tmp/dhcp_options
echo -n > /tmp/dhcp_static_hosts
echo -n > /tmp/dnsmasq.leases
echo -n > /tmp/zebra.conf
echo -n > /tmp/ripd.conf
echo -n > /tmp/dhcp6c.conf

# SYSTEM TUNING
# reserve 8Mb RAM for kernel
echo 8192 > /proc/sys/vm/min_free_kbytes
# For LION-7: Increase concurrent connection limit
if [ -e /proc/sys/net/netfilter/nf_conntrack_max ] ; then
    echo 65535 > /proc/sys/net/netfilter/nf_conntrack_max
fi
mount -t debugfs none /sys/kernel/debug
###########################################################################
#  2. Create syscfg and set the default configuration ( this should be
#     cleaned up )
###########################################################################
# We'd nomally use /var/lib as the mount point for persistent
# application data.  But /var/lib is already being used for
# non-persistent application data (e.g. /var/lib/tc).  So, we fall
# back to using /mnt/lib.
APPLICATION_DIR=/var/config
SYSCFG_DIR=${APPLICATION_DIR}/syscfg
SYSCFG_FILE=${SYSCFG_DIR}/syscfg.dat
SYSCFG_RESET="0"

PERSISTENT_PARTITION=$(awk -F: '/syscfg/ { print $1 }' /proc/mtd)
if [ -z $PERSISTENT_PARTITION ]; then
    echo [utopia][init] Cannot find syscfg partition, assuming /dev/$PERSISTENT_PARTITION
fi
MTD_DEVICE=/dev/${PERSISTENT_PARTITION}
MTD_BLOCK_DEVICE=/dev/$(echo ${PERSISTENT_PARTITION} | sed s/mtd/mtdblock/)
MTD_NUM="`echo -n $PERSISTENT_PARTITION | sed 's/mtd//g'`"
mounted=0
mkdir -p ${APPLICATION_DIR} || echo [utopia][init] No mount point for persistent storage.

echo "Attempting mount of ubifs syscfg partition"
UBIDEV=1 #if not using UBI block, set to 0, else 1

# suggested change by Roger at MediaTek to ensure that /dev/ubi_ctrl is available
# prior to calling ubiattach
# mdev -s
if [ ! -e "/dev/ubi_ctrl" ] ; then
	mknod /dev/ubi_ctrl c 10 62
fi

# echo "ubiattach /dev/ubi_ctrl -m ${MTD_NUM} -d ${UBIDEV}" >> /dev/console
ubiattach /dev/ubi_ctrl -m ${MTD_NUM} -d ${UBIDEV}

#if mount -t jffs2 $MTD_BLOCK_DEVICE ${APPLICATION_DIR}; then
if mount -o sync -t ubifs ubi${UBIDEV}_0 ${APPLICATION_DIR}; then
    mounted=1
else
    echo [utopia][init] Persistent storage mount failed, attempting format

#     echo [utopia][init] Backing up syscfg partition to /tmp/mtd${MTD_NUM}_corrupt
#     dd if=/dev/${MTD_NUM} of=/tmp/mtd${MTD_NUM}_corrupt
#     echo [utopia][init] Backing up syscfg partition to /tmp/mtd${MTD_NUM}_corrupt DONE!

    tmp=$(mktemp -t -d)
    mkdir -p ${tmp}/syscfg

    echo "erasing flash partition $MTD_DEVICE"
    # flash_erase ${MTD_DEVICE} 0 0
    # change suggested by Adam to get ubifs commands working from uboot
    ubidetach /dev/ubi_ctrl -m ${MTD_NUM}
    flash_erase -N ${MTD_DEVICE} 0 0
    ubiformat -y ${MTD_DEVICE}
    echo "ubiattach /dev/ubi_ctrl -m ${MTD_NUM}"
		ubiattach /dev/ubi_ctrl -m ${MTD_NUM}

    echo "trying to create ubi volume"
    if ! ubimkvol /dev/ubi${UBIDEV} -N syscfg -m; then
	echo [utopia][init] Format persistent storage failed.  Perhaps ubimkvol not installed.  Giving up.
    else
	if ! mount -o sync -t ubifs ubi${UBIDEV}_0 ${APPLICATION_DIR}; then
	    echo [utopia][init] Format succeeded, mount still failed.  Giving up.
	else
	    mounted=1
	fi
    fi
    rm -rf ${tmp}
    SYSCFG_RESET="1"
fi

if [ ${mounted} -ne 0 ]; then
    [ -d ${SYSCFG_DIR} ] || mkdir -p ${SYSCFG_DIR}
    syscfg_create -f ${SYSCFG_FILE}
    echo [utopia][init] Using persistent syscfg data from ${SYSCFG_DIR}
else
    echo [utopia][init] Using raw partition ${MTD_DEVICE} for syscfg data
    syscfg_check -d $MTD_DEVICE
    if [ $? = 0 ]; then
	echo "[utopia][init] Starting syscfg subsystem using flash partition $MTD_DEVICE"
	/sbin/syscfg_create -d $MTD_DEVICE
    else
	echo "[utopia][init] Formating flash partition $MTD_DEVICE for syscfg use"
	syscfg_format -d $MTD_DEVICE
	if [ $? = 0 ]; then
	    echo "[utopia][init] Starting syscfg subsystem using flash partition $MTD_DEVICE with default settings"
	    /sbin/syscfg_create -d $MTD_DEVICE
	else
	    echo "[utopia][init] FAILURE: formatting flash partition $MTD_DEVICE for syscfg use"
	    echo "[utopia][init] Starting syscfg with default settings using file store (/tmp/syscfg.db)"
	    echo "" > /tmp/syscfg.db
	    /sbin/syscfg_create -f /tmp/syscfg.db
	fi
    fi
fi
product_name=$(cat /etc/product)
[ -f /etc/fw_env.config.$product_name ] && cp -f /etc/fw_env.config.$product_name /tmp/fw_env.config

#start hotplug2 before QCA driver loading. Could possibly handle by udev
#init_hotplug2
echo "[utopia][init] Starting system logging"
/etc/init.d/service_syslog.sh syslog-start

echo "[utopia][init] Starting sysevent subsystem"
if [ -f /usr/sbin/start_syseventd.sh ];then
        /usr/sbin/start_syseventd.sh
else
        /sbin/syseventd
fi

# set flag to show that syscfg was reset
if [ "$SYSCFG_RESET" == "1" ] ; then
	sysevent set notify_that_syscfg_was_reset 1
fi

# LED start pulsing blue
echo "[utopia][init] Starting blue ..."
/etc/led/nodes_led_pulse.sh blue 3

# load kernel modules to handle FTP PORT command
MODULE_PATH=/lib/modules/`uname -r`/
# Load ssdk.ko for QCA platform
if [ -f $MODULE_PATH/qca-ssdk.ko ] ; then
    /sbin/modprobe qca-ssdk
fi

#load QCA NSS and GMAC drivers
echo "[utopia][init] Enabling DesignWare USB3 DRD Core drivers"

/sbin/modprobe usb-common
/sbin/modprobe usbcore
#/sbin/modprobe usb_nls_base
#/sbin/modprobe usb_udc_core
#/sbin/modprobe libcomposite
/sbin/modprobe phy_qcom_dwc3
/sbin/modprobe phy_msm_qusb
/sbin/modprobe phy_msm_ssusb_qmp
/sbin/modprobe usb_f_diag
/sbin/modprobe dwc3_of_simple
/sbin/modprobe dwc3
/sbin/modprobe ehci-hcd
/sbin/modprobe ehci_platform
/sbin/modprobe xhci-hcd
/sbin/modprobe xhci-pci
/sbin/modprobe xhci_plat_hcd

#/sbin/modprobe usb-storage
#/sbin/modprobe uas

echo "[utopia][init] Loading QCA Ethernet, NSS and GMAC drivers"
/sbin/modprobe cfg80211
/sbin/modprobe qca-nss-dp
/sbin/modprobe qca-nss-drv
/sbin/modprobe nat46
/sbin/modprobe qca-nss-bridge-mgr
/sbin/modprobe qca-nss-gre
/sbin/modprobe qca-nss-l2tpv2
/sbin/modprobe qca-nss-lag-mgr
/sbin/modprobe qca-nss-map-t
/sbin/modprobe qca-nss-pppoe
/sbin/modprobe qca-nss-pptp
/sbin/modprobe qca-nss-vlan
/sbin/modprobe qca-nss-crypto
/sbin/modprobe qca-nss-macsec
/sbin/modprobe qca-nss-qdisc
/sbin/modprobe qca-nss-cfi-cryptoapi
#/sbin/modprobe qca-nss-gmac
/sbin/modprobe qca-nss-tun6rd
/sbin/modprobe qca-nss-tunipip6
/sbin/modprobe qca-nss-ipsecmgr
/sbin/modprobe qca-nss-cfi-ocf
/sbin/modprobe qca-nss-ipsec
/sbin/modprobe qca-nss-crypto_tool
/sbin/modprobe nf_conntrack_ftp
/sbin/modprobe nf_nat_ftp
/sbin/modprobe qca-mcs
/sbin/modprobe qrfs

#03847295
enable_rps

sysctl -w net.netfilter.nf_conntrack_acct=1

# load the watchdog module and start the watchdog program
# insmod $MODULE_PATH/mod_wdtutil.ko
# /bin/mknod /dev/watchdog c $(awk ' /wdtutil/{ print $1 }' /proc/devices) 1
# /usr/sbin/wdtutil -c 16 -i 5
# echo "watchdog running"

# we want plugged in usb devices to propagate events to sysevent
echo "[utopia][init] Late loading usb drivers"
#/sbin/modprobe nls_base
/sbin/modprobe sd_mod
#/sbin/modprobe usb_storage
/sbin/modprobe vfat
#/sbin/modprobe ntfs

mknod /dev/gpio c 252 0
mknod /dev/rdm0 c 253 0

echo "[utopia][init] Setting any unset system values to default"
apply_system_defaults

PIN="`syscfg get smart_connect::client_pin`"
if [ -z "$PIN" ] ; then
	WPS_PIN=`syscfg get device::wps_pin`
	PIN=`echo ${WPS_PIN:4}`
	echo "[utopia][init] Set smart_connect::client_pin $PIN" > /dev/console
	syscfg set smart_connect::client_pin "$PIN"
fi

# RAINIER-5849 is fixed by moving vconfig to immediately after the Ethernet
# driver in the wait script. This is a Broadcom only issue.
if [ -f /usr/sbin/vlan_setup.sh ]; then
        /usr/sbin/vlan_setup.sh
        # To maintain compatibility with service_interface we manually set vlan2-status started
        sysevent set vlan2-status started
fi


# for nodes, at boot up always set the backhaul status to down
sysevent set backhaul::status down


INIT_DIR=/etc/registration.d
# run all executables in the sysevent registration directory
# echo "[utopia][init] Running registration using $INIT_DIR"
execute_dir $INIT_DIR

# Load bdutil daemon
lsmod | grep mod_bdutil 2>&1 > /dev/null
#if [ $? -eq 0 ]; then
#        echo "[utopia][init] Starting bdutil daemon" > /dev/console
#        /usr/sbin/bdutil &
#fi

# This is an entry point where developers can quickly add test scripts
# that will be run after boot up
if [ -d "/var/config/run_scripts" ] ; then
	echo "running scripts in /var/config/run_script directory !!!" >> /dev/console
	execute_dir "/var/config/run_scripts" &
fi

# The code below attempts to sync up the current admin password ( which may have
# been changed, with the admin http_auth password for the sysinfo.cgi file.
# Matt Fatheree appologizes in advance for this spaghetti code.
# BEWARE: here there be dragons
if [ ! -f "/var/config/.sysinfo_pswd" ] ; then
	if [ -f "/var/config/syspwl.lst" ] ; then
		# if there is an admin password already set try to use that
		ADMPASS="`cat /var/config/syspwl.lst  | grep 1000 | cut -d':' -f2`"
		echo "admin:$ADMPASS" > /var/config/.sysinfo_pswd
	else
		echo "admin:admin" > /var/config/.sysinfo_pswd
	fi
else
  # this is a case for when someone has changed the admin passwd
  # before they had code that supported protecting sysinfo.cgi
  # in that case the sysinfo_pswd exists, but has the default admin:admin
  # password combination.  In that case, we basically do what we did above, but
  # recreate the sysinfo_pswd file
	if [ -f "/var/config/syspwl.lst" ] ; then
	# quick hack to sync up sysinfo passwords
	  echo "attempting to sync sysinfo.cgi auth credentials" >> /dev/console
		ORGPASS="`cat /var/config/.sysinfo_pswd | grep admin | cut -d':' -f2`"
		ADMPASS="`cat /var/config/syspwl.lst  | grep 1000 | cut -d':' -f2`"
		if [ "$ORGPASS" != "$ADMPASS" ] ; then
		  echo "sync sysinfo.cgi auth credentials from syspwl.lst" >> /dev/console
			echo "admin:$ADMPASS" > /var/config/.sysinfo_pswd
		fi
	else
		echo "admin:admin" > /var/config/.sysinfo_pswd
	fi
fi

#echo "[utopia][init] Loading LEDS and Buttons drivers" - not in dakota
#/sbin/modprobe gpio_keys
/sbin/modprobe button-hotplug
#killall -q hotplug2
#wait
#QCA driver will load cal data from /tmp. Cannot be any other directory
calpart=`grep "0:ART" /proc/mtd | awk -F: '{print $1}'`
if [ "$calpart" != "" ]; then
    echo "[utopia][init] Load WiFi cal data from MTD("$calpart") to FS."
    HK_BD_FILENAME=/lib/firmware/IPQ8074_FW/bdwlan.bin
    mkdir -p /tmp/IPQ8074
    dd if=/dev/$calpart of=/tmp/wifi1.caldata bs=1 count=12064 skip=208896
    FILESIZE=$(stat -Lc%s "$HK_BD_FILENAME")
    dd if=/dev/$calpart of=/tmp/IPQ8074/caldata.bin bs=1 count=$FILESIZE skip=4096
fi

#restart run-time hotplug2 for buttons handler
[ -x /sbin/hotplug2 ] && /sbin/hotplug2 --override --persistent \
		--set-rules-file /etc/hotplug2.rules \
		--set-coldplug-cmd /sbin/udevtrigger \
		--max-children 1 >/dev/null 2>&1 &

#Create wifi f/w directory and copy all files there to this place
#so that wifi devices can load its firmware and board data file when
#special files are needed for specific region.
REGION=`skuapi -g cert_region | cut -d'=' -f2 | tr -d ' '`
echo "[utopia][init] Setup link to WiFi firmware and board data ($REGION)"


if [ "$REGION" = "ME" -o "$REGION" = "CN" -o "$REGION" = "AH" -o "$REGION" = "KR" ] ; then
    syscfg_set wifi::multiregion_enable 1
    syscfg_set wifi::multiregion_supportedcountries "USA,CAN,EEE,CHN,HKG,IND,PHL,SGP,THA,XAH,TWN,JPN,KOR,AUS,NZL,XME,SAU"
    SELECTEDCOUNTRY=`syscfg get wifi::multiregion_selectedcountry`
    if [ "$SELECTEDCOUNTRY" = "" ] && [ "$REGION" = "ME" ] ; then
	syscfg_set wifi::multiregion_region ME
	syscfg_set wifi::multiregion_selectedcountry XME
    fi
    if [ "$SELECTEDCOUNTRY" = "" ] && [ "$REGION" = "CN" ] ; then
	syscfg_set wifi::multiregion_region CN
	syscfg_set wifi::multiregion_selectedcountry CHN
    fi
    if [ "$SELECTEDCOUNTRY" = "" ] && [ "$REGION" = "AH" ] ; then
	syscfg_set wifi::multiregion_region AH
	syscfg_set wifi::multiregion_selectedcountry XAH
    fi
    if [ "$SELECTEDCOUNTRY" = "" ] && [ "$REGION" = "KR" ] ; then
	syscfg_set wifi::multiregion_region KR
	syscfg_set wifi::multiregion_selectedcountry KOR
    fi
else
    syscfg_set wifi::multiregion_enable 0
fi

COUNTRY=""

if [ "1" = "`syscfg get wifi::multiregion_support`" -a "1" = "`syscfg get wifi::multiregion_enable`" ] ; then
    echo "[utopia][init] Multi-region is supported and enabled"
    MULTIREGION=`syscfg get wifi::multiregion_region`
    COUNTRY=`syscfg get wifi::multiregion_selectedcountry`
    echo "[utopia][init] Region: $MULTIREGION, Country: $COUNTRY"
    #echo "$MULTIREGION" > /tmp/zb_power_region
else
    echo "[utopia][init] Multi-region is not supported or not enabled"
    echo "[utopia][init] Cert region: $REGION"
    #echo "$REGION" > /tmp/zb_power_region
fi
if [ ! -d /tmp/IPQ8074/WIFI_FW ]; then
    mkdir -p /tmp/IPQ8074/WIFI_FW
    cp -r /lib/firmware/IPQ8074_FW/*.* /tmp/IPQ8074/WIFI_FW
    cd /tmp/IPQ8074 && ln -sf WIFI_FW/*.* .
    rm /tmp/IPQ8074/bdwlan.bin
    rm /tmp/IPQ8074/bdwlan.b293
    ln -sf /tmp/IPQ8074/bdwlan.bin /tmp/IPQ8074/bdwlan.b293
fi

if [ ! -d /tmp/QCA9984 ]; then
    mkdir /tmp/QCA9984
    cp -r /lib/firmware/QCA9984/hw_1 /tmp/QCA9984/hw.1
    rm /tmp/QCA9984/hw.1/boardData_QCA9984_CUS239_high_band_5G_v1_006.bin
    ln -sf /tmp/QCA9984/hw.1/boarddata_1.bin /tmp/QCA9984/hw.1/boardData_QCA9984_CUS239_high_band_5G_v1_006.bin
fi

#Override with default FCC data
cp /lib/firmware/QCA9984/FCC/* /tmp/QCA9984/hw.1
cp /lib/firmware/IPQ8074_FW/FCC/* /tmp/IPQ8074
#Override with regional board data if not FCC.
if [ "$COUNTRY" ] ; then
	case "$COUNTRY" in
		"CHN") #China
		    echo "[utopia][init] Using CHN region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region CN
		    cp /lib/firmware/IPQ8074_FW/CN/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/CN/* /tmp/QCA9984/hw.1
		    ;;
		"HKG") #HKG
		    echo "[utopia][init] Using HKG region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region HK
		    cp /lib/firmware/IPQ8074_FW/HK/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/HK/* /tmp/QCA9984/hw.1
		    ;;
		"IND")  #India
		    echo "[utopia][init] Using IND region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region IN
		    cp /lib/firmware/IPQ8074_FW/IN/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/IN/* /tmp/QCA9984/hw.1
		    ;;
		"PHL") #Philippines
		    echo "[utopia][init] Using PHL region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region PH
		    cp /lib/firmware/IPQ8074_FW/PH/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/PH/* /tmp/QCA9984/hw.1
		    ;;
		"SGP") #Singapore
		    echo "[utopia][init] Using SGP region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region SG
		    cp /lib/firmware/IPQ8074_FW/SG/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/SG/* /tmp/QCA9984/hw.1
		    ;;
		"THA") #Thailand
		    echo "[utopia][init] Using THA region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region TH
		    cp /lib/firmware/IPQ8074_FW/TH/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/TH/* /tmp/QCA9984/hw.1
		    ;;
		"XAH")
		    echo "[utopia][init] Using XAH region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region AH
		    cp /lib/firmware/IPQ8074_FW/AH/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/AH/* /tmp/QCA9984/hw.1
		    ;;
		"TWN")
		    echo "[utopia][init] Using TWN region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region US
		    cp /lib/firmware/IPQ8074_FW/TW/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/TW/* /tmp/QCA9984/hw.1
		    ;;
		"AUS") 
		    echo "[utopia][init] Using AUS region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region AU
		    cp /lib/firmware/IPQ8074_FW/AU/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/AU/* /tmp/QCA9984/hw.1
		    ;;
		"CAN")
		    echo "[utopia][init] Using CAN region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region CA
		    if [ "$REGION" = "CN" ] ; then
		    	cp /lib/firmware/IPQ8074_FW/IC_MPT/* /tmp/IPQ8074
			cp /lib/firmware/QCA9984/IC_MPT/* /tmp/QCA9984/hw.1
		    else
			cp /lib/firmware/IPQ8074_FW/IC/* /tmp/IPQ8074
			cp /lib/firmware/QCA9984/IC/* /tmp/QCA9984/hw.1
		    fi
		    ;;
		"EEE")
		    echo "[utopia][init] Using EEE region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region EU
		    if [ "$REGION" = "CN" ] ; then
		    	cp /lib/firmware/IPQ8074_FW/EU_MPT/* /tmp/IPQ8074
		    	cp /lib/firmware/QCA9984/EU_MPT/* /tmp/QCA9984/hw.1
		    else
		    	cp /lib/firmware/IPQ8074_FW/EU/* /tmp/IPQ8074
		    	cp /lib/firmware/QCA9984/EU/* /tmp/QCA9984/hw.1
		    fi
		    ;;
		"XME")
		    echo "[utopia][init] Using XME region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region ME
		    cp /lib/firmware/IPQ8074_FW/ME/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/ME/* /tmp/QCA9984/hw.1
		    ;;
		"NZL") 
		    echo "[utopia][init] Using NZL region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region AU
		    cp /lib/firmware/IPQ8074_FW/AU/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/AU/* /tmp/QCA9984/hw.1
		    ;;
		"SAU")
		    echo "[utopia][init] Using SAU region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region ME
		    cp /lib/firmware/IPQ8074_FW/ME/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/ME/* /tmp/QCA9984/hw.1
		    ;;
		"USA")
		    echo "[utopia][init] Using USA region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region US
		    if [ "$REGION" = "CN" ] ; then
		    	cp /lib/firmware/IPQ8074_FW/FCC_MPT/* /tmp/IPQ8074
		    	cp /lib/firmware/QCA9984/FCC_MPT/* /tmp/QCA9984/hw.1
		    else
		    	cp /lib/firmware/IPQ8074_FW/FCC/* /tmp/IPQ8074
		    	cp /lib/firmware/QCA9984/FCC/* /tmp/QCA9984/hw.1
		    fi
		    ;;
		"JPN") 
		    echo "[utopia][init] Using JPN region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region JP
		    cp /lib/firmware/IPQ8074_FW/JP/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/JP/* /tmp/QCA9984/hw.1
		    ;;
		"KOR") 
		    echo "[utopia][init] Using KOR region for WiFi firmware and board data"
		    syscfg_set wifi::multiregion_region KR
		    cp /lib/firmware/IPQ8074_FW/KR/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/KR/* /tmp/QCA9984/hw.1
		    ;;
		*)
		    echo "[utopia][init] Critical error, no support Country Code"
		    ;;
	esac
else
	case "$REGION" in
		"CA")
		    echo "[utopia][init] Using CA region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/IC/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/IC/* /tmp/QCA9984/hw.1
		    ;;
		"AU")
		    echo "[utopia][init] Using AU region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/AU/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/AU/* /tmp/QCA9984/hw.1
		    ;;
		"AH")
		    echo "[utopia][init] Using AH region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/AH/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/AH/* /tmp/QCA9984/hw.1
		    ;;
		"AP")
		    echo "[utopia][init] Using AP region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/AP/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/AP/* /tmp/QCA9984/hw.1
		    ;;
		"EU")
		    echo "[utopia][init] Using EU region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/EU/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/EU/* /tmp/QCA9984/hw.1
		    ;;
		"PH")
		    echo "[utopia][init] Using PH region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/PH/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/PH/* /tmp/QCA9984/hw.1
		    ;;
		"ME")
		    echo "[utopia][init] Using ME region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/ME/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/ME/* /tmp/QCA9984/hw.1
		    ;;
		"CN")
		    echo "[utopia][init] Using CN region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/CN/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/CN/* /tmp/QCA9984/hw.1
		    ;;
		"JP")
		    echo "[utopia][init] Using JP region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/JP/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/JP/* /tmp/QCA9984/hw.1
		    ;;
		"KR")
		    echo "[utopia][init] Using KR region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/KR/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/KR/* /tmp/QCA9984/hw.1
		    ;;
		"HK")
		    echo "[utopia][init] Using HK region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/HK/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/HK/* /tmp/QCA9984/hw.1
		    ;;
		"ID")
		    echo "[utopia][init] Using ID region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/ID/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/ID/* /tmp/QCA9984/hw.1
		    ;;
		"IN")
		    echo "[utopia][init] Using IN region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/IN/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/IN/* /tmp/QCA9984/hw.1
		    ;;
		"TH")
		    echo "[utopia][init] Using TH region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/TH/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/TH/* /tmp/QCA9984/hw.1
		    ;;
		"SG")
		    echo "[utopia][init] Using SG region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/SG/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/SG/* /tmp/QCA9984/hw.1
		    ;;
		"VN")
		    echo "[utopia][init] Using Vietnam region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/VN/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/VN/* /tmp/QCA9984/hw.1
		    ;;
		"MY")
		    echo "[utopia][init] Using MY region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/AH/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/AH/* /tmp/QCA9984/hw.1
		    ;;
		"TW")
		    echo "[utopia][init] Using TW region for WiFi firmware and board data"
		    cp /lib/firmware/IPQ8074_FW/TW/* /tmp/IPQ8074
		    cp /lib/firmware/QCA9984/TW/* /tmp/QCA9984/hw.1
		    ;;
		*)
		    echo "[utopia][init] No REGION definded, use FCC"
		    ;;
	esac
fi
syscfg_commit
#start NSS RPS
if [ -e /etc/init.d/qca-nss-drv ]; then
    /etc/init.d/qca-nss-drv start autoscaling-disable
fi
if [ -f /etc/sysctl.d/qca-nss-drv.conf ]; then
    sysctl -p /etc/sysctl.d/qca-nss-drv.conf
fi
# ECM start, sysctl also call in service_system script
/sbin/modprobe bonding
echo "[utopia][init] Loading QCA Enhanced Connection manager"
if [ -e /etc/init.d/qca-nss-ecm ]; then
   /etc/init.d/qca-nss-ecm start
fi
if [ -f /etc/sysctl.d/qca-nss-ecm.conf ]; then
        sysctl -p /etc/sysctl.d/qca-nss-ecm.conf
fi

#echo "inserting fpbypass"
if [ "`syscfg get fastpath_support`" == "1" ] ; then
  if [ "`syscfg get nss_support`" == "1" ] && [ -e $MODULE_PATH/ecm.ko ] ; then
	echo "inserting fpbypass.ko for QCA"
	insmod $MODULE_PATH/fpbypass.ko
  else
	echo "error when inserting fpbypass"
  fi
fi
# set up kernel panic logging if needed.
if [ -e /etc/init.d/setup_kpaniclog.sh ]; then
    /etc/init.d/setup_kpaniclog.sh
fi

# The code below attempts to sync up the current admin password ( which may have
# been changed, with the admin http_auth password for the sysinfo.cgi file.
# Matt Fatheree appologizes in advance for this spaghetti code.
# BEWARE: here there be dragons
if [ ! -f "/var/config/.sysinfo_pswd" ] ; then
	if [ -f "/var/config/syspwl.lst" ] ; then
		# if there is an admin password already set try to use that
		ADMPASS="`cat /var/config/syspwl.lst  | grep 1000 | cut -d':' -f2`"
		echo "admin:$ADMPASS" > /var/config/.sysinfo_pswd
	else
		echo "admin:admin" > /var/config/.sysinfo_pswd
	fi
else
  # this is a case for when someone has changed the admin passwd
  # before they had code that supported protecting sysinfo.cgi
  # in that case the sysinfo_pswd exists, but has the default admin:admin
  # password combination.  In that case, we basically do what we did above, but
  # recreate the sysinfo_pswd file
	if [ -f "/var/config/syspwl.lst" ] ; then
	# quick hack to sync up sysinfo passwords
	  echo "attempting to sync sysinfo.cgi auth credentials" >> /dev/console
		ORGPASS="`cat /var/config/.sysinfo_pswd | grep admin | cut -d':' -f2`"
		ADMPASS="`cat /var/config/syspwl.lst  | grep 1000 | cut -d':' -f2`"
		if [ "$ORGPASS" != "$ADMPASS" ] ; then
		  echo "sync sysinfo.cgi auth credentials from syspwl.lst" >> /dev/console
			echo "admin:$ADMPASS" > /var/config/.sysinfo_pswd
		fi
	else
		echo "admin:admin" > /var/config/.sysinfo_pswd
	fi
fi
# NODES-2358
ethtool -K eth0 tso off
ethtool -K eth1 tso off

if [ -e "/usr/bin/lldpd" ] ; then
#addgroup _lldpd
echo "adding group for lldpd user"
echo "_lldpd:x:1005:admin" >> /tmp/etc/.root/group
fi
# make sure /dev/null permission is 666
chmod 666 /dev/null

# fix syscfg bridge_1 variables so that users do not need to factory reset
# fixed needed because of splitting bridge into two; bridge_2 will automatically be added
# added to end because sysevent daemon wasn't up
syscfg_reset "switch::bridge_max"

# bridge_1
syscfg_reset "switch::bridge_1::ifname"
syscfg_reset "switch::bridge_1::physical_ifname"
syscfg_reset "switch::bridge_1::port_numbers"
syscfg_reset "switch::bridge_1::port_names"

# unset switch::bridge_1::wan_monitor_port; monitor using bridge_2 instead
#syscfg_unset "switch::bridge_1::wan_monitor_port"

# commit if any changes
syscfg_commit

#move to here for Bronx, because Quartz need more time to become ready
# Get BTLE radio ready
echo "[utopia][init] Initializing BTLE interface" >> /dev/console
BTRESETGPIO="21"
echo $BTRESETGPIO >/sys/class/gpio/export
echo out >/sys/class/gpio/gpio${BTRESETGPIO}/direction
#moved to iotd
#echo 0 >/sys/class/gpio/gpio${BTRESETGPIO}/value
#sleep 0.05
#echo 1 >/sys/class/gpio/gpio${BTRESETGPIO}/value
#sleep 0.05

# Program BT Mac address
BT_MAC_ADDR=`syscfg get bt_mac_addr`
BT_MAC_ADDR=`echo "$BT_MAC_ADDR" | tr -s ':' ' '`
MAC0=`echo "$BT_MAC_ADDR" | awk '{print $1}'`
MAC1=`echo "$BT_MAC_ADDR" | awk '{print $2}'`
MAC2=`echo "$BT_MAC_ADDR" | awk '{print $3}'`
MAC3=`echo "$BT_MAC_ADDR" | awk '{print $4}'`
MAC4=`echo "$BT_MAC_ADDR" | awk '{print $5}'`
MAC5=`echo "$BT_MAC_ADDR" | awk '{print $6}'`
CERT_REGION=`skuapi -g cert_region | cut -d'=' -f2 | tr -d ' '`
# Dallas uses the same psr file for all cert regions.
#PSR="/etc/csr8x11-a12-bt4.2.psr"

echo "[utopia][init] Bluetooth Mac Address: $BT_MAC_ADDR" >> /dev/console
echo "[utopia][init] Cert Region: $CERT_REGION" >> /dev/console
#echo "[utopia][init] BT PSR: $PSR" >> /dev/console

if [ -c /dev/spidev32765.0 ] ; then
	echo "[utopia][init] BTLE interface ready to use" >> /dev/console
    # Start btsetup service
    sysevent set btsetup-start
    sysevent set quartzfwup 0
else
	echo "[utopia][init] BTLE interface failed" >> /dev/console
fi

# Change guest access auth port to 11161 (Ref. OLYMPUS-154)
# Some clients unable to get redirect to guest captive portal for authentication
if [ "$(syscfg get guest_auth_port)" != "11161" ]; then
    echo "[utopia][init] Setting guest access auth port to 11161" >> /dev/console
    syscfg set guest_auth_port 11161
    syscfg commit
fi

I have prepared dts for this router (based on MX4200 support). Unfortunately, after uploading the image, the router auto-recovers. Currently I don't have access via console yet.
Here is the original dts: https://hastebin.com/share/isanocaqiz.swift
Can someone take a look at this? @SpectreDev ?

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

/dts-v1/;

#include "ipq8074.dtsi"
#include "ipq8074-hk-cpu.dtsi"
#include "ipq8074-ess.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>

/ {
	model = "Linksys MX5300";
	compatible = "linksys,mx5300", "qcom,ipq8074";

	aliases {
		serial0 = &blsp1_uart5;
		/*
		 * Aliases as required by u-boot
		 * to patch MAC addresses
		 */
		ethernet0 = &dp1;
		ethernet1 = &dp2;
		ethernet2 = &dp3;
		ethernet3 = &dp4;
		ethernet4 = &dp5;
		led-boot = &led_system_blue;
		led-running = &led_system_blue, &led_system_red;
		led-failsafe = &led_system_red;
		led-upgrade = &led_system_green;
	};

	chosen {
		stdout-path = "serial0:115200n8";
		bootargs-append = " root=/dev/ubiblock0_1";
	};

	keys {
		compatible = "gpio-keys";
		pinctrl-0 = <&button_pins>;
		pinctrl-names = "default";

		reset-button {
			label = "reset";
			gpios = <&tlmm 67 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};

		wps-button {
			label = "wps";
			gpios = <&tlmm 54 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WPS_BUTTON>;
		};
	};
};

&tlmm {
	button_pins: button-state {
		pins = "gpio54", "gpio67";
		function = "gpio";
		drive-strength = <8>;
		bias-pull-up;
	};

	mdio_pins: mdio-state {
		mdc-pins {
			pins = "gpio68";
			function = "mdc";
			drive-strength = <8>;
			bias-pull-up;
		};

		mdio-pins {
			pins = "gpio69";
			function = "mdio";
			drive-strength = <8>;
			bias-pull-up;
		};
	};
};

&blsp1_uart5 {
	status = "okay";
};

&prng {
	status = "okay";
};

&cryptobam {
	status = "okay";
};

&crypto {
	status = "okay";
};

&qpic_bam {
	status = "okay";
};

&qpic_nand {
	status = "okay";

	/*
	 * Bootloader will find the NAND DT node by the compatible and
	 * then "fixup" it by adding the partitions from the SMEM table
	 * using the legacy bindings thus making it impossible for us
	 * to change the partition table or utilize NVMEM for calibration.
	 * So add a dummy partitions node that bootloader will populate
	 * and set it as disabled so the kernel ignores it instead of
	 * printing warnings due to the broken way bootloader adds the
	 * partitions.
	 */
	partitions {
		status = "disabled";
	};

	nand@0 {
		reg = <0>;
		compatible = "qcom,nandcs";
		nand-ecc-strength = <4>;
		nand-ecc-step-size = <512>;
		nand-bus-width = <8>;

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

			partition@0 {
				label = "0:sbl1";
				reg = <0x0 0x100000>;
				read-only;
			};

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

			partition@200000 {
				label = "0:bootconfig";
				reg = <0x200000 0x80000>;
				read-only;
			};

			partition@280000 {
				label = "0:bootconfig1";
				reg = <0x280000 0x80000>;
				read-only;
			};

			partition@300000 {
				label = "0:qsee";
				reg = <0x300000 0x300000>;
				read-only;
			};

			partition@600000 {
				label = "0:qsee_1";
				reg = <0x600000 0x300000>;
				read-only;
			};

			partition@900000 {
				label = "0:devcfg";
				reg = <0x900000 0x80000>;
				read-only;
			};

			partition@980000 {
				label = "0:devcfg_1";
				reg = <0x980000 0x80000>;
				read-only;
			};

			partition@a00000 {
				label = "0:apdp";
				reg = <0xa00000 0x80000>;
				read-only;
			};

			partition@a80000 {
				label = "0:apdp_1";
				reg = <0xa80000 0x80000>;
				read-only;
			};

			partition@b00000 {
				label = "0:rpm";
				reg = <0xb00000 0x80000>;
				read-only;
			};

			partition@b80000 {
				label = "0:rpm_1";
				reg = <0xb80000 0x80000>;
				read-only;
			};

			partition@c00000 {
				label = "0:cdt";
				reg = <0xc00000 0x80000>;
				read-only;
			};

			partition@c80000 {
				label = "0:cdt_1";
				reg = <0xc80000 0x80000>;
				read-only;
			};

			partition@d00000 {
				label = "0:appsblenv";
				reg = <0xd00000 0x80000>;
			};

			partition@d80000 {
				label = "0:appsbl";
				reg = <0xd80000 0x100000>;
				read-only;
			};

			partition@e80000 {
				label = "0:appsbl_1";
				reg = <0xe80000 0x100000>;
				read-only;
			};

			partition@f80000 {
				label = "0:art";
				reg = <0xf80000 0x80000>;
				read-only;
			};

			partition@1000000 {
				label = "u_env";
				reg = <0x1000000 0x40000>;
			};

			partition@1040000 {
				label = "s_env";
				reg = <0x1040000 0x20000>;
			};

			partition@1060000 {
				label = "devinfo";
				reg = <0x1060000 0x20000>;
				read-only;
			};

			partition@1080000 {
				label = "kernel";
				reg = <0x1080000 0x9600000>;
			};

			partition@1680000 {
				label = "rootfs";
				reg = <0x1680000 0x9000000>;
			};

			partition@a680000 {
				label = "alt_kernel";
				reg = <0xa680000 0x9600000>;
			};

			partition@ac80000 {
				label = "alt_rootfs";
				reg = <0xac80000 0x9000000>;
			};
			partition@13c80000 {
				label = "sysdiag";
				reg = <0x13c80000 0x200000>;
				read-only;
			};
			partition@13e80000 {
				label = "0:ethphyfw";
				reg = <0x13e80000 0x80000>;
				read-only;
			};
			partition@13f00000 {
				label = "syscfg";
				reg = <0x13f00000 0xB800000>;
				read-only;
			};
			partition@1f700000 {
				label = "0:wififw";
				reg = <0x1f700000 0x900000>;
				read-only;
			};
		};
	};
};

&blsp1_i2c2 {
	status = "okay";

	led-controller@62 {
		compatible = "nxp,pca9633";
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <0x62>;
		nxp,hw-blink;

		led_system_red: led@0 {
			label = "red";
			reg = <0>;
			color = <LED_COLOR_ID_RED>;
		};

		led_system_green: led@1 {
			label = "green";
			reg = <1>;
			color = <LED_COLOR_ID_GREEN>;
		};

		led_system_blue: led@3 {
			label = "blue";
			reg = <2>;
			color = <LED_COLOR_ID_BLUE>;
		};
	};

	rtc@68 {
		compatible = "dallas,ds1307";
		reg = <0x68>;
	};
};

&mdio {
	status = "okay";

	pinctrl-0 = <&mdio_pins>;
	pinctrl-names = "default";
	reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;

	qca8075_0: ethernet-phy@0 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <0>;
	};

	qca8075_1: ethernet-phy@1 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <1>;
	};

	qca8075_2: ethernet-phy@2 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <2>;
	};

	qca8075_3: ethernet-phy@3 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <3>;
	};

	qca8075_4: ethernet-phy@4 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <4>;
	};
};

&switch {
	status = "okay";

	switch_cpu_bmp = <0x1>; /* cpu port bitmap */
	switch_lan_bmp = <0x3e>; /* lan port bitmap */
	switch_wan_bmp = <0x40>; /* wan port bitmap */
	switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
	switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/
	switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/
	bm_tick_mode = <0>; /* bm tick mode */
	tm_tick_mode = <0>; /* tm tick mode */

	qcom,port_phyinfo {
		port@0 {
			port_id = <1>;
			phy_address = <0>;
		};
		port@1 {
			port_id = <2>;
			phy_address = <1>;
		};
		port@2 {
			port_id = <3>;
			phy_address = <2>;
		};
		port@3 {
			port_id = <4>;
			phy_address = <3>;
		};
		port@4 {
			port_id = <5>;
			phy_address = <4>;
		};
	};
};

&edma {
	status = "okay";
};

&dp1 {
	status = "okay";
	phy-handle = <&qca8075_0>;
	label = "lan1";
};

&dp2 {
	status = "okay";
	phy-handle = <&qca8075_1>;
	label = "lan2";
};

&dp3 {
	status = "okay";
	phy-handle = <&qca8075_2>;
	label = "lan3";
};

&dp4 {
	status = "okay";
	phy-handle = <&qca8075_3>;
	label = "lan4";
};

&dp5 {
	status = "okay";
	phy-handle = <&qca8075_4>;
	label = "wan";
};

&ssphy_0 {
	status = "okay";
};

&qusb_phy_0 {
	status = "okay";
};

&usb_0 {
	status = "okay";
};

&pcie_qmp0 {
	status = "okay";
};

&pcie0 {
	status = "okay";

	perst-gpio = <&tlmm 61 GPIO_ACTIVE_LOW>;

	bridge@0,0 {
		reg = <0x00000000 0 0 0 0>;
		#address-cells = <3>;
		#size-cells = <2>;
		ranges;

		wifi2: wifi@1,0 {
			status = "okay";

			compatible = "qcom,ath10k";
			reg = <0x00010000 0 0 0 0>;

			qcom,ath10k-calibration-variant = "Linksys-MX5300";
		};
	};
};

&wifi {
	status = "okay";

	qcom,ath11k-calibration-variant = "Linksys-MX5300";
};

Some additional info:

All fw_printenv:
FwSize=0x9600000
altKernAddr=0xa680000
auto_recovery=yes
baudrate=115200
boot_part=1
boot_part_ready=3
bootargs=console=ttyMSM0,115200n8
bootcmd=aq_load_fw && if test $auto_recovery = no; then bootipq; elif test $boot_part = 1; then run bootpart1; else run bootpart2; fi
bootdelay=2
bootpart1=setenv bootargs $partbootargs1 && nand read $loadaddr $priKernAddr $kernsize && bootm $loadaddr
bootpart2=setenv bootargs $partbootargs2 && nand read $loadaddr $altKernAddr $kernsize && bootm $loadaddr
dumpipq_data=0
eth1addr=*:*:*:*:*:*
eth2addr=*:*:*:*:*:*
eth3addr=*:*:*:*:*:*
eth4addr=*:*:*:*:*:*
eth5addr=*:*:*:*:*:*
ethact=eth0
ethaddr=*:*:*:*:*:*
fdt_high=0x4A400000
fdtcontroladdr=4a97b130
firmwareName=bronx.img
flash_alt_image=tftpboot $loadaddr $firmwareName && nand erase $altKernAddr $FwSize && nand write $loadaddr $altKernAddr $filesize
flash_both_images=run flash_pri_image && nand erase $altKernAddr $FwSize && nand write $loadaddr $altKernAddr $filesize
flash_pri_image=tftpboot $loadaddr $firmwareName && nand erase $priKernAddr $FwSize && nand write $loadaddr $priKernAddr $filesize
flash_type=2
ipaddr=192.168.1.1
kernsize=0x600000
loadaddr=0x44000000
machid=8010008
mtdids=nand0=nand0
netmask=255.255.255.0
partbootargs1=console=ttyMSM0,115200n8 ubi.mtd=rootfs root=ubi0:ubifs rootfstype=ubifs rootwait swiotlb=1
partbootargs2=console=ttyMSM0,115200n8 ubi.mtd=alt_rootfs root=ubi0:ubifs rootfstype=ubifs rootwait swiotlb=1
priKernAddr=0x1080000
sdk_ver=es2
serverip=192.168.1.254
soc_version_major=2
soc_version_minor=0
stderr=serial@78B3000
stdin=serial@78B3000
stdout=serial@78B3000
wan_phy=1G
-----Boot Data-----
cat /proc/cmdline: console=ttyMSM0,115200n8 ubi.mtd=rootfs root=ubi0:ubifs rootfstype=ubifs rootwait swiotlb=1 clk_ignore_unused
cat /proc/mtd: dev:    size   erasesize  name
mtd0: 00100000 00020000 "0:SBL1"
mtd1: 00100000 00020000 "0:MIBIB"
mtd2: 00080000 00020000 "0:BOOTCONFIG"
mtd3: 00080000 00020000 "0:BOOTCONFIG1"
mtd4: 00300000 00020000 "0:QSEE"
mtd5: 00300000 00020000 "0:QSEE_1"
mtd6: 00080000 00020000 "0:DEVCFG"
mtd7: 00080000 00020000 "0:DEVCFG_1"
mtd8: 00080000 00020000 "0:APDP"
mtd9: 00080000 00020000 "0:APDP_1"
mtd10: 00080000 00020000 "0:RPM"
mtd11: 00080000 00020000 "0:RPM_1"
mtd12: 00080000 00020000 "0:CDT"
mtd13: 00080000 00020000 "0:CDT_1"
mtd14: 00080000 00020000 "0:APPSBLENV"
mtd15: 00100000 00020000 "0:APPSBL"
mtd16: 00100000 00020000 "0:APPSBL_1"
mtd17: 00080000 00020000 "0:ART"
mtd18: 00040000 00020000 "u_env"
mtd19: 00020000 00020000 "s_env"
mtd20: 00020000 00020000 "devinfo"
mtd21: 09600000 00020000 "kernel"
mtd22: 09000000 00020000 "rootfs"
mtd23: 09600000 00020000 "alt_kernel"
mtd24: 09000000 00020000 "alt_rootfs"
mtd25: 00200000 00020000 "sysdiag"
mtd26: 00080000 00020000 "0:ETHPHYFW"
mtd27: 0b800000 00020000 "syscfg"
mtd28: 00900000 00020000 "0:WIFIFW"
mounted filesystems:

ubi0:ubifs on / type ubifs (ro,relatime)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
mdev on /dev type tmpfs (rw,relatime,size=100k)
none on /tmp type tmpfs (rw,relatime,size=102400k)
none on /dev/pts type devpts (rw,relatime,mode=600)
ubi1_0 on /tmp/var/config type ubifs (rw,sync,relatime)

Unable to boot after write to nand:

Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.3.1-00147
S - IMAGE_VARIANT_STRING=HAACANAZA
S - OEM_IMAGE_VERSION_STRING=CRM
S - Boot Config, 0x000002e5
B -       201 - PBL, Start
B -      2736 - bootable_media_detect_entry, Start
B -      3444 - bootable_media_detect_success, Start
B -      3449 - elf_loader_entry, Start
B -      6118 - auth_hash_seg_entry, Start
B -      6361 - auth_hash_seg_exit, Start
B -     68606 - elf_segs_hash_verify_entry, Start
B -    131302 - PBL, End
B -    214476 - SBL1, Start
B -    292617 - GCC [RstStat:0x10, RstDbg:0x600000] WDog Stat : 0x4
B -    302346 - pm_device_init, Start
B -    482571 - PM_SET_VAL:Skip
D -    178211 - pm_device_init, Delta
B -    484858 - pm_driver_init, Start
D -      5368 - pm_driver_init, Delta
B -    491294 - clock_init, Start
D -      2104 - clock_init, Delta
B -    495350 - boot_flash_init, Start
D -     12688 - boot_flash_init, Delta
B -    511790 - boot_config_data_table_init, Start
D -      3141 - boot_config_data_table_init, Delta - (575 Bytes)
B -    519262 - Boot Setting :  0x00000618
B -    523258 - CDT version:2,Platform ID:8,Major ID:1,Minor ID:0,Subtype:8
B -    530090 - sbl1_ddr_set_params, Start
B -    533902 - CPR configuration: 0x30c
B -    537349 - cpr_init, Start
B -    540124 - Rail:0 Mode: 5 Voltage: 832000
B -    545340 - CL CPR settled at 784000mV
B -    548176 - Rail:1 Mode: 5 Voltage: 904000
B -    552355 - Rail:1 Mode: 7 Voltage: 944000
D -     16531 - cpr_init, Delta
B -    559217 - Pre_DDR_clock_init, Start
B -    563243 - Pre_DDR_clock_init, End
B -    566629 - DDR Type : PCDDR3
B -    572363 - do ddr sanity test, Start
D -      1067 - do ddr sanity test, Delta
B -    577121 - DDR: Start of HAL DDR Boot Training
B -    581787 - DDR: End of HAL DDR Boot Training
B -    587552 - DDR: Checksum to be stored on flash is 96661726
B -    597678 - Image Load, Start
D -    225883 - QSEE Image Loaded, Delta - (1373936 Bytes)
B -    823652 - Image Load, Start
D -        61 - SEC Image Loaded, Delta - (0 Bytes)
B -    831308 - Image Load, Start
D -     10766 - DEVCFG Image Loaded, Delta - (26004 Bytes)
B -    842135 - Image Load, Start
D -     25437 - RPM Image Loaded, Delta - (105964 Bytes)
B -    867664 - Image Load, Start
D -    102785 - APPSBL Image Loaded, Delta - (627152 Bytes)
B -    970540 - QSEE Execution, Start
D -        61 - QSEE Execution, Delta
B -    976366 - USB D+ check, Start
D -         0 - USB D+ check, Delta
B -    982740 - SBL1, End
D -    770582 - SBL1, Delta
S - Flash Throughput, 6679 KB/s  (2134303 Bytes,  319538 us)
S - DDR Frequency, 466 MHz
S - Core 0 Frequency, 1651 MHz


U-Boot 2016.01 (Mar 13 2020 - 17:34:10 +0800)

version: 0.3.14
DRAM:  smem ram ptable found: ver: 1 len: 4
1 GiB
board_devinfo_offset=1060000, board_devinfo_size=20000
board_senv_offset=1040000, board_senv_size=20000
board_kernel_offset=0x1080000, board_fw_size=0x9600000, board_altkernel_offset=0xa680000\nNAND:  ONFI device found
ID = 1590acad
Vendor = ad
Device = ac
qpic_nand: changing oobsize to 64 from 128 bytes
SF: Unsupported flash IDs: manuf ff, jedec ffff, ext_jedec ffff
ipq_spi: SPI Flash not found (bus/cs/speed/mode) = (0/0/48000000/0)
512 MiB
MMC:   <NULL>: 0
devinfo_import--devinfo_mem_pool.crc=b107910
fun=cmd_init  DEVINFO_ITEMS=511
devinfo: data is valid!
read senv success
#### auto_recovery enabled:1, boot_part:2, boot_part_ready:3,  boot_count=0

####[boot_count_write] erase:0, auto_recovery->block_offset:0x1040000 offset=0x1046000

Updating boot_count ... 
####[boot_count_write] offset:0x1046000 , length:2048
done

PCI Link Intialized
In:    serial@78B3000
Out:   serial@78B3000
Err:   serial@78B3000
machid: 8010008
Card did not respond to voltage select!
eth0 MAC Address from ART is not valid
eth1 MAC Address from ART is not valid
eth2 MAC Address from ART is not valid
eth3 MAC Address from ART is not valid
eth4 MAC Address from ART is not valid
eth5 MAC Address from ART is not valid
auto_recovery_check changes bootcmd: boot from partition 2
 
Bus 0:	i2c@78b6000
Setting bus to 0
Valid chip addresses: 62 68
Hit 'Space' or 'Enter' key to stop autoboot:  0 
Normal boot

NAND read: device 0 offset 0x13e80000, size 0x80000
 524288 bytes read: OK
Erasing NAND...
Erasing at 0x1020000 -- 100% complete.
Writing to NAND... OK
PHY::Scratchpad Read/Write test fail
Disable 50MHz clock...
Erasing NAND...
Erasing at 0x1020000 -- 100% complete.
Writing to NAND... OK

NAND read: device 0 offset 0xa680000, size 0x600000
 6291456 bytes read: OK
## Loading kernel from FIT Image at 44000000 ...
   Using 'config@1' configuration
   Trying 'kernel-1' kernel subimage
     Description:  ARM64 OpenWrt Linux-6.1.61
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x440000e8
     Data Size:    4876489 Bytes = 4.7 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x41000000
     Entry Point:  0x41000000
     Hash algo:    crc32
     Hash value:   0b9f80d7
     Hash algo:    sha1
     Hash value:   ce6a31dc04837ba85fb5b05e68f570cc95e5c5ef
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 44000000 ...
   Using 'config@1' configuration
   Trying 'fdt-1' fdt subimage
     Description:  ARM64 OpenWrt linksys_mx5300 device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x444a6af4
     Data Size:    45611 Bytes = 44.5 KiB
     Architecture: AArch64
     Hash algo:    crc32
     Hash value:   1fcbbb6a
     Hash algo:    sha1
     Hash value:   5126ada41e23da35b619cba276deb9329a7cdfd1
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x444a6af4
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 4a3f1000, end 4a3ff22a ... OK
Using machid 0x8010008 from environment

Starting kernel ...

Jumping to AARCH64 kernel via monitor
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 6.1.61 (a@a) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r24307-bc335f2967) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 SMP Fri Nov  3 21:16:29 2023
[    0.000000] Machine model: Linksys MX5300
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000040ffffff]
[    0.000000]   node   0: [mem 0x0000000041000000-0x000000004a3fffff]
[    0.000000]   node   0: [mem 0x000000004a400000-0x00000000510fffff]
[    0.000000]   node   0: [mem 0x0000000051100000-0x000000007fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.0 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.0
[    0.000000] psci: OSI mode supported.
[    0.000000] psci: failed to set PC mode: -1
[    0.000000] percpu: Embedded 17 pages/cpu s31080 r8192 d30360 u69632
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] alternatives: applying boot alternatives
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 258048
[    0.000000] Kernel command line: console=ttyMSM0,115200n8 ubi.mtd=alt_rootfs root=ubi0:ubifs rootfstype=ubifs rootwait swiotlb=1 root=/dev/ubiblock0_1
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 887716K/1048576K available (7744K kernel code, 854K rwdata, 2268K rodata, 1280K init, 273K bss, 160860K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] Root IRQ handler: gic_handle_irq
[    0.000000] GICv2m: range[mem 0x0b00a000-0x0b00affc], SPI[448:479]
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] arch_timer: cp15 and mmio timer(s) running at 19.20MHz (virt/virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000001] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000106] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.000120] pid_max: default: 32768 minimum: 301
[    0.000597] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.000611] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.002440] cblist_init_generic: Setting adjustable number of callback queues.
[    0.002449] cblist_init_generic: Setting shift to 2 and lim to 1.
[    0.002643] rcu: Hierarchical SRCU implementation.
[    0.002646] rcu: 	Max phase no-delay instances is 1000.
[    0.003456] smp: Bringing up secondary CPUs ...
[    0.004094] Detected VIPT I-cache on CPU1
[    0.004237] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.004905] Detected VIPT I-cache on CPU2
[    0.005012] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.005628] Detected VIPT I-cache on CPU3
[    0.005727] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.005794] smp: Brought up 1 node, 4 CPUs
[    0.005803] SMP: Total of 4 processors activated.
[    0.005808] CPU features: detected: 32-bit EL0 Support
[    0.005812] CPU features: detected: CRC32 instructions
[    0.005874] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.005880] CPU: All CPU(s) started at EL1
[    0.005883] alternatives: applying system-wide alternatives
[    0.016775] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.016802] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.017021] pinctrl core: initialized pinctrl subsystem
[    0.018193] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.018749] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.018794] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.018841] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.019232] thermal_sys: Registered thermal governor 'step_wise'
[    0.019426] cpuidle: using governor menu
[    0.019727] ASID allocator initialised with 65536 entries
[    0.073382] qcom,cpr4-apss-regulator b018000.cpr4-ctrl: CPR valid fuse count: 4
[    0.081889] SCSI subsystem initialized
[    0.082078] usbcore: registered new interface driver usbfs
[    0.082118] usbcore: registered new interface driver hub
[    0.082165] usbcore: registered new device driver usb
[    0.082592] qcom_scm: convention: smc arm 64
[    0.083921] clocksource: Switched to clocksource arch_sys_counter
[    0.085136] NET: Registered PF_INET protocol family
[    0.085287] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.086638] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    0.086664] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.086679] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.086765] TCP bind hash table entries: 8192 (order: 6, 262144 bytes, linear)
[    0.087038] TCP: Hash tables configured (established 8192 bind 8192)
[    0.087139] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.087177] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.087399] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.087436] PCI: CLS 0 bytes, default 64
[    0.088804] workingset: timestamp_bits=46 max_order=18 bucket_order=0
[    0.093897] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.093927] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.098293] qcom-qmp-usb-phy 78000.phy: supply vdda-phy not found, using dummy regulator
[    0.098430] qcom-qmp-usb-phy 78000.phy: supply vdda-pll not found, using dummy regulator
[    0.100181] qcom-qusb2-phy 79000.phy: supply vdd not found, using dummy regulator
[    0.100333] qcom-qusb2-phy 79000.phy: supply vdda-pll not found, using dummy regulator
[    0.100400] qcom-qusb2-phy 79000.phy: supply vdda-phy-dpdm not found, using dummy regulator
[    0.100559] qcom-qusb2-phy 79000.phy: Registered Qcom-QUSB2 phy
[    0.102815] qcom-pcie 20000000.pci: host bridge /soc/pci@20000000 ranges:
[    0.102868] qcom-pcie 20000000.pci:       IO 0x0020200000..0x002020ffff -> 0x0000000000
[    0.102893] qcom-pcie 20000000.pci:      MEM 0x0020220000..0x002fffffff -> 0x0020220000
[    0.215484] qcom-pcie 20000000.pci: iATU unroll: enabled
[    0.215496] qcom-pcie 20000000.pci: iATU regions: 8 ob, 8 ib, align 4K, limit 1024G
[    1.215695] qcom-pcie 20000000.pci: Phy link never came up
[    1.215864] qcom-pcie 20000000.pci: PCI host bridge to bus 0000:00
[    1.215875] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.215887] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    1.215895] pci_bus 0000:00: root bus resource [mem 0x20220000-0x2fffffff]
[    1.215934] pci 0000:00:00.0: [17cb:1002] type 01 class 0x060400
[    1.215956] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x00000fff]
[    1.216038] pci 0000:00:00.0: PME# supported from D0 D3hot D3cold
[    1.219616] pci 0000:00:00.0: BAR 8: assigned [mem 0x20300000-0x204fffff]
[    1.219635] pci 0000:00:00.0: BAR 9: assigned [mem 0x20500000-0x206fffff 64bit pref]
[    1.219647] pci 0000:00:00.0: BAR 0: assigned [mem 0x20220000-0x20220fff]
[    1.219660] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
[    1.219672] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
[    1.219681] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
[    1.219692] pci 0000:00:00.0:   bridge window [mem 0x20300000-0x204fffff]
[    1.219702] pci 0000:00:00.0:   bridge window [mem 0x20500000-0x206fffff 64bit pref]
[    1.221967] pcieport 0000:00:00.0: PME: Signaling with IRQ 16
[    1.222269] pcieport 0000:00:00.0: AER: enabled with IRQ 16
[    1.225739] bam-dma-engine 704000.dma-controller: num-channels unspecified in dt
[    1.225755] bam-dma-engine 704000.dma-controller: num-ees unspecified in dt
[    1.230220] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    1.230905] msm_serial 78b3000.serial: msm_serial: detected port #0
[    1.230958] msm_serial 78b3000.serial: uartclk = 3686400
[    1.231052] 78b3000.serial: ttyMSM0 at MMIO 0x78b3000 (irq = 21, base_baud = 230400) is a MSM
[    1.231082] msm_serial: console setup on port #0
[    2.046180] printk: console [ttyMSM0] enabled
[    2.051328] msm_serial: driver initialized
[    2.060241] loop: module loaded
[    2.061658] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xac
[    2.062197] nand: Hynix H27S4G8F2EDA-BC
[    2.068807] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
[    2.072724] 29 fixed-partitions partitions found on MTD device qcom_nand.0
[    2.080024] Creating 29 MTD partitions on "qcom_nand.0":
[    2.087009] 0x000000000000-0x000000100000 : "0:sbl1"
[    2.093962] 0x000000100000-0x000000200000 : "0:mibib"
[    2.098780] 0x000000200000-0x000000280000 : "0:bootconfig"
[    2.103241] 0x000000280000-0x000000300000 : "0:bootconfig1"
[    2.108781] 0x000000300000-0x000000600000 : "0:qsee"
[    2.116465] 0x000000600000-0x000000900000 : "0:qsee_1"
[    2.121661] 0x000000900000-0x000000980000 : "0:devcfg"
[    2.124331] 0x000000980000-0x000000a00000 : "0:devcfg_1"
[    2.129362] 0x000000a00000-0x000000a80000 : "0:apdp"
[    2.134904] 0x000000a80000-0x000000b00000 : "0:apdp_1"
[    2.139780] 0x000000b00000-0x000000b80000 : "0:rpm"
[    2.144797] 0x000000b80000-0x000000c00000 : "0:rpm_1"
[    2.149580] 0x000000c00000-0x000000c80000 : "0:cdt"
[    2.154774] 0x000000c80000-0x000000d00000 : "0:cdt_1"
[    2.159437] 0x000000d00000-0x000000d80000 : "0:appsblenv"
[    2.164655] 0x000000d80000-0x000000e80000 : "0:appsbl"
[    2.170530] 0x000000e80000-0x000000f80000 : "0:appsbl_1"
[    2.175609] 0x000000f80000-0x000001000000 : "0:art"
[    2.180552] 0x000001000000-0x000001040000 : "u_env"
[    2.184953] 0x000001040000-0x000001060000 : "s_env"
[    2.189622] 0x000001060000-0x000001080000 : "devinfo"
[    2.194547] 0x000001080000-0x00000a680000 : "kernel"
[    2.342471] 0x000001680000-0x00000a680000 : "rootfs"
[    2.480062] mtd: setting mtd22 (rootfs) as root device
[    2.480416] mtdsplit: no squashfs found in "rootfs"
[    2.484122] 0x00000a680000-0x000013c80000 : "alt_kernel"
[    2.632164] 0x00000ac80000-0x000013c80000 : "alt_rootfs"
[    2.771441] 0x000013c80000-0x000013e80000 : "sysdiag"
[    2.773843] 0x000013e80000-0x000013f00000 : "0:ethphyfw"
[    2.776398] 0x000013f00000-0x00001f700000 : "syscfg"
[    2.956533] 0x00001f700000-0x000020000000 : "0:wififw"
[    2.975203] spmi spmi-0: PMIC arbiter version v2 (0x20010000)
[    2.995293] i2c_dev: i2c /dev entries driver
[    3.002272] sdhci: Secure Digital Host Controller Interface driver
[    3.002315] sdhci: Copyright(c) Pierre Ossman
[    3.007379] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.013463] remoteproc remoteproc0: releasing cd00000.q6v5_wcss
[    3.020226] NET: Registered PF_INET6 protocol family
[    3.024122] Segment Routing with IPv6
[    3.028378] In-situ OAM (IOAM) with IPv6
[    3.031976] NET: Registered PF_PACKET protocol family
[    3.036011] 8021q: 802.1Q VLAN Support v1.8
[    3.059908] qcom,cpr4-apss-regulator b018000.cpr4-ctrl: CPR valid fuse count: 4
[    3.060212] cpr4_ipq807x_apss_read_fuse_data: apc_corner: speed bin = 0
[    3.066065] cpr4_ipq807x_apss_read_fuse_data: apc_corner: CPR fusing revision = 1
[    3.072634] cpr4_ipq807x_apss_read_fuse_data: apc_corner: CPR misc fuse value = 0
[    3.080307] cpr4_ipq807x_apss_read_fuse_data: apc_corner: Voltage boost fuse config = 0 boost = disable
[    3.087816] cpr3_mem_acc_init: apc: not using memory accelerator regulator
[    3.096947] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused      SVS: open-loop= 704000 uV
[    3.103887] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused      NOM: open-loop= 832000 uV
[    3.113878] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused    TURBO: open-loop= 896000 uV
[    3.123692] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused   STURBO: open-loop=1000000 uV
[    3.133547] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused      SVS: quot[ 7]= 679, quot_offset[ 7]=   0
[    3.143307] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused      NOM: quot[ 7]= 906, quot_offset[ 7]= 225
[    3.154157] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused    TURBO: quot[ 7]=1006, quot_offset[ 7]= 100
[    3.165095] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused   STURBO: quot[ 7]=1175, quot_offset[ 7]= 165
[    3.176260] cpr3_regulator_init_ctrl: apc: Default CPR mode = closed-loop
[    3.179197] cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 800000 KHz, changing to: 1017600 KHz
[    3.195411] remoteproc remoteproc0: cd00000.q6v5_wcss is available
[    3.204837] ubi0: attaching mtd24
[    3.277631] UBI: EOF marker found, PEBs from 101 will be erased
[    3.395769] ubi0: scanning is finished
[    3.420398] ubi0: volume 2 ("rootfs_data") re-sized from 9 to 969 LEBs
[    3.420952] ubi0: attached mtd24 (name "alt_rootfs", size 144 MiB)
[    3.425831] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    3.431984] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    3.438859] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    3.445704] ubi0: good PEBs: 1152, bad PEBs: 0, corrupted PEBs: 0
[    3.452469] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
[    3.458728] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1699046189
[    3.465848] ubi0: available PEBs: 0, total reserved PEBs: 1152, PEBs reserved for bad PEB handling: 80
[    3.475142] ubi0: background thread "ubi_bgt0d" started, PID 547[    3.493056] List of all partitions:
[    3.493091] 1f00            1024 mtdblock0 
[    3.493096]  (driver?)
[    3.499509] 1f01            1024 mtdblock1 
[    3.499512]  (driver?)
[    3.506024] 1f02             512 mtdblock2 
[    3.506027]  (driver?)
[    3.512528] 1f03             512 mtdblock3 
[    3.512531]  (driver?)
[    3.519039] 1f04            3072 mtdblock4 
[    3.519042]  (driver?)
[    3.525554] 1f05            3072 mtdblock5 
[    3.525556]  (driver?)
[    3.532059] 1f06             512 mtdblock6 
[    3.532061]  (driver?)
[    3.538570] 1f07             512 mtdblock7 
[    3.538573]  (driver?)
[    3.545086] 1f08             512 mtdblock8 
[    3.545089]  (driver?)
[    3.551591] 1f09             512 mtdblock9 
[    3.551593]  (driver?)
[    3.558102] 1f0a             512 mtdblock10 
[    3.558105]  (driver?)
[    3.564964] 1f0b             512 mtdblock11 
[    3.564967]  (driver?)
[    3.571556] 1f0c             512 mtdblock12 
[    3.571559]  (driver?)
[    3.578157] 1f0d             512 mtdblock13 
[    3.578160]  (driver?)
[    3.584757] 1f0e             512 mtdblock14 
[    3.584760]  (driver?)
[    3.591348] 1f0f            1024 mtdblock15 
[    3.591351]  (driver?)
[    3.597953] 1f10            1024 mtdblock16 
[    3.597956]  (driver?)
[    3.604547] 1f11             512 mtdblock17 
[    3.604550]  (driver?)
[    3.611140] 1f12             256 mtdblock18 
[    3.611143]  (driver?)
[    3.617741] 1f13             128 mtdblock19 
[    3.617744]  (driver?)
[    3.624339] 1f14             128 mtdblock20 
[    3.624342]  (driver?)
[    3.630930] 1f15          153600 mtdblock21 
[    3.630933]  (driver?)
[    3.637533] 1f16          147456 mtdblock22 
[    3.637536]  (driver?)
[    3.644137] 1f17          153600 mtdblock23 
[    3.644140]  (driver?)
[    3.650722] 1f18          147456 mtdblock24 
[    3.650724]  (driver?)
[    3.657325] 1f19            2048 mtdblock25 
[    3.657328]  (driver?)
[    3.663923] 1f1a             512 mtdblock26 
[    3.663925]  (driver?)
[    3.670514] 1f1b          188416 mtdblock27 
[    3.670517]  (driver?)
[    3.677117] 1f1c            9216 mtdblock28 
[    3.677120]  (driver?)
[    3.683708] fe00            7440 ubiblock0_1 
[    3.683711]  (driver?)
[    3.683915] random: crng init done
[    3.685886] No filesystem could mount root, tried: 
[    3.692562]  ubifs
[    3.695956] 
[    3.702803] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(254,0)
[    3.704466] SMP: stopping secondary CPUs
[    3.712882] Kernel Offset: disabled
[    3.716782] CPU features: 0x00000,00000000,0000400b
[    3.719997] Memory Limit: none
[    3.724856] Rebooting in 1 seconds..

Currently, OpenWrt boots from flash memory. The default rootfstype is ubifs, so we need to add rootfstype=squashfs ro to bootargs.

I used BDF files from the FCC directory. Many 5GHz radio frequencies are disabled.
Is there any way to enable disabled frequencies?

Wiphy phy0
		Frequencies:
			* 5180 MHz [36] (disabled)
			* 5200 MHz [40] (disabled)
			* 5220 MHz [44] (disabled)
			* 5240 MHz [48] (disabled)
			* 5260 MHz [52] (disabled)
			* 5280 MHz [56] (disabled)
			* 5300 MHz [60] (disabled)
			* 5320 MHz [64] (disabled)
			* 5500 MHz [100] (24.0 dBm) (radar detection)
			* 5520 MHz [104] (24.0 dBm) (radar detection)
			* 5540 MHz [108] (24.0 dBm) (radar detection)
			* 5560 MHz [112] (24.0 dBm) (radar detection)
			* 5580 MHz [116] (24.0 dBm) (radar detection)
			* 5600 MHz [120] (24.0 dBm) (radar detection)
			* 5620 MHz [124] (24.0 dBm) (radar detection)
			* 5640 MHz [128] (24.0 dBm) (radar detection)
			* 5660 MHz [132] (24.0 dBm) (radar detection)
			* 5680 MHz [136] (24.0 dBm) (radar detection)
			* 5700 MHz [140] (24.0 dBm) (radar detection)
			* 5720 MHz [144] (24.0 dBm) (radar detection)
			* 5745 MHz [149] (30.0 dBm)
			* 5765 MHz [153] (30.0 dBm)
			* 5785 MHz [157] (30.0 dBm)
			* 5805 MHz [161] (30.0 dBm)
			* 5825 MHz [165] (30.0 dBm)
			* 5845 MHz [169] (27.0 dBm) (no IR)
			* 5865 MHz [173] (disabled)
Wiphy phy1
		Frequencies:
			* 5180 MHz [36] (24.0 dBm)
			* 5200 MHz [40] (24.0 dBm)
			* 5220 MHz [44] (24.0 dBm)
			* 5240 MHz [48] (24.0 dBm)
			* 5260 MHz [52] (24.0 dBm) (radar detection)
			* 5280 MHz [56] (24.0 dBm) (radar detection)
			* 5300 MHz [60] (24.0 dBm) (radar detection)
			* 5320 MHz [64] (24.0 dBm) (radar detection)
			* 5500 MHz [100] (disabled)
			* 5520 MHz [104] (disabled)
			* 5540 MHz [108] (disabled)
			* 5560 MHz [112] (disabled)
			* 5580 MHz [116] (disabled)
			* 5600 MHz [120] (disabled)
			* 5620 MHz [124] (disabled)
			* 5640 MHz [128] (disabled)
			* 5660 MHz [132] (disabled)
			* 5680 MHz [136] (disabled)
			* 5700 MHz [140] (disabled)
			* 5720 MHz [144] (disabled)
			* 5745 MHz [149] (disabled)
			* 5765 MHz [153] (disabled)
			* 5785 MHz [157] (disabled)
			* 5805 MHz [161] (disabled)
			* 5825 MHz [165] (disabled)
			* 5845 MHz [169] (disabled)
			* 5865 MHz [173] (disabled)
			* 5885 MHz [177] (disabled)

And I keep getting this error:
[ 1028.315295] hsl_phy_phydev_get[805]:ERROR:phy_addr 5 phydev is NULL

On MX5300, if we write something to mtd21/mtd23, the data will also be changed in mtd22/mtd24.

Firmware installation from initramfs (mtd23 is alt_kernel and mtd24 is alt_rootfs):

root@OpenWrt:~# sha256sum /dev/mtd23
f762f6339eee018d11229590bd5f35019dfdb5f4b657fae3c32d3499a7cfa677  /dev/mtd23

root@OpenWrt:~# sha256sum /dev/mtd24
04613e3b1b32b7550cda0070e79a6fcebec0953a2cf1c0c533b7bd5845ede46b  /dev/mtd24

root@OpenWrt:~# mtd erase alt_kernel
Unlocking alt_kernel ...
Erasing alt_kernel ...

root@OpenWrt:~# sha256sum /dev/mtd23
b4954ebebc338b6a8747745514c3f37d9d32e3d3359111078a7b40d85a815ae4  /dev/mtd23

root@OpenWrt:~# sha256sum /dev/mtd24
6ea07c08ce177b4963a77d768d29c2e166e5de27c9715ca8ad9dfb85761d844f  /dev/mtd24

root@OpenWrt:~# mtd -l 64 dump alt_kernel | hexdump 
Dumping alt_kernel ...
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0000040

root@OpenWrt:~# mtd -l 64 dump alt_rootfs | hexdump 
Dumping alt_rootfs ...
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0000040

root@OpenWrt:~# mtd -n write /tmp/openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin alt_kernel
Unlocking alt_kernel ...

Writing from /tmp/openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin to alt_kernel ...     

root@OpenWrt:~# mtd -l 64 dump alt_kernel | hexdump 
Dumping alt_kernel ...
0000000 0dd0 edfe 4b00 2c22 0000 3800 4b00 401e
0000010 0000 2800 0000 1100 0000 1000 0000 0000
0000020 0000 6c00 4b00 081e 0000 0000 0000 0000
0000030 0000 0000 0000 0000 0000 0100 0000 0000
0000040

root@OpenWrt:~# mtd -l 64 dump alt_rootfs | hexdump 
Dumping alt_rootfs ...
0000000 4255 2349 0001 0000 0000 0000 0000 0000
0000010 0000 0008 0000 0010 5565 2aff 0000 0000
0000020 0000 0000 0000 0000 0000 0000 0000 0000
0000030 0000 0000 0000 0000 0000 0000 54d0 49b9
0000040

Does your sysupgrade work for you?

Yeah I'm confused by this, no clue on what Linksys did

remove this and see if it boots on nand for you

Sysupgrade works correctly on a partition where OpenWrt was previously installed.

Maybe it's enough to install OpenWrt on the both partitions first in case of first installation from initramfs:

mtd write openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin alt_kernel
mtd write openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin kernel

and only on the second partition in case of first installation from OEM software.

I think it would be useful to have an additional option (env) for sysupgrade to update the currently running partition.
If you update OpenWrt with keep the configuration to the second partition, should rootfs_data be synchronized between partitions?

1 Like

It's working now: Adding OpenWrt support for Linksys MX5300 - #14 by lytr

Nice findings

I'm not too sure on the answer to your question, maybe @robimarko any knowledge on this?

yeah this didnt work for me got cant get kernel image

Sadly, I have no information about the Linksys dual FW logic

This is what the partition layout looks like in OEM firmware:
linksys
and after install OpenWrt:
openwrt

s_env partition is used for saving information about boot count. After 3 unsuccessful boots partitions are switched.

In the OEM firmware we have only one partition (syscfg) where changes are saved.
After installing OpenWrt on both partitions we have two separate rootfs_data volumes.