Commit cfa9c097 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

merged with rocko

parent 69cc54a1
...@@ -6,11 +6,21 @@ MACHINE_DEVICETREE ?= "elphel393.dts" ...@@ -6,11 +6,21 @@ MACHINE_DEVICETREE ?= "elphel393.dts"
COMPATIBLE_MACHINE_elphel393 = ".*" COMPATIBLE_MACHINE_elphel393 = ".*"
# include all
# MACHINE_DEVICETREE - in case something new is added
SRC_URI += "file://${MACHINE_DEVICETREE} \ SRC_URI += "file://${MACHINE_DEVICETREE} \
file://elphel393_4_mt9p006.dts \
file://elphel393_4_mt9f002.dts \
file://elphel393_4_lepton35.dts \
file://elphel393_eyesis.dts \
file://elphel393_eyesis_bottom2.dts \
file://elphel393-zynq-base.dtsi \ file://elphel393-zynq-base.dtsi \
file://elphel393-common.dtsi \
file://elphel393-bootargs-mmc.dtsi \ file://elphel393-bootargs-mmc.dtsi \
file://elphel393-bootargs-nand.dtsi \ file://elphel393-bootargs-nand.dtsi \
file://elphel393-bootargs-ram.dtsi \ file://elphel393-bootargs-ram.dtsi \
file://elphel393-revision-rev0-B.dtsi \
file://elphel393-revision-revC.dtsi \
" "
do_deploy(){ do_deploy(){
...@@ -38,41 +48,90 @@ do_deploy(){ ...@@ -38,41 +48,90 @@ do_deploy(){
done done
} }
# full sub python do_deploy(){
do_compile() {
if test -n "${MACHINE_DEVICETREE}"; then import shutil
mkdir -p ${WORKDIR}/devicetree
for i in ${MACHINE_DEVICETREE}; do B = d.getVar('B', True)
if test -e ${WORKDIR}/$i; then DEPLOY_DIR_IMAGE = d.getVar('DEPLOY_DIR_IMAGE', True)
echo cp ${WORKDIR}/$i ${WORKDIR}/devicetree MACHINE_DEVICETREE = d.getVar('MACHINE_DEVICETREE', True)
cp ${WORKDIR}/$i ${WORKDIR}/devicetree PRODUCTION_DEVICETREE = d.getVar('PRODUCTION_DEVICETREE', True)
cp ${WORKDIR}/*.dtsi ${WORKDIR}/devicetree PRODUCTION_ROOT_LOCATION = d.getVar('PRODUCTION_ROOT_LOCATION', True)
fi
done DTS_NAME = os.path.splitext(MACHINE_DEVICETREE)[0]
fi BOARD_DEFAULT_REVISION = "revC"
for DTS_FILE in ${S}/devicetree/*.dts; do dtb_dir_path = os.path.join(DEPLOY_DIR_IMAGE,"dtb")
DTS_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'` os.makedirs(dtb_dir_path,exist_ok=True)
for RLOC in ${PRODUCTION_ROOT_LOCATION}; do for f in os.listdir(B):
ln -sf ${WORKDIR}/devicetree/elphel393-bootargs-${RLOC}.dtsi ${WORKDIR}/devicetree/elphel393-bootargs.dtsi shutil.copyfile(os.path.join(B,f),os.path.join(dtb_dir_path,f))
dtc -I dts -O dtb ${DEVICETREE_FLAGS} -o ${DTS_NAME}_${RLOC}.dtb ${DTS_FILE}
done for RLOC in PRODUCTION_ROOT_LOCATION.split():
done
if not DTS_NAME.startswith("elphel393_eyesis"):
dtb_name = DTS_NAME+"_"+BOARD_DEFAULT_REVISION+"_"+RLOC+".dtb"
dtb_path = os.path.join(B,dtb_name)
dtb_build_path = os.path.join(DEPLOY_DIR_IMAGE,dtb_name)
rloc_path = os.path.join(DEPLOY_DIR_IMAGE,RLOC)
dtb_deploy_path = os.path.join(rloc_path,PRODUCTION_DEVICETREE)
if not os.path.exists(dtb_path):
print("Warning: "+dtb_path+" is not available")
os.system("install -d "+DEPLOY_DIR_IMAGE)
os.system("install -m 0644 "+dtb_path+" "+dtb_build_path)
os.makedirs(rloc_path,exist_ok=True)
shutil.copyfile(dtb_build_path,dtb_deploy_path)
print("Deployed "+dtb_deploy_path)
} }
# full sub python do_compile(){
do_install() {
for DTS_FILE in ${S}/devicetree/*.dts; do WORKDIR = d.getVar('WORKDIR', True)
DTS_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'` PRODUCTION_ROOT_LOCATION = d.getVar('PRODUCTION_ROOT_LOCATION', True)
for RLOC in ${PRODUCTION_ROOT_LOCATION}; do DEVICETREE_FLAGS = d.getVar('DEVICETREE_FLAGS', True)
if [ ! -f ${B}/${DTS_NAME}_${RLOC}.dtb ]; then
echo "Warning: ${DTS_NAME}_${RLOC}.dtb is not available!" for f in os.listdir(WORKDIR):
continue if f.endswith(".dts"):
fi
install -d ${D}/boot/devicetree DTS_NAME = os.path.splitext(f)[0]
install -m 0644 ${B}/${DTS_NAME}_${RLOC}.dtb ${D}/boot/devicetree/${DTS_NAME}_${RLOC}.dtb eyesis = False
done
done print("Found dts file: "+f)
if f.startswith("elphel393_eyesis"):
print("Device tree type: Eyesis4Pi 393 (panoramic camera)")
eyesis = True
else:
print("Device tree type: 10393 (regular)")
if not eyesis:
for RLOC in PRODUCTION_ROOT_LOCATION.split():
os.system("ln -sf "+WORKDIR+"/elphel393-bootargs-"+RLOC+".dtsi "+WORKDIR+"/elphel393-bootargs.dtsi")
for REV in ["rev0-B","revC"]:
os.system("ln -sf "+WORKDIR+"/elphel393-revision-"+REV+".dtsi "+WORKDIR+"/elphel393-revision.dtsi")
os.system("dtc -I dts -O dtb "+DEVICETREE_FLAGS+" -o "+DTS_NAME+"_"+REV+"_"+RLOC+".dtb "+f)
else:
for RLOC in PRODUCTION_ROOT_LOCATION.split():
os.system("dtc -I dts -O dtb "+DEVICETREE_FLAGS+" -o "+DTS_NAME+"_"+RLOC+".dtb "+f)
}
python do_install(){
B = d.getVar('B', True)
D = d.getVar('D', True)
os.system("install -d "+D+"/boot/devicetree")
for f in os.listdir(B):
if not f.startswith("elphel393_eyesis"):
src = B+"/"+f
dst = D+"/boot/devicetree/"+f
os.system("install -m 0644 "+src+" "+dst)
} }
REMOTE_USER ??= "root" REMOTE_USER ??= "root"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment