diff options
| author | Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com> | 2021-09-21 08:30:57 -0600 |
|---|---|---|
| committer | Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> | 2021-09-28 08:21:41 -0700 |
| commit | 412e8cb294fae5ef69422d31cd7c6606d0dfc8dc (patch) | |
| tree | fc0ca9ca2eaf4175a222b4a27a7c4e4f80b9be0c | |
| parent | 82b6663debca03a95e8259b8a1e78faa13fc8a26 (diff) | |
| download | meta-xilinx-412e8cb294fae5ef69422d31cd7c6606d0dfc8dc.tar.gz | |
meta-xilinx-setup: Add overlay dt generation support
This patch adds support to generate overly dt file.
The lopper assist file, which is "xlnx_overlaydt" will get called by this
dt-processor.sh script based on the arguments passed.
Ex: dt-processor.sh <system dts file> overlay_dtb full
With the above command it generates pl.dtsi file with overlay syntax and
compiles the pl.dtsi and generates pl.dtbo.
It also takes additional argument as external_fpga. As there is no partial
support in versal, and we generate external_fpga dt property to apply overlay
with out loading the bit file.
There is no impact in the default flow, because the overlay support will
come into picture with overlay_dtb argument.
Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
| -rwxr-xr-x | meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh index 5d1118ff..06df3e4b 100755 --- a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh +++ b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh | |||
| @@ -2,10 +2,12 @@ | |||
| 2 | 2 | ||
| 3 | if [ $# -lt 2 ]; then | 3 | if [ $# -lt 2 ]; then |
| 4 | echo "Usage:" | 4 | echo "Usage:" |
| 5 | echo " $0 <conf_dir> <system_dtb> [<machine_type>]" | 5 | echo " $0 <conf_dir> <system_dtb> [<overlay_dtb>] [<external_fpga>] [<machine_type>]" |
| 6 | echo | 6 | echo |
| 7 | echo " conf_dir - location for the build conf directory" | 7 | echo " conf_dir - location for the build conf directory" |
| 8 | echo " system_dtb - Full patch to the system dtb" | 8 | echo " system_dtb - Full patch to the system dtb" |
| 9 | echo " overlay_dtb - To generate overlay dts" | ||
| 10 | echo " external_fpga - Flag to apply partial overlay" | ||
| 9 | echo " machine_type - zynq, zynqmp or versal" | 11 | echo " machine_type - zynq, zynqmp or versal" |
| 10 | echo | 12 | echo |
| 11 | exit 1 | 13 | exit 1 |
| @@ -23,8 +25,22 @@ if [ ! -f $2 ]; then | |||
| 23 | fi | 25 | fi |
| 24 | dtb=$2 | 26 | dtb=$2 |
| 25 | 27 | ||
| 26 | # We'll autodetect if blank (later) | 28 | # Default is no overlay |
| 27 | machine=$3 | 29 | overlay_dtb=false |
| 30 | external_fpga=false | ||
| 31 | if [ ! -f $3 ]; then | ||
| 32 | if [ ! -f $4 ]; then | ||
| 33 | overlay_dtb=true | ||
| 34 | external_fpga=true | ||
| 35 | machine=$5 | ||
| 36 | else | ||
| 37 | overlay_dtb=true | ||
| 38 | machine=$4 | ||
| 39 | fi | ||
| 40 | else | ||
| 41 | # We'll autodetect if blank (later) | ||
| 42 | machine=$3 | ||
| 43 | fi | ||
| 28 | 44 | ||
| 29 | lopper=$(which lopper.py) | 45 | lopper=$(which lopper.py) |
| 30 | 46 | ||
| @@ -69,7 +85,16 @@ cortex_a53_linux() { | |||
| 69 | fi | 85 | fi |
| 70 | 86 | ||
| 71 | mkdir -p dtb | 87 | mkdir -p dtb |
| 72 | (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-a53-imux.dts -i ${lops_dir}/lop-domain-linux-a53.dts ${dtb} ${dtb_file} && rm -f lop-a53-imux.dts.dtb lop-domain-linux-a53.dts.dtb) | 88 | # Check if it is overlay dts otherwise just create linux dtb |
| 89 | if [ ${overlay_dtb} = "true" ]; then | ||
| 90 | if [ ${external_fpga} = "true" ]; then | ||
| 91 | (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f ${dtb} -- xlnx_overlay_dt ${machine} full; dtc -q -O dtb -o pl.dtbo -b 0 -@ pl.dtsi && rm -f pl.dtsi) | ||
| 92 | else | ||
| 93 | (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py ${dtb} -- xlnx_overlay_dt ${machine} partial ; dtc -q -O dtb -o pl.dtbo -b 0 -@ pl.dtsi && rm -f pl.dtsi) | ||
| 94 | fi | ||
| 95 | else | ||
| 96 | (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-a53-imux.dts -i ${lops_dir}/lop-domain-linux-a53.dts ${dtb} ${dtb_file} && rm -f lop-a53-imux.dts.dtb lop-domain-linux-a53.dts.dtb) | ||
| 97 | fi | ||
| 73 | 98 | ||
| 74 | cat << EOF > ${conf_file} | 99 | cat << EOF > ${conf_file} |
| 75 | CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" | 100 | CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" |
| @@ -186,7 +211,19 @@ cortex_a72_linux() { | |||
| 186 | fi | 211 | fi |
| 187 | 212 | ||
| 188 | mkdir -p dtb | 213 | mkdir -p dtb |
| 214 | # Check if it is overlay dts otherwise just create linux dtb | ||
| 215 | if [ ${overlay_dtb} = "true" ]; then | ||
| 216 | # As there is no partial support on Versal, As per fpga manager implementatin there is a flag "external_fpga" which says | ||
| 217 | # apply overlay without loading the bit file. | ||
| 218 | if [ ${external_fpga} = "true" ]; then | ||
| 219 | (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f ${dtb} -- xlnx_overlay_dt ${machine} full external_fpga ; dtc -q -O dtb -o pl.dtbo -b 0 -@ pl.dtsi && rm -f pl.dtsi) | ||
| 220 | else | ||
| 221 | # If there is no external_fpga flag, then the default is full | ||
| 222 | (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py ${dtb} -- xlnx_overlay_dt ${machine} full ; dtc -q -O dtb -o pl.dtbo -b 0 -@ pl.dtsi && rm -f pl.dtsi) | ||
| 223 | fi | ||
| 224 | else | ||
| 189 | (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-a72-imux.dts -i ${lops_dir}/lop-domain-a72.dts ${dtb} ${dtb_file} && rm -f lop-a72-imux.dts.dtb lop-domain-a72.dts.dtb) | 225 | (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-a72-imux.dts -i ${lops_dir}/lop-domain-a72.dts ${dtb} ${dtb_file} && rm -f lop-a72-imux.dts.dtb lop-domain-a72.dts.dtb) |
| 226 | fi | ||
| 190 | 227 | ||
| 191 | cat << EOF > ${conf_file} | 228 | cat << EOF > ${conf_file} |
| 192 | CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" | 229 | CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" |
