summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2023-07-21 10:43:04 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-07-25 15:27:33 +0100
commit6684cfb613058937e48f8ed681f5c1eece7cc6a0 (patch)
tree0778c5d777b95e1b6da5b06a8d9a0bae23375f7d /meta
parentbbed3a143be42ad4b8e74f94f36aceb37e91f6a1 (diff)
downloadpoky-6684cfb613058937e48f8ed681f5c1eece7cc6a0.tar.gz
python3-dtc: add from meta-virtualization
This provides pylibfdt, which is a runtime dependency for the dtschema module that we already carry in oe-core. (From OE-Core rev: 123077ecd9f3c1839da0d7b1474d689e5c6a689c) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/conf/distro/include/maintainers.inc1
-rw-r--r--meta/recipes-devtools/python/python3-dtc/0001-Revert-libfdt-overlay-make-overlay_get_target-public.patch132
-rw-r--r--meta/recipes-devtools/python/python3-dtc_1.6.1.bb26
3 files changed, 159 insertions, 0 deletions
diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 6e82e943fa..17f038c71e 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -614,6 +614,7 @@ RECIPE_MAINTAINER:pn-python3-cython = "Unassigned <unassigned@yoctoproject.org>"
614RECIPE_MAINTAINER:pn-python3-dbus = "Zang Ruochen <zangruochen@loongson.cn>" 614RECIPE_MAINTAINER:pn-python3-dbus = "Zang Ruochen <zangruochen@loongson.cn>"
615RECIPE_MAINTAINER:pn-python3-dbusmock = "Unassigned <unassigned@yoctoproject.org>" 615RECIPE_MAINTAINER:pn-python3-dbusmock = "Unassigned <unassigned@yoctoproject.org>"
616RECIPE_MAINTAINER:pn-python3-docutils = "Unassigned <unassigned@yoctoproject.org>" 616RECIPE_MAINTAINER:pn-python3-docutils = "Unassigned <unassigned@yoctoproject.org>"
617RECIPE_MAINTAINER:pn-python3-dtc = "Trevor Gamblin <tgamblin@baylibre.com>"
617RECIPE_MAINTAINER:pn-python3-dtschema = "Bruce Ashfield <bruce.ashfield@gmail.com>" 618RECIPE_MAINTAINER:pn-python3-dtschema = "Bruce Ashfield <bruce.ashfield@gmail.com>"
618RECIPE_MAINTAINER:pn-python3-dtschema-wrapper = "Bruce Ashfield <bruce.ashfield@gmail.com>" 619RECIPE_MAINTAINER:pn-python3-dtschema-wrapper = "Bruce Ashfield <bruce.ashfield@gmail.com>"
619RECIPE_MAINTAINER:pn-python3-editables = "Ross Burton <ross.burton@arm.com>" 620RECIPE_MAINTAINER:pn-python3-editables = "Ross Burton <ross.burton@arm.com>"
diff --git a/meta/recipes-devtools/python/python3-dtc/0001-Revert-libfdt-overlay-make-overlay_get_target-public.patch b/meta/recipes-devtools/python/python3-dtc/0001-Revert-libfdt-overlay-make-overlay_get_target-public.patch
new file mode 100644
index 0000000000..a2df482e3a
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-dtc/0001-Revert-libfdt-overlay-make-overlay_get_target-public.patch
@@ -0,0 +1,132 @@
1From 4d4703e0199fb3556c37694e4d951785abca22fd Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Wed, 19 Jan 2022 12:46:42 -0500
4Subject: [PATCH] Revert "libfdt: overlay: make overlay_get_target() public"
5
6This reverts commit 45f3d1a095dd3440578d5c6313eba555a791f3fb.
7
8Upstream-Status: Inappropriate [embedded specific]
9
10---
11 libfdt/fdt_overlay.c | 29 ++++++++++++++++++++++-------
12 libfdt/libfdt.h | 18 ------------------
13 libfdt/version.lds | 1 -
14 3 files changed, 22 insertions(+), 26 deletions(-)
15
16diff --git a/libfdt/fdt_overlay.c b/libfdt/fdt_overlay.c
17index 5c0c398..d217e79 100644
18--- a/libfdt/fdt_overlay.c
19+++ b/libfdt/fdt_overlay.c
20@@ -40,22 +40,37 @@ static uint32_t overlay_get_target_phandle(const void *fdto, int fragment)
21 return fdt32_to_cpu(*val);
22 }
23
24-int fdt_overlay_target_offset(const void *fdt, const void *fdto,
25- int fragment_offset, char const **pathp)
26+/**
27+ * overlay_get_target - retrieves the offset of a fragment's target
28+ * @fdt: Base device tree blob
29+ * @fdto: Device tree overlay blob
30+ * @fragment: node offset of the fragment in the overlay
31+ * @pathp: pointer which receives the path of the target (or NULL)
32+ *
33+ * overlay_get_target() retrieves the target offset in the base
34+ * device tree of a fragment, no matter how the actual targeting is
35+ * done (through a phandle or a path)
36+ *
37+ * returns:
38+ * the targeted node offset in the base device tree
39+ * Negative error code on error
40+ */
41+static int overlay_get_target(const void *fdt, const void *fdto,
42+ int fragment, char const **pathp)
43 {
44 uint32_t phandle;
45 const char *path = NULL;
46 int path_len = 0, ret;
47
48 /* Try first to do a phandle based lookup */
49- phandle = overlay_get_target_phandle(fdto, fragment_offset);
50+ phandle = overlay_get_target_phandle(fdto, fragment);
51 if (phandle == (uint32_t)-1)
52 return -FDT_ERR_BADPHANDLE;
53
54 /* no phandle, try path */
55 if (!phandle) {
56 /* And then a path based lookup */
57- path = fdt_getprop(fdto, fragment_offset, "target-path", &path_len);
58+ path = fdt_getprop(fdto, fragment, "target-path", &path_len);
59 if (path)
60 ret = fdt_path_offset(fdt, path);
61 else
62@@ -621,7 +636,7 @@ static int overlay_merge(void *fdt, void *fdto)
63 if (overlay < 0)
64 return overlay;
65
66- target = fdt_overlay_target_offset(fdt, fdto, fragment, NULL);
67+ target = overlay_get_target(fdt, fdto, fragment, NULL);
68 if (target < 0)
69 return target;
70
71@@ -764,7 +779,7 @@ static int overlay_symbol_update(void *fdt, void *fdto)
72 return -FDT_ERR_BADOVERLAY;
73
74 /* get the target of the fragment */
75- ret = fdt_overlay_target_offset(fdt, fdto, fragment, &target_path);
76+ ret = overlay_get_target(fdt, fdto, fragment, &target_path);
77 if (ret < 0)
78 return ret;
79 target = ret;
80@@ -786,7 +801,7 @@ static int overlay_symbol_update(void *fdt, void *fdto)
81
82 if (!target_path) {
83 /* again in case setprop_placeholder changed it */
84- ret = fdt_overlay_target_offset(fdt, fdto, fragment, &target_path);
85+ ret = overlay_get_target(fdt, fdto, fragment, &target_path);
86 if (ret < 0)
87 return ret;
88 target = ret;
89diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
90index a7f432c..7f117e8 100644
91--- a/libfdt/libfdt.h
92+++ b/libfdt/libfdt.h
93@@ -2116,24 +2116,6 @@ int fdt_del_node(void *fdt, int nodeoffset);
94 */
95 int fdt_overlay_apply(void *fdt, void *fdto);
96
97-/**
98- * fdt_overlay_target_offset - retrieves the offset of a fragment's target
99- * @fdt: Base device tree blob
100- * @fdto: Device tree overlay blob
101- * @fragment_offset: node offset of the fragment in the overlay
102- * @pathp: pointer which receives the path of the target (or NULL)
103- *
104- * fdt_overlay_target_offset() retrieves the target offset in the base
105- * device tree of a fragment, no matter how the actual targeting is
106- * done (through a phandle or a path)
107- *
108- * returns:
109- * the targeted node offset in the base device tree
110- * Negative error code on error
111- */
112-int fdt_overlay_target_offset(const void *fdt, const void *fdto,
113- int fragment_offset, char const **pathp);
114-
115 /**********************************************************************/
116 /* Debugging / informational functions */
117 /**********************************************************************/
118diff --git a/libfdt/version.lds b/libfdt/version.lds
119index cbce5d4..7ab85f1 100644
120--- a/libfdt/version.lds
121+++ b/libfdt/version.lds
122@@ -77,7 +77,6 @@ LIBFDT_1.2 {
123 fdt_appendprop_addrrange;
124 fdt_setprop_inplace_namelen_partial;
125 fdt_create_with_flags;
126- fdt_overlay_target_offset;
127 local:
128 *;
129 };
130--
1312.19.1
132
diff --git a/meta/recipes-devtools/python/python3-dtc_1.6.1.bb b/meta/recipes-devtools/python/python3-dtc_1.6.1.bb
new file mode 100644
index 0000000000..a868bd0109
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-dtc_1.6.1.bb
@@ -0,0 +1,26 @@
1SUMMARY = "Python Library for the Device Tree Compiler"
2HOMEPAGE = "https://devicetree.org/"
3DESCRIPTION = "A python library for the Device Tree Compiler, a tool used to manipulate Device Tree files which contain a data structure for describing hardware."
4SECTION = "bootloader"
5LICENSE = "GPL-2.0-only | BSD-2-Clause"
6
7DEPENDS = "flex-native bison-native swig-native python3-setuptools-scm-native libyaml dtc"
8
9SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=master \
10 file://0001-Revert-libfdt-overlay-make-overlay_get_target-public.patch \
11 "
12
13UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
14
15LIC_FILES_CHKSUM = "file://pylibfdt/libfdt.i;beginline=1;endline=6;md5=afda088c974174a29108c8d80b5dce90"
16
17SRCREV = "c001fc01a43e7a06447c06ea3d50bd60641322b8"
18
19PV = "1.6.1+git${SRCPV}"
20S = "${WORKDIR}/git"
21
22PYPA_WHEEL = "${S}/dist/libfdt-1.6.2*.whl"
23
24inherit setuptools3 pkgconfig
25
26BBCLASSEXTEND = "native nativesdk"