mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-01-28 01:17:30 +01:00
qoriq: add support for NXP T4240RDB board
Hardware specs:
- NXP T4240, 12C/24T @ 1.67 GHz
- 3 × 2 GB DDR3 SO-DIMM
- 128 MB NOR flash
- 2 GB SLC NAND
- SD card interface
- PCIe: x4 and x8
- SATA 3 Gbps
- 8 × 1 GbE
- 4 × 10 GbE SFP
- RTC
This commit adds the sysupgrade and 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 gunzip -c openwrt-qoriq-generic-fsl_T4240RDB-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:
- download and extract factory image on tftp server root
- boot device and stop in u-boot (from nor or sd card 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-squashfs-factory-nor.bin
protect off all
erase $fwaddr +$filesize
cp.b $loadaddr $fwaddr $filesize
- 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-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 <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/10941
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
parent
c5d3d5fe28
commit
0a2b3b66db
10 changed files with 354 additions and 5 deletions
|
|
@ -24,8 +24,8 @@ define Package/layerscape-fman
|
|||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP FMan ucode
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv8_64b
|
||||
DEPENDS:=@TARGET_layerscape||TARGET_qoriq
|
||||
DEFAULT:=y if TARGET_layerscape_armv8_64b||TARGET_qoriq
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
|
|
@ -38,6 +38,8 @@ define Build/InstallDev
|
|||
$(STAGING_DIR_IMAGE)/fsl_ls1043a-rdb-fman.bin
|
||||
$(CP) $(PKG_BUILD_DIR)/fsl_fman_ucode_ls1046_r1.0_106_4_18.bin \
|
||||
$(STAGING_DIR_IMAGE)/fsl_ls1046a-rdb-fman.bin
|
||||
$(CP) $(PKG_BUILD_DIR)/fsl_fman_ucode_t4240_r2.0_106_4_18.bin \
|
||||
$(STAGING_DIR_IMAGE)/fsl_t4240-rdb-fman.bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,layerscape-fman))
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ define Package/layerscape-rcw
|
|||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP Layerscape RCW binaries
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv7
|
||||
DEPENDS:=@TARGET_layerscape||TARGET_qoriq
|
||||
DEFAULT:=y if TARGET_layerscape_armv7||TARGET_qoriq
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
|
|
@ -46,7 +46,8 @@ BOARDS := \
|
|||
ls2088a-rdb \
|
||||
lx2160a-rdb \
|
||||
lx2160a-rdb-sdboot \
|
||||
ls1021a-twr
|
||||
ls1021a-twr \
|
||||
T4240RDB \
|
||||
|
||||
RCW_ls1012a-rdb :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin
|
||||
RCW_ls1012a-frdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin
|
||||
|
|
@ -65,6 +66,7 @@ RCW_ls2088a-rdb :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin
|
|||
RCW_lx2160a-rdb :=lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2.bin
|
||||
RCW_lx2160a-rdb-sdboot :=lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2.bin
|
||||
RCW_ls1021a-twr :=ls1021atwr/SSR_PNS_30/rcw_1200.bin
|
||||
RCW_T4240RDB :=t4240rdb/SSFFPPH_27_55_1_9/rcw_27_55_1_9_1666MHz.bin
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
--- /dev/null
|
||||
+++ b/t4240rdb/a008098.rcw
|
||||
@@ -0,0 +1,31 @@
|
||||
+/*
|
||||
+ * Work-around for erratum A-008098
|
||||
+ *
|
||||
+ * Description:
|
||||
+ * The PCI Express controller may fail to discard a bad packet when there
|
||||
+ * are excessive, correctable errors resulting in corrupted memory.
|
||||
+ *
|
||||
+ * Impact:
|
||||
+ * While running in an environment with many correctable errors the PCI
|
||||
+ * Express controller can corrupt memory.
|
||||
+ *
|
||||
+ * T4240RDB have only 0x100 bytes for PBI in eeprom. Unused pcie must be deleted.
|
||||
+ */
|
||||
+
|
||||
+.pbi
|
||||
+write 0x240000, 0x87000048
|
||||
+write 0x240004, 0x80802040
|
||||
+write 0x240000, 0x8700004c
|
||||
+write 0x240004, 0x02c02000
|
||||
+write 0x240000, 0x87000050
|
||||
+write 0x240004, 0x00002000
|
||||
+
|
||||
+write 0x260000, 0x87000048
|
||||
+write 0x260004, 0x80802040
|
||||
+write 0x260000, 0x8700004c
|
||||
+write 0x260004, 0x02c02000
|
||||
+write 0x260000, 0x87000050
|
||||
+write 0x260004, 0x00002000
|
||||
+
|
||||
+flush
|
||||
+.end
|
||||
--- a/t4240rdb/SSFFPPH_27_55_1_9/rcw_27_55_1_9_1666MHz.rcw
|
||||
+++ b/t4240rdb/SSFFPPH_27_55_1_9/rcw_27_55_1_9_1666MHz.rcw
|
||||
@@ -60,4 +60,4 @@ write 0x124010, 0x00000101
|
||||
write 0x124130, 0x0000000c
|
||||
.end
|
||||
|
||||
-#include <../t4240qds/a008098.rcw>
|
||||
+#include <a008098.rcw>
|
||||
|
|
@ -15,6 +15,9 @@ wg_set_opt_interface() {
|
|||
}
|
||||
|
||||
case "$board" in
|
||||
fsl,T4240RDB)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
;;
|
||||
watchguard,firebox-m300)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
wg_set_opt_interface "eth2" "2"
|
||||
|
|
|
|||
|
|
@ -3,8 +3,103 @@
|
|||
PART_NAME=firmware
|
||||
REQUIRE_IMAGE_METADATA=1
|
||||
|
||||
platform_get_rootfs_device() {
|
||||
local majmin sys path
|
||||
|
||||
majmin="$(awk '$5=="/rom"{print $3; exit}' /proc/self/mountinfo 2>/dev/null)"
|
||||
[ -n "$majmin" ] || {
|
||||
echo "Unable to determine upgrade device"
|
||||
return 1
|
||||
}
|
||||
|
||||
sys="/sys/dev/block/$majmin"
|
||||
[ -e "$sys" ] || {
|
||||
echo "Unable to determine upgrade device"
|
||||
return 1
|
||||
}
|
||||
|
||||
path="$(readlink -f "$sys" 2>/dev/null)" || return 1
|
||||
basename "$path"
|
||||
}
|
||||
|
||||
platform_copy_config_sdboot() {
|
||||
local diskdev partdev parttype=ext4
|
||||
|
||||
export_bootdevice && export_partdevice diskdev 0 || {
|
||||
echo "Unable to determine upgrade device"
|
||||
return 1
|
||||
}
|
||||
|
||||
if export_partdevice partdev 1; then
|
||||
mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt 2>&1
|
||||
echo "Saving config backup..."
|
||||
cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
|
||||
umount /mnt
|
||||
fi
|
||||
}
|
||||
|
||||
platform_do_upgrade_sdboot() {
|
||||
local diskdev partdev parttype=ext4
|
||||
local tar_file="$1"
|
||||
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
|
||||
board_dir=${board_dir%/}
|
||||
|
||||
export_bootdevice && export_partdevice diskdev 0 || {
|
||||
echo "Unable to determine upgrade device"
|
||||
return 1
|
||||
}
|
||||
|
||||
if export_partdevice partdev 1; then
|
||||
mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt 2>&1
|
||||
echo "Writing kernel..."
|
||||
tar xf $tar_file ${board_dir}/kernel -O > /mnt/fitImage
|
||||
umount /mnt
|
||||
fi
|
||||
|
||||
echo "Erasing rootfs..."
|
||||
dd if=/dev/zero of=/dev/mmcblk0p2 bs=1M > /dev/null 2>&1
|
||||
echo "Writing rootfs..."
|
||||
tar xf $tar_file ${board_dir}/root -O | dd of=/dev/mmcblk0p2 bs=512k > /dev/null 2>&1
|
||||
|
||||
}
|
||||
|
||||
platform_do_upgrade_nor() {
|
||||
local diskdev partdev parttype=ext4
|
||||
local tar_file="$1"
|
||||
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
|
||||
board_dir=${board_dir%/}
|
||||
local temp_sysupgrade="/tmp/sysupgrade.bin"
|
||||
|
||||
tar xf $tar_file ${board_dir}/kernel -O > $temp_sysupgrade.tmp || return 1
|
||||
tar xf $tar_file ${board_dir}/root -O >> $temp_sysupgrade.tmp || return 1
|
||||
dd if=$temp_sysupgrade.tmp of=$temp_sysupgrade bs=128k conv=sync > /dev/null 2>&1 || return 1
|
||||
printf '\xDE\xAD\xC0\xDE' | dd of=$temp_sysupgrade bs=128k oflag=append conv=notrunc,sync > /dev/null 2>&1 || return 1
|
||||
|
||||
default_do_upgrade "$temp_sysupgrade"
|
||||
}
|
||||
|
||||
platform_check_image() {
|
||||
case "$(board_name)" in
|
||||
fsl,T4240RDB)
|
||||
T4240_ROOTFS="$(platform_get_rootfs_device)"
|
||||
#Keep info about rootfs device for stage-2
|
||||
echo "$T4240_ROOTFS" > /tmp/t4240_rootfs_device
|
||||
|
||||
case "$T4240_ROOTFS" in
|
||||
mmcblk*)
|
||||
export_bootdevice && export_partdevice diskdev 0 || {
|
||||
echo "Unable to determine upgrade device"
|
||||
return 1
|
||||
}
|
||||
;;
|
||||
mtdblock*)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
echo "Unable to determine upgrade device"
|
||||
return 1
|
||||
esac
|
||||
;;
|
||||
watchguard,firebox-m300)
|
||||
legacy_sdcard_check_image "$1"
|
||||
;;
|
||||
|
|
@ -16,6 +111,17 @@ platform_check_image() {
|
|||
|
||||
platform_copy_config() {
|
||||
case "$(board_name)" in
|
||||
fsl,T4240RDB)
|
||||
T4240_ROOTFS="$(cat /tmp/t4240_rootfs_device 2>/dev/null)"
|
||||
|
||||
case "$T4240_ROOTFS" in
|
||||
mmcblk*)
|
||||
platform_copy_config_sdboot
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
esac
|
||||
;;
|
||||
watchguard,firebox-m300)
|
||||
legacy_sdcard_copy_config "$1"
|
||||
;;
|
||||
|
|
@ -26,6 +132,21 @@ platform_copy_config() {
|
|||
|
||||
platform_do_upgrade() {
|
||||
case "$(board_name)" in
|
||||
fsl,T4240RDB)
|
||||
T4240_ROOTFS="$(cat /tmp/t4240_rootfs_device 2>/dev/null)"
|
||||
|
||||
case "$T4240_ROOTFS" in
|
||||
mmcblk*)
|
||||
platform_do_upgrade_sdboot "$1"
|
||||
;;
|
||||
mtdblock*)
|
||||
platform_do_upgrade_nor "$1"
|
||||
;;
|
||||
*)
|
||||
echo "Unable to determine upgrade device"
|
||||
return 1
|
||||
esac
|
||||
;;
|
||||
watchguard,firebox-m300)
|
||||
legacy_sdcard_do_upgrade "$1"
|
||||
;;
|
||||
|
|
@ -34,3 +155,4 @@ platform_do_upgrade() {
|
|||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ CONFIG_ARCH_STACKWALK=y
|
|||
CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y
|
||||
CONFIG_ASN1=y
|
||||
CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
|
||||
CONFIG_ATA=y
|
||||
CONFIG_AUDIT_ARCH=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
|
|
@ -39,6 +40,7 @@ CONFIG_CONSOLE_TRANSLATIONS=y
|
|||
CONFIG_CONTEXT_TRACKING=y
|
||||
CONFIG_CONTEXT_TRACKING_IDLE=y
|
||||
CONFIG_CORENET_GENERIC=y
|
||||
CONFIG_CORTINA_PHY=y
|
||||
CONFIG_CPU_BIG_ENDIAN=y
|
||||
CONFIG_CPU_FREQ=y
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
|
||||
|
|
@ -247,12 +249,15 @@ CONFIG_MPIC=y
|
|||
CONFIG_MPIC_MSGR=y
|
||||
CONFIG_MPIC_TIMER=y
|
||||
CONFIG_MPILIB=y
|
||||
CONFIG_MTD_CMDLINE_PARTS=y
|
||||
CONFIG_MTD_NAND_CORE=y
|
||||
CONFIG_MTD_NAND_ECC=y
|
||||
CONFIG_MTD_NAND_ECC_SW_HAMMING=y
|
||||
CONFIG_MTD_NAND_FSL_IFC=y
|
||||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_MTD_RAW_NAND=y
|
||||
CONFIG_MTD_SPLIT_FIRMWARE=y
|
||||
CONFIG_MTD_SPLIT_FIT_FW=y
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
|
||||
|
|
@ -357,6 +362,8 @@ CONFIG_RETHOOK=y
|
|||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
CONFIG_SATA_FSL=y
|
||||
CONFIG_SATA_HOST=y
|
||||
# CONFIG_SCOM_DEBUGFS is not set
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_SCSI_COMMON=y
|
||||
|
|
@ -414,6 +421,7 @@ CONFIG_USB_UAS=y
|
|||
CONFIG_VDSO_GETRANDOM=y
|
||||
CONFIG_VIRT_CPU_ACCOUNTING=y
|
||||
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y
|
||||
CONFIG_VITESSE_PHY=y
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
# CONFIG_VT_HW_CONSOLE_BINDING is not set
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
/include/ "t4240rdb.dts"
|
||||
|
||||
/ {
|
||||
model = "NXP T4240RDB";
|
||||
aliases {
|
||||
ethernet0 = "/soc@ffe000000/fman@400000/ethernet@e0000";
|
||||
ethernet1 = "/soc@ffe000000/fman@400000/ethernet@e2000";
|
||||
ethernet2 = "/soc@ffe000000/fman@400000/ethernet@e4000";
|
||||
ethernet3 = "/soc@ffe000000/fman@400000/ethernet@e6000";
|
||||
ethernet4 = "/soc@ffe000000/fman@500000/ethernet@f0000";
|
||||
ethernet5 = "/soc@ffe000000/fman@500000/ethernet@f2000";
|
||||
ethernet6 = "/soc@ffe000000/fman@500000/ethernet@e0000";
|
||||
ethernet7 = "/soc@ffe000000/fman@500000/ethernet@e2000";
|
||||
ethernet8 = "/soc@ffe000000/fman@500000/ethernet@e4000";
|
||||
ethernet9 = "/soc@ffe000000/fman@500000/ethernet@e6000";
|
||||
ethernet10 = "/soc@ffe000000/fman@400000/ethernet@f0000";
|
||||
ethernet11 = "/soc@ffe000000/fman@400000/ethernet@f2000";
|
||||
};
|
||||
};
|
||||
|
||||
&ifc {
|
||||
nor@0,0 {
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
reg = <0x0 0x7e00000>;
|
||||
label = "firmware";
|
||||
};
|
||||
partition@7e00000 {
|
||||
reg = <0x7e00000 0x100000>;
|
||||
label = "cortina-ucode";
|
||||
};
|
||||
partition@7f00000 {
|
||||
reg = <0x7f00000 0x20000>;
|
||||
label = "fman";
|
||||
};
|
||||
partition@7f20000 {
|
||||
reg = <0x7f20000 0x20000>;
|
||||
label = "u-boot-env";
|
||||
};
|
||||
partition@7f40000 {
|
||||
reg = <0x7f40000 0xc0000>;
|
||||
label = "u-boot";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nand@2,0 {
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
reg = <0x0 0x80000000>;
|
||||
label = "nand";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pci1 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pci3 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&soc {
|
||||
i2c@118000 {
|
||||
eeprom@50 {
|
||||
compatible = "atmel,24c02";
|
||||
reg = <0x50>;
|
||||
};
|
||||
};
|
||||
|
||||
sata@221000 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
|
@ -4,6 +4,11 @@ include $(TOPDIR)/rules.mk
|
|||
include $(INCLUDE_DIR)/image.mk
|
||||
|
||||
SQUASHFSCOMP := xz $(LZMA_XZ_OPTIONS)
|
||||
LS_SD_KERNELPART_SIZE = 24
|
||||
LS_SD_KERNELPART_OFFSET = 3
|
||||
LS_SD_ROOTFSPART_OFFSET = 32
|
||||
LS_SD_IMAGE_SIZE = $(shell echo $$((($(LS_SD_ROOTFSPART_OFFSET) + \
|
||||
$(CONFIG_TARGET_ROOTFS_PARTSIZE)))))
|
||||
|
||||
define Build/sdcard-img
|
||||
rm -fR $@.boot
|
||||
|
|
@ -22,6 +27,36 @@ define Build/sdcard-img
|
|||
$(if $(UBOOT),dd if=$(STAGING_DIR_IMAGE)/$(UBOOT).img of=$@ bs=512 skip=1 seek=1 conv=notrunc)
|
||||
endef
|
||||
|
||||
define Build/ls-clean
|
||||
rm -f $@
|
||||
endef
|
||||
|
||||
define Build/ls-append
|
||||
dd if=$(STAGING_DIR_IMAGE)/$(1) >> $@
|
||||
endef
|
||||
|
||||
define Build/ls-append-dtb
|
||||
dd if=$(DTS_DIR)/$(1).dtb >> $@
|
||||
endef
|
||||
|
||||
define Build/ls-append-kernel
|
||||
mkdir -p $@.tmp && \
|
||||
cp $(IMAGE_KERNEL) $@.tmp/fitImage && \
|
||||
make_ext4fs -J -L kernel -l "$(LS_SD_KERNELPART_SIZE)M" \
|
||||
$(if $(SOURCE_DATE_EPOCH),-T $(SOURCE_DATE_EPOCH)) \
|
||||
"$@.kernel.part" "$@.tmp" && \
|
||||
dd if=$@.kernel.part >> $@ && \
|
||||
rm -rf $@.tmp && \
|
||||
rm -f $@.kernel.part
|
||||
endef
|
||||
|
||||
define Build/ls-append-sdhead
|
||||
./gen_sdcard_head_img.sh $(STAGING_DIR_IMAGE)/$(1)-sdcard-head.img \
|
||||
$(LS_SD_KERNELPART_OFFSET) $(LS_SD_KERNELPART_SIZE) \
|
||||
$(LS_SD_ROOTFSPART_OFFSET) $(CONFIG_TARGET_ROOTFS_PARTSIZE)
|
||||
dd if=$(STAGING_DIR_IMAGE)/$(1)-sdcard-head.img >> $@
|
||||
endef
|
||||
|
||||
define Device/Default
|
||||
PROFILES := Default
|
||||
DEVICE_DTS := $(subst _,-,$(1))
|
||||
|
|
|
|||
21
target/linux/qoriq/image/gen_sdcard_head_img.sh
Executable file
21
target/linux/qoriq/image/gen_sdcard_head_img.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright 2018 NXP
|
||||
|
||||
set -x
|
||||
[ $# -eq 5 ] || {
|
||||
echo "SYNTAX: $0 <file> <kernel part offset> <kernel size> <rootfs part offset> <rootfs size>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
OUTPUT="$1"
|
||||
KERNELOFFSET="$(($2 * 1024))"
|
||||
KERNELSIZE="$3"
|
||||
ROOTFSOFFSET="$(($4 * 1024))"
|
||||
ROOTFSSIZE="$5"
|
||||
|
||||
head=4
|
||||
sect=63
|
||||
|
||||
set $(ptgen -o $OUTPUT -h $head -s $sect -t 83 -p ${KERNELSIZE}M@${KERNELOFFSET} -p ${ROOTFSSIZE}M@${ROOTFSOFFSET})
|
||||
|
|
@ -1,3 +1,33 @@
|
|||
define Device/fsl_T4240RDB
|
||||
DEVICE_VENDOR := NXP
|
||||
DEVICE_MODEL := T4240RDB
|
||||
DEVICE_DTS_DIR := $(DTS_DIR)/fsl
|
||||
DEVICE_PACKAGES := \
|
||||
kmod-eeprom-at24 kmod-gpio-button-hotplug kmod-hwmon-w83793 kmod-leds-gpio \
|
||||
kmod-ptp-qoriq kmod-rtc-ds1374 u-boot-fsl_T4240RDB-nor u-boot-fsl_T4240RDB-sdboot
|
||||
FILESYSTEMS := squashfs
|
||||
KERNEL := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
IMAGES := factory-nor.bin.gz sdcard.img.gz rcw.bin sysupgrade.bin
|
||||
IMAGE/factory-nor.bin.gz := \
|
||||
append-kernel | append-rootfs | pad-rootfs | pad-to 126M | \
|
||||
pad-to 127M | \
|
||||
ls-append fsl_t4240-rdb-fman.bin | pad-to 130176k | \
|
||||
ls-append $(1)-nor-uboot-env.bin | pad-to 130304k | \
|
||||
ls-append $(1)-nor-uboot.bin | gzip
|
||||
IMAGE/rcw.bin := ls-append $(1)-rcw.bin
|
||||
IMAGE/sdcard.img.gz := \
|
||||
ls-clean | \
|
||||
ls-append-sdhead $(1) | pad-to 4K | \
|
||||
ls-append $(1)-sdboot-uboot.bin | pad-to 1028k | \
|
||||
ls-append $(1)-sdboot-uboot-env.bin | pad-to 1040k | \
|
||||
ls-append fsl_t4240-rdb-fman.bin | pad-to 2M | \
|
||||
pad-to $(LS_SD_KERNELPART_OFFSET)M | \
|
||||
ls-append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
|
||||
append-rootfs | pad-to $(LS_SD_IMAGE_SIZE)M | gzip
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += fsl_T4240RDB
|
||||
|
||||
define Device/watchguard_firebox-m300
|
||||
DEVICE_VENDOR := WatchGuard
|
||||
DEVICE_MODEL := Firebox M300
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue