[OpenWrt-Devel] [PATCH v4 1/3] ramips: add support for JS7628 development board

Adrian Schmutzler mail at adrianschmutzler.de
Tue Oct 8 08:31:09 EDT 2019


Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org] On Behalf Of Robinson Wu
> Sent: Dienstag, 8. Oktober 2019 11:20
> To: openwrt-devel at lists.openwrt.org
> Cc: Robinson Wu <wurobinson at qq.com>
> Subject: [OpenWrt-Devel] [PATCH v4 1/3] ramips: add support for JS7628 development board
> 
> This commit adds support for the ZhuoTK JS7628 development board,
> The device has the following specifications:
> 

Having looked at all three patches, I wonder whether there is any OpenWrt-relevant difference between the boards with same flash size (except the name). So, is there a difference between e.g.
Device/zhuotk_js7628-8m
Device/zhuotk_js7688-8m
Device/zhuotk_ztk7628p-8m
?

If there is no difference, you have essentially two options:

1. Keep devices separate:
In this case, you should create flash-based DTSIs on top of the existing DTSI, e.g.
mt7628an_zhuotk_js76x8-8m.dtsi
mt7628an_zhuotk_js76x8-16m.dtsi
mt7628an_zhuotk_js76x8-32m.dtsi

Each of those will contain the former content of the corresponding DTS file except the compatible/model.
Based on those DTSIs you could then have nine DTS files for the devices (just as you did) that then just contain a link to the matching DTSI and model/compatible.

2. Have three devices only:
I personally think option 1 is overkill here. Instead, you could exploit the DEVICE_ALT syntax and only create three devices, but use all nine names for them:

Three DTSes:
mt7628an_zhuotk_js76x8-8m.dts
mt7628an_zhuotk_js76x8-16m.dts
mt7628an_zhuotk_js76x8-32m.dts

Three definitions with nine names:
+define Device/zhuotk_js76x8-8m
+  MTK_SOC := mt7628an
+  IMAGE_SIZE := 7872k
+  DEVICE_VENDOR := ZhuoTK
+  DEVICE_MODEL := JS7628
+  DEVICE_VARIANT := 8M flash
+  DEVICE_ALT0_VENDOR := ZhuoTK
+  DEVICE_ALT0_MODEL := JS7688
+  DEVICE_ALT0_VARIANT := 8M flash
+  DEVICE_ALT1_VENDOR := ZhuoTK
+  DEVICE_ALT1_MODEL := ZTK7628P
+  DEVICE_ALT1_VARIANT := 8M flash
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
+endef
+TARGET_DEVICES += zhuotk_js76x8-8m
+
+define Device/zhuotk_js76x8-16m
... accordingly
+endef
+TARGET_DEVICES += zhuotk_js76x8-16m
+
+define Device/zhuotk_js76x8-32m
... accordingly
+endef
+TARGET_DEVICES += zhuotk_js76x8-32m
+

compatible in DTSes will have to match Device node names, so
zhuotk,js76x8-8m etc.

I think this will provide I nice tradeoff between usability and codebase tidiness.

Best

Adrian Schmutzler
-------------- 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/20191008/f8c51da4/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