On 2/25/21 11:10 AM, Adrian Schmutzler wrote:
Hi,

-----Original Message-----
From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org]
On Behalf Of Stefan Lippers-Hollmann
Sent: Donnerstag, 25. Februar 2021 07:56
To: Hauke Mehrtens <ha...@hauke-m.de>
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [PATCH 1/2] realtek: Add generic zyxel_gs1900 image definition

Hi

On 2021-02-24, Hauke Mehrtens wrote:
Add a new common device definition for the Zyxel GS1900 line of
switches.
[...]
-define Device/zyxel_gs1900-10hp
+define Device/zyxel_gs1900
    SOC := rtl8380
    IMAGE_SIZE := 6976k
    DEVICE_VENDOR := ZyXEL
    DEVICE_MODEL := GS1900-10HP
    UIMAGE_MAGIC := 0x83800000
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | zyxel-vers
+AAHI | uImage gzip endef

I'm wondering if this attempt to deal the gs1900 switch family really improves
the situation for these devices. While IMAGE_SIZE and UIMAGE_MAGIC
might indeed by rather generic to most (all?) members of the gs1900 family,
SOC might not be (GS1900-24, GS1900-24E, GS1900-24HP are RTL8382M,
GS1900-48 and GS1900-48HP are RTL8393 - admittedly, I do not know how
different the resulting DTS would need to be, as these devices are not
supported yet) and zyxel-vers is different for every single model (aside from
GS1900-8HPv1 && GS1900-8HPv2):

Common definitions in Makefiles and DTS are two different questions. It's not 
uncommon that shared nodes in Makefile are possible where DTSes are still 
individual. Anyway, one could make zyxel-vers a variable and move back SOC to 
the devices when necessary:

DEVICE_VARS += ZYXEL_VERS

define Device/zyxel_gs1900
    IMAGE_SIZE := 6976k
    DEVICE_VENDOR := ZyXEL
    UIMAGE_MAGIC := 0x83800000
    KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | zyxel-vers 
$$$$(ZYXEL_VERS)
        | uImage gzip
endef

define Device/zyxel_gs1900-10hp
    $(Device/zyxel_gs1900)
    SOC := rtl8380
    DEVICE_MODEL := GS1900-10HP
    ZYXEL_VERS := AAZI
endef
TARGET_DEVICES += zyxel_gs1900-10hp

That would still keep the kernel_initramfs recipe in the common node. Of 
course, this might eventually hit a point where having the common node is more 
effort than benefit.

I will update it like this and also remove the DEVICE_MODEL.

Hauke

Attachment: OpenPGP_0x93DD20630910B515.asc
Description: application/pgp-keys

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to