From nobody Tue Dec 16 08:34:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1625223051; cv=none; d=zohomail.com; s=zohoarc; b=O3ER8C4z5LXyENX2lX+UHP33eb5z5AA6T2OdBQecA5dkfjw6w80OvfI+cJDb1BWs0QQm63ngvXHNUX7wxWDUfhUXCq3FGHnAHvC/2koCgtmFX1uy2sbrqV2+VdnXpDNUVdJBeypZPv1OE5A3SOOiHS2xylvJ5EHxwrCRzT9VDE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625223051; 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=DIGZ1OnFIqnIhBTRUfPjwDd5CcBHiyNlzbgBPSbVdrw=; b=kQRWi2olid++LKTCJwBiaUfjcsuQQvnnfjRoddFuJwN/019IO/MZz/3W2UzPiPiLJChnkIpM02L64yc419L2GuJ790kOlGr/sbqTH0yBFLahS78kxd3ijuxle2rmUK1Ni1c+QMZSAi9KxZgXnCCcS298V7JERTXcyicMCUpos58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625223051793953.6063137616189; Fri, 2 Jul 2021 03:50:51 -0700 (PDT) Received: from localhost ([::1]:54770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzGl0-0005xO-Pg for importer@patchew.org; Fri, 02 Jul 2021 06:50:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzGb6-0004qX-8i for qemu-devel@nongnu.org; Fri, 02 Jul 2021 06:40:36 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:43607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lzGay-0006eI-8e for qemu-devel@nongnu.org; Fri, 02 Jul 2021 06:40:35 -0400 Received: by mail-wm1-x32c.google.com with SMTP id q18-20020a1ce9120000b02901f259f3a250so6054813wmc.2 for ; Fri, 02 Jul 2021 03:40:27 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id p16sm2745810wrs.52.2021.07.02.03.40.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 03:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DIGZ1OnFIqnIhBTRUfPjwDd5CcBHiyNlzbgBPSbVdrw=; b=IpqWMlIuauj2fBX47HmfivH2y06YJ0rjzRziKQunFdvjyKzOAtdvQh7KALlbUYpY+w 81/mdqajlzmxC1xXExmDNZbKaPrnADzgFEcoo79H4wQTyzm+vtZeqGHhH3KQ3dZZSKhb DXfwGJ/eYr5pbdIZM724imio3moC8YuEs05SNwmIjCXYK8xF0GG3q9eLaGHjrhQQg2W/ OyLVrRF1+6DmecbHfvgKHVt/Zluxlhbh1drjAGD2WfXmAeos267rwDRuSoOHzoRoAw2x eL7kOmmHfwk73PPbqKHM+GqExswQEkyOIMT+6vS4cIyviwf2nnsyqjqrY3/yuRrdCxhp TVBA== 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=DIGZ1OnFIqnIhBTRUfPjwDd5CcBHiyNlzbgBPSbVdrw=; b=AgARDhX/H6cUQ5M7YZjnVxG/nnpHIzYkbk/MGL4lbkO+LiwH2qWDKZwgTZ0UvBTpub EM1ajgCRGyXVyCiuIzBupZ9CVinrwKOP/fdTko4Oih1HuhFkqyG12UBhKFT/+UdyOfhN CK7xpB4owlzIX4lTOUuasruYG65FMT7bt5GgD48k6k0bmomoF9qfLL4IXcuCKmm4YPAi QFblGO44WPTMgg2va4EJ/vDKW8QqPTANArrRhAJgvhNQcweANJVX/am3hVhFJwm8bj86 7LgGhim8RSHeVdhI+vOKBl3Wa50tYnw4lOOcBwAKdwK5ccIfJMITlCkW3I+qp97nyyMv W95g== X-Gm-Message-State: AOAM530rIFqanPTAaGW5h1n2cdfmrEss/8jffBxBjZz782jXDzUwFBGE iRtUOzSfsfWdV67u9zbCP3PR0orvBSfZGk2s X-Google-Smtp-Source: ABdhPJzoTSdjxRQPcDxq3kjbX99YShRV6LjnMgTsiaNwYl1iycbOgyCAR6wED3yV9cozURGmM2cMeQ== X-Received: by 2002:a1c:26c2:: with SMTP id m185mr15269864wmm.146.1625222426876; Fri, 02 Jul 2021 03:40:26 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 08/11] hw/arm/virt: Make PL061 GPIO lines pulled low, not high Date: Fri, 2 Jul 2021 11:40:15 +0100 Message-Id: <20210702104018.19881-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210702104018.19881-1-peter.maydell@linaro.org> References: <20210702104018.19881-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Uvarov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1625223053443100001 Content-Type: text/plain; charset="utf-8" For the virt board we have two PL061 devices -- one for NonSecure which is inputs only, and one for Secure which is outputs only. For the former, we don't care whether its outputs are pulled low or high when the line is configured as an input, because we don't connect them. For the latter, we do care, because we wire the lines up to the gpio-pwr device, which assumes that level 1 means "do the action" and 1 means "do nothing". For consistency in case we add more outputs in future, configure both PL061s to pull GPIO lines down to 0. Reported-by: Maxim Uvarov Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- hw/arm/virt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 4b96f060140..93ab9d21ea0 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -895,6 +895,9 @@ static void create_gpio_devices(const VirtMachineState = *vms, int gpio, MachineState *ms =3D MACHINE(vms); =20 pl061_dev =3D qdev_new("pl061"); + /* Pull lines down to 0 if not driven by the PL061 */ + qdev_prop_set_uint32(pl061_dev, "pullups", 0); + qdev_prop_set_uint32(pl061_dev, "pulldowns", 0xff); s =3D SYS_BUS_DEVICE(pl061_dev); sysbus_realize_and_unref(s, &error_fatal); memory_region_add_subregion(mem, base, sysbus_mmio_get_region(s, 0)); --=20 2.20.1