Skip to content
Snippets Groups Projects
Commit 878efd7f authored by Dmitry Petrov's avatar Dmitry Petrov Committed by Tobias Kahlki
Browse files

uuu-scripts: import from meta-seconorth-distro

parent c2dd2c00
No related branches found
No related tags found
1 merge request!464uuu-scripts: import from meta-seconorth-distro
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=38ec0c18112e9a92cffc4951661e85a5"
SRC_URI = "https://github.com/NXPmicro/mfgtools/releases/download/uuu_${PV}/uuu;subdir=${BP};name=linuxbin \
https://github.com/NXPmicro/mfgtools/releases/download/uuu_${PV}/uuu.exe;subdir=${BP};name=windowsbin \
https://raw.githubusercontent.com/NXPmicro/mfgtools/master/LICENSE;subdir=${BP};name=license \
"
SRC_URI[linuxbin.sha256sum] = "75385372ec89adae666c42305d5b7a428f0fe7e3b4762276db8ecba70e48ef6a"
SRC_URI[windowsbin.sha256sum] = "15331892a4fdf2b372fe55c9e8f8b504f7bbafcff2d7cf8a10cd6ccead4b7aa3"
SRC_URI[license.sha256sum] = "cc8d47f7b9260f6669ecd41c24554c552f17581d81ee8fc602c6d23edb8bf495"
inherit bin_package
inherit deploy
# To prevent unexpected behaviour, native must be included last.
inherit native
INSANE_SKIP:${PN} += "already-stripped"
do_deploy() {
install -d ${DEPLOYDIR}/
install -m 0755 ${S}/uuu ${DEPLOYDIR}/uuu
install -m 0755 ${S}/uuu.exe ${DEPLOYDIR}/uuu.exe
}
addtask do_deploy after do_install
# We do not install anything to the root file system
ALLOW_EMPTY:${PN} = "1"
SUMMARY = "SECO Northern Europe uuu scripts for initial commissioning"
HOMEPAGE = "https://www.seco.com"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
SRC_URI = " \
file://uuu.lst;subdir=${BP} \
file://uuu-mx6.lst;subdir=${BP} \
"
inherit deploy kernel-artifact-names
DEPENDS = "uuu-native"
do_deploy() {
bberror "MACHINE specific do_deploy override function is not found. Make sure MACHINE is suppoerted."
}
do_deploy:mx8() {
if test -n "${KERNEL_DEVICETREE}"; then
for DTB in ${KERNEL_DEVICETREE}; do
ext="${DTB##*.}"
if [ $ext = 'dtb' ];then
DTB_BASE_NAME=$(basename ${DTB} .dtb)
# Generate .sh files based on different DTB files
cat > uuu-${DTB_BASE_NAME}.sh <<EOF
#!/bin/sh
UUU=\$(which uuu 2>/dev/null)
if [ -z "\$UUU" ];then
UUU="\$(dirname "\$0")/uuu"
fi
\$UUU -d -b uuu.lst imx-boot ${KERNEL_IMAGETYPE}-${KERNEL_IMAGE_LINK_NAME}${KERNEL_IMAGE_BIN_EXT} ${DTB_BASE_NAME}.dtb fngsystem-image-${MACHINE}.cpio.gz
EOF
# Generate Windows .bat files based on different DTB files
cat > uuu-${DTB_BASE_NAME}.bat <<EOF
.\uuu.exe -d -b uuu.lst imx-boot ${KERNEL_IMAGETYPE}-${KERNEL_IMAGE_LINK_NAME}${KERNEL_IMAGE_BIN_EXT} ${DTB_BASE_NAME}.dtb fngsystem-image-${MACHINE}.cpio.gz
EOF
fi
done
fi
install -d ${DEPLOYDIR}/
install -m 0755 ${S}/uuu.lst ${DEPLOYDIR}/uuu.lst
install -m 0755 ${S}/uuu-*.sh ${DEPLOYDIR}/
install -m 0755 ${S}/uuu-*.bat ${DEPLOYDIR}/
}
do_deploy:mx6() {
if test -n "${KERNEL_DEVICETREE}"; then
for DTB in ${KERNEL_DEVICETREE}; do
ext="${DTB##*.}"
if [ $ext = 'dtb' ];then
DTB_BASE_NAME=$(basename ${DTB} .dtb)
# Generate .sh files based on different DTB files
cat > uuu-${DTB_BASE_NAME}.sh <<EOF
#!/bin/sh
FNGSYSTEM_SIZE=\$(stat -c "%s" "\$(realpath fngsystem-image-${MACHINE}.cpio.gz)")
echo "exec -b 0x10010000 -r 0x13C00000 -s \$FNGSYSTEM_SIZE \"console=ttymxc0,115200 root=/dev/ram0 rootfstype=ramfs rdinit=/sbin/init cma=0 fngsystem=mfg\"" > fngboot-mx6.cfg
cat ${KERNEL_IMAGETYPE}-${KERNEL_IMAGE_LINK_NAME}${KERNEL_IMAGE_BIN_EXT} ${DTB_BASE_NAME}.dtb > linuximage
UUU=\$(which uuu 2>/dev/null)
if [ -z "\$UUU" ];then
UUU="\$(dirname "\$0")/uuu"
fi
\$UUU -d -b uuu-mx6.lst u-boot.imx fngboot-mx6.cfg linuximage fngsystem-image-${MACHINE}.cpio.gz
EOF
# Generate Windows .bat files based on different DTB files
cat > uuu-${DTB_BASE_NAME}.bat <<EOF
SET "filename=fngsystem-image-${MACHINE}.cpio.gz"
FOR %%A IN (%filename%) DO ECHO exec -b 0x10010000 -r 0x13C00000 -s %%~zA > fngboot-mx6.cfg
ECHO "console=ttymxc0,115200 root=/dev/ram0 rootfstype=ramfs rdinit=/sbin/init cma=0 fngsystem=mfg" >> fngboot-mx6.cfg
COPY /B ${KERNEL_IMAGETYPE}-${KERNEL_IMAGE_LINK_NAME}${KERNEL_IMAGE_BIN_EXT} + ${DTB_BASE_NAME}.dtb linuximage
.\uuu.exe -d -b uuu-mx6.lst u-boot.imx fngboot-mx6.cfg linuximage fngsystem-image-${MACHINE}.cpio.gz
EOF
fi
done
fi
install -d ${DEPLOYDIR}/
install -m 0755 ${S}/uuu-mx6.lst ${DEPLOYDIR}/uuu-mx6.lst
install -m 0755 ${S}/uuu-*.sh ${DEPLOYDIR}/
install -m 0755 ${S}/uuu-*.bat ${DEPLOYDIR}/
}
addtask do_deploy after do_install
# We do not install anything to the root file system
ALLOW_EMPTY:${PN} = "1"
uuu_version 1.4.43
# arguments for uuu script:
# @_fngboot | FNG-Boot Image
# @_bootcfg | FNG-Boot boot script
# @_image | Combined Linux Image (kernel + dtb)
# @_initramfs | FNG-System initramfs
SDP: write -f _fngboot -ivt 0
SDP: jump -f _fngboot
SDP: write -f _bootcfg -addr 0x10000000
SDP: write -f _image -addr 0x1000FFC0
SDP: write -f _initramfs -addr 0x13C00000
SDP: boot -f _fngboot
SDP: done
# Run this script with uuu -b tanaro.lst imx-boot Image guf-tanaro-fg0700w0dsswagl1.dtb fngsystem-image-seco-mx8mm.cpio.gz
#uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.43-5-ga0b566d
uuu_version 1.4.43
# arguments for uuu script:
# @_uboot | U/Boot image (with SPL and Fastboot)
# @_image | Linux kernel image
# @_dtb | DTB
# @_initramfs | initramfs
# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f _uboot
# This command will be run when i.MX8MP
SDPS: boot -f _uboot
# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f _uboot -skipspl -addr 0x42000000
SDPV: jump -addr 0x42000000
SDPV: delay 2000
# Not assuming u-boot settings, set to defaults
# (on imx8mp they are not available yet)
# fdt_addr=0x43000000
# initrd_addr=0x43800000
# loadaddr=0x40480000
FB: ucmd setenv fdt_addr 0x43000000
FB: ucmd setenv initrd_addr 0x43800000
FB: ucmd setenv loadaddr 0x40480000
FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f _image
FB: ucmd setenv fastboot_buffer ${fdt_addr}
FB: download -f _dtb
FB: ucmd setenv fastboot_buffer ${initrd_addr}
FB: download -f _initramfs
FB: ucmd setenv bootargs "console=ttymxc0,115200 root=/dev/ram0 rootfstype=ramfs rdinit=/sbin/init cma=64M os=fngsystem vt.global_cursor_default=0 vt.color=0xF7 fbcon=logo-pos:center,logo-count:1,rotate:0"
FB: acmd booti ${loadaddr} ${initrd_addr}:${fastboot_bytes} ${fdt_addr}
FB: done
# }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment