From nobody Thu Nov 14 18:01:45 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708305948; cv=none; d=zohomail.com; s=zohoarc; b=JyvUxRpYJzJTrIvoXo6jDozES6+Gk0JQt597d8bdYXkmjvDxcu1MPjR75VG7+sM1HowFSirFO/1OC3HFjByKaL49AhmMi4xpbL+nUjke37iTLhAt5fkwJ114IGvXFtwhPpWAWy3+fwuI+5S44Ds0hMU6eIAP/Qa2wMTgj9103XU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708305948; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dwrUXWIcfFzdV7BBJp4HhKekDysIM9N/Y6Nj2awBLZc=; b=i6b8NUmohc2pz+ovVfx3fdpRr3d2GXOBbGRCO+qPKKgiqLt3Vzd5y9Y09gYDDgsgD/cB/vUkczvZTlB51mm+cSvx9YK+EvtkmjNVTP+cZvjzt7qWfVOoH/ppk0xyiHVG7BwgkhE3zo5qJ81aFLeQBZTocA1G/rGaLN76abmVXec= 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 1708305948285400.1067254344939; Sun, 18 Feb 2024 17:25:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbsJZ-0005Pq-1V; Sun, 18 Feb 2024 20:19:25 -0500 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 1rbsIh-0003a1-TR; Sun, 18 Feb 2024 20:18:33 -0500 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbsIf-0004LU-9I; Sun, 18 Feb 2024 20:18:31 -0500 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-60837b7a8ddso4278687b3.3; Sun, 18 Feb 2024 17:18:28 -0800 (PST) Received: from localhost.localdomain ([201.203.117.224]) by smtp.gmail.com with ESMTPSA id m12-20020a819e0c000000b00607ff905ed3sm1204704ywj.58.2024.02.18.17.18.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 17:18:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708305508; x=1708910308; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dwrUXWIcfFzdV7BBJp4HhKekDysIM9N/Y6Nj2awBLZc=; b=T78IK6WhS/MUQYx0NAeqrJMCTYVce+NqIRId8GE+POY2TlPlAUABp7uYb/xqHU+Cri QTegRR+aYAQx0K/uodP8X4cH1l0B6T+j7bL09PK1cWF6jNG59kJR3YK9vlQJ2IgzKEbx +91zmekr92zkJwSDAMZvRuh0CkvJl4KhGkoK+jDkjcrYCRBDlc/0Q1l0ZWG45RwEpsEM aoDmhfpmEU861ILrpkYrQpXYvcD/7E8YNqa0B0Lxzd3B66bFBjg6M6suS4cbKz6mV/os 5VtePrC3itmaadOtDQw5Nobv2pH9e8hRm+5ko3SScJzbee0wVpAeir5FGJ+kpvexrsI6 xBXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708305508; x=1708910308; 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=dwrUXWIcfFzdV7BBJp4HhKekDysIM9N/Y6Nj2awBLZc=; b=vFzt76uOmn1RFdKGDLT5UWPBHAxXFyvaUDVzEMJ97Kr4BGwraL/fzfmhxf1FS9clcC LowaII96zSUJeQNzP9hcO1L2xaI9LrjClhIGQX9g8yg2TMs1qJGgmd4dfqiHhwzKUOZo oUIA8t7KAsWSviotbMHAdsqiqhlLRdsm0/g4PesCwtSSn7UxkX/s7ECW18KdSEC8x/TB eeE3p1RH5jTAG5QDD+RbvDpCe/jL+gj7Z9DmJ7U9sP0qF+icreJbIP5A12eCKGovJRbg W6kQnXJrYPyD1CYk03912dAJOeUGyPqBbEy7mqv/RGtvuy/aTut1hLsD47b0sCwrMiCA XfGg== X-Gm-Message-State: AOJu0YyuemuzUsfEg9ohZGvvvRJ4XcrEw22C4RzrDhH+U4HhhmiQduKK Zbiyl5QteCLgzNUlplHtoadoAuGNq0Lvvt5HKB6vsnXwvdNDP8B3X3B2vtg793Y= X-Google-Smtp-Source: AGHT+IFTp8B7Tb0wAmV4USL3PThH4U2rziC+6FSUS2zjGz/gGbPxow9IiLImKDiDTCnywdECZM0q9g== X-Received: by 2002:a81:ad1d:0:b0:604:a47e:6e52 with SMTP id l29-20020a81ad1d000000b00604a47e6e52mr10905607ywh.32.1708305507805; Sun, 18 Feb 2024 17:18:27 -0800 (PST) From: Sergey Kambalin X-Google-Original-From: Sergey Kambalin To: qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org, Sergey Kambalin Subject: [PATCH v5 39/41] Add missed BCM2835 properties Date: Sun, 18 Feb 2024 19:17:37 -0600 Message-Id: <20240219011739.2316619-40-sergey.kambalin@auriga.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240219011739.2316619-1-sergey.kambalin@auriga.com> References: <20240219011739.2316619-1-sergey.kambalin@auriga.com> 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=2607:f8b0:4864:20::1133; envelope-from=serg.oker@gmail.com; helo=mail-yw1-x1133.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708305949858100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Sergey Kambalin --- hw/misc/bcm2835_property.c | 21 +++++++++++++++++++++ include/hw/arm/raspberrypi-fw-defs.h | 11 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 5c48f8d743..bdd9a6bbce 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -19,6 +19,8 @@ #include "trace.h" #include "hw/arm/raspi_platform.h" =20 +#define VCHI_BUSADDR_SIZE sizeof(uint32_t) + /* https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface= */ =20 static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t v= alue) @@ -138,6 +140,13 @@ static void bcm2835_property_mbox_push(BCM2835Property= State *s, uint32_t value) resplen =3D 8; break; =20 + case RPI_FWREQ_GET_CLOCKS: + /* TODO: add more clock IDs if needed */ + stl_le_phys(&s->dma_as, value + 12, 0); + stl_le_phys(&s->dma_as, value + 16, RPI_FIRMWARE_ARM_CLK_ID); + resplen =3D 8; + break; + case RPI_FWREQ_SET_CLOCK_RATE: case RPI_FWREQ_SET_MAX_CLOCK_RATE: case RPI_FWREQ_SET_MIN_CLOCK_RATE: @@ -276,6 +285,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyS= tate *s, uint32_t value) stl_le_phys(&s->dma_as, value + 12, 0); resplen =3D 4; break; + case RPI_FWREQ_FRAMEBUFFER_GET_NUM_DISPLAYS: stl_le_phys(&s->dma_as, value + 12, 1); resplen =3D 4; @@ -301,6 +311,17 @@ static void bcm2835_property_mbox_push(BCM2835Property= State *s, uint32_t value) resplen); break; =20 + case RPI_FWREQ_GET_THROTTLED: + stl_le_phys(&s->dma_as, value + 12, 0); + resplen =3D 4; + break; + + case RPI_FWREQ_VCHIQ_INIT: + stl_le_phys(&s->dma_as, + value + offsetof(rpi_firmware_prop_request_t, payl= oad), + 0); + resplen =3D VCHI_BUSADDR_SIZE; + break; default: qemu_log_mask(LOG_UNIMP, "bcm2835_property: unhandled tag 0x%08x\n", tag); diff --git a/include/hw/arm/raspberrypi-fw-defs.h b/include/hw/arm/raspberr= ypi-fw-defs.h index 579cf0d554..8b404e0533 100644 --- a/include/hw/arm/raspberrypi-fw-defs.h +++ b/include/hw/arm/raspberrypi-fw-defs.h @@ -159,4 +159,15 @@ enum rpi_firmware_clk_id { RPI_FIRMWARE_NUM_CLK_ID, }; =20 +struct rpi_firmware_property_tag_header { + uint32_t tag; + uint32_t buf_size; + uint32_t req_resp_size; +}; + +typedef struct rpi_firmware_prop_request { + struct rpi_firmware_property_tag_header hdr; + uint8_t payload[0]; +} rpi_firmware_prop_request_t; + #endif /* INCLUDE_HW_MISC_RASPBERRYPI_FW_DEFS_H_ */ --=20 2.34.1