From patchwork Fri Nov 8 19:47:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 11235463 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE80D1709 for ; Fri, 8 Nov 2019 19:49:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95C312067B for ; Fri, 8 Nov 2019 19:49:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=dabbelt-com.20150623.gappssmtp.com header.i=@dabbelt-com.20150623.gappssmtp.com header.b="pi7fIL92" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95C312067B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:59604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAGT-0001W2-9X for patchwork-qemu-devel@patchwork.kernel.org; Fri, 08 Nov 2019 14:49:49 -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) 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) 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 *node_path, return r; } +static size_t stringarr_length(const char *strings) +{ + size_t count = 1; + while (strings[count - 1] != '\0' || strings[count] != '\0') { + count++; + } + return count; +} + +int qemu_fdt_setprop_strings(void *fdt, const char *node_path, + const char *property, const char *strings) +{ + size_t length = 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 that + * 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 From patchwork Fri Nov 8 19:47:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 11235465 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 696171747 for ; Fri, 8 Nov 2019 19:49:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 40FB82067B for ; Fri, 8 Nov 2019 19:49:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=dabbelt-com.20150623.gappssmtp.com header.i=@dabbelt-com.20150623.gappssmtp.com header.b="Phez6cVA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40FB82067B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:59606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAGU-0001XY-QN for patchwork-qemu-devel@patchwork.kernel.org; Fri, 08 Nov 2019 14:49:50 -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) 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) 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 haven'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) armcpu = ARM_CPU(qemu_get_cpu(0)); if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) { - const char compat[] = "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"); From patchwork Fri Nov 8 19:47:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 11235469 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9BA681747 for ; Fri, 8 Nov 2019 19:51:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72C872067B for ; Fri, 8 Nov 2019 19:51:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=dabbelt-com.20150623.gappssmtp.com header.i=@dabbelt-com.20150623.gappssmtp.com header.b="YVUh2sWq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72C872067B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:59680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAIY-0004L0-KN for patchwork-qemu-devel@patchwork.kernel.org; Fri, 08 Nov 2019 14:51:58 -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) 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) 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 = 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);