Skip to content

Commit

Permalink
open-amp: device-tree: Update Versal NET DTs
Browse files Browse the repository at this point in the history
In addition update device tree bbappend to mimic how QEMU DTs use overlays
and only update to EXTRA_OVERLAYS if the proper conditions are met

Signed-off-by: Ben Levinsky <[email protected]>
Signed-off-by: Mark Hatle <[email protected]>
  • Loading branch information
bentheredonethat authored and mhatle committed Apr 10, 2023
1 parent e16de8a commit fb5fa16
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ SRC_URI = " \
# openamp.dtsi is in the WORKDIR
DT_INCLUDE:append = " ${WORKDIR}"

do_configure:append() {
if ${@bb.utils.contains('DISTRO_FEATURES', 'openamp', ' true', 'false', d)} && [ "${ENABLE_OPENAMP_DTSI}" = "1" ]; then
if [ -e "${DT_FILES_PATH}/system-top.dts" ]; then
if [ -e "${WORKDIR}/${MACHINE}-openamp.dtsi" ]; then
sed -i '/${MACHINE}-openamp\.dtsi/d' ${DT_FILES_PATH}/system-top.dts
echo '/include/ "${MACHINE}-openamp.dtsi"' >> ${DT_FILES_PATH}/system-top.dts
elif [ -e "${WORKDIR}/${SOC_FAMILY}-openamp.dtsi" ]; then
sed -i '/${SOC_FAMILY}-openamp\.dtsi/d' ${DT_FILES_PATH}/system-top.dts
echo '/include/ "${SOC_FAMILY}-openamp.dtsi"' >> ${DT_FILES_PATH}/system-top.dts
else
bbfatal "${MACHINE}-openamp.dtsi or ${SOC_FAMILY}-openamp.dtsi file is not available. Cannot automatically add to system-top.dts."
fi
else
bbfatal "system-top.dts not found in this configuration, cannot automatically add OpenAmp device tree nodes (openamp.dtsi)"
fi
fi
}
do_configure[vardeps] += "ENABLE_OPENAMP_DTSI OPENAMP_EXTRA_OVERLAYS"

OPENAMP_EXTRA_OVERLAYS:zynq = "zynq-openamp.dtsi"
OPENAMP_EXTRA_OVERLAYS:zynqmp = "zynqmp-openamp.dtsi"
OPENAMP_EXTRA_OVERLAYS:versal = "versal-openamp.dtsi"
OPENAMP_EXTRA_OVERLAYS:versal-net = "versal-net-openamp.dtsi"

def set_openamp_extra_overlays(d):
distro_features = d.getVar('DISTRO_FEATURES', True)
enable_openamp_dtsi = d.getVar('ENABLE_OPENAMP_DTSI')
if 'openamp' in distro_features and enable_openamp_dtsi == '1':
return d.getVar('OPENAMP_EXTRA_OVERLAYS', True)
else:
return ''

EXTRA_OVERLAYS:append = "${@set_openamp_extra_overlays(d)}"
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@
reg = <0x0 0xeba00000 0x0 0x10000>;
status = "okay";
compatible = "mmio-sram";
power-domain = <&versal_firmware 0x183180cb>;
power-domain = <&versal_net_firmware 0x183180cb>;
};

tcm_0b: tcm_0b@eba10000 {
no-map;
reg = <0x0 0xeba10000 0x0 0x8000>;
status = "okay";
compatible = "mmio-sram";
power-domain = <&versal_firmware 0x183180cc>;
power-domain = <&versal_net_firmware 0x183180cc>;
};

tcm_0c: tcm_0b@eba20000 {
no-map;
reg = <0x0 0xeba20000 0x0 0x8000>;
status = "okay";
compatible = "mmio-sram";
power-domain = <&versal_firmware 0x183180cd>;
power-domain = <&versal_net_firmware 0x183180cd>;
};

r52ss {
Expand All @@ -68,7 +68,7 @@
ranges;
sram = <&tcm_0a>, <&tcm_0b>, <&tcm_0c>;
memory-region = <&rproc_0_reserved>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
power-domain = <&versal_firmware 0x181100BF>;
power-domain = <&versal_net_firmware 0x181100BF>;
mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
mbox-names = "tx", "rx";
};
Expand Down

0 comments on commit fb5fa16

Please sign in to comment.