2011-02-09 05:45:23 +00:00
|
|
|
# Support for device tree generation
|
2011-02-11 10:27:22 +00:00
|
|
|
FILES_kernel-devicetree = "/boot/devicetree*"
|
2011-02-09 05:45:23 +00:00
|
|
|
KERNEL_DEVICETREE_FLAGS = "-R 8 -p 0x3000"
|
|
|
|
|
|
|
|
python __anonymous () {
|
2012-03-03 10:59:25 +00:00
|
|
|
devicetree = d.getVar("KERNEL_DEVICETREE", True) or ''
|
2011-02-09 05:45:23 +00:00
|
|
|
if devicetree:
|
2012-03-03 10:59:25 +00:00
|
|
|
depends = d.getVar("DEPENDS", True)
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
d.setVar("DEPENDS", "%s dtc-native" % depends)
|
2012-03-03 10:59:25 +00:00
|
|
|
packages = d.getVar("PACKAGES", True)
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
d.setVar("PACKAGES", "%s kernel-devicetree" % packages)
|
2011-02-09 05:45:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_install_append() {
|
|
|
|
if test -n "${KERNEL_DEVICETREE}"; then
|
2012-06-26 03:53:16 +00:00
|
|
|
for DTS_FILE in ${KERNEL_DEVICETREE}; do
|
|
|
|
if [ ! -f ${DTS_FILE} ]; then
|
|
|
|
echo "Warning: ${DTS_FILE} is not available!"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
|
|
|
|
DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
|
|
|
|
DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
|
|
|
|
dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o ${DTS_BASE_NAME} ${DTS_FILE}
|
|
|
|
install -m 0644 ${DTS_BASE_NAME} ${D}/boot/devicetree-${DTB_SYMLINK_NAME}.dtb
|
|
|
|
done
|
2011-02-09 05:45:23 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2012-06-26 03:53:16 +00:00
|
|
|
do_deploy_append() {
|
|
|
|
if test -n "${KERNEL_DEVICETREE}"; then
|
|
|
|
for DTS_FILE in ${KERNEL_DEVICETREE}; do
|
|
|
|
if [ ! -f ${DTS_FILE} ]; then
|
|
|
|
echo "Warning: ${DTS_FILE} is not available!"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
|
|
|
|
DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
|
|
|
|
DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
|
|
|
|
install -d ${DEPLOYDIR}
|
|
|
|
install -m 0644 ${B}/${DTS_BASE_NAME} ${DEPLOYDIR}/${DTB_NAME}.dtb
|
|
|
|
cd ${DEPLOYDIR}
|
|
|
|
ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
|
|
|
|
cd -
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
}
|