From patchwork Mon Jun 12 22:34:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 691633 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp132026wru; Mon, 12 Jun 2023 15:36:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4KdukDJ77wZPFvCt5f63ijSpzhdVgLaUMIPl9CBMhOqgiUgZfGChcJ0zQBfUBSPsrkz8UD X-Received: by 2002:a05:6214:230b:b0:626:2f1b:b41a with SMTP id gc11-20020a056214230b00b006262f1bb41amr12381113qvb.49.1686609367589; Mon, 12 Jun 2023 15:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686609367; cv=none; d=google.com; s=arc-20160816; b=lTgRZd5ZCLfv28ooldewZmqBFtUE8hwOq/Zq6Acp+baTyohONL7Z9G5X25dVR5QG4J F1GCHxU8Ai3kUtSeGKnYdwtpfltx3tG3QrQKHzLz0x3dcoQUGqNaAOlyEj2lnIxIAAah tXs07KvZsv1Qt6ekXJZ7EHoYCmOKDHgqlaq7AwDR3TkYZk/SUUhp6A6USsgHUcKMgrnk WoFLVYIIQNxWutCYh6wRJlfOuiKgmZHjn/oV+0WFHMDj+U2j3P4/WvAA1cpW3YVUjusU U9qeGJd0FPBADQztjUz8yfhZGPF6WCfTx5IsvwCeUB1IW+2IMdDkPyLOuij8o/wqx6Fq AeXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qu0YkZGL/goBV8MNatIwrKy50fK2dB6nGF+E/AAnJcw=; b=ZLmnHg7Ic3OZ9l8JRdYuflOPHoOGgrNXeb3brW2SN2Vf4KYiRQcXDFRtEcFOZhxumg idCJDMiNbcY0rgF+t23kg9aV46M4Oov3cZ2pWUrrmM9JmlGKHFsBKINmC5NAJrwU5TaX 0LMPRrA4i30BE1K6aJerBCVMsa+OABcl++xnwYa3kZ1UGxoQnqvgiEWSwsh3otyl1rT7 +/eurORU7oNQFLh0ogeejnHsDvFPHUQW1BFxm5NzkRTEBA5rQBnJmHvtd06yu36q2ZFL vl1FbjB46zDjvPJZ0aqxIODn26wnB5neFsUfJMyk176GEMOpYrLSuReK0+QKAOcMdBhU POFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ohccGuMz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z2-20020ae9c102000000b0075d22c1892dsi6596116qki.662.2023.06.12.15.36.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Jun 2023 15:36:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ohccGuMz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8q8A-0001el-4S; Mon, 12 Jun 2023 18:35:22 -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 1q8q88-0001e3-2Y for qemu-devel@nongnu.org; Mon, 12 Jun 2023 18:35:20 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q8q86-0007rX-I9 for qemu-devel@nongnu.org; Mon, 12 Jun 2023 18:35:19 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-51478f6106cso8471451a12.1 for ; Mon, 12 Jun 2023 15:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686609317; x=1689201317; 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=qu0YkZGL/goBV8MNatIwrKy50fK2dB6nGF+E/AAnJcw=; b=ohccGuMzFzrNl9EFwbE5JDyln4H5edIrf2w3BmuLRfV2Ri7GTzBjZ8vxJEDU7wIOrf OqxSfqxU9nOIM0P6Qz+lvNF9FjRktJwRnAY/UdyIVmbNPxunJ6zbqKG+Fh9mb3tLyFU+ njlaOn2vm48okCkw8Vvn2YaJM4xyvxaSLZ3dEemLiftAxsWkube0dZDvDH5GmErslmlz 1TEMMeKkmeBpyDALN1P4rfYEF7EjrC1Q9ggHsCVy6mbaGS9SR8bZbYNTIRQb7sQbQXxE Qhz0kLSsabEYKV2dx5lnegK8oUOJ7qpUHoiBmJiYAt+5YrjzDK/X3QdXD9W+TMpJHzKw Lwfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686609317; x=1689201317; 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=qu0YkZGL/goBV8MNatIwrKy50fK2dB6nGF+E/AAnJcw=; b=fKo7JsJseSdZrl7O7vCBKvzuhEuUx1sGeUe5yFXnOzKEENpo3+b2vvmI8sw6SIogFo v9KrTOV7Uj3D51j49Ft2qoJ1n1+BreC/nelXBbnpXVCBU35nQNHlajSxQAkBqdyOsMW3 Osck4sYa5Otzp793cDF2wKH5a0H3RLn6ml1ySjf1l5si1J/4XwcF6F8cZCIu2wL/eefv 94jZ2kE8+AWksj/qjUogI7ziY5d0po2g/dYxhvpMHik9qdyo7476V5vsLHrGCaYw2yFC GVSBCUhhuFySZf1DfEmCwrfBMCtRH6hyAd7etFcMur6SVUnNHdqX1E6QOMNexUZcLzN8 qdXA== X-Gm-Message-State: AC+VfDwkYWwW2ysNimYqqqLn6JJobCoKzeA8KZlTJ/uDTTsLTLCU7gIm 87860rz4aTDBc4MkwCfOePtOqe1SYJGtN7T2kbG30w== X-Received: by 2002:a17:907:320b:b0:96a:3e7:b592 with SMTP id xg11-20020a170907320b00b0096a03e7b592mr8758313ejb.25.1686609316954; Mon, 12 Jun 2023 15:35:16 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id u22-20020a170906069600b0097461a7ebdcsm5753892ejb.82.2023.06.12.15.35.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 12 Jun 2023 15:35:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Sergey Kambalin , qemu-arm@nongnu.org, Peter Maydell Subject: [RFC PATCH v3 4/4] hw/misc/bcm2835_property: Handle CORE_CLK_ID firmware property Date: Tue, 13 Jun 2023 00:34:56 +0200 Message-Id: <20230612223456.33824-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230612223456.33824-1-philmd@linaro.org> References: <20230612223456.33824-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Sergey Kambalin Signed-off-by: Sergey Kambalin Message-Id: <20230531155258.8361-1-sergey.kambalin@auriga.com> [PMD: Split from bigger patch: 3/4] Signed-off-by: Philippe Mathieu-Daudé --- TOCHECK: seems raspi3-specific freq. Use a per-soc freq? Good enough for now? --- include/hw/arm/raspi_platform.h | 1 + hw/misc/bcm2835_property.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/hw/arm/raspi_platform.h b/include/hw/arm/raspi_platform.h index 83f2588fc5..92a317950a 100644 --- a/include/hw/arm/raspi_platform.h +++ b/include/hw/arm/raspi_platform.h @@ -173,6 +173,7 @@ /* Clock rates */ #define RPI_FIRMWARE_EMMC_CLK_RATE 50000000 #define RPI_FIRMWARE_UART_CLK_RATE 3000000 +#define RPI_FIRMWARE_CORE_CLK_RATE 350000000 #define RPI_FIRMWARE_DEFAULT_CLK_RATE 700000000 #endif diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 2e4fe969bf..4ed9faa54a 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -127,6 +127,9 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) case RPI_FIRMWARE_UART_CLK_ID: stl_le_phys(&s->dma_as, value + 16, RPI_FIRMWARE_UART_CLK_RATE); break; + case RPI_FIRMWARE_CORE_CLK_ID: + stl_le_phys(&s->dma_as, value + 16, RPI_FIRMWARE_CORE_CLK_RATE); + break; default: stl_le_phys(&s->dma_as, value + 16, RPI_FIRMWARE_DEFAULT_CLK_RATE);