Skip to content

Commit

Permalink
mediatek: filogic: add H3C Magic NX30 Pro (NMBM-Enabled layout)
Browse files Browse the repository at this point in the history
Because this device enable NMBM by default, most users use custom
U-Boot with NMBM-Enabled in Chinese forums.

This layout is the same as the ubootmod layout but enabling NMBM.
  • Loading branch information
ptpt52 committed Oct 12, 2023
1 parent 9898e51 commit 618fe4c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
15 changes: 15 additions & 0 deletions target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro-nmbm.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

/dts-v1/;
#include "mt7981b-h3c-magic-nx30-pro.dts"

/ {
model = "H3C Magic NX30 Pro (NMBM-Enabled layout)";
compatible = "h3c,magic-nx30-pro-nmbm", "mediatek,mt7981";
};

&spi_nand {
mediatek,nmbm;
mediatek,bmt-max-ratio = <1>;
mediatek,bmt-max-reserved-blocks = <64>;
};
2 changes: 1 addition & 1 deletion target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
pinctrl-0 = <&spi0_flash_pins>;
status = "okay";

spi_nand@0 {
spi_nand: spi_nand@0 {
compatible = "spi-nand";
#address-cells = <1>;
#size-cells = <1>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mediatek_setup_interfaces()
glinet,gl-mt3000)
ucidef_set_interfaces_lan_wan eth1 eth0
;;
h3c,magic-nx30-pro-nmbm|\
h3c,magic-nx30-pro)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ case "$board" in
[ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
;;
h3c,magic-nx30-pro-nmbm|\
h3c,magic-nx30-pro)
addr=$(mtd_get_mac_ascii pdt_data_1 ethaddr)
[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
Expand Down
21 changes: 21 additions & 0 deletions target/linux/mediatek/image/filogic.mk
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,27 @@ define Device/h3c_magic-nx30-pro
endef
TARGET_DEVICES += h3c_magic-nx30-pro

define Device/h3c_magic-nx30-pro-nmbm
DEVICE_VENDOR := H3C
DEVICE_MODEL := Magic NX30 Pro (NMBM-Enabled layout)
DEVICE_DTS := mt7981b-h3c-magic-nx30-pro-nmbm
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 65536k
KERNEL_IN_UBI := 1
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
ARTIFACTS := initramfs-factory.ubi
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel
endif
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += h3c_magic-nx30-pro-nmbm

define Device/netgear_wax220
DEVICE_VENDOR := NETGEAR
DEVICE_MODEL := WAX220
Expand Down

0 comments on commit 618fe4c

Please sign in to comment.