diff mbox series

[RFC,v3,4/4] hw/misc/bcm2835_property: Handle CORE_CLK_ID firmware property

Message ID 20230612223456.33824-5-philmd@linaro.org
State New
Headers show
Series hw/arm/raspi: Use named constants in BCM props | expand

Commit Message

Philippe Mathieu-Daudé June 12, 2023, 10:34 p.m. UTC
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(+)

Comments

Peter Maydell June 19, 2023, 1:30 p.m. UTC | #1
On Mon, 12 Jun 2023 at 23:35, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> 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?

Seems like 'good enough for now' to me. We can add a comment:

+/*
+ * TODO: this is really SoC-specific; we might want to
+ * set it per-SoC if it turns out any guests care.
+ */

-- PMM
diff mbox series

Patch

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);