<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Mr. Kinsey Moore,</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you very much for your help.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I just sent patch 1. And about patch2, I have a question:</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In shared/dev/clock/bcm2835-system-timer.c:</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
#if RTEMS_BSP == raspberrypi4b</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
#include <bsp/bcm2711.h></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
#else</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
#include <bsp/raspberrypi.h></div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
#endif /* RTEMS_BSP */</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Do I need to rename bcm2711.h in rpi4 BSP to raspberrypi.h, this will modify many files in rpi4 BSP.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best regards,</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Ning</div>
<hr style="display: inline-block; width: 98%;">
<div style="direction: ltr; font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<b>From:</b> Kinsey Moore <kinsey.moore@oarcorp.com><br>
<b>Sent:</b> Tuesday, April 9, 2024 11:10<br>
<b>To:</b> Ning Yang <yangn0@qq.com><br>
<b>Cc:</b> devel@rtems.org <devel@rtems.org><br>
<b>Subject:</b> Re: [PATCH 1/2] dev/clock: Move bcm2835-system-timer driver to shared space</div>
<div style="direction: ltr;"> </div>
<div style="direction: ltr;">One comment inline below.</div>
<div style="direction: ltr;"><br>
</div>
<div style="direction: ltr;">On Tue, Apr 9, 2024 at 10:02 AM Ning Yang <<a href="mailto:yangn0@qq.com" id="OWA1d95e4fb-f37a-b265-2800-08e09ee212b3" class="OWAAutoLink">yangn0@qq.com</a>> wrote:</div>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left: 1px solid rgb(204, 204, 204);">
<div style="direction: ltr;">This patch moves the bcm2835 system timer driver in the arm/raspberrypi directory to the shared directory.<br>
<br>
Made some changes in the include section to adapt to rpi4 BSP.<br>
---<br>
.../clockdrv.c => shared/dev/clock/bcm2835-system-timer.c} | 7 +++++++<br>
spec/build/bsps/arm/raspberrypi/obj.yml | 2 +-<br>
2 files changed, 8 insertions(+), 1 deletion(-)<br>
rename bsps/{arm/raspberrypi/clock/clockdrv.c => shared/dev/clock/bcm2835-system-timer.c} (95%)<br>
<br>
diff --git a/bsps/arm/raspberrypi/clock/clockdrv.c b/bsps/shared/dev/clock/bcm2835-system-timer.c<br>
similarity index 95%<br>
rename from bsps/arm/raspberrypi/clock/clockdrv.c<br>
rename to bsps/shared/dev/clock/bcm2835-system-timer.c<br>
index 8d220d51ba..2725735860 100644<br>
--- a/bsps/arm/raspberrypi/clock/clockdrv.c<br>
+++ b/bsps/shared/dev/clock/bcm2835-system-timer.c<br>
@@ -22,7 +22,14 @@<br>
#include <bsp.h><br>
#include <bsp/irq.h><br>
#include <bsp/irq-generic.h><br>
+<br>
+#if RTEMS_BSP == raspberrypi4b<br>
+#include <bsp/bcm2711.h><br>
+#define BCM2835_REG(addr) *(volatile uint32_t*)(addr)<br>
+#else<br>
#include <bsp/raspberrypi.h><br>
+#endif /* RTEMS_BSP */<br>
+</div>
</blockquote>
<div style="direction: ltr;"><br>
</div>
<div style="direction: ltr;">This change should really be in patch 2, but there is another issue with this change. This pattern is not used in existing code that I could find because it's fragile and introduces BSP-specific code into a shared driver that will
need to be updated for every single BSP that eventually wants to use it. Either the RPi4 BSP should define BCM2835_REG as a 32bit register access for compatibility or this driver should have its register accesses renamed to something more generic such as PI32_REG
which the RPi3 and RPi4 BSPs can provide for usage with this driver.</div>
<div style="direction: ltr;"><br>
</div>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left: 1px solid rgb(204, 204, 204);">
<div style="direction: ltr;"> #include <rtems/timecounter.h><br>
<br>
/* This is defined in ../../../shared/dev/clock/clockimpl.h */<br>
diff --git a/spec/build/bsps/arm/raspberrypi/obj.yml b/spec/build/bsps/arm/raspberrypi/obj.yml<br>
index ec5c82a8fb..ea370829df 100644<br>
--- a/spec/build/bsps/arm/raspberrypi/obj.yml<br>
+++ b/spec/build/bsps/arm/raspberrypi/obj.yml<br>
@@ -26,7 +26,6 @@ install:<br>
- bsps/arm/raspberrypi/include/bsp/vc.h<br>
links: []<br>
source:<br>
-- bsps/arm/raspberrypi/clock/clockdrv.c<br>
- bsps/arm/raspberrypi/console/console-config.c<br>
- bsps/arm/raspberrypi/console/fb.c<br>
- bsps/arm/raspberrypi/console/fbcons.c<br>
@@ -47,6 +46,7 @@ source:<br>
- bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c<br>
- bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c<br>
- bsps/arm/shared/start/bsp-start-memcpy.S<br>
+- bsps/shared/dev/clock/bcm2835-system-timer.c<br>
- bsps/shared/dev/cpucounter/cpucounterfrequency.c<br>
- bsps/shared/dev/cpucounter/cpucounterread.c<br>
- bsps/shared/dev/getentropy/getentropy-cpucounter.c<br>
--<br>
2.34.1<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" id="OWAb9a482bd-335c-d2c3-12ca-6b98b8ecbc4b" class="OWAAutoLink">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" id="OWA82274851-87d2-f370-e363-74b09dc4959a" class="OWAAutoLink" data-auth="NotApplicable">http://lists.rtems.org/mailman/listinfo/devel</a></div>
</blockquote>
</body>
</html>