<div dir="ltr"><div><div>Kindly ignore this.  I have rebased and pushed all the changes in one patch. <br><br></div>Thanks<br></div>Mudit </div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 20, 2016 at 6:55 PM, Mudit Jain <span dir="ltr"><<a href="mailto:muditjain18011995@gmail.com" target="_blank">muditjain18011995@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Mudit Jain <<a href="mailto:muditj@nvidia.com">muditj@nvidia.com</a>><br>
<br>
---<br>
 c/src/lib/libbsp/arm/<wbr>raspberrypi/include/vc.h      |  8 +++++++<br>
 c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc.c         | 26 ++++++++++++++++++++++<br>
 c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc_defines.h | 12 ++++++++++<br>
 3 files changed, 46 insertions(+)<br>
<br>
diff --git a/c/src/lib/libbsp/arm/<wbr>raspberrypi/include/vc.h b/c/src/lib/libbsp/arm/<wbr>raspberrypi/include/vc.h<br>
index 74f7557..e863732 100644<br>
--- a/c/src/lib/libbsp/arm/<wbr>raspberrypi/include/vc.h<br>
+++ b/c/src/lib/libbsp/arm/<wbr>raspberrypi/include/vc.h<br>
@@ -144,6 +144,14 @@ typedef struct {<br>
<br>
 int bcm2835_mailbox_get_board_<wbr>serial(<br>
   bcm2835_get_board_serial_<wbr>entries *_entries );<br>
+<br>
+typedef struct {<br>
+  uint32_t clock_id;<br>
+  uint32_t clock_rate;<br>
+} bcm2835_get_clock_rate_<wbr>entries;<br>
+<br>
+int bcm2835_mailbox_get_clock_<wbr>rate(<br>
+  bcm2835_get_clock_rate_entries *_entries );<br>
 /** @} */<br>
<br>
 #endif /* LIBBSP_ARM_RASPBERRYPI_VC_H */<br>
diff --git a/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc.c b/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc.c<br>
index c089b36..df92649 100644<br>
--- a/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc.c<br>
+++ b/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc.c<br>
@@ -447,3 +447,29 @@ int bcm2835_mailbox_get_board_<wbr>serial(<br>
<br>
   return 0;<br>
 }<br>
+<br>
+int bcm2835_mailbox_get_clock_<wbr>rate(<br>
+  bcm2835_get_clock_rate_entries *_entries )<br>
+{<br>
+  struct {<br>
+    bcm2835_mbox_buf_hdr hdr;<br>
+    bcm2835_mbox_tag_get_clock_<wbr>rate get_clock_rate;<br>
+    uint32_t end_tag;<br>
+  } buffer BCM2835_MBOX_BUF_ALIGN_<wbr>ATTRIBUTE;<br>
+  BCM2835_MBOX_INIT_BUF( &buffer );<br>
+  BCM2835_MBOX_INIT_TAG_NO_REQ( &buffer.get_clock_rate,<br>
+    BCM2835_MAILBOX_TAG_GET_CLOCK_<wbr>RATE );<br>
+  buffer.get_clock_rate.body.<wbr>req.clock_id = _entries->clock_id;<br>
+  bcm2835_mailbox_buffer_flush_<wbr>and_invalidate( &buffer, sizeof( &buffer ) );<br>
+<br>
+  if ( bcm2835_mailbox_send_read_<wbr>buffer( &buffer ) )<br>
+    return -1;<br>
+<br>
+  _entries->clock_id = buffer.get_clock_rate.body.<wbr>resp.clock_id;<br>
+  _entries->clock_rate = buffer.get_clock_rate.body.<wbr>resp.clock_rate;<br>
+<br>
+  if ( !bcm2835_mailbox_buffer_<wbr>suceeded( &buffer.hdr ) )<br>
+    return -2;<br>
+<br>
+  return 0;<br>
+}<br>
diff --git a/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc_defines.h b/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc_defines.h<br>
index e1a5a5b..48d1658 100644<br>
--- a/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc_defines.h<br>
+++ b/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc_defines.h<br>
@@ -217,6 +217,18 @@ typedef struct {<br>
 } bcm2835_mbox_tag_get_vc_<wbr>memory;<br>
<br>
 #define BCM2835_MAILBOX_TAG_GET_CLOCKS          0x00010007<br>
+typedef struct {<br>
+  bcm2835_mbox_tag_hdr tag_hdr;<br>
+  union {<br>
+    struct {<br>
+      uint32_t clock_id;<br>
+    } req;<br>
+    struct {<br>
+      uint32_t clock_id;<br>
+      uint32_t clock_rate;<br>
+    } resp;<br>
+  } body;<br>
+} bcm2835_mbox_tag_get_clock_<wbr>rate;<br>
<br>
 /* Config */<br>
 #define BCM2835_MAILBOX_TAG_GET_CMD_<wbr>LINE        0x00050001<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
</font></span></blockquote></div><br></div>