Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2219366/?format=api
{ "id": 2219366, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2219366/?format=api", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.0/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260402215629.745866-5-ruslichenko.r@gmail.com>", "date": "2026-04-02T21:55:49", "name": "[v3,04/33] hw/core: introduce generic FDT device model registry", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5f2107c95b13e96f2bc13f5a7ea13de12d5be000", "submitter": { "id": 92275, "url": "http://patchwork.ozlabs.org/api/1.0/people/92275/?format=api", "name": "Ruslan Ruslichenko", "email": "ruslichenko.r@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260402215629.745866-5-ruslichenko.r@gmail.com/mbox/", "series": [ { "id": 498555, "url": "http://patchwork.ozlabs.org/api/1.0/series/498555/?format=api", "date": "2026-04-02T21:55:47", "name": "hw/arm: Introduce generic FDT-driven machine", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/498555/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219366/checks/", "tags": {}, "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=XtDluCNb;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmwnR67Bpz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 09:02:19 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w8Q21-0008Ez-LF; Thu, 02 Apr 2026 17:56:53 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <ruslichenko.r@gmail.com>)\n id 1w8Q1z-0008DB-K1\n for qemu-devel@nongnu.org; Thu, 02 Apr 2026 17:56:51 -0400", "from mail-ed1-x533.google.com ([2a00:1450:4864:20::533])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <ruslichenko.r@gmail.com>)\n id 1w8Q1x-00073C-Su\n for qemu-devel@nongnu.org; Thu, 02 Apr 2026 17:56:51 -0400", "by mail-ed1-x533.google.com with SMTP id\n 4fb4d7f45d1cf-66c4c7e2bb7so1821927a12.0\n for <qemu-devel@nongnu.org>; Thu, 02 Apr 2026 14:56:49 -0700 (PDT)", "from thinkpad-t470s.. (93-143-182-244.adsl.net.t-com.hr.\n [93.143.182.244]) by smtp.googlemail.com with ESMTPSA id\n a640c23a62f3a-b9c3cac0e1asm134009166b.27.2026.04.02.14.56.46\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 02 Apr 2026 14:56:47 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775167008; x=1775771808; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=COppB07ZdgBSIiLPYIXUKRW1DDBdEAcH3Z/PWDGJeWs=;\n b=XtDluCNb9W+ZBaPdofNm5Z+FphNrnu5bPHBpEorvBXcekKUACZBdVzwkdKdfKpE6sh\n 76na9LzQDrDE/kNkiC3NhkcvN3olYrzfk7DicvwCEc0Z7UCfo2QN6niCLv94t1iFcdal\n s1oGfp6TA+TSRoX82NRYrnJc4qw3f/u985MaWrkXJPbrBPuskwTOCP97XItliGINab2y\n CYYznW3SJ1dLD+5d3fDlXbniFOg0X9sd0Kd8q3CKg1GP08BImpI+CVfBhsheRpz4U5cW\n zcpascM64CRx/avuTej5Bg3lweSnRPZ/KuOxL59GO23wxlxDe8Mqbb3NGCGQcekxd3XA\n h+9A==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775167008; x=1775771808;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=COppB07ZdgBSIiLPYIXUKRW1DDBdEAcH3Z/PWDGJeWs=;\n b=W7U/Lu72owjpkJFtXwMEAyisrBeyj+yw/suP2qbY259bE3vL68u2DP8501lM8bH1Eh\n NDqB1i7AqexRB+aQK2xBqqtuRL6NXXO+U5YR0z0cd6vzmyNgWVVEi3HT4u2UI+QtyjVd\n d6LfH6Pk2dYQYe8VAaWPqvm9z3C+GriAcWQouyFF+Bp5f2Cy3UhcCSLbYIOAIRVUHn6T\n qQnQoczRxawX2Va/zGaka1LLFV+XeZjsY4jZQlxrnM/aaeYJ4HXr/Zcb6pwauqN/R/r0\n 0kzD17EzERSKP6sIbXvvHnW2Ye+nHz3CFNZwiNKETQuiU5WS8npTKVQj/Y4P0SRM+mbo\n Ksiw==", "X-Gm-Message-State": "AOJu0Yz7JjIghenIS28RCOjKSCBfgzqOJpivYU6vIO3IxoF5tnf01b3R\n xGW1nEh6no+oU7UnbutKATil3qOvRKso4uuVp0hGtyjnVw9d6zMqWqNpIA62PQi0", "X-Gm-Gg": "AeBDievfOl35QvDVsFajcUnxSKft+4OtEQRSDIWONpa2Uq1CqcrkmAaPcx3upkHHRNY\n 0ziDhR+Fw0inI0xeyTKzfDD67q+cuWk1cADHLWtHGQwv0RUmbUhAtvP/h8ezb85JdL3P1OIAeVB\n gof8NsAZaEw0ansZBS3A9LMqiYFCHifFD/8kG3CP/n0y8tkZ6MIqyai8QlR6nazL5z0Gd1XXS25\n qD0Sken49NWnMM6nbcbKQD9+LUxNm+ECpkS4utCDtY/VOnD0PUwRcllBQnN3Sw2slioWhXA4Z+a\n nZrl5NgXxB0HOC1zryIb61YTWXOoIckuqGwDVu70Oy6y7EEVAzAzELXiYgpYHRuJwRoFJEK81SI\n bheOzDBhQD8Ta0bhR8OMvJoKi7ohzCZxqpA8GovS2q+mjnps5SmCAhOLGWvXTKkTpRAJEDftGwi\n yILm2qpSwYpnBKcBigexG+nsl1yxw13uRu3dQ39dZFYE60jY4MmOo22VxVt+FufvpUtv2wvl2hi\n zVlOTe+", "X-Received": "by 2002:a17:907:808:b0:b9c:3ba2:2da8 with SMTP id\n a640c23a62f3a-b9c67b83e0amr24481566b.52.1775167007568;\n Thu, 02 Apr 2026 14:56:47 -0700 (PDT)", "From": "Ruslan Ruslichenko <ruslichenko.r@gmail.com>", "To": "qemu-devel@nongnu.org", "Cc": "qemu-arm@nongnu.org, alex.bennee@linaro.org, peter.maydell@linaro.org,\n artem_mygaiev@epam.com, volodymyr_babchuk@epam.com,\n takahiro.nakata.wr@renesas.com,\n \"Edgar E . Iglesias\" <edgar.iglesias@gmail.com>,\n Ruslan_Ruslichenko@epam.com, balaton@eik.bme.hu", "Subject": "[PATCH v3 04/33] hw/core: introduce generic FDT device model registry", "Date": "Thu, 2 Apr 2026 23:55:49 +0200", "Message-ID": "<20260402215629.745866-5-ruslichenko.r@gmail.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260402215629.745866-1-ruslichenko.r@gmail.com>", "References": "<20260402215629.745866-1-ruslichenko.r@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2a00:1450:4864:20::533;\n envelope-from=ruslichenko.r@gmail.com; helo=mail-ed1-x533.google.com", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "From: Ruslan Ruslichenko <Ruslan_Ruslichenko@epam.com>\n\nIntroduce infrastructure to instantiate device models\ndirectly from the device tree.\n\nThis includes the registry of known device models with\nassociated init functions and key API methods to\noperate it.\n\nThe MIT license of fdt_generic.c preserved as in original\nfile from https://github.com/Xilinx/qemu.git repo.\n\nThe license for fdt_generic.h derived from matching\nfdt_generic.c file.\n\nSigned-off-by: Ruslan Ruslichenko <Ruslan_Ruslichenko@epam.com>\n---\n hw/core/fdt_generic.c | 110 ++++++++++++++++++++++++++++++++++\n include/hw/core/fdt_generic.h | 61 +++++++++++++++++++\n 2 files changed, 171 insertions(+)\n create mode 100644 hw/core/fdt_generic.c\n create mode 100644 include/hw/core/fdt_generic.h", "diff": "diff --git a/hw/core/fdt_generic.c b/hw/core/fdt_generic.c\nnew file mode 100644\nindex 0000000000..65e3c1efa3\n--- /dev/null\n+++ b/hw/core/fdt_generic.c\n@@ -0,0 +1,110 @@\n+/*\n+ * SPDX-License-Identifier: MIT\n+ *\n+ * Tables of FDT device models and their init functions. Keyed by compatibility\n+ * strings, device instance names.\n+ *\n+ * Copyright (c) 2010 PetaLogix Qld Pty Ltd.\n+ * Copyright (c) 2010 Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>.\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+\n+#include \"qemu/osdep.h\"\n+#include \"hw/core/fdt_generic.h\"\n+#include \"hw/core/qdev-properties.h\"\n+#include \"qemu/log.h\"\n+\n+\n+#define FDT_GENERIC_MAX_PATTERN_LEN 1024\n+\n+typedef struct TableListNode {\n+ struct TableListNode *next;\n+ char key[FDT_GENERIC_MAX_PATTERN_LEN];\n+ FDTInitFn fdt_init;\n+ void *opaque;\n+} TableListNode;\n+\n+/* add a node to the table specified by *head_p */\n+\n+static void add_to_table(\n+ FDTInitFn fdt_init,\n+ const char *key,\n+ void *opaque,\n+ TableListNode **head_p)\n+{\n+ TableListNode *nn = malloc(sizeof(*nn));\n+ nn->next = *head_p;\n+ strcpy(nn->key, key);\n+ nn->fdt_init = fdt_init;\n+ nn->opaque = opaque;\n+ *head_p = nn;\n+}\n+\n+/* FIXME: add return codes that differentiate between not found and error */\n+\n+/*\n+ * search a table for a key string and call the fdt init function if found.\n+ * Returns 0 if a match is found, 1 otherwise\n+ */\n+\n+static int fdt_init_search_table(\n+ char *node_path,\n+ FDTMachineInfo *fdti,\n+ const char *key, /* string to match */\n+ TableListNode **head) /* head of the list to search */\n+{\n+ TableListNode *iter;\n+\n+ for (iter = *head; iter != NULL; iter = iter->next) {\n+ if (!strcmp(key, iter->key)) {\n+ if (iter->fdt_init) {\n+ return iter->fdt_init(node_path, fdti, iter->opaque);\n+ }\n+ return 0;\n+ }\n+ }\n+\n+ return 1;\n+}\n+\n+TableListNode *compat_list_head;\n+\n+void add_to_compat_table(FDTInitFn fdt_init, const char *compat, void *opaque)\n+{\n+ add_to_table(fdt_init, compat, opaque, &compat_list_head);\n+}\n+\n+int fdt_init_compat(char *node_path, FDTMachineInfo *fdti, const char *compat)\n+{\n+ return fdt_init_search_table(node_path, fdti, compat, &compat_list_head);\n+}\n+\n+TableListNode *inst_bind_list_head;\n+\n+void add_to_inst_bind_table(FDTInitFn fdt_init, const char *name, void *opaque)\n+{\n+ add_to_table(fdt_init, name, opaque, &inst_bind_list_head);\n+}\n+\n+int fdt_init_inst_bind(char *node_path, FDTMachineInfo *fdti,\n+ const char *name)\n+{\n+ return fdt_init_search_table(node_path, fdti, name, &inst_bind_list_head);\n+}\ndiff --git a/include/hw/core/fdt_generic.h b/include/hw/core/fdt_generic.h\nnew file mode 100644\nindex 0000000000..3d8ec2f7ff\n--- /dev/null\n+++ b/include/hw/core/fdt_generic.h\n@@ -0,0 +1,61 @@\n+/*\n+ * SPDX-License-Identifier: MIT\n+ *\n+ * Tables of FDT device models and their init functions. Keyed by compatibility\n+ * strings, device instance names.\n+ */\n+\n+#ifndef FDT_GENERIC_H\n+#define FDT_GENERIC_H\n+\n+#include \"qemu/help-texts.h\"\n+#include \"system/device_tree.h\"\n+\n+typedef struct FDTMachineInfo FDTMachineInfo;\n+\n+typedef int (*FDTInitFn)(char *, FDTMachineInfo *, void *);\n+\n+/* associate a FDTInitFn with a FDT compatibility */\n+\n+void add_to_compat_table(FDTInitFn, const char *, void *);\n+\n+/*\n+ * try and find a device model for a particular compatibility. If found,\n+ * the FDTInitFn associated with the compat will be called and 0 will\n+ * be returned. Returns non-zero on not found or error\n+ */\n+\n+int fdt_init_compat(char *, FDTMachineInfo *, const char *);\n+\n+/* same as above, but associates with a FDT node name (rather than compat) */\n+\n+void add_to_inst_bind_table(FDTInitFn, const char *, void *);\n+int fdt_init_inst_bind(char *, FDTMachineInfo *, const char *);\n+\n+/* statically register a FDTInitFn as being associate with a compatibility */\n+\n+#define fdt_register_compatibility_opaque(function, compat, n, opaque) \\\n+static void __attribute__((constructor)) \\\n+function ## n ## _register_imp(void) { \\\n+ add_to_compat_table(function, compat, opaque); \\\n+}\n+\n+#define fdt_register_compatibility_n(function, compat, n) \\\n+fdt_register_compatibility_opaque(function, compat, n, NULL)\n+\n+#define fdt_register_compatibility(function, compat) \\\n+fdt_register_compatibility_n(function, compat, 0)\n+\n+#define fdt_register_instance_opaque(function, inst, n, opaque) \\\n+static void __attribute__((constructor)) \\\n+function ## n ## _register_imp(void) { \\\n+ add_to_inst_bind_table(function, inst, opaque); \\\n+}\n+\n+#define fdt_register_instance_n(function, inst, n) \\\n+fdt_register_instance_opaque(function, inst, n, NULL)\n+\n+#define fdt_register_instance(function, inst) \\\n+fdt_register_instance_n(function, inst, 0)\n+\n+#endif /* FDT_GENERIC_H */\n", "prefixes": [ "v3", "04/33" ] }