[OpenWrt-Devel] [PATCH] ramips: add support for JCG JHR-AC876M

Adrian Schmutzler mail at adrianschmutzler.de
Thu Dec 12 08:01:12 EST 2019


Hi,

> +	aliases {
> +		led-boot = &led_wps;
> +		led-failsafe = &led_wps;
> +		led-running = &led_wps;
> +		led-upgrade = &led_wps;
> +		label-mac-device = &wifi2g;

This won't work (address not set explicitly in DTS). You will need to provide the address in 02_network (see below).

> diff --git a/target/linux/ramips/image/mt7621.mk
> b/target/linux/ramips/image/mt7621.mk
> index d663aa29da..cbbda06822 100644
> --- a/target/linux/ramips/image/mt7621.mk
> +++ b/target/linux/ramips/image/mt7621.mk
> @@ -361,6 +361,19 @@ define Device/iodata_wnpr2600g
>  endef
>  TARGET_DEVICES += iodata_wnpr2600g
> 
> +define Device/jcg_jhr-ac876m
> +  MTK_SOC := mt7621
> +  IMAGE_SIZE := 16064k
> +  IMAGES += factory.bin
> +  IMAGE/factory.bin := \
> +        $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 89.1

Won't $$(sysupgrade_bin) include the metadata not needed for the factory image?

> +  JCG_MAXSIZE := 16449536

I'd prefer to have a substitution included in jcg-header, so we can use 16064k here, too.

> +  DEVICE_VENDOR := JCG
> +  DEVICE_MODEL := JHR-AC876M
> +  DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 kmod-usb-ledtrig-usbport
> wpad-basic
> +endef
> +TARGET_DEVICES += jcg_jhr-ac876m
> +
>  define Device/lenovo_newifi-d1
>    MTK_SOC := mt7621
>    IMAGE_SIZE := 32448k
> diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> index bb6e41e06f..904e82e09a 100755
> --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> @@ -14,6 +14,7 @@ ramips_setup_interfaces()
>  	d-team,pbr-m1|\
>  	firefly,firewrt|\
>  	hiwifi,hc5962|\
> +	jcg,jhr-ac876m|\
>  	mediatek,ap-mt7621a-v60|\
>  	mediatek,mt7621-eval-board|\
>  	mqmaker,witi|\
> @@ -223,6 +224,9 @@ ramips_setup_macs()
>  		wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
>  		label_mac=$wan_mac
>  		;;
> +	jcg,jhr-ac876m)
> +		wan_mac=$(mtd_get_mac_binary factory 0x4)

What about 0xe006? If lan is 0xe000, I would expect the wan MAC address there.

Add here:

label_mac=$(mtd_get_mac_binary factory 0x4)

Best

Adrian 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20191212/37d26a79/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list