From nobody Mon Apr 7 19:01:28 2025 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=pass; 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1571937513; cv=none; d=zoho.com; s=zohoarc; b=ctTZciFD4XSP62FiFnXgP7CjNdbCmRau4Nc/6MgYpjLLw4XQyaVjUMpZfqUy2FXbMZaz+waZb+nQHvufVVUEFidt4VHhDYDP/0EeibE4hVvCRsH1eKSGqjsIozXEeR+N2g7RS/ezZsPoTHCOXlaZmsBtHnDebmTVIIiqgKM9Y1A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571937513; h=Content-Type:Content-Transfer-Encoding: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=rFFq99KjNRPKwCumrUa38nTH8zpDsdg+udhpyP1ndZA=; b=AbPDWIiAm5CnOzPrQrvTC7h7w21ZcIHTvIdDTL9C+gd0ZEyQ9WU6dCt0hHREac4lOpgY98f5EPKuqSl/0w732s4PHQ+DCEhX8JlCqVPE/FuhTf8XYDCI3D1vvQpdGvEaG7PqKNYSqoJVrgNA17ynAJo4tx9iJXUKfM9BYZiyffw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571937513672306.85265352424665; Thu, 24 Oct 2019 10:18:33 -0700 (PDT) Received: from localhost ([::1]:48518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNgkp-0001ZC-LZ for importer@patchew.org; Thu, 24 Oct 2019 13:18:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58296) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNfyN-0008Ne-58 for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:28:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNfyK-00015C-SC for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:28:26 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:44684) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNfyK-00014x-M6 for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:28:24 -0400 Received: by mail-wr1-x434.google.com with SMTP id z11so3426695wro.11 for ; Thu, 24 Oct 2019 09:28:24 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id r27sm42606124wrc.55.2019.10.24.09.28.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 09:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=rFFq99KjNRPKwCumrUa38nTH8zpDsdg+udhpyP1ndZA=; b=gh2UpAr1dKcujn0ivGmq8cOE6z5VChPo4Q0f121SMOuchWjp1XxF13nJpA1ml4LEMz MY4kCmiUUaL8wlX6RUH3Y3gJEPTlDM7mQ9hGYM2eO5Rt2vn+ATX0asQogy5wZKFB7Poi 1I5VxTMg+MqEPEmU3UHGSehGWBH7k2ZAD5i5SEwEMIYUOA8MQk0nyVhb9Y4Ax7BhP1Vx mTKehyfkTC/7rGoJGgEhL1ZUMCMQ2BxPISzDi+pp+ATg0Srzytc9p6kXe3r3I3mY+7F1 ieb9iZKlJrQl4V1TsKkpKr1mZ6KGF5Kof/791g9L86Spo48k3ZyfxWWQF7xpB6+Ajg2X vr5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rFFq99KjNRPKwCumrUa38nTH8zpDsdg+udhpyP1ndZA=; b=XW+natUmbPzYoizH3E9cGmsdNF8dpjhtFe2ju0HGR+ErIzMdaAFxmcyVaJZhSQQ3k/ 3s5LMbXr/jkMyXFG31JeSRqWyF72jUPLiwrr1qHIF28j72LuF9kRMpwzPDWsIZ/Qo4Xg OxlhIW/5tFoWgecy4B4OnAXxpRL0v2YY+FfrycGLojYeWK/Cz6AS3pRcBTFHuwTDx8bj EJl+JdUO3Zo6ufGTIER/tJmWhX4OKAgzD31dN7hMUOIKL/xWBlBfACtR5dRAfBk1dCT/ HZ3fh5wQJUs3lAykBtHRN6tYoCvm5PR/ucmuqTpXAYfTHiGDIPDmgYUCRhCe/TlfN9+1 u1bg== X-Gm-Message-State: APjAAAWr9ra35A/6af9LQuh4eT8y73iwbCjQzMerqeNjUCPDkQFj578m ZEmsGj2hMG6sLBPf46PgPQYrNVYFL8M= X-Google-Smtp-Source: APXvYqz3fjWED6wXjAzRNtRQnQpyeYa62gT4qVkvaBezR59gGgPrulRiriIpjVql5k31As1LiDfcVw== X-Received: by 2002:a5d:6a03:: with SMTP id m3mr4390417wru.90.1571934503453; Thu, 24 Oct 2019 09:28:23 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 45/51] hw/arm/bcm2835_peripherals: Use the thermal sensor block Date: Thu, 24 Oct 2019 17:27:18 +0100 Message-Id: <20191024162724.31675-46-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191024162724.31675-1-peter.maydell@linaro.org> References: <20191024162724.31675-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::434 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Philippe Mathieu-Daud=C3=A9 Map the thermal sensor in the BCM2835 block. Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20191019234715.25750-3-f4bug@amsat.org Signed-off-by: Peter Maydell --- include/hw/arm/bcm2835_peripherals.h | 2 ++ include/hw/arm/raspi_platform.h | 1 + hw/arm/bcm2835_peripherals.c | 13 +++++++++++++ 3 files changed, 16 insertions(+) diff --git a/include/hw/arm/bcm2835_peripherals.h b/include/hw/arm/bcm2835_= peripherals.h index 62a4c7b559d..be7ad9b4991 100644 --- a/include/hw/arm/bcm2835_peripherals.h +++ b/include/hw/arm/bcm2835_peripherals.h @@ -20,6 +20,7 @@ #include "hw/misc/bcm2835_property.h" #include "hw/misc/bcm2835_rng.h" #include "hw/misc/bcm2835_mbox.h" +#include "hw/misc/bcm2835_thermal.h" #include "hw/sd/sdhci.h" #include "hw/sd/bcm2835_sdhost.h" #include "hw/gpio/bcm2835_gpio.h" @@ -53,6 +54,7 @@ typedef struct BCM2835PeripheralState { SDHCIState sdhci; BCM2835SDHostState sdhost; BCM2835GpioState gpio; + Bcm2835ThermalState thermal; UnimplementedDeviceState i2s; UnimplementedDeviceState spi[1]; UnimplementedDeviceState i2c[3]; diff --git a/include/hw/arm/raspi_platform.h b/include/hw/arm/raspi_platfor= m.h index cdcbca943fb..61b04a1bd4a 100644 --- a/include/hw/arm/raspi_platform.h +++ b/include/hw/arm/raspi_platform.h @@ -48,6 +48,7 @@ #define SPI0_OFFSET 0x204000 #define BSC0_OFFSET 0x205000 /* BSC0 I2C/TWI */ #define OTP_OFFSET 0x20f000 +#define THERMAL_OFFSET 0x212000 #define BSC_SL_OFFSET 0x214000 /* SPI slave */ #define AUX_OFFSET 0x215000 /* AUX: UART1/SPI1/SPI2 */ #define EMMC1_OFFSET 0x300000 diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index fdcf616c56a..70bf927a025 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -111,6 +111,10 @@ static void bcm2835_peripherals_init(Object *obj) object_property_add_const_link(OBJECT(&s->dma), "dma-mr", OBJECT(&s->gpu_bus_mr), &error_abort); =20 + /* Thermal */ + sysbus_init_child_obj(obj, "thermal", &s->thermal, sizeof(s->thermal), + TYPE_BCM2835_THERMAL); + /* GPIO */ sysbus_init_child_obj(obj, "gpio", &s->gpio, sizeof(s->gpio), TYPE_BCM2835_GPIO); @@ -321,6 +325,15 @@ static void bcm2835_peripherals_realize(DeviceState *d= ev, Error **errp) INTERRUPT_DMA0 + n)); } =20 + /* THERMAL */ + object_property_set_bool(OBJECT(&s->thermal), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + memory_region_add_subregion(&s->peri_mr, THERMAL_OFFSET, + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->thermal), 0)); + /* GPIO */ object_property_set_bool(OBJECT(&s->gpio), true, "realized", &err); if (err) { --=20 2.20.1