0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-08-22 22:02:24 +00:00
Files
openwrt/target/linux/realtek/image/Makefile
Colton Pawielski 9c26d14489 realtek: add support for Vimin VM-S100-0800MS
Vimin VM-S100-0800MS is an 8 port Multi-Gig switch, based on RTL9303.
Ported from XikeStor SKS8300-8X with changes to support different u-boot
build.

Specification:

- SoC             : Realtek RTL9303
- RAM             : DDR3 512 MiB
- Flash           : SPI-NOR 16 MiB (Winbond W25Q128JVSQ)
- Ethernet        : 8x 1/2.5/10 Gbps (SFP+)
- LEDs/Keys (GPIO): 0x/1x
- UART            : "Console" port on the front panel
  - type          : RS-232C
  - connector     : RJ-45
  - settings      : 115200n8
- Power           : AC100-240V 50/60Hz

Flash instruction using initramfs image:

 1. Prepare TFTP server with an IP address "192.168.1.111"
 2. Connect your PC to Port1 on VM-S100-0800MS
 3. Power on VM-S100-0800MS and interrupt boot by pressing Esc
 4. Enable Port1 with the following commands

    rtk 10g 0 fiber1g (or fiber10g if 10GBase-*R, dac300cm for DAC cable)
    rtk ext-devInit 0
    rtk ext-pinSet 2 0

    Note: the last command sets tx-disable to low

 7. Download initramfs image from TFTP server

    tftpboot 0x82000000 <image name>

 8. Boot with the downloaded image

    bootm

 9. On the initramfs image, backup the stock firmware if needed
10. Upload (or download) sysupgrade image to the device
11. Erase "firmware" partition to cleanup JFFS2 of stock FW

    mtd erase firmware

12. Perform sysupgrade with the sysupgrade image
13. Wait ~120 sec to complete flashing

Reverting to stock firmware:
 1. Prepare by downloading the stock firmware. Vimin doesn't have
    the firmware on their website, tested using firmware for shared
    hardware Nicgiga S100-0800S-M.
    Filename: vmlinux-nicgiga-S100-0800S-M-241126EN.bix

 2. Prepare TFTP server with an IP address "192.168.1.111"
 3. Connect your PC to Port1 on VM-S100-0800MS
 4. Power on VM-S100-0800MS and interrupt boot by pressing Esc
 5. Enable Port1 with the following commands

    rtk 10g 0 fiber1g (or fiber10g if 10GBase-*R, dac300cm for DAC cable)
    rtk ext-devInit 0
    rtk ext-pinSet 2 0

    Note: the last command sets tx-disable to low

 6. Download initramfs image from TFTP server

    tftpboot 0x82000000 <image name>

 7. Boot with the downloaded image

    bootm

 8. Under Management -> Firmware -> Upgrade/Backup, upload bix file.
 9. Reboot device

Signed-off-by: Colton Pawielski <cepawiel@mtu.edu>
Link: https://github.com/openwrt/openwrt/pull/19477
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-28 23:37:39 +02:00

144 lines
3.3 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
KERNEL_LOADADDR = 0x80100000
DEVICE_VARS += \
BELKIN_HEADER \
BELKIN_MODEL \
CAMEO_BOARD_MODEL \
CAMEO_BOARD_VERSION \
CAMEO_CUSTOMER_SIGNATURE \
CAMEO_KERNEL_PART \
CAMEO_KERNEL_PART_SIZE \
CAMEO_ROOTFS_PART \
H3C_DEVICE_ID \
H3C_PRODUCT_ID \
LINKSYS_HEADER \
ZYXEL_VERS
define Build/rt-compress
$(STAGING_DIR_HOST)/bin/xz -9 --format=lzma --stdout "$@" > "$@.new"
mv "$@.new" "$@"
endef
define Build/rt-loader
$(MAKE) all clean -C rt-loader CROSS_COMPILE="$(TARGET_CROSS)" \
KERNEL_IMG_IN="$@" KERNEL_IMG_OUT="$@.new" BUILD_DIR="$@.build"
mv "$@.new" "$@"
endef
define Build/zyxel-vers
( echo VERS;\
for hw in $(ZYXEL_VERS); do\
echo -n "V9.99($$hw.0) | ";\
date -d @$(SOURCE_DATE_EPOCH) +%m/%d/%Y;\
done ) >> $@
endef
define Build/cameo-tag
$(SCRIPT_DIR)/cameo-tag.py $@ $(CAMEO_KERNEL_PART_SIZE)
endef
define Build/cameo-version
echo -n "OpenWrt" >> $@
dd if=/dev/zero bs=25 count=1 >> $@
endef
define Build/cameo-headers
dd if=$@ bs=$(CAMEO_KERNEL_PART_SIZE) count=1 of=$@.kernel_part; \
dd if=$@ bs=$(CAMEO_KERNEL_PART_SIZE) skip=1 of=$@.rootfs_part; \
$(SCRIPT_DIR)/cameo-imghdr.py $@.kernel_part $@.kernel_part.hex \
"$(CAMEO_BOARD_MODEL)" os $(CAMEO_KERNEL_PART) \
$(CAMEO_CUSTOMER_SIGNATURE) \
$(CAMEO_BOARD_VERSION) \
$(KERNEL_LOADADDR); \
$(SCRIPT_DIR)/cameo-imghdr.py $@.rootfs_part $@.rootfs_part.hex \
"$(CAMEO_BOARD_MODEL)" squashfs $(CAMEO_ROOTFS_PART) \
$(CAMEO_CUSTOMER_SIGNATURE) \
$(CAMEO_BOARD_VERSION); \
cat $@.kernel_part.hex $@.rootfs_part.hex > $@
endef
define Build/7z
$(STAGING_DIR_HOST)/bin/7zr a $(@).new -t7z -m0=lzma $(@)
mv $@.new $@
endef
define Build/h3c-image
$(STAGING_DIR_HOST)/bin/mkh3cimg \
-i $(@) \
-o $(@).new \
-c 7z \
-p $(H3C_PRODUCT_ID) \
-d $(H3C_DEVICE_ID)
mv $@.new $@
endef
define Build/h3c-vfs
$(STAGING_DIR_HOST)/bin/mkh3cvfs \
-i $(@) \
-o $(@).new \
-f openwrt-kernel.bin
mv $@.new $@
endef
define Build/belkin-header
$(SCRIPT_DIR)/belkin-header.py $(@) $(@).new $(BELKIN_HEADER) ${BELKIN_MODEL}
mv $@.new $@
endef
define Build/linksys-image
$(SCRIPT_DIR)/linksys-image.sh $(@) $(@).new $(LINKSYS_MODEL)
mv $@.new $@
endef
define Device/Default
PROFILES = Default
KERNEL := \
kernel-bin | \
append-dtb | \
libdeflate-gzip | \
uImage gzip
KERNEL_INITRAMFS := \
kernel-bin | \
append-dtb | \
libdeflate-gzip | \
uImage gzip
DEVICE_DTS_DIR := ../dts
DEVICE_DTS = $$(SOC)_$(1)
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := \
append-kernel | \
pad-to 64k | \
append-rootfs | \
pad-rootfs | \
check-size | \
append-metadata
endef
define Device/kernel-lzma
KERNEL := \
kernel-bin | \
append-dtb | \
lzma | \
uImage lzma
KERNEL_INITRAMFS := \
kernel-bin | \
append-dtb | \
lzma | \
uImage lzma
endef
define Device/uimage-rt-loader
KERNEL/rt-loader := kernel-bin | append-dtb | rt-compress | rt-loader
KERNEL := $$(KERNEL/rt-loader) | uImage none
KERNEL_INITRAMFS := $$(KERNEL/rt-loader) | uImage none
endef
include $(SUBTARGET).mk
$(eval $(call BuildImage))