From patchwork Thu Apr 23 12:11:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11505539 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 51F3113B2 for ; Thu, 23 Apr 2020 12:12:28 +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 2311B20857 for ; Thu, 23 Apr 2020 12:12:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QvLz5bKf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2311B20857 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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]:42168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRaiR-0003TM-5k for patchwork-qemu-devel@patchwork.kernel.org; Thu, 23 Apr 2020 08:12:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51980) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRahN-00024X-Cj for qemu-devel@nongnu.org; Thu, 23 Apr 2020 08:11:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRahN-00085v-2F for qemu-devel@nongnu.org; Thu, 23 Apr 2020 08:11:21 -0400 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]:46061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRahM-00085N-LE; Thu, 23 Apr 2020 08:11:20 -0400 Received: by mail-lj1-x244.google.com with SMTP id n6so5907840ljg.12; Thu, 23 Apr 2020 05:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YVkWkfMLZqJjeUY/UkhC2JqEDudQAewY227aecSIcQA=; b=QvLz5bKfJ7ZkPBA+xQ7RXcsCxhiu4FopAVwgqaytywA6rFfM/yIE2GWFQysTQ6Mzdy vO83kZjsNAGSEtdAPl9QlrVGPM0kj/igm2rKRavryTRUhi0UCbKRHZmxiUcinVxBRxpm bLuq9wbDeJPysVu3kH9VBTOl5QuKi4wVOfYzJcOW/rXLvNqJrzr95jNJZwdYmU5rED2/ o/VdAaPW6H98n6E9S+/2aRGSIUTu7BjzsZYya39dgJGnvfb44E4MOYnkwd76TO+E3PS6 HvoV99sD7KR9vOI0nNu5Mm8t/nxs3E+6cEx4oDMiRVKztJEYiMKv0rsULccDcT2XRFHH ZJRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YVkWkfMLZqJjeUY/UkhC2JqEDudQAewY227aecSIcQA=; b=oiFULWgTHNoZRvAlLsQgEaVmb/zL0d6npdAo44hiF3SOelsKiMlqRv6zlZy0WicRlg acl1gnkN815i2ee1nYTOeB4mWdYGD+lGvfTduRuCkrQL1rodfvCWg+9jwEY2JUzgewqW kw7vboLSprWXJTNA1aBofN+vml8yAr9xXK4nmveE47O5APIJw7b2NzJIGeqhrzFMOoO7 taLc5W+TEgXu1pqEnLfscSPcn8ENC35RWtI0rvfHBlt+wKQ9U/eRSa7NID3loh+LPgbK FdM8BZ3IaM7z6anNd5NSCmddJfHBn/ytYngdoXkGeML2O4lN/AhjAwBQn6Ajdx0Bd40N y4ew== X-Gm-Message-State: AGi0PubuABfx/P5yrovNEQhnGdIX7yJWLoSfiGi551YwvBUaag+MxCF4 l0D1xomalNKq8x5N/2tP7X6NV6BtQNw= X-Google-Smtp-Source: APiQypIh9NOVYzeM7sOit40n1f7NfeU4n6dh/ES7KCsUtfdnn5nkqeoJ29ru76R1FBx/nbvCdfNtDg== X-Received: by 2002:a2e:a40b:: with SMTP id p11mr526774ljn.148.1587643876676; Thu, 23 Apr 2020 05:11:16 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id u21sm1639447ljo.61.2020.04.23.05.11.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 05:11:15 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 1/4] device_tree: Allow name wildcards in qemu_fdt_node_path() Date: Thu, 23 Apr 2020 14:11:11 +0200 Message-Id: <20200423121114.4274-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200423121114.4274-1-edgar.iglesias@gmail.com> References: <20200423121114.4274-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::244; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x244.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::244 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Allow name wildcards in qemu_fdt_node_path(). This is useful to find all nodes with a given compatibility string. Reviewed-by: Alistair Francis Signed-off-by: Edgar E. Iglesias --- device_tree.c | 2 +- include/sysemu/device_tree.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/device_tree.c b/device_tree.c index bba6cc2164..f5b4699aed 100644 --- a/device_tree.c +++ b/device_tree.c @@ -308,7 +308,7 @@ char **qemu_fdt_node_path(void *fdt, const char *name, char *compat, offset = len; break; } - if (!strcmp(iter_name, name)) { + if (!name || !strcmp(iter_name, name)) { char *path; path = g_malloc(path_len); diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h index c16fd69bc0..7c53ef7634 100644 --- a/include/sysemu/device_tree.h +++ b/include/sysemu/device_tree.h @@ -39,6 +39,9 @@ void *load_device_tree_from_sysfs(void); * NULL. If there is no error but no matching node was found, the * returned array contains a single element equal to NULL. If an error * was encountered when parsing the blob, the function returns NULL + * + * @name may be NULL to wildcard names and only match compatibility + * strings. */ char **qemu_fdt_node_path(void *fdt, const char *name, char *compat, Error **errp); From patchwork Thu Apr 23 12:11:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11505543 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 C7291913 for ; Thu, 23 Apr 2020 12:13:56 +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 9CDC321835 for ; Thu, 23 Apr 2020 12:13:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="maMZOWCo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CDC321835 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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]:42190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRajr-0005V4-Pu for patchwork-qemu-devel@patchwork.kernel.org; Thu, 23 Apr 2020 08:13:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51992) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRahN-00024Z-Ng for qemu-devel@nongnu.org; Thu, 23 Apr 2020 08:11:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRahN-000860-1v for qemu-devel@nongnu.org; Thu, 23 Apr 2020 08:11:21 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:32994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRahM-00085T-Ld; Thu, 23 Apr 2020 08:11:20 -0400 Received: by mail-lj1-x242.google.com with SMTP id w20so5972078ljj.0; Thu, 23 Apr 2020 05:11:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ibni5GBdJPCYUbCK4oOU2/vhcP6N08qmypiQakNxh54=; b=maMZOWCoIqBkYRUPD5dLj7xFGvvrl7FK/OxkIwMNGmlNMi8fN1MqIuocIYDCpBNZfR j6IxkcFPjFtVD1ComvfYd2bRGR4fUqiRPmCztRcP4wWifCR/cGuCodFSXXa1Mq9wkbdu hPzqRwc//Jcmo8iO3MHuTLk65Zd2f/DyWe0bGMxucYj+M8QyuMB/qGXyC/M8E6kmXZ5M Xwj1XZWbUcvzyxeqWw31YbWYde4px4io1ZrRHg2Qcr3hsMMx8IO//A8bBzlV/LDcxtlX KPTmPDW1SZtqfDYbg+abW5Br0zIy/VGBwfcPfEuw5aD2kBThCF8dt1ZdO7Iswv1OP0AO tOHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ibni5GBdJPCYUbCK4oOU2/vhcP6N08qmypiQakNxh54=; b=C1GRmo2aWgQ1mWtShMHE4acp9WMLTlITduDyAS6s68HPW/hl9o4Dm3cr4io2Sphe+A NvgfQ+HIPesgEBucAfZPQaScN/6kWhiu3pVk0ldUg4spKNDLD/8rtwZ0Kn2KXeETVcD6 HiY3O3rMhDFAJNBF5UJ8txX6EBLSukzcvUdPgvRq2gh7TsUYLqZxh1oXp5ZDV/jT3o7R Rd/xZS3yPRyVQAmKKsH595mbSmbFzJX1Z6bLetPrmfxoNOB46G3XBwqnwf41InfwX4Rh x9ZHZ4bIJcBHH4kG+PjAVOBWzkknShcYiMZfUvquoX8gOu20pF0O2fWSZD+JNMl0IKeb sNTQ== X-Gm-Message-State: AGi0PuZ0ZytciDh3IUjafTZ8LLZT8emmetNBVyyvdPZ+4qzUakZ+AEa/ Lg+8fMe8NEyd0nikLx/F82JeK0fnZ3w= X-Google-Smtp-Source: APiQypL0MmbVPn6xBaga799KZscPvt93J+PDxtO/MNAnxzl6bng6v7dYp/TttLGASor6QNSLQZDyTQ== X-Received: by 2002:a2e:8693:: with SMTP id l19mr2159005lji.63.1587643878038; Thu, 23 Apr 2020 05:11:18 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id b73sm1708175lfg.86.2020.04.23.05.11.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 05:11:17 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 2/4] device_tree: Constify compat in qemu_fdt_node_path() Date: Thu, 23 Apr 2020 14:11:12 +0200 Message-Id: <20200423121114.4274-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200423121114.4274-1-edgar.iglesias@gmail.com> References: <20200423121114.4274-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::242; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x242.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::242 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Make compat in qemu_fdt_node_path() const char *. Signed-off-by: Edgar E. Iglesias --- device_tree.c | 2 +- include/sysemu/device_tree.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/device_tree.c b/device_tree.c index f5b4699aed..b335dae707 100644 --- a/device_tree.c +++ b/device_tree.c @@ -291,7 +291,7 @@ char **qemu_fdt_node_unit_path(void *fdt, const char *name, Error **errp) return path_array; } -char **qemu_fdt_node_path(void *fdt, const char *name, char *compat, +char **qemu_fdt_node_path(void *fdt, const char *name, const char *compat, Error **errp) { int offset, len, ret; diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h index 7c53ef7634..982c89345f 100644 --- a/include/sysemu/device_tree.h +++ b/include/sysemu/device_tree.h @@ -43,7 +43,7 @@ void *load_device_tree_from_sysfs(void); * @name may be NULL to wildcard names and only match compatibility * strings. */ -char **qemu_fdt_node_path(void *fdt, const char *name, char *compat, +char **qemu_fdt_node_path(void *fdt, const char *name, const char *compat, Error **errp); /** From patchwork Thu Apr 23 12:11:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11505545 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 9C274159A for ; Thu, 23 Apr 2020 12:15:04 +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 7087920736 for ; Thu, 23 Apr 2020 12:15:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pmL89yyf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7087920736 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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]:42202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRakx-0006eW-Kf for patchwork-qemu-devel@patchwork.kernel.org; Thu, 23 Apr 2020 08:15:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52014) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRahO-00024u-I3 for qemu-devel@nongnu.org; Thu, 23 Apr 2020 08:11:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRahO-00086n-0l for qemu-devel@nongnu.org; Thu, 23 Apr 2020 08:11:22 -0400 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]:38113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRahN-00085Y-KW; Thu, 23 Apr 2020 08:11:21 -0400 Received: by mail-lf1-x143.google.com with SMTP id l11so4551603lfc.5; Thu, 23 Apr 2020 05:11:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZzALLD5JjgtTBfQ7kca+0KHNMa+Pi21VHypSM0MfNpQ=; b=pmL89yyfWHWglmE3kQKcGQ8tGr905N32Yd47/kpbYIy6W8zaGQXS5rnA7JAjukvLqI 1dmOamjnoFfAAAU2lrmYNw9KUN3Gjjyrsu4edSAAgz/jsopzrdX31PUQIgPeECJlKRGd 3GklfZyl7kk5bvbbi0kluRaaYMnwfXtYGAUFMQAWaSa0yqyNe70EKote4E3f+4e9TGX5 aBOo8x4HARGo9btgFRptCSn5zYUN9KAru5CIp5F+NhUJ7AGs5KfXQ/ri/img+PGShWwp BAMAx/VaeZjvoEgl6QvxocLr+r4Q95VqWrAgp5sjVCKpk3SsWmE1uwhrHEVIG8mZ6Yrx H9nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZzALLD5JjgtTBfQ7kca+0KHNMa+Pi21VHypSM0MfNpQ=; b=iKArPlPGbsX8/zbobyLWiAgEL7Y29+iLi2liEnwRym/3FQ+KUQiiEru8pNcAfLc6Kq kcSUGHxDvJy1SeB48V5PrVYGDhKmQVw0Ip2Fb+FltfSzej81lWHespfUjneycnoX3ztu ViogbvTUnfilvpJUW78RqIaAcfA2aqntG2Vc4eibUFk5v4X5x4YG5g/AD2Iqxy00yI/d 3Au5Qr3xPhmGEnKHewFiRaKp6zeLvQFMn1lGOi85VRU6T322/EvPX1fsmzPqQz1Sh7zk nRQS8lnFyynM0TS15KFPnb32rFpapZlhuctzEpPUQe22XuBlvR1wh65pdJHk4CTWNxMT aatQ== X-Gm-Message-State: AGi0PuZDuceEJWFVwrkbz2PzTYfi47WNaRdIE2AxGMhrFyen9dlahJLO 31Ic0H+CMAEMhL7S3Oi4yF4nyoUhUvQ= X-Google-Smtp-Source: APiQypIGPdKDAHnaDhGdqauQepbYbTlNoqh/i5cS37Yyi20b5AofVsz6fhTkQOzvFqzycjqRhqsmsQ== X-Received: by 2002:a05:6512:52c:: with SMTP id o12mr2161976lfc.217.1587643879397; Thu, 23 Apr 2020 05:11:19 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id c2sm1739088ljk.97.2020.04.23.05.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 05:11:18 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 3/4] hw/arm: xlnx-zcu102: Move arm_boot_info into XlnxZCU102 Date: Thu, 23 Apr 2020 14:11:13 +0200 Message-Id: <20200423121114.4274-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200423121114.4274-1-edgar.iglesias@gmail.com> References: <20200423121114.4274-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::143; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x143.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::143 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Move arm_boot_info into XlnxZCU102. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Edgar E. Iglesias --- hw/arm/xlnx-zcu102.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c index bd645ad818..4eb117c755 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -31,13 +31,14 @@ typedef struct XlnxZCU102 { bool secure; bool virt; + + struct arm_boot_info binfo; } XlnxZCU102; #define TYPE_ZCU102_MACHINE MACHINE_TYPE_NAME("xlnx-zcu102") #define ZCU102_MACHINE(obj) \ OBJECT_CHECK(XlnxZCU102, (obj), TYPE_ZCU102_MACHINE) -static struct arm_boot_info xlnx_zcu102_binfo; static bool zcu102_get_secure(Object *obj, Error **errp) { @@ -166,9 +167,9 @@ static void xlnx_zcu102_init(MachineState *machine) /* TODO create and connect IDE devices for ide_drive_get() */ - xlnx_zcu102_binfo.ram_size = ram_size; - xlnx_zcu102_binfo.loader_start = 0; - arm_load_kernel(s->soc.boot_cpu_ptr, machine, &xlnx_zcu102_binfo); + s->binfo.ram_size = ram_size; + s->binfo.loader_start = 0; + arm_load_kernel(s->soc.boot_cpu_ptr, machine, &s->binfo); } static void xlnx_zcu102_machine_instance_init(Object *obj) From patchwork Thu Apr 23 12:11:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11505549 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 80EEB92A for ; Thu, 23 Apr 2020 12:16:05 +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 55D1B20736 for ; Thu, 23 Apr 2020 12:16:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="coGGTA8v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55D1B20736 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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]:42230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRalw-0007jR-Dh for patchwork-qemu-devel@patchwork.kernel.org; Thu, 23 Apr 2020 08:16:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52030) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRahP-00026H-GO for qemu-devel@nongnu.org; Thu, 23 Apr 2020 08:11:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRahP-00088o-2F for qemu-devel@nongnu.org; Thu, 23 Apr 2020 08:11:23 -0400 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]:35435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRahO-00086E-Lc; Thu, 23 Apr 2020 08:11:22 -0400 Received: by mail-lj1-x244.google.com with SMTP id g4so5967445ljl.2; Thu, 23 Apr 2020 05:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A4c4N6qFKw7wpuvVvkmWf+aAEVWxYv87v7CLCkKzKPw=; b=coGGTA8vomQ1GHf8kwtf/FbV6J6ZiV1q5bKWojrJ5BcgnO7Gi51oOgXxBAal0uH3PD HstP7xrryPvxD5ApfDgW8Pg90mo6ShkRdxmMJfQdX7DidEGDooeMcqjY8BqqybuZtahy NRwag/m6FibTPHrQ3JZvXE6Eyk14pqt9xt6Ylw81u+5Dx4Ko9pcSTMThe/YDbECMyUDE UY59fMdfDOBHrWPZ/0FlOruF8c4itqU5oqLQTTP5Wr5R1e+LpEQW9pBQ6oi+bsu9dVWB Acb5Hgne52q7Buj1TAl40AIgu1Nj8PubTHaEgM93Ck2bvVzx1UVjW1akZWnZi8qsJs4R RTgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A4c4N6qFKw7wpuvVvkmWf+aAEVWxYv87v7CLCkKzKPw=; b=sTI+55paK9IWK/SRoLsi7PfhsowjDFRQ+9Tdn7r+izbMzLjAwry2tiEtV+ZA3lnEaj BPOdJnFidB6ZJJBjWb/BjkvcIAcyLwE5QXBgJ6eY3aw1oSVtJ0rEnJTm1UJuTcjDNJzE p5lIIX2s15spH+T50eBgJ1+ZIQRvUkHDBuQlKQpO9rwhXuOzyEexFLDyK9KrohTpAJdO YtVS1ij0hJGU5JWanY7SlGq37N/N/kSnMax7ZMZKEgGC2PnCnF5NGrYaXh/qH5oBRmLv bi30tAmQRWGjEA2kI9gM+iqTQr1DWoSRV2Lp3+cRi2CMk5+ugjhFLKtygxPeaN9hFEjz ZSwQ== X-Gm-Message-State: AGi0PuaQjkOr2EBVwkfn3n1EdFKy9nK3lajQIKxREAjwDsUoOg2jL78t TrF7BpaUkoOm4rs/2eSAH2C4BPJoz2Q= X-Google-Smtp-Source: APiQypJR8Zzwdm+DNKe/h0gxcuPsc/UdbsR70VyDEDrbbQ8RNhYLriKyDjMQ1xy9rZoe29B7Gtx1YQ== X-Received: by 2002:a2e:a367:: with SMTP id i7mr2261216ljn.289.1587643880634; Thu, 23 Apr 2020 05:11:20 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id b9sm1830439lfp.27.2020.04.23.05.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 05:11:19 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 4/4] hw/arm: xlnx-zcu102: Disable unsupported FDT firmware nodes Date: Thu, 23 Apr 2020 14:11:14 +0200 Message-Id: <20200423121114.4274-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200423121114.4274-1-edgar.iglesias@gmail.com> References: <20200423121114.4274-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::244; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x244.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::244 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Disable unsupported FDT firmware nodes if a user passes us a DTB with nodes enabled that the machine cannot support due to lack of EL3 or EL2 support. Reviewed-by: Alistair Francis Signed-off-by: Edgar E. Iglesias --- hw/arm/xlnx-zcu102.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c index 4eb117c755..a798e228b7 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -23,6 +23,7 @@ #include "qemu/error-report.h" #include "qemu/log.h" #include "sysemu/qtest.h" +#include "sysemu/device_tree.h" typedef struct XlnxZCU102 { MachineState parent_obj; @@ -68,6 +69,34 @@ static void zcu102_set_virt(Object *obj, bool value, Error **errp) s->virt = value; } +static void zcu102_modify_dtb(const struct arm_boot_info *binfo, void *fdt) +{ + XlnxZCU102 *s = container_of(binfo, XlnxZCU102, binfo); + bool method_is_hvc; + char **node_path; + const char *r; + int prop_len; + int i; + + /* If EL3 is enabled, we keep all firmware nodes active. */ + if (!s->secure) { + node_path = qemu_fdt_node_path(fdt, NULL, "xlnx,zynqmp-firmware", + &error_fatal); + + for (i = 0; node_path && node_path[i]; i++) { + r = qemu_fdt_getprop(fdt, node_path[i], "method", &prop_len, NULL); + method_is_hvc = r && !strcmp("hvc", r); + + /* Allow HVC based firmware if EL2 is enabled. */ + if (method_is_hvc && s->virt) { + continue; + } + qemu_fdt_setprop_string(fdt, node_path[i], "status", "disabled"); + } + g_strfreev(node_path); + } +} + static void xlnx_zcu102_init(MachineState *machine) { XlnxZCU102 *s = ZCU102_MACHINE(machine); @@ -169,6 +198,7 @@ static void xlnx_zcu102_init(MachineState *machine) s->binfo.ram_size = ram_size; s->binfo.loader_start = 0; + s->binfo.modify_dtb = zcu102_modify_dtb; arm_load_kernel(s->soc.boot_cpu_ptr, machine, &s->binfo); }