From nobody Thu Apr 25 22:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1573242611; cv=none; d=zoho.com; s=zohoarc; b=NW0uzl3sYoX8Qp02i62z5QEzbPi1+Xro+OWwHBFAGNe98cY5BauxA9QZp3x4vMQC+Tn3i4uzKz88DR4sNmtZx82pOZGiiIZ0l9gHVIbk0xbE4L1uZrVyD0orPhVp06kGNI9CE5RdtoXfYxE/EK5zagaJ3+KqB7s4IJWORiZwQPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573242611; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9MuKvPi+Vd4vUU4gqbdXcIHJqwKNnvJAqsIK6Fo7Ucc=; b=VvcX4YYuqibv6g8jhucRyYF5HRpEv4FtOSx3gskmqyMeUpYIzKi2aW/fkLS9ehUPKTzUzc5hhCehBK32A/Qzpc2y76Gofcg5rfIuRCz0PI4FcLhBseYLpMPQRJQknbrq/NgHryWk9dTOMgf5Mi6g7RLgo5F5J//Ny3hg58+QPSY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573242611674387.8414382841015; Fri, 8 Nov 2019 11:50:11 -0800 (PST) Received: from localhost ([::1]:59604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAGo-0001W2-5P for importer@patchew.org; Fri, 08 Nov 2019 14:50:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35782) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAFA-000092-Rb for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iTAF9-00060u-N1 for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:28 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:33748) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iTAF9-0005zZ-H1 for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:27 -0500 Received: by mail-pg1-x543.google.com with SMTP id h27so4630382pgn.0 for ; Fri, 08 Nov 2019 11:48:27 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id y24sm8053861pfr.116.2019.11.08.11.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 11:48:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:cc:from:to; bh=9MuKvPi+Vd4vUU4gqbdXcIHJqwKNnvJAqsIK6Fo7Ucc=; b=pi7fIL923oWWgDW4NPnQr/eftyTVeXcfwmZIwygNlZzAU9KU4roZv2++952mIomA2A aIf0ihpR6GsxlgDp3WbhP3DMao2VHHieH8F1TJfYCS145O6Q/LnbmrdttZPUkm0Rva7S DXwD9uGEwkdY70/o6rNq6GiprPPjNnjeU66Afl3J7IFfUKV1U22N54TOqkA1NtM+m5R7 RIAvi1sQG+hmoWN09m+rdkaeCbMn7IMCqZ9pdNtTF4h3aL257z9sANMewLU/RihQDOz6 uJM7n8jBG9OAA9VmElcrAiRrqH/coQ3u9xcdFs4v17kWX/w5zaxmYmgzZMQsWF0jp8hc hboQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=9MuKvPi+Vd4vUU4gqbdXcIHJqwKNnvJAqsIK6Fo7Ucc=; b=ZWIpiHVfMgK0aaps2KVrOJ/rvvyyZgzyldpQuO8V9/nV02miSO0PEBPJ0FCRrcGc3B O6QSb7Gi/pG/y4C8BxM/9ArL8gWf9LEtrxsWTHje+z+r1WopOxPNK8AXounYOo5g8n4f v3iVbZ9WZYg/REy3HzsBDTZlnUAWeUKT0KSA+YJKqKRbelgkPEcM7udq6l0SR2knG7HK LPYrtRNsaBHaoM0TeJkDUL0nhhf4UvbWdF/D42Z2JB+3brL3ejewUPpgC+EyPr5U1uYf +BsNNA9jMz7omqEqZF3bNUbAxi7gPiglZAYHW9LlPCHGG1X4PzGb7Fmeqmg0jOecMZQo Eexw== X-Gm-Message-State: APjAAAUw++TKJ/RWLboLh0fBAWCDhvjAKik006cxAyRo92VyCI3SDPZf +kpwKW6Of9Phe6fX7+cPxKLUEipZ44M= X-Google-Smtp-Source: APXvYqye9hkQzVWrvzFfvnjgCHDEpcWJPAIWeA2Fh2TraED35OgiTF3LQL4UzzHFLXFTLDyOEky3hA== X-Received: by 2002:a63:e26:: with SMTP id d38mr8265069pgl.44.1573242506131; Fri, 08 Nov 2019 11:48:26 -0800 (PST) Subject: [PATCH v2 1/3] device_tree: Add a helper function for string arrays Date: Fri, 8 Nov 2019 11:47:56 -0800 Message-Id: <20191108194758.17813-2-palmer@dabbelt.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191108194758.17813-1-palmer@dabbelt.com> References: <20191108194758.17813-1-palmer@dabbelt.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Palmer Dabbelt To: Peter Maydell , Alistair Francis , qemu-devel@nongnu.org, david@gibson.dropbear.id.au X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Palmer Dabbelt , qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The device tree format allows for arrays of strings, which are encoded with '\0's inside regular strings. These are ugly to represent in C, so the helper function represents them as strings with internal '\0's that are terminated with a double '\0'. In other words, the array ["string1", "string2"] is represeted as "string1\0string2\0". The DTB generated by this function is accepted by DTC and produces an array of strings, but I can't find any explicit line in the DT specification that defines how these are encoded. Signed-off-by: Palmer Dabbelt --- device_tree.c | 17 +++++++++++++++++ include/sysemu/device_tree.h | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/device_tree.c b/device_tree.c index f8b46b3c73..b4379f13a7 100644 --- a/device_tree.c +++ b/device_tree.c @@ -397,6 +397,23 @@ int qemu_fdt_setprop_string(void *fdt, const char *nod= e_path, return r; } =20 +static size_t stringarr_length(const char *strings) +{ + size_t count =3D 1; + while (strings[count - 1] !=3D '\0' || strings[count] !=3D '\0') { + count++; + } + return count; +} + +int qemu_fdt_setprop_strings(void *fdt, const char *node_path, + const char *property, const char *strings) +{ + size_t length =3D stringarr_length(strings); + return qemu_fdt_setprop(fdt, node_path, property, strings, length); +} + + const void *qemu_fdt_getprop(void *fdt, const char *node_path, const char *property, int *lenp, Error **errp) { diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h index c16fd69bc0..d43c07128e 100644 --- a/include/sysemu/device_tree.h +++ b/include/sysemu/device_tree.h @@ -70,6 +70,12 @@ int qemu_fdt_setprop_string(void *fdt, const char *node_= path, int qemu_fdt_setprop_phandle(void *fdt, const char *node_path, const char *property, const char *target_node_path); +/* + * This uses a particularly odd encoding: "strings" is a list of strings t= hat + * must be terminated by two back-to-back '\0' characters. + */ +int qemu_fdt_setprop_strings(void *fdt, const char *node_path, + const char *property, const char *strings); /** * qemu_fdt_getprop: retrieve the value of a given property * @fdt: pointer to the device tree blob --=20 2.21.0 From nobody Thu Apr 25 22:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1573242618; cv=none; d=zoho.com; s=zohoarc; b=VG3SPpap+We/SB8ldotS8OCh4Er9OA4rmgy4MpVZV/d4gBdaMl0QOZOVZf2EovdzlZ3gyc0F5IAvgKSbgGQwWIeD8s/d/n2XwoDS/kRv2vGxj7oz7OoSE9dvrmrjTeL0r+9h5Luwm8p0srYDxm48DL1lrKJc6zuGRW23gY9Vor0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573242618; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5agNHd9M2bORCVbIGO//JZMZDNyfUZl1bBgI5l6KvTQ=; b=DqhssldEQ7ShaXDgFU4FmHPsEO5j6g9gLl8ppEe53MAq9QjGMLoPf81u0dpEMCBBSxc5FQsJqqA/IEjZOwakEKXWssU+JCbJRnaYaYYe7GalOBmIEpABQCSaIYLNZfkcofSPwoC7K/0A344jGxUoG6TmpmpicbKU1g5H6jJyPIs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573242618803423.82574253359326; Fri, 8 Nov 2019 11:50:18 -0800 (PST) Received: from localhost ([::1]:59606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAGr-0001XY-5R for importer@patchew.org; Fri, 08 Nov 2019 14:50:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35805) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAFC-00009k-5G for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iTAFB-000642-6b for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:30 -0500 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:33716) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iTAFB-00063b-0n for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:29 -0500 Received: by mail-pf1-x443.google.com with SMTP id c184so5346683pfb.0 for ; Fri, 08 Nov 2019 11:48:28 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id r68sm7456977pfr.78.2019.11.08.11.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 11:48:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:cc:from:to; bh=5agNHd9M2bORCVbIGO//JZMZDNyfUZl1bBgI5l6KvTQ=; b=Phez6cVAOAk6qvA3brvUjT0QhoQeK19ixiY6E8EHjShNInxaUAUxVga9N8f+ahKnB4 eZUDjKYVzlgD4hVBUQBW42rgQ7tfX2VLAWVm8gj+M3+9lUr0X+auUBHf+nwNOZKFOr2S TNBLth0FYYYnT5toF+rM/dDsjb5kJdepUsN8lZYHCtXWxWd2+NdyZuPc5/OviT1lWMn/ 0xEge9o7YRi/M7szla8/Qh/VvkaEOAtMewPqwyx/83iGRbuxImvjt8/edortm2heLP43 +MtOo6YPuRppc53pDpXMd+SglAST0/IGjZOOpkTNbFhfdI3uSJ+p/w+9/75c2wDvA/Lx MRJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=5agNHd9M2bORCVbIGO//JZMZDNyfUZl1bBgI5l6KvTQ=; b=nTP3caUhiUVmZyMp7K+jdF3HPiF/Eo0h0uZXgodVLQagrsMzznYQQNJQHWQb6+8Vfg ySaCuDev69e3r962iK2xmM2jDEJvCMEnOOSkF5Yv/Dv9FH+HylCU1jdM7wTrGab73EvN A9luJr3HqxA7Z5Gs1rrPShrjTuhwqwhCRhmSFfMKJEYBK0zmIK3Bc8UCW7AFq5jYi+q0 drqAQUsMA2HwtYj430TwS5fYgM6Gs1MxTeayx2KfWmoxCOkdTLPVmFYwyr9UNsk8vewp Vq6WOaTxyrjn6uB+wyFmL+AWV6rh48tIwuyozw5irCuhNy8JNL/OjZWv9TU5EX2+wsv3 nJag== X-Gm-Message-State: APjAAAVLzhGZtt0aipbx15mM3493Du4o7CHzAb9PUT7ECwj2/H2FQfJ1 +Sx8xItxTX039MXCv6A1gK0A+w== X-Google-Smtp-Source: APXvYqx89ckaICmNEcPymnIaPzw/La0DkOPJLAUZIE+RBy/lpguEOtXGyUt3wXoJKDiajjs6+Ikk0A== X-Received: by 2002:a63:7887:: with SMTP id t129mr13976804pgc.144.1573242507720; Fri, 08 Nov 2019 11:48:27 -0800 (PST) Subject: [PATCH v2 2/3] ARM/virt: Use fdt_setprop_strings() Date: Fri, 8 Nov 2019 11:47:57 -0800 Message-Id: <20191108194758.17813-3-palmer@dabbelt.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191108194758.17813-1-palmer@dabbelt.com> References: <20191108194758.17813-1-palmer@dabbelt.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Palmer Dabbelt To: Peter Maydell , Alistair Francis , qemu-devel@nongnu.org, david@gibson.dropbear.id.au X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Palmer Dabbelt , qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This new helper function encodes the idiom used by the ARM virt board to set a string array. I don't currently have a working ARM userspace, so I h= aven't tested this, but I made the helper function because I wanted to use it for the RISC-V virt board where I have tested it. Signed-off-by: Palmer Dabbelt --- hw/arm/virt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index d4bedc2607..4dc00f54d5 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -304,9 +304,8 @@ static void fdt_add_timer_nodes(const VirtMachineState = *vms) =20 armcpu =3D ARM_CPU(qemu_get_cpu(0)); if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) { - const char compat[] =3D "arm,armv8-timer\0arm,armv7-timer"; - qemu_fdt_setprop(vms->fdt, "/timer", "compatible", - compat, sizeof(compat)); + qemu_fdt_setprop_strings(vms->fdt, "/timer", "compatible", + "arm,armv8-timer\0arm,armv7-timer\0"); } else { qemu_fdt_setprop_string(vms->fdt, "/timer", "compatible", "arm,armv7-timer"); --=20 2.21.0 From nobody Thu Apr 25 22:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1573242734; cv=none; d=zoho.com; s=zohoarc; b=Cj4sT0SJ/ma4aUBa21I3yK0CsJBXIMHglrDPtJGkyJTtsmsI0CiMw2KBNVptrEY9mPTKU9+MU9GZxf37pir2HD/DJvtkkgOU3XAARFRu3dxjbhiA040Cuomv0197KyTRbhi3sInNfcEqNwm/qncOpJdKYn808mE4+uZMQvcB3uk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573242734; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tM4Fro2TVwkO5f8g7B2j9ujSbXOxCnayqaeFwddAub0=; b=PUO5xk2PS2tnW2lmfUF4cqNGwvpxu8nNstqsV0tAyLWDTS6n63AltNRoDjH1nkTbsvFqbG/Fq4Jxgt1ohXegh4vQ99vZ5XzNH4l6PjFIUfsPCCLvKqRx/8+V0N9ywAvJT4Je3Wk0evZ8xsCjOaR9RO/pNYrx9pS+j1nDpavKxEc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573242734451624.491410276001; Fri, 8 Nov 2019 11:52:14 -0800 (PST) Received: from localhost ([::1]:59680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAIn-0004L0-9O for importer@patchew.org; Fri, 08 Nov 2019 14:52:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35831) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAFE-0000CP-8i for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iTAFD-000654-8Q for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:32 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:43277) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iTAFD-00064l-38 for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:31 -0500 Received: by mail-pf1-x442.google.com with SMTP id 3so5284757pfb.10 for ; Fri, 08 Nov 2019 11:48:31 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id f13sm10128262pfa.57.2019.11.08.11.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 11:48:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:cc:from:to; bh=tM4Fro2TVwkO5f8g7B2j9ujSbXOxCnayqaeFwddAub0=; b=YVUh2sWqTpEsCPUFUfc7lHA6DqDheheDlRXwy4adX+zaiGg5E35gi4DvX317kmuZ3F uzd1E0aMootYzW3hWBEz7NPfcPbjHrFUtxVsAYYJ28+wic/rdrbMKGVASUePI4myZzsq OceIEvUgvxZQ2B+eJoQpPfqkBksqyVt0UFlk81sOefbOCi9WQa8VzUyEXWD8njikPa0Q KSKVlqoMzufrm2EdbdZSrhuzfz6EOslTTAn6DEJpYU4wz0+8Qowxd9CXTojwr6Owscuq RqykuOXIoEtGEdlg2caWy62iH+cBBM6wBRrr//hnkQ8wUV7re69agX1oN1y+qGHJPyn9 N8cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=tM4Fro2TVwkO5f8g7B2j9ujSbXOxCnayqaeFwddAub0=; b=HldKFTDJi5oVD6ieNRTbTlRWU45m0qW15Ou7fYJOVNjm/G8mrOhVJkGF+mC5Z2cVOv r2gVZtx8LH2I9LV11YYYOAQwY/vwTarYE8Pu5wLJvRLl2Df6ab9yT5+1hdavWh7ErnE8 dyolZASKUlMG6EqzjioNzs2ogwYeAh0m5SajURFUJAjzovQoc3SFVh92AnLpxXQw03cl xfWL8dzGF97l7I7eD4dyoUkQ7EBRQsIFDf0WGHupqAJXMhozzyMEF2zvssN6t0tSGnHT Jzr8G4CbhF+SVTV5qwDgmAP6J0llXobTbgrW5NhuO433agP44dUV69aGbwwdQr8WrjnK +WQg== X-Gm-Message-State: APjAAAUbE/bzmUW9FwTaIZVa7WBrpUxbWm4HKBV48Df6DILuFB4a9LoP OLJ4j6UMbfy+qLLxlCJHqCYHSg== X-Google-Smtp-Source: APXvYqyrGOnLuRk4FgFZpne9bF6/pVqmwaDHEIfbSixB8zyzH8jvZtKCG8KIWTfttqaah879NKq8uw== X-Received: by 2002:a63:f513:: with SMTP id w19mr13779501pgh.55.1573242509630; Fri, 08 Nov 2019 11:48:29 -0800 (PST) Subject: [PATCH v2 3/3] RISC-V: virt: This is a "sifive,test1" test finisher Date: Fri, 8 Nov 2019 11:47:58 -0800 Message-Id: <20191108194758.17813-4-palmer@dabbelt.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191108194758.17813-1-palmer@dabbelt.com> References: <20191108194758.17813-1-palmer@dabbelt.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Palmer Dabbelt To: Peter Maydell , Alistair Francis , qemu-devel@nongnu.org, david@gibson.dropbear.id.au X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Palmer Dabbelt , qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The test finisher implements the reset command, which means it's a "sifive,test1" device. This is a backwards compatible change, so it's also a "sifive,test0" device. Fixes: 9a2551ed6f ("riscv: sifive_test: Add reset functionality") Signed-off-by: Palmer Dabbelt --- hw/riscv/virt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 23f340df19..65ad725920 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -359,7 +359,8 @@ static void create_fdt(RISCVVirtState *s, const struct = MemmapEntry *memmap, nodename =3D g_strdup_printf("/test@%lx", (long)memmap[VIRT_TEST].base); qemu_fdt_add_subnode(fdt, nodename); - qemu_fdt_setprop_string(fdt, nodename, "compatible", "sifive,test0"); + qemu_fdt_setprop_strings(fdt, nodename, "compatible", + "sifive,test1\0sifive,test0\0"); qemu_fdt_setprop_cells(fdt, nodename, "reg", 0x0, memmap[VIRT_TEST].base, 0x0, memmap[VIRT_TEST].size); --=20 2.21.0