I can flash Zyxel GS1900-24 but GS1900-24HP does not work

Hello,

First thank you everybody for building and supporting OpenWrt. OpenWrt is the best! :wink:

Recently I found that Zyxel GS1900 switches are supported and I purchased a few of them on eBay. I chose to flash them using TFTP method from U-Boot since if I know that I can boot from an image loaded from TFTP server and then run sysupgrade to flash an image permanently it's a guarantee that I can re-flash it anytime again even when the OS is broken for any reason.

I successfully flashed Zyxel GS1900-24 and GS1900-48. I didn't have time to verify that OpenWrt runs well on those switch but OpenWrt does boot and network works so I'm happy.

But I have problem to load an image from TFTP on GS1900-24HP (PoE version of the switch). If I had this problem with only a single switch I would conclude that the switch is defective but I have more than one from different sellers and they all have the same problem...

When I run tftpboot 0x84f00000 192.168.1.10:openwrt-...-kernel.bin from U-Boot on GS1900-24 or 48 it looks like this:

TFTP from server 192.168.1.10; our IP address is 192.168.1.1
Filename 'openwrt-22.03.1-realtek-rtl838x-zyxel_gs1900-24-v1-initramfs-kernel.bin'.
Load address: 0x84f00000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##############
done
Bytes transferred = 6870927 (68d78f hex)

But when I try to run it on 24HP I get:

...
Loading: #

and the shell stops responding.

I know that the network works since I can type ping 192.168.1.10 in U-Boot and I get message that host is alive but it looks like tftpboot halts after a few bytes and I have to power cycle the switch.

Can anybody please advise?

Thank you.

Martin

You did try the the -24HP specific image on your switch? And there's a v1 and v2 of those.

Assuming these are v1 since you got them second hand, I guess your problem is found here:

0x80000000 + 0x4000000 < 0x84f00000

2 Likes

Yes, I tried both zyxel_gs1900-24hp-v1-initramfs-kernel.bin and zyxel_gs1900-24hp-v2-initramfs-kernel.bin. I haven't tried it but based on my understanding the tftpboot should load any image - even an image that won't boot.

Ouh, I didn't realize that the first argument after tftpboot command is memory address... Could you please tell me what number should I try?

The good thing about the GS1900 (and most other realtek-based switches) is the dual firmware design: You just need to tell U-Boot to load the backup image and you are back to stock.

The commit message at https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=a5ac8ad0ba9df50bdd0dda1dc26cf36f83006893 contains the following information:

U-Boot TFTP method:

* Configure your client with a static 192.168.1.x IP (e.g. 192.168.1.10).

* Set up a TFTP server on your client and make it serve the initramfs
  image.

* Connect serial, power up the switch, interrupt U-boot by hitting the
  space bar, and enable the network:

  > rtk network on

* Since the GS1900-24HP v1 is a dual-partition device, you want to keep the
  OEM firmware on the backup partition for the time being. OpenWrt can
  only be installed in the first partition anyway (hardcoded in the
  DTS). To ensure we are set to boot from the first partition, issue the
  following commands:

  > setsys bootpartition 0
  > savesys

* Download the image onto the device and boot from it:

  > tftpboot 0x81f00000 192.168.1.10:openwrt-realtek-rtl838x-zyxel_gs1900-24hp-v1-initramfs-kernel.bin
  > bootm

* Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it:

  > sysupgrade /tmp/openwrt-realtek-rtl838x-zyxel_gs1900-24hp-v1-squashfs-sysupgrade.bin

So it's 0x81f00000

1 Like

Thank you. I haven't tried that yet but I'm assuming this will do the work:

setsys bootpartition 1
savesys

Yeah, I didn't look at commit messages ;-). Thank you.

So I looked at https://openwrt.org/toh/hwdata/zyxel/start and commit massages for files in https://git.openwrt.org/?p=openwrt/openwrt.git;a=tree;f=target/linux/realtek/dts-5.10 and I summarized that the following addresses should work for supported Zyxel switches. I didn't find an address for 8, 24HPv2 and 48 but since it's all 0x81f00000 or 0x84f00000 I'm guessing it's OK just to flip a coin and choose one of those addresses and see if it works.

tftpboot ????       # rtl8380_zyxel_gs1900-8.dts
tftpboot 0x84f00000 # rtl8380_zyxel_gs1900-8hp-v1.dts
tftpboot 0x84f00000 # rtl8380_zyxel_gs1900-8hp-v2.dts
tftpboot 0x84f00000 # rtl8380_zyxel_gs1900-10hp.dts
tftpboot 0x84f00000 # rtl8382_zyxel_gs1900-16.dts
tftpboot 0x81f00000 # rtl8382_zyxel_gs1900-24-v1.dts
tftpboot 0x84f00000 # rtl8382_zyxel_gs1900-24e.dts
tftpboot 0x81f00000 # rtl8382_zyxel_gs1900-24hp-v1.dts
tftpboot ????       # rtl8382_zyxel_gs1900-24hp-v2.dts
tftpboot ????       # rtl8393_zyxel_gs1900-48.dts

Well it's relatively simple: The 64MB devices will need the lower load address, and only the 24-v1 and 24HP-v1 have 64MB of RAM. The GS1900-8 has 128MB and so does the GS1900-24HP-v2 and the GS1900-48.

1 Like

Nice and easy. Thank you.

1 Like

:slight_smile: One of the reasons why I sold my 24HP-v1 and replaced it by a 24HP-v2 is the 64MB RAM oddity.

I don't really see a reason to replace it by v2. I'm not going to run any apps on the switch - just L2 switching and VLANs so 64M RAM is more than enough...