qoriq: add factory images for NXP T4240RDB board master
authorPawel Dembicki <[email protected]>
Wed, 19 Nov 2025 22:07:18 +0000 (23:07 +0100)
committerStijn Tintel <[email protected]>
Fri, 5 Dec 2025 21:57:41 +0000 (23:57 +0200)
commit9a01b005fd8c439a7ec00afaa43d0e134e23cf5c
tree61853dedc61ed022a475ee07fb2872e9f88bab67
parentfccba7fc33c4fe23f0ef599fd14b8cac75809ec8
qoriq: add factory images for NXP T4240RDB board

This commit adds the factory images for T4240RDB board in both variants:
  - nor: for booting and read whole system from NOR memory
  - sdboot: for booting and read whole system from SD card

SD Card images install:

  - Burn image to sdcard. E.g:
    gunzip -c openwrt-qoriq-generic-fsl_t4240rdb-sdboot-squashfs-sdcard.img.gz | \
    sudo dd of=/dev/mmcblk0 conv=fsync,notrunc status=progress bs=4M && sync
  - Download lastest Cortina PHY firmware from NXP github [1], if you accept their
    EULA [2].
  - Install Cortina PHY on image, E.g:
    dd if=cs4315-cs4340-PHY-ucode.txt of=/dev/mmcblk0 bs=1 seek=2M
  - Insert SD-Card to SD slot
  - Switch SW3.4 to OFF
  - Configre mac addresses from sticker in u-boot. E.g:
    setenv ethaddr 00:10:f3:3a:a8:66
    setenv eth1addr 00:10:f3:3a:a8:67
    setenv eth2addr 00:10:f3:3a:a8:68
    setenv eth3addr 00:10:f3:3a:a8:69
    setenv eth4addr 00:10:f3:3a:a8:6a
    setenv eth5addr 00:10:f3:3a:a8:6b
    setenv eth6addr 00:10:f3:3a:a8:6c
    setenv eth7addr 00:10:f3:3a:a8:6d
    setenv eth8addr 00:10:f3:3a:a8:6e
    setenv eth9addr 00:10:f3:3a:a8:6f
    setenv eth10addr 00:10:f3:3a:a8:70
    setenv eth11addr 00:10:f3:3a:a8:71
    saveenv
  - reset and boot

NOR images install (from SD Card image):

  - boot device from OpenWrt SD Card image
  - download nor factory image and put it into /tmp/
  - Run install:
    gunzip -c /tmp/openwrt-qoriq-generic-fsl_t4240rdb-nor-squashfs-factory.bin.gz | mtd write - /dev/mtd0
  - Switch SW3.4 to ON
  - Switch SW3.1-3 to OFF
  - reboot
  - Do postprocessing (see bellow)

NOR images install (from u-boot):

  - download and extract initfamfs image on tftp server root
  - boot device and stop in u-boot
  - configure server and ip address. E.g:
    setenv ipaddr 192.168.1.2
    setenv serverip 192.168.1.1
  - Download image and run flashing:
    tftpboot $loadaddr openwrt-qoriq-generic-fsl_t4240rdb-sdcard-initramfs-kernel.bin
    setenv bootargs console=ttyS0,115200
    bootm $loadaddr
  - download nor factory image and put it into /tmp/
  - Run install:
    gunzip -c /tmp/openwrt-qoriq-generic-fsl_t4240rdb-nor-squashfs-factory.bin.gz | mtd write - /dev/mtd0
  - Switch SW3.4 to ON
  - Switch SW3.1-3 to OFF
  - reboot
  - Do postprocessing (see bellow)

NOR images post processing:

  - Configre mac addresses from sticker in u-boot. E.g:
    setenv ethaddr 00:10:f3:3a:a8:66
    setenv eth1addr 00:10:f3:3a:a8:67
    setenv eth2addr 00:10:f3:3a:a8:68
    setenv eth3addr 00:10:f3:3a:a8:69
    setenv eth4addr 00:10:f3:3a:a8:6a
    setenv eth5addr 00:10:f3:3a:a8:6b
    setenv eth6addr 00:10:f3:3a:a8:6c
    setenv eth7addr 00:10:f3:3a:a8:6d
    setenv eth8addr 00:10:f3:3a:a8:6e
    setenv eth9addr 00:10:f3:3a:a8:6f
    setenv eth10addr 00:10:f3:3a:a8:70
    setenv eth11addr 00:10:f3:3a:a8:71
    saveenv
  - boot
  - Download and refresh RCW stored in eeprom:
    tr '\0' '\377' < /dev/zero | dd bs=256 of=/sys/bus/i2c/devices/0-0050/eeprom
    cat /tmp/openwrt-qoriq-generic-fsl_t4240rdb-nor-squashfs-rcw.bin > /sys/bus/i2c/devices/0-0050/eeprom
  - Download lastest Cortina PHY firmware from NXP github [1], if you accept their
    EULA [2].
  - Install Cortina PHY on image, E.g:
    mtd write cs4315-cs4340-PHY-ucode.txt /dev/mtd4
  - reset and boot

[1] https://raw.githubusercontent.com/nxp-qoriq/qoriq-firmware-cortina/refs/tags/lf-6.12.34-2.1.0/cs4315-cs4340-PHY-ucode.txt
[2] https://github.com/nxp-qoriq/qoriq-firmware-cortina/blob/lf-6.12.34-2.1.0/EULA.txt

Signed-off-by: Pawel Dembicki <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/10941
Signed-off-by: Stijn Tintel <[email protected]>
package/firmware/layerscape/fman-ucode/Makefile
package/firmware/layerscape/ls-rcw/Makefile
package/firmware/layerscape/ls-rcw/patches/0003-fix_rcw_for_t4240rdb.patch [new file with mode: 0644]
target/linux/qoriq/image/Makefile
target/linux/qoriq/image/gen_sdcard_head_img.sh [new file with mode: 0755]
target/linux/qoriq/image/generic.mk