System device tree, AMD EDF, custom board
Dear All,
I am currently updating my workflow to move to Scarthgap.
The issue I am facing is related to the fact that I use a system device tree generated by sdtgen from my XSA design than I use genmachine-conf to create the configuration files and set my machine name. Now is the pickle for me. I don't know how to add a device tree specification that is related to my custom board (and not to the FPGA and the design itself, e.g. a device connected to an i2c bus defined in the PL). If I add it as I was doing it before, it doesn't find the labels that are defined in the PL part of my design and only focuses on the one accessible by the PS part.
Any help, pointers, would be greatly appreciated !
Thanks,
Pi-r
Quoted 14 lines · pierre.daye via lists.yoctoproject.org
Dear All,
I am currently updating my workflow to move to Scarthgap.
The issue I am facing is related to the fact that I use a system device tree generated by sdtgen from my XSA design than I use genmachine-conf to create the configuration files and set my machine name.
Now is the pickle for me. I don't know how to add a device tree specification that is related to my custom board (and not to the FPGA and the design itself, e.g. a device connected to an i2c bus defined in the PL). If I add it as I was doing it before, it doesn't find the labels that are defined in the PL part of my design and only focuses on the one accessible by the PS part.
Quoted 7 lines
Any help, pointers, would be greatly appreciated !
Thanks,
Pi-r
Hello, Pierre
Here is my proposal (maybe there is a better way :) )
I've created custom layer let's call it meta-my-custom-board with "bitbake-layers create-layer -a ..." and put device-tree.bbappend here
meta-my-custom-board
├── conf
│ └── layer.conf
├── COPYING.MIT
├── README
└── recipes-bsp
└── device-tree
├── device-tree.bbappend
└── files
├── custom_device.dtsi <----------- here just list of /include/
"... below dtsi ..."
├── one.dtsi
├── two.dtsi
└── three.dtsiIn custom bbappend I've customized do_configure to append main dtsi to linux dts
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"SYSTEM_USER_DTSI ?= "custom_device.dtsi"
SRC_URI:append = " file://${SYSTEM_USER_DTSI}"
SRC_URI:append = " file://one.dtsi"
SRC_URI:append = " file://two.dtsi"
TARGET_DTS_MODIFY ?= "cortexa53-linux.dts"
do_configure:append() {
set -xe
echo "Running do_configure for ${MACHINE}..."
if [ -f ${S}/${TARGET_DTS_MODIFY} ]; then
if ! grep -q "/include/ \"${SYSTEM_USER_DTSI}\""
"${S}/${TARGET_DTS_MODIFY}"; then
echo "/include/ \"${SYSTEM_USER_DTSI}\"" >>${S}/${TARGET_DTS_MODIFY}
fi
fi
}
HTH,
Signature · 2 lines
Best Regards, Sergei Nikulov
Thanks Sergei,
The issue is that with the system device tree approach, there is a clear cut between the linux (from what I understand, interacts only with the cortex a53) and the logic part (related to the fpga). Your approach is ok as long as you don't have interactions between the two, which is exactly my target!
For example, I want to set the i2c devices that are connected to a i2c port linked to the logic part (aka FPGA) on my SoC.
This is where it is complicated for me to understand what I should do.
In the process described by AMD ( https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/3250586081/Development+Flows+-+How+it+all+works ), it remains unclear to me how I can define these points? Should I use an append to xilinx-bootbin or should I try to append it during the build of the image (as it was done previously).
Hello, Pierre
Yes, I've provided you with the way to modify dts for Linux. You should clarify exactly your issue.
Perhaps it is not related to yocto at all.
If we are talking about how to put PL bitstream - I've followed EDF instructions
Vivado (here you define your HW mappings for SDT) -> XSA file -> sdtgen -> SDT -> gen-machine-conf (yoctoproject starts here, AFAIU)
After that
bitbake xilinx-bootbin
put together bitstream + fsbl + pmufw + u-boot to boot.bin (you can verify what's inside with bootgen tool)
All the best,
Quoted 16 lines · pierre.daye via Lists.Yoctoproject.Org
Thanks Sergei,
The issue is that with the system device tree approach, there is a clear cut between the linux (from what I understand, interacts only with the cortex a53) and the logic part (related to the fpga).
Your approach is ok as long as you don't have interactions between the two, which is exactly my target!
For example, I want to set the i2c devices that are connected to a i2c port linked to the logic part (aka FPGA) on my SoC.
This is where it is complicated for me to understand what I should do. In the process described by AMD (
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/3250586081/Development+Flows+-+How+it+all+works),
it remains unclear to me how I can define these points? Should I use an append to xilinx-bootbin or should I try to append it during the build of the image (as it was done previously).
Signature · 2 lines
Best Regards, Sergei Nikulov
Hi Pierre,
I'm not an expert on this but have been going through the migration an older Petalinux to Scarthgap and SDTgen recently. If you find you don't get the right answers here you could also try posting on the meta-xilinx subgroup - they've helped me a lot before.
The answer may depend on how you are configuring your PL, is it as part of boot.bin or is it configured later in U-Boot/Linux? Relatedly do you have a single device tree for Linux with PS and PL parts in or is it split into two, a base device tree for PS and a device tree overlay for PL? (Do you supply the -g/--gen-pl-overlay argument to gen-machine-conf?)
In our case we have PL configured in U-boot, and use a device tree overlay for the PL applied after Linux has booted.
For extra bits we need in the PS/base device tree we use "set_dt_param -user_dts <path to dsti file>" in the tcl file we pass to sdtgen.
This doesn't work for nodes in the PL though - after discussing our situation with AMD we were advised to create a Yocto recipe which takes the pl.dtsi output of gen-machine-conf and combines it with our own dtsi for the extra parts, compiling it into a dtbo which we load via a systemd service as Linux starts.
Hope this helps a bit, happy to dig deeper if it sounds right for your situation.
Best Regards,
Phil Dawson
Hi Philip,
I found a solution that is aligned with what you just wrote.
The main point that I found that anything purely related to linux (with no interaction with the PL) can be attached to a traditional device-tree.bbappend recipe.
If you have something that is interacting with the PL (e.g. my drivers receive interrupts from the gic), then it needs to be provided through addition the stdgen with the -user_dts parameters.
For the moment, at least, it is building correctly. When I am decompiling the system.dtb found in boot partition [dtc -qqq -I dtb -O dts -o ${PWD}/tmp/device_tree.dts ${PWD}/tmp/system.dtb], I can see all my special nodes and the customisation I did, so I have some hope that everything will work fine :).
Thanks for the help,
Pierre