summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/rcw/rcw_git.bb
blob: 39e5a8413260e6a9e7f6cfe9f812f6a413276b8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
SUMMARY = "Reset Configuration Word"
DESCRIPTION = "Reset Configuration Word - hardware boot-time parameters for the QorIQ targets"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=be7e0b2ce5a7a1f4f25a6d82cec1f47d"

DEPENDS += "change-file-endianess-native tcl-native"

inherit deploy siteinfo

SRC_URI = "git://github.com/qoriq-open-source/rcw.git;nobranch=1"
SRCREV = "43c79c98d706a13572864bb4554df78c4fc24fe7"

S = "${WORKDIR}/git"

export PYTHON = "${USRBINPATH}/python2"

M="${@d.getVar('MACHINE', True).replace('-64b','').replace('-32b','').replace('-${SITEINFO_ENDIANNESS}','')}"

do_install () {
    if [ -f ${S}/${M}/Makefile ]; then
        oe_runmake BOARDS=${M} DESTDIR=${D}/boot/rcw/ install
    else
        install -d ${D}/boot/rcw
        cp -a ${S}/${M} ${D}/boot/rcw/
        chown -R root:root ${D}
    fi
    for f in `find ${D}/boot/rcw/ -name "*qspiboot*"`;do
        if echo $f |grep -q "qspiboot_sben"; then
            continue
        fi
        f_swap=`echo $f |sed -e 's/qspiboot/qspiboot_swap/'`
        tclsh ${STAGING_BINDIR_NATIVE}/byte_swap.tcl $f $f_swap 8
        mv -f $f_swap $f
    done
}

do_deploy () {
    install -d ${DEPLOYDIR}/rcw
    cp -r ${D}/boot/rcw/* ${DEPLOYDIR}/rcw/
}
addtask deploy after do_install

PACKAGES += "${PN}-image"
FILES_${PN}-image += "/boot"

COMPATIBLE_MACHINE = "(qoriq)"
PACKAGE_ARCH = "${MACHINE_ARCH}"