From patchwork Sun Oct 29 06:03:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joelle van Dyne X-Patchwork-Id: 13439714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 079DBC4167D for ; Sun, 29 Oct 2023 06:06:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwyuT-0002GB-JX; Sun, 29 Oct 2023 02:04:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwyuS-0002FX-8U for qemu-devel@nongnu.org; Sun, 29 Oct 2023 02:04:28 -0400 Received: from mail-pg1-f179.google.com ([209.85.215.179]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwyuP-0001pP-Qt for qemu-devel@nongnu.org; Sun, 29 Oct 2023 02:04:28 -0400 Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-577e62e2adfso2353324a12.2 for ; Sat, 28 Oct 2023 23:04:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698559464; x=1699164264; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RsCUo6FYIwj5uKTqrDxQQU+6CCkuwUVskMEosAm0UDs=; b=X8HBTKhWg9kPTE1XyMLJkmfdC1hSy7RAYGOxvVoiXktNGxx6lqZMe+AXxhR78z0FRn mDMblPs95oJ3AExlyMYmlJve/HqJQE+G7Y76wi5CkBNmtN5KFFCQJkCgRadiRuRKqUUd u7C9NEusGgGwk/EVcZr+hrCERq4IaC2s/w3R7K8zI3oF86oEWWHld4essS2+WEGl/OAh cvgOmFAcEie0PvjVBptRpPLntHR5oSSA53R5qc5fLnww5r0NfCNGuwUxwi28UGbHFtuN 07Z2COInBrbKuamU1rnhTFGBuQqQrpBhXS7usah/m4rvhEIHoLxqUaKAQDaGdHuRABE0 hrWQ== X-Gm-Message-State: AOJu0YyBGgmNvi/0ZVDDbW2M0xnkqwx0SNwUkZS8UA+KnHhAyiT8YygO Ah9kn4pNjya4dvRY34yCWOzz+3NABYnXvw== X-Google-Smtp-Source: AGHT+IEPXqORc+ppyLIp/O7NVkhtgvDn6nmOHo0kclH5E/sRoCzXq6ArWuDsgubME5UhKVLc/5lntw== X-Received: by 2002:a05:6a21:3395:b0:17a:cfce:5a30 with SMTP id yy21-20020a056a21339500b0017acfce5a30mr6475433pzb.16.1698559464321; Sat, 28 Oct 2023 23:04:24 -0700 (PDT) Received: from localhost.localdomain ([2601:642:4c02:6ead:344e:2b1:f5a5:58c6]) by smtp.gmail.com with ESMTPSA id u12-20020a17090341cc00b001b8943b37a5sm4019518ple.24.2023.10.28.23.04.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 28 Oct 2023 23:04:23 -0700 (PDT) From: Joelle van Dyne To: qemu-devel@nongnu.org Cc: Joelle van Dyne , Paolo Bonzini , Song Gao Subject: [PATCH v3 08/14] hw/loongarch/virt: connect TPM to platform bus Date: Sat, 28 Oct 2023 23:03:21 -0700 Message-ID: <20231029060404.71196-9-j@getutm.app> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231029060404.71196-1-j@getutm.app> References: <20231029060404.71196-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.179; envelope-from=osy86dev@gmail.com; helo=mail-pg1-f179.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/loongarch/virt.c | 7 +++++++ hw/loongarch/Kconfig | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 4b7dc67a2d..feed0f8bbf 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1004,6 +1004,13 @@ static void loongarch_machine_device_plug_cb(HotplugHandler *hotplug_dev, } else if (memhp_type_supported(dev)) { virt_mem_plug(hotplug_dev, dev, errp); } + +#ifdef CONFIG_TPM + if (object_dynamic_cast(OBJECT(dev), TYPE_TPM_IF)) { + tpm_sysbus_plug(TPM_IF(dev), OBJECT(lams->platform_bus_dev), + VIRT_PLATFORM_BUS_BASEADDRESS); + } +#endif } static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *machine, diff --git a/hw/loongarch/Kconfig b/hw/loongarch/Kconfig index 5727efed6d..25da190ffc 100644 --- a/hw/loongarch/Kconfig +++ b/hw/loongarch/Kconfig @@ -5,6 +5,7 @@ config LOONGARCH_VIRT imply VIRTIO_VGA imply PCI_DEVICES imply NVDIMM + imply TPM_TIS_SYSBUS select SERIAL select VIRTIO_PCI select PLATFORM_BUS