Skip to content

Commit fb5fa16

Browse files
bentheredonethatmhatle
authored andcommitted
open-amp: device-tree: Update Versal NET DTs
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 <ben.levinsky@amd.com> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
1 parent e16de8a commit fb5fa16

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/device-tree.bbappend

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ SRC_URI = " \
1010
# openamp.dtsi is in the WORKDIR
1111
DT_INCLUDE:append = " ${WORKDIR}"
1212

13-
do_configure:append() {
14-
if ${@bb.utils.contains('DISTRO_FEATURES', 'openamp', ' true', 'false', d)} && [ "${ENABLE_OPENAMP_DTSI}" = "1" ]; then
15-
if [ -e "${DT_FILES_PATH}/system-top.dts" ]; then
16-
if [ -e "${WORKDIR}/${MACHINE}-openamp.dtsi" ]; then
17-
sed -i '/${MACHINE}-openamp\.dtsi/d' ${DT_FILES_PATH}/system-top.dts
18-
echo '/include/ "${MACHINE}-openamp.dtsi"' >> ${DT_FILES_PATH}/system-top.dts
19-
elif [ -e "${WORKDIR}/${SOC_FAMILY}-openamp.dtsi" ]; then
20-
sed -i '/${SOC_FAMILY}-openamp\.dtsi/d' ${DT_FILES_PATH}/system-top.dts
21-
echo '/include/ "${SOC_FAMILY}-openamp.dtsi"' >> ${DT_FILES_PATH}/system-top.dts
22-
else
23-
bbfatal "${MACHINE}-openamp.dtsi or ${SOC_FAMILY}-openamp.dtsi file is not available. Cannot automatically add to system-top.dts."
24-
fi
25-
else
26-
bbfatal "system-top.dts not found in this configuration, cannot automatically add OpenAmp device tree nodes (openamp.dtsi)"
27-
fi
28-
fi
29-
}
13+
do_configure[vardeps] += "ENABLE_OPENAMP_DTSI OPENAMP_EXTRA_OVERLAYS"
14+
15+
OPENAMP_EXTRA_OVERLAYS:zynq = "zynq-openamp.dtsi"
16+
OPENAMP_EXTRA_OVERLAYS:zynqmp = "zynqmp-openamp.dtsi"
17+
OPENAMP_EXTRA_OVERLAYS:versal = "versal-openamp.dtsi"
18+
OPENAMP_EXTRA_OVERLAYS:versal-net = "versal-net-openamp.dtsi"
19+
20+
def set_openamp_extra_overlays(d):
21+
distro_features = d.getVar('DISTRO_FEATURES', True)
22+
enable_openamp_dtsi = d.getVar('ENABLE_OPENAMP_DTSI')
23+
if 'openamp' in distro_features and enable_openamp_dtsi == '1':
24+
return d.getVar('OPENAMP_EXTRA_OVERLAYS', True)
25+
else:
26+
return ''
27+
28+
EXTRA_OVERLAYS:append = "${@set_openamp_extra_overlays(d)}"

meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/versal-net-openamp.dtsi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@
3535
reg = <0x0 0xeba00000 0x0 0x10000>;
3636
status = "okay";
3737
compatible = "mmio-sram";
38-
power-domain = <&versal_firmware 0x183180cb>;
38+
power-domain = <&versal_net_firmware 0x183180cb>;
3939
};
4040

4141
tcm_0b: tcm_0b@eba10000 {
4242
no-map;
4343
reg = <0x0 0xeba10000 0x0 0x8000>;
4444
status = "okay";
4545
compatible = "mmio-sram";
46-
power-domain = <&versal_firmware 0x183180cc>;
46+
power-domain = <&versal_net_firmware 0x183180cc>;
4747
};
4848

4949
tcm_0c: tcm_0b@eba20000 {
5050
no-map;
5151
reg = <0x0 0xeba20000 0x0 0x8000>;
5252
status = "okay";
5353
compatible = "mmio-sram";
54-
power-domain = <&versal_firmware 0x183180cd>;
54+
power-domain = <&versal_net_firmware 0x183180cd>;
5555
};
5656

5757
r52ss {
@@ -68,7 +68,7 @@
6868
ranges;
6969
sram = <&tcm_0a>, <&tcm_0b>, <&tcm_0c>;
7070
memory-region = <&rproc_0_reserved>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
71-
power-domain = <&versal_firmware 0x181100BF>;
71+
power-domain = <&versal_net_firmware 0x181100BF>;
7272
mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
7373
mbox-names = "tx", "rx";
7474
};

0 commit comments

Comments
 (0)