[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 32/33] hw/misc/bcm2835_property: Replace magic frequency values by
From: |
Peter Maydell |
Subject: |
[PULL 32/33] hw/misc/bcm2835_property: Replace magic frequency values by definitions |
Date: |
Mon, 19 Jun 2023 15:29:13 +0100 |
From: Sergey Kambalin <sergey.kambalin@auriga.com>
Signed-off-by: Sergey Kambalin <sergey.kambalin@auriga.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230612223456.33824-4-philmd@linaro.org
Message-Id: <20230531155258.8361-1-sergey.kambalin@auriga.com>
[PMD: Split from bigger patch: 4/4]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/hw/arm/raspi_platform.h | 5 +++++
hw/misc/bcm2835_property.c | 8 +++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/include/hw/arm/raspi_platform.h b/include/hw/arm/raspi_platform.h
index 4a56dd4b890..83f2588fc52 100644
--- a/include/hw/arm/raspi_platform.h
+++ b/include/hw/arm/raspi_platform.h
@@ -170,4 +170,9 @@
#define INTERRUPT_ILLEGAL_TYPE0 6
#define INTERRUPT_ILLEGAL_TYPE1 7
+/* Clock rates */
+#define RPI_FIRMWARE_EMMC_CLK_RATE 50000000
+#define RPI_FIRMWARE_UART_CLK_RATE 3000000
+#define RPI_FIRMWARE_DEFAULT_CLK_RATE 700000000
+
#endif
diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c
index 7d398a6f750..2e4fe969bf8 100644
--- a/hw/misc/bcm2835_property.c
+++ b/hw/misc/bcm2835_property.c
@@ -17,6 +17,7 @@
#include "qemu/log.h"
#include "qemu/module.h"
#include "trace.h"
+#include "hw/arm/raspi_platform.h"
/* https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface */
@@ -121,13 +122,14 @@ static void
bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
case RPI_FWREQ_GET_MIN_CLOCK_RATE:
switch (ldl_le_phys(&s->dma_as, value + 12)) {
case RPI_FIRMWARE_EMMC_CLK_ID:
- stl_le_phys(&s->dma_as, value + 16, 50000000);
+ stl_le_phys(&s->dma_as, value + 16,
RPI_FIRMWARE_EMMC_CLK_RATE);
break;
case RPI_FIRMWARE_UART_CLK_ID:
- stl_le_phys(&s->dma_as, value + 16, 3000000);
+ stl_le_phys(&s->dma_as, value + 16,
RPI_FIRMWARE_UART_CLK_RATE);
break;
default:
- stl_le_phys(&s->dma_as, value + 16, 700000000);
+ stl_le_phys(&s->dma_as, value + 16,
+ RPI_FIRMWARE_DEFAULT_CLK_RATE);
break;
}
resplen = 8;
--
2.34.1
- [PULL 30/33] hw/arm/raspi: Import Linux raspi definitions as 'raspberrypi-fw-defs.h', (continued)
- [PULL 30/33] hw/arm/raspi: Import Linux raspi definitions as 'raspberrypi-fw-defs.h', Peter Maydell, 2023/06/19
- [PULL 28/33] imx_serial: set wake bit when we receive a data byte, Peter Maydell, 2023/06/19
- [PULL 29/33] docs: sbsa: document board to firmware interface, Peter Maydell, 2023/06/19
- [PULL 33/33] hw/misc/bcm2835_property: Handle CORE_CLK_ID firmware property, Peter Maydell, 2023/06/19
- [PULL 17/33] target/arm: Convert LDR/STR reg+reg to decodetree, Peter Maydell, 2023/06/19
- [PULL 24/33] hw/intc/allwinner-a10-pic: Handle IRQ levels other than 0 or 1, Peter Maydell, 2023/06/19
- [PULL 20/33] target/arm: Convert LDAPR/STLR (imm) to decodetree, Peter Maydell, 2023/06/19
- [PULL 21/33] target/arm: Convert load/store (multiple structures) to decodetree, Peter Maydell, 2023/06/19
- [PULL 27/33] hw/arm/Kconfig: sbsa-ref uses Bochs display, Peter Maydell, 2023/06/19
- [PULL 26/33] hw/timer/nrf51_timer: Don't lose time when timer is queried in tight loop, Peter Maydell, 2023/06/19
- [PULL 32/33] hw/misc/bcm2835_property: Replace magic frequency values by definitions,
Peter Maydell <=
- Re: [PULL 00/33] target-arm queue, Richard Henderson, 2023/06/19