qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Use named constants in BCM props


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] Use named constants in BCM props
Date: Wed, 31 May 2023 19:34:12 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

Hi Sergey,

On 31/5/23 17:52, Sergey Kambalin wrote:
Signed-off-by: Sergey Kambalin <sergey.kambalin@auriga.com>
---
  hw/misc/bcm2835_property.c            | 120 ++++++++++---------
  include/hw/arm/raspi_platform.h       |   6 +
  include/hw/misc/raspberrypi-fw-defs.h | 163 ++++++++++++++++++++++++++
  3 files changed, 236 insertions(+), 53 deletions(-)
  create mode 100644 include/hw/misc/raspberrypi-fw-defs.h


diff --git a/include/hw/arm/raspi_platform.h b/include/hw/arm/raspi_platform.h
index 4a56dd4b89..92a317950a 100644
--- a/include/hw/arm/raspi_platform.h
+++ b/include/hw/arm/raspi_platform.h
@@ -170,4 +170,10 @@
  #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_CORE_CLK_RATE    350000000
+#define RPI_FIRMWARE_DEFAULT_CLK_RATE 700000000

Are these VideoCore constants?

  #endif
diff --git a/include/hw/misc/raspberrypi-fw-defs.h 
b/include/hw/misc/raspberrypi-fw-defs.h
new file mode 100644
index 0000000000..4551fe7450
--- /dev/null
+++ b/include/hw/misc/raspberrypi-fw-defs.h
@@ -0,0 +1,163 @@
+/*
+ * Raspberry Pi firmware definitions
+ *
+ * Copyright (C) 2022  Auriga LLC, based on Linux kernel
+ *   `include/soc/bcm2835/raspberrypi-firmware.h` (Copyright © 2015 Broadcom)
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef INCLUDE_HW_MISC_RASPBERRYPI_FW_DEFS_H_
+#define INCLUDE_HW_MISC_RASPBERRYPI_FW_DEFS_H_
+
+#include "qemu/osdep.h"

See https://qemu-project.gitlab.io/qemu/devel/style.html#include-directives:

  Do not include “qemu/osdep.h” from header files since the .c
  file will have already included it.

Otherwise your patch looks good!

I hope you are using the 'git cherry-pick -p' command to split
your previous big patch in multiple smaller, and not rewritting
the patches from scratch.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]