openwrt/target/linux/econet/image/Makefile
Ahmed Naseef 9ba87609b8 econet: image: add little endian TRX support for EN7528
The EN7528 SoC uses a little endian MIPS architecture, unlike the big
endian EN751221 family. The tclinux TRX firmware format stores multi-byte
fields in the CPU's native byte order, requiring different header layouts
for each architecture:

  - Big endian (EN751221): magic "2RDH", fields in big endian order
  - Little endian (EN7528): magic "HDR2", fields in little endian order

Update tclinux-trx.sh to support both endianness variants:
  - Add --endian parameter to select byte order (default: be)
  - Add --model parameter for optional platform identifier field
  - Convert to named parameters for clarity and extensibility
  - Use hex32() helper for endian-aware 32-bit field output

Move TRX_ENDIAN configuration to subtarget files, allowing each subtarget
to specify its native byte order:
  - en751221.mk: TRX_ENDIAN := be
  - en7528.mk: TRX_ENDIAN := le

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21326
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-15 01:12:52 +01:00

28 lines
781 B
Makefile

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
define Target/Description
Build firmware images for EcoNet MIPS based boards.
endef
# tclinux-trx is the default format used in the SDK
define Build/tclinux-trx
./tclinux-trx.sh --kernel $@ --rootfs $(IMAGE_ROOTFS) \
--version $(VERSION_DIST)-$(REVISION) --endian $(TRX_ENDIAN) \
$(if $(TRX_MODEL),--model $(TRX_MODEL)) > $@.new
mv $@.new $@
endef
# tclinux bootloader requires LZMA, BUT only provides 7.5MB of space
# to decompress into. So we use vmlinuz and decompress twice.
define Device/Default
DEVICE_DTS_DIR := ../dts
KERNEL_SIZE := 7480k
KERNEL_NAME := vmlinuz.bin
KERNEL_LOADADDR := 0x80020000
KERNEL := kernel-bin | append-dtb
endef
include $(SUBTARGET).mk
$(eval $(call BuildImage))