diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2023-01-13 18:14:54 -0800 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2023-01-16 07:26:08 -0800 |
| commit | 6ced1c74369eba9b588781c4732cfe68f545a7e3 (patch) | |
| tree | 39b9d628ed2576d9e7b36f802dc3ecfcb5656800 | |
| parent | df1e0ba1c2b70fac570de53b80eb7eea99a7fdae (diff) | |
| download | meta-xilinx-6ced1c74369eba9b588781c4732cfe68f545a7e3.tar.gz | |
xilinx-lops.bb: Add lop-machine-name.dts
Add a new lop that will pull out the model and machine name.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
| -rw-r--r-- | meta-xilinx-core/recipes-kernel/lopper/xilinx-lops.bb | 2 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-kernel/lopper/xilinx-lops/lop-machine-name.dts | 43 |
2 files changed, 45 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-kernel/lopper/xilinx-lops.bb b/meta-xilinx-core/recipes-kernel/lopper/xilinx-lops.bb index 38ec473b..1dc5dc29 100644 --- a/meta-xilinx-core/recipes-kernel/lopper/xilinx-lops.bb +++ b/meta-xilinx-core/recipes-kernel/lopper/xilinx-lops.bb | |||
| @@ -8,6 +8,7 @@ RDEPENDS:${PN} += "lopper" | |||
| 8 | SRC_URI = " \ | 8 | SRC_URI = " \ |
| 9 | file://lop-microblaze-yocto.dts \ | 9 | file://lop-microblaze-yocto.dts \ |
| 10 | file://lop-xilinx-id-cpus.dts \ | 10 | file://lop-xilinx-id-cpus.dts \ |
| 11 | file://lop-machine-name.dts \ | ||
| 11 | " | 12 | " |
| 12 | 13 | ||
| 13 | LIC_FILES_CHKSUM = "file://lop-microblaze-yocto.dts;endline=8;md5=a0e89d39fa397ec5d5320409ff701280" | 14 | LIC_FILES_CHKSUM = "file://lop-microblaze-yocto.dts;endline=8;md5=a0e89d39fa397ec5d5320409ff701280" |
| @@ -23,6 +24,7 @@ do_install() { | |||
| 23 | mkdir -p ${D}/${PYTHON_SITEPACKAGES_DIR}/lopper/lops | 24 | mkdir -p ${D}/${PYTHON_SITEPACKAGES_DIR}/lopper/lops |
| 24 | cp ${S}/lop-microblaze-yocto.dts ${D}/${PYTHON_SITEPACKAGES_DIR}/lopper/lops/. | 25 | cp ${S}/lop-microblaze-yocto.dts ${D}/${PYTHON_SITEPACKAGES_DIR}/lopper/lops/. |
| 25 | cp ${S}/lop-xilinx-id-cpus.dts ${D}/${PYTHON_SITEPACKAGES_DIR}/lopper/lops/. | 26 | cp ${S}/lop-xilinx-id-cpus.dts ${D}/${PYTHON_SITEPACKAGES_DIR}/lopper/lops/. |
| 27 | cp ${S}/lop-machine-name.dts ${D}/${PYTHON_SITEPACKAGES_DIR}/lopper/lops/. | ||
| 26 | } | 28 | } |
| 27 | 29 | ||
| 28 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}/lopper/lops" | 30 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}/lopper/lops" |
diff --git a/meta-xilinx-core/recipes-kernel/lopper/xilinx-lops/lop-machine-name.dts b/meta-xilinx-core/recipes-kernel/lopper/xilinx-lops/lop-machine-name.dts new file mode 100644 index 00000000..11f0b604 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/lopper/xilinx-lops/lop-machine-name.dts | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * Author: | ||
| 5 | * Mark Hatle <mark.hatle@amd.com> | ||
| 6 | * | ||
| 7 | * SPDX-License-Identifier: BSD-3-Clause | ||
| 8 | */ | ||
| 9 | |||
| 10 | /dts-v1/; | ||
| 11 | |||
| 12 | / { | ||
| 13 | compatible = "system-device-tree-v1,lop"; | ||
| 14 | lops { | ||
| 15 | compatible = "system-device-tree-v1,lop"; | ||
| 16 | track_feature: track_feature { | ||
| 17 | compatible = "system-device-tree-v1,lop,code-v1"; | ||
| 18 | noexec; | ||
| 19 | code = " | ||
| 20 | # print( 'track: lopper library routine: %s' % node ) | ||
| 21 | try: | ||
| 22 | node.tunes[prop] = prop | ||
| 23 | except: | ||
| 24 | pass | ||
| 25 | "; | ||
| 26 | }; | ||
| 27 | lop_0_1 { | ||
| 28 | compatible = "system-device-tree-v1,lop,select-v1"; | ||
| 29 | select_1; | ||
| 30 | select_2 = "/"; | ||
| 31 | lop_0_2 { | ||
| 32 | compatible = "system-device-tree-v1,lop,code-v1"; | ||
| 33 | inherit = "subsystem"; | ||
| 34 | code = " | ||
| 35 | for n in tree.__selected__: | ||
| 36 | mach_name = n['compatible'].value[0].replace(',','-').replace('.','-') | ||
| 37 | model = n['model'].value[0] | ||
| 38 | print( '%s %s' % (mach_name.lower(), model) ) | ||
| 39 | "; | ||
| 40 | }; | ||
| 41 | }; | ||
| 42 | }; | ||
| 43 | }; | ||
