openwrt-redmi-ax3000/target/linux/airoha/image/an7581.mk
Ziyang Huang 70e26da6bd airoha: an7581: add support for Bell XG-140G-Y003
This commit adds support for Bell XG-140G-Y003 models.

Hardware
--------
  SoC:     Airoha AN7581
  RAM:     TN4G16D3CSER-EK (512MB DDR3 1866MHz)
  Flash:   S35ML02G300 (256M)
  ETH:     AN7581 GbE Switch (eth0: LAN2, LAN3, LAN4)
           EN8811H 2.5GbE PHY (eth1: LAN1)

Installation
------------

1. Connect uart to PC, press enter to login into U-Boot console.
       Username: telecomadmin
       Password: nE7jA%5m

2. Run the following command to setup bootcmd.
       setenv bootcmd 'flash read 0x000c0000 0x880000 $loadaddr && bootm'
       saveenv

3. Use a TFTP client to PUT "*-squashfs-factory.bin" to "192.168.1.1".

4. Run the following command to flash.
       flash erase 0x000c0000 0x02880000
       flash write 0x000c0000 $filesize $loadaddr

5. Reboot.
       reset

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
2025-11-26 21:54:22 +08:00

64 lines
2.0 KiB
Makefile

define Build/an7581-emmc-bl2-bl31-uboot
head -c $$((0x800)) /dev/zero > $@
cat $(STAGING_DIR_IMAGE)/an7581_$1-bl2.fip >> $@
dd if=$(STAGING_DIR_IMAGE)/an7581_$1-bl31-u-boot.fip of=$@ bs=1 seek=$$((0x20000)) conv=notrunc
endef
define Build/an7581-preloader
cat $(STAGING_DIR_IMAGE)/an7581_$1-bl2.fip >> $@
endef
define Build/an7581-bl31-uboot
cat $(STAGING_DIR_IMAGE)/an7581_$1-bl31-u-boot.fip >> $@
endef
define Device/FitImageLzma
KERNEL_SUFFIX := -uImage.itb
KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
KERNEL_NAME := Image
endef
define Device/airoha_an7581-evb
$(call Device/FitImageLzma)
DEVICE_VENDOR := Airoha
DEVICE_MODEL := AN7581 Evaluation Board (SNAND)
DEVICE_PACKAGES := kmod-leds-pwm kmod-i2c-an7581 kmod-pwm-airoha kmod-input-gpio-keys-polled
DEVICE_DTS := an7581-evb
DEVICE_DTS_CONFIG := config@1
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata
ARTIFACT/preloader.bin := an7581-preloader rfb
ARTIFACT/bl31-uboot.fip := an7581-bl31-uboot rfb
ARTIFACTS := preloader.bin bl31-uboot.fip
endef
TARGET_DEVICES += airoha_an7581-evb
define Device/airoha_an7581-evb-emmc
DEVICE_VENDOR := Airoha
DEVICE_MODEL := AN7581 Evaluation Board (EMMC)
DEVICE_DTS := an7581-evb-emmc
DEVICE_PACKAGES := kmod-i2c-an7581
ARTIFACT/preloader.bin := an7581-preloader rfb
ARTIFACT/bl31-uboot.fip := an7581-bl31-uboot rfb
ARTIFACTS := preloader.bin bl31-uboot.fip
endef
TARGET_DEVICES += airoha_an7581-evb-emmc
define Device/bell_xg-140g-y003
$(call Device/FitImageLzma)
DEVICE_VENDOR := Bell
DEVICE_MODEL := Bell XG-140G-Y003
DEVICE_DTS := an7581-xg-140g-y003
KERNEL_SIZE := 8704k
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES := \
kmod-phy-airoha-en8811h \
kmod-gpio-button-hotplug \
kmod-i2c-an7581 \
uboot-envtools
endef
TARGET_DEVICES += bell_xg-140g-y003