Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2198199/?format=api
{ "id": 2198199, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2198199/?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": "<20260219143332.3316679-16-ruslichenko.r@gmail.com>", "date": "2026-02-19T14:33:14", "name": "[v2,15/33] hw/core/fdt_generic_util: map device memory", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "a0313bdd041b9fa8a4fd5139d04ebc8e554ab4f2", "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/20260219143332.3316679-16-ruslichenko.r@gmail.com/mbox/", "series": [ { "id": 492690, "url": "http://patchwork.ozlabs.org/api/1.0/series/492690/?format=api", "date": "2026-02-19T14:33:04", "name": "hw/arm: Introduce generic FDT-driven machine", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/492690/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2198199/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=20230601 header.b=ITtawJ6E;\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 4fGwvN0swfz1xxQ\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 20 Feb 2026 01:37:20 +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 1vt57i-0000OH-Bd; Thu, 19 Feb 2026 09:35:22 -0500", "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 1vt57N-0000FJ-Oa\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 09:35:02 -0500", "from mail-wm1-x332.google.com ([2a00:1450:4864:20::332])\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 1vt57L-00031j-Tn\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 09:35:01 -0500", "by mail-wm1-x332.google.com with SMTP id\n 5b1f17b1804b1-48374014a77so11197185e9.3\n for <qemu-devel@nongnu.org>; Thu, 19 Feb 2026 06:34:59 -0800 (PST)", "from thinkpad-t470s.. (93-143-129-182.adsl.net.t-com.hr.\n [93.143.129.182]) by smtp.googlemail.com with ESMTPSA id\n ffacd0b85a97d-43796abd259sm52022770f8f.24.2026.02.19.06.34.56\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 19 Feb 2026 06:34:57 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1771511698; x=1772116498; 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=+o4P+WixlSveqwPM81MzIq9MXznfscUez/G4LTT0AoQ=;\n b=ITtawJ6EakbqgvR389Fy/opKQFppMlS4FoD1bM1FNB+cF3tA0U691HSfiOgq9dS1SD\n TpnUvKysrEsKeISZTPpUGVfaIBpbvtxFP61IIHV98ZmdT2d1Xd2QjKkhzonE4vGCqGmu\n XzCLJpL1BtDsslfctB06aoV0CYBHy7YOG1hM818gwnfBRcbMLzJ1OGoFnx7OLZlfAAOS\n dZYkA4kJvMDv/TsSWpITHNIlsIWmlP3707Bq4fE3R1FK8SSX8nzbOJlVmjGlF7+0h0lD\n ci2qCGw2uV0YIm7Tb/YpRgbg/JGIg5KARLX9LsxWD+N+zfJFj6Xkr1F3fn6ZM1jqGt/2\n b68A==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771511698; x=1772116498;\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=+o4P+WixlSveqwPM81MzIq9MXznfscUez/G4LTT0AoQ=;\n b=nTJ0e+4mIcHG9ZKP45wzSzI/R4rQ48nDMJxIzyMc5e0Y4kKK3IvxyGB6Ue4CX05Pca\n zODnF75JXndtSaB18Yk9bpxBtbDsQG5qFWtD19SUxt35nwQ5HTwJCXAFErl/T57a/tRK\n AXadf3T5G6ePRM9fL+wPa37EpElVHe1IobL8zI9CaMfIAq8+l1ROVULpyn7LtyIGy5ld\n qV91rE9ru1gXsFGex5bCBo8vkb8tLrxDbuk8UORgp5asDyq+rwCqSS2TR3I10KVIlSTE\n E4DIwtK0seYQY6ZUsRJD7Ih6foCw8AFeRoGYS9nW22KJBzCez9199GLpKMJtXC6gJwIF\n jE4Q==", "X-Gm-Message-State": "AOJu0Yxm7HYRnefgRsL5I1j+OSdRKEFyD/hkAIuTYdqamJpSyGgtm6XC\n OFaa+CkUyhnppEkvDpxdpYSm4BGB9Fl08GtljFq3hC1cU1lAn8PYM6AutfCsuAup", "X-Gm-Gg": "AZuq6aLR8X5Oc0qJSaQHNKfDUwhzE3ZDVS+KowJTKrpj9EztegCDoM+mSuhMajRbYXL\n t+Ozvqh6s3YFyViKUIUlA+1U0T9HZsEFS1G9gk6C7ndN4aHgubudiK7jmTEOWWmFfIS6QMouWlc\n W8IPcTCY+DExJVHq1OHnDpihVciY6X10ZtRgdk8Dv7sMjOD1KyncNibzZUPNWZjHNrsHjGQ3DtL\n LfytAeQjgIgt+fNx4tGBQjKylnLGZ5LkfL15as2Gaut70JdIytiZZdhGN24nA/5HVu/PG5KsMQ8\n fsImgHkvh3B+JJ7UCB060yy33MfbfNQ7bBVEHvDXFRm2M5cfP4QcSEBjY213By+ETSTNs6BdTlF\n EpggvE2W3SvSqe5VEddZW6CLp/yi9mpc0DYWTeJCxegl47ffBB2xSaODgDurF5bEPwp9x/P12rd\n tFssbd9lJju3srKyHp7ZXchmxT0SLq/nZKySq9bfltNiQ3vGxGYpZAjawGDPdW65/LjDc3", "X-Received": "by 2002:a05:600c:4745:b0:47e:e20e:bbbe with SMTP id\n 5b1f17b1804b1-48373a4e7dfmr356698125e9.25.1771511697961;\n Thu, 19 Feb 2026 06:34:57 -0800 (PST)", "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 v2 15/33] hw/core/fdt_generic_util: map device memory", "Date": "Thu, 19 Feb 2026 15:33:14 +0100", "Message-ID": "<20260219143332.3316679-16-ruslichenko.r@gmail.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260219143332.3316679-1-ruslichenko.r@gmail.com>", "References": "<20260219143332.3316679-1-ruslichenko.r@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2a00:1450:4864:20::332;\n envelope-from=ruslichenko.r@gmail.com; helo=mail-wm1-x332.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=ham 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\nParse device mmio regions provided within 'reg' and\n'reg-extened' device tree properties.\nCall corresponding device interface class handlers to\ncreate memory regions.\n\nSigned-off-by: Ruslan Ruslichenko <Ruslan_Ruslichenko@epam.com>\n---\n hw/core/fdt_generic_util.c | 129 +++++++++++++++++++++++++++++++++++++\n 1 file changed, 129 insertions(+)", "diff": "diff --git a/hw/core/fdt_generic_util.c b/hw/core/fdt_generic_util.c\nindex dcacc5033b..838ed9a85c 100644\n--- a/hw/core/fdt_generic_util.c\n+++ b/hw/core/fdt_generic_util.c\n@@ -630,6 +630,22 @@ static inline uint64_t get_int_be(const void *p, int len)\n }\n }\n \n+/* FIXME: use structs instead of parallel arrays */\n+\n+static const char *fdt_generic_reg_size_prop_names[] = {\n+ \"#address-cells\",\n+ \"#size-cells\",\n+ \"#bus-cells\",\n+ \"#priority-cells\",\n+};\n+\n+static const int fdt_generic_reg_cells_defaults[] = {\n+ 1,\n+ 1,\n+ 0,\n+ 0,\n+};\n+\n /*\n * Error handler for device creation failure.\n *\n@@ -831,6 +847,117 @@ static void fdt_init_qdev_array_prop(Object *obj,\n DB_PRINT_NP(0, \"set property %s propname to <list>\\n\", propname);\n }\n \n+static void fdt_parse_node_reg_prop(FDTMachineInfo *fdti, char *node_path,\n+ Object *dev)\n+{\n+ FDTGenericRegPropInfo reg = {0};\n+ Object *parent;\n+ char parent_path[DT_PATH_LENGTH];\n+ int cell_idx = 0;\n+ bool extended = true;\n+ Error *errp = NULL;\n+ int i;\n+\n+ if (!object_dynamic_cast(dev, TYPE_SYS_BUS_DEVICE) &&\n+ !object_dynamic_cast(dev, TYPE_FDT_GENERIC_MMAP))\n+ return;\n+\n+ qemu_fdt_getprop_cell(fdti->fdt, node_path, \"reg-extended\", 0,\n+ &errp);\n+ if (errp) {\n+ error_free(errp);\n+ errp = NULL;\n+ extended = false;\n+ qemu_devtree_getparent(fdti->fdt, parent_path, node_path);\n+ }\n+\n+ parent = fdt_init_get_opaque(fdti, parent_path);\n+\n+ for (reg.n = 0;; reg.n++) {\n+ char ph_parent[DT_PATH_LENGTH];\n+ const char *pnp = parent_path;\n+\n+ reg.parents = g_renew(Object *, reg.parents, reg.n + 1);\n+ reg.parents[reg.n] = parent;\n+\n+ if (extended) {\n+ int p_ph = qemu_fdt_getprop_cell(fdti->fdt, node_path,\n+ \"reg-extended\", cell_idx++,\n+ &errp);\n+ if (errp) {\n+ error_free(errp);\n+ errp = NULL;\n+ goto exit_reg_parse;\n+ }\n+ if (qemu_devtree_get_node_by_phandle(fdti->fdt, ph_parent,\n+ p_ph)) {\n+ goto exit_reg_parse;\n+ }\n+\n+ while (!fdt_init_has_opaque(fdti, ph_parent) &&\n+ qemu_in_coroutine()) {\n+ fdt_init_yield(fdti);\n+ }\n+\n+ if (!fdt_init_has_opaque(fdti, ph_parent)) {\n+ goto exit_reg_parse;\n+ }\n+\n+ reg.parents[reg.n] = fdt_init_get_opaque(fdti, ph_parent);\n+ pnp = ph_parent;\n+ }\n+\n+ for (i = 0; i < FDT_GENERIC_REG_TUPLE_LENGTH; ++i) {\n+ const char *size_prop_name = fdt_generic_reg_size_prop_names[i];\n+ int nc = qemu_fdt_getprop_cell_inherited(fdti->fdt, node_path,\n+ size_prop_name, 0, &errp);\n+ uint64_t val = 0;\n+\n+ if (errp) {\n+ int size_default = fdt_generic_reg_cells_defaults[i];\n+\n+ DB_PRINT_NP(0, \"WARNING: no %s for %s container, assuming \"\n+ \"default of %d\\n\", size_prop_name, pnp,\n+ size_default);\n+ nc = size_default;\n+ error_free(errp);\n+ errp = NULL;\n+ }\n+\n+ reg.x[i] = g_renew(uint64_t, reg.x[i], reg.n + 1);\n+ for (int j = 0; j < nc; ++j) {\n+ val <<= 32;\n+ val |= qemu_fdt_getprop_cell(fdti->fdt, node_path,\n+ extended ? \"reg-extended\"\n+ : \"reg\",\n+ cell_idx + j, &errp);\n+ if (errp) {\n+ val = 0;\n+ break;\n+ }\n+ }\n+ reg.x[i][reg.n] = val;\n+ cell_idx += nc;\n+ if (errp) {\n+ goto exit_reg_parse;\n+ }\n+ }\n+ }\n+\n+exit_reg_parse:\n+ if (object_dynamic_cast(dev, TYPE_FDT_GENERIC_MMAP)) {\n+ FDTGenericMMapClass *fmc = FDT_GENERIC_MMAP_GET_CLASS(dev);\n+ if (fmc->parse_reg) {\n+ while (fmc->parse_reg(FDT_GENERIC_MMAP(dev), reg,\n+ &error_abort) && qemu_in_coroutine()) {\n+ fdt_init_yield(fdti);\n+ }\n+ }\n+ }\n+\n+ return;\n+}\n+\n static int fdt_init_qdev(char *node_path, FDTMachineInfo *fdti, char *compat)\n {\n Object *dev, *parent;\n@@ -972,6 +1099,8 @@ static int fdt_init_qdev(char *node_path, FDTMachineInfo *fdti, char *compat)\n }\n }\n \n+ fdt_parse_node_reg_prop(fdti, node_path, dev);\n+\n g_free(dev_type);\n g_free(props);\n \n", "prefixes": [ "v2", "15/33" ] }