[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 4/4] hw/misc/bcm2835_property: Handle CORE_CLK_ID firmware
From: |
Philippe Mathieu-Daudé |
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 |
From: Sergey Kambalin <sergey.kambalin@auriga.com>
Signed-off-by: Sergey Kambalin <sergey.kambalin@auriga.com>
Message-Id: <20230531155258.8361-1-sergey.kambalin@auriga.com>
[PMD: Split from bigger patch: 3/4]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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);
--
2.38.1