<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Qiao,</div><div class="">Functionally, this code looks good to me. It builds without warnings for the Pi and Pi2, and I was able to make the calls to init the frame buffer on the Pi B+. </div><div class=""><br class=""></div><div class="">When you did the frame buffer test, what was your MMU table entry for the mailbox/framebuffer?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Alan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 19, 2015, at 3:17 PM, QIAO YANG <<a href="mailto:yangqiao0505@me.com" class="">yangqiao0505@me.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><div class="">Here is a modified patch for mailbox. If there's still anything against the convention, please point it out and I'll correct it immediately. The mailbox implementation might also be needed by other rpi bsp developpers.<br class=""><br class="">----------------------<br class=""><br class="">diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am<br class="">index c6133df..70bc01d 100644<br class="">--- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am<br class="">+++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am<br class="">@@ -43,6 +43,7 @@ include_bsp_HEADERS += ../shared/include/arm-release-id.h<br class=""> include_bsp_HEADERS += include/irq.h<br class=""> include_bsp_HEADERS += include/mmu.h<br class=""> include_bsp_HEADERS += include/usart.h<br class="">+include_bsp_HEADERS += include/mailbox.h<br class=""> include_bsp_HEADERS += include/raspberrypi.h<br class=""> <br class=""> include_libcpu_HEADERS = ../../../libcpu/arm/shared/include/cache_.h \<br class="">@@ -123,6 +124,9 @@ libbsp_a_SOURCES += misc/timer.c<br class=""> <br class=""> # I2C<br class=""> <br class="">+# Mailbox<br class="">+libbsp_a_SOURCES += misc/mailbox.c<br class="">+<br class=""> # Cache<br class=""> libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c<br class=""> libbsp_a_SOURCES += ../../../libcpu/arm/shared/include/cache_.h<br class="">diff --git a/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h b/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h<br class="">new file mode 100644<br class="">index 0000000..fa6a0c2<br class="">--- /dev/null<br class="">+++ b/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h<br class="">@@ -0,0 +1,33 @@<br class="">+/**<br class="">+ * @file<br class="">+ *<br class="">+ * @ingroup raspberrypi<br class="">+ *<br class="">+ * @brief mailbox support.<br class="">+ */<br class="">+<br class="">+/*<br class="">+ * Copyright (c) 2015 Yang Qiao<br class="">+ *<br class="">+ * The license and distribution terms for this file may be<br class="">+ * found in the file LICENSE in this distribution or at<br class="">+ *<br class="">+ * <a href="http://www.rtems.org/license/LICENSE" class="">http://www.rtems.org/license/LICENSE</a><br class="">+ *<br class="">+ */<br class="">+<br class="">+#ifndef LIBBSP_ARM_RASPBERRYPI_MAILBOX_H<br class="">+#define LIBBSP_ARM_RASPBERRYPI_MAILBOX_H<br class="">+<br class="">+#ifdef __cplusplus<br class="">+extern "C" {<br class="">+#endif /* __cplusplus */<br class="">+<br class="">+extern unsigned int raspberrypi_mailbox_read(unsigned int channel);<br class="">+extern void raspberrypi_mailbox_write(unsigned int channel, unsigned int data);<br class="">+<br class="">+#ifdef __cplusplus<br class="">+}<br class="">+#endif /* __cplusplus */<br class="">+<br class="">+#endif /* LIBBSP_ARM_RASPBERRYPI_MAILBOX_H */<br class="">diff --git a/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h b/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h<br class="">index c33e22a..3240404 100644<br class="">--- a/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h<br class="">+++ b/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h<br class="">@@ -208,6 +208,55 @@<br class=""> <br class=""> /** @} */<br class=""> <br class="">+ /**<br class="">+ * @name Mailbox Registers<br class="">+ *<br class="">+ * @{<br class="">+ */<br class="">+<br class="">+#define BCM2835_MBOX_BASE (RPI_PERIPHERAL_BASE+0xB880)<br class="">+<br class="">+#define BCM2835_MBOX_PEEK (BCM2835_MBOX_BASE+0x10)<br class="">+#define BCM2835_MBOX_READ (BCM2835_MBOX_BASE+0x00)<br class="">+#define BCM2835_MBOX_WRITE (BCM2835_MBOX_BASE+0x20)<br class="">+#define BCM2835_MBOX_STATUS (BCM2835_MBOX_BASE+0x18)<br class="">+#define BCM2835_MBOX_SENDER (BCM2835_MBOX_BASE+0x14)<br class="">+#define BCM2835_MBOX_CONFIG (BCM2835_MBOX_BASE+0x1C)<br class="">+<br class="">+#define BCM2835_MBOX_SUCCESS (BCM2835_MBOX_BASE+0x80000000)<br class="">+#define BCM2835_MBOX_FULL (BCM2835_MBOX_BASE+0x80000000)<br class="">+#define BCM2835_MBOX_EMPTY (BCM2835_MBOX_BASE+0x40000000)<br class="">+<br class="">+/**<br class="">+* @name Mailbox Channels<br class="">+*<br class="">+* @{<br class="">+*/<br class="">+<br class="">+/* Power Manager channel */<br class="">+#define BCM2835_MBOX_CHANNEL_PM 0<br class="">+/* Framebuffer channel */<br class="">+#define BCM2835_MBOX_CHANNEL_FB 1<br class="">+ /* Virtual UART channel */<br class="">+#define BCM2835_MBOX_CHANNEL_VUART 2<br class="">+ /* VCHIQ channel */<br class="">+#define BCM2835_MBOX_CHANNEL_VCHIQ 3<br class="">+ /* LEDs channel */<br class="">+#define BCM2835_MBOX_CHANNEL_LED 4<br class="">+ /* Button channel */<br class="">+#define BCM2835_MBOX_CHANNEL_BUTTON 5<br class="">+ /* Touch screen channel */<br class="">+#define BCM2835_MBOX_CHANNEL_TOUCHS 6<br class="">+/* Property tags (ARM <-> VC) channel */<br class="">+#define BCM2835_MBOX_CHANNEL_PROP_AVC 8<br class="">+ /* Property tags (VC <-> ARM) channel */<br class="">+#define BCM2835_MBOX_CHANNEL_PROP_VCA 9<br class="">+<br class="">+/** @} */<br class="">+<br class="">+<br class="">+/** @} */<br class="">+<br class=""> <br class=""> /** @} */<br class=""> <br class="">diff --git a/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c b/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c<br class="">new file mode 100644<br class="">index 0000000..2a63a41<br class="">--- /dev/null<br class="">+++ b/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c<br class="">@@ -0,0 +1,44 @@<br class="">+/**<br class="">+ * @file<br class="">+ *<br class="">+ * @ingroup raspberrypi<br class="">+ *<br class="">+ * @brief mailbox support.<br class="">+ */<br class="">+<br class="">+/*<br class="">+ * Copyright (c) 2015 Yang Qiao<br class="">+ *<br class="">+ * The license and distribution terms for this file may be<br class="">+ * found in the file LICENSE in this distribution or at<br class="">+ *<br class="">+ * <a href="http://www.rtems.org/license/LICENSE" class="">http://www.rtems.org/license/LICENSE</a><br class="">+ *<br class="">+ */<br class="">+<br class="">+#include <stdint.h><br class="">+#include <bsp/raspberrypi.h><br class="">+#include <bsp/mailbox.h><br class="">+<br class="">+unsigned int raspberrypi_mailbox_read (unsigned int channel)<br class="">+{<br class="">+ unsigned int data;<br class="">+ unsigned int read_channel;<br class="">+<br class="">+ while ( 1 )<br class="">+ {<br class="">+ while (BCM2835_REG (BCM2835_MBOX_STATUS ) & BCM2835_MBOX_EMPTY);<br class="">+ data = BCM2835_REG (BCM2835_MBOX_READ );<br class="">+ read_channel = (unsigned int) (data & 0xF );<br class="">+ if (read_channel == channel)<br class="">+ return (data & 0xFFFFFFF0);<br class="">+ }<br class="">+}<br class="">+<br class="">+void raspberrypi_mailbox_write(unsigned int channel, unsigned int data)<br class="">+{<br class="">+ while (BCM2835_REG(BCM2835_MBOX_STATUS) & BCM2835_MBOX_FULL);<br class="">+ BCM2835_REG(BCM2835_MBOX_WRITE) = <br class="">+ (data & 0xFFFFFFF0) | <br class="">+ (unsigned int) (channel & 0xF);<br class="">+}<br class="">diff --git a/c/src/lib/libbsp/arm/raspberrypi/preinstall.am b/c/src/lib/libbsp/arm/raspberrypi/preinstall.am<br class="">index 70259e2..4cb7ed6 100644<br class="">--- a/c/src/lib/libbsp/arm/raspberrypi/preinstall.am<br class="">+++ b/c/src/lib/libbsp/arm/raspberrypi/preinstall.am<br class="">@@ -126,6 +126,10 @@ $(PROJECT_INCLUDE)/bsp/usart.h: include/usart.h $(PROJECT_INCLUDE)/bsp/$(dirstam<br class=""> $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/usart.h<br class=""> PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/usart.h<br class=""> <br class="">+$(PROJECT_INCLUDE)/bsp/mailbox.h: include/mailbox.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)<br class="">+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/mailbox.h<br class="">+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/mailbox.h<br class="">+<br class=""> $(PROJECT_INCLUDE)/bsp/raspberrypi.h: include/raspberrypi.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)<br class=""> $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/raspberrypi.h<br class=""> PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/raspberrypi.h<br class=""></div><div class=""><br class=""></div><div class=""><br class="">On Apr 16, 2015, at 11:20 PM, Gedare Bloom <<a href="mailto:gedare@rtems.org" class="">gedare@rtems.org</a>> wrote:<br class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="msg-quote"><div class="_stretch"><span class="body-text-content">Are you working to make the corrections I mentioned?<br class=""><br class="">On Tue, Apr 7, 2015 at 10:05 AM, Gedare Bloom <<a href="mailto:gedare@rtems.org" data-mce-href="mailto:gedare@rtems.org" class="">gedare@rtems.org</a>> wrote:<br class=""></span><blockquote class="quoted-plain-text" type="cite">On Mon, Apr 6, 2015 at 5:12 PM, QIAO YANG <<a href="mailto:yangqiao0505@me.com" data-mce-href="mailto:yangqiao0505@me.com" class="">yangqiao0505@me.com</a>> wrote:</blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">-----</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">index c6133df..70bc01d 100644</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">--- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">@@ -43,6 +43,7 @@ include_bsp_HEADERS += ../shared/include/arm-release-id.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">include_bsp_HEADERS += include/irq.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">include_bsp_HEADERS += include/mmu.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">include_bsp_HEADERS += include/usart.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+include_bsp_HEADERS += include/mailbox.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">include_bsp_HEADERS += include/raspberrypi.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">include_libcpu_HEADERS = ../../../libcpu/arm/shared/include/cache_.h \</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">@@ -123,6 +124,9 @@ libbsp_a_SOURCES += misc/timer.c</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"># I2C</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+# Mailbox</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+libbsp_a_SOURCES += misc/mailbox.c</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"># Cache</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">libbsp_a_SOURCES += ../../../libcpu/arm/shared/include/cache_.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">diff --git a/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">b/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">new file mode 100644</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">index 0000000..abdb258</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">--- /dev/null</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+++ b/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">@@ -0,0 +1,7 @@</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite">Need file header documentation. Please see</blockquote><blockquote class="quoted-plain-text" type="cite"><a href="https://devel.rtems.org/wiki/Developer/Coding/Conventions" data-mce-href="https://devel.rtems.org/wiki/Developer/Coding/Conventions" class="">https://devel.rtems.org/wiki/Developer/Coding/Conventions</a><div style="width:0px; height:0px;" class=""> </div></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#ifndef MAILBOX_H</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define MAILBOX_H</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+extern unsigned int readmailbox(unsigned int channel);</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+extern void writemailbox(unsigned int channel, unsigned int data);</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite">Please use function names with a "namespace". the usual convention in</blockquote><blockquote class="quoted-plain-text" type="cite">RTEMS is to use Package_Class_Method like raspberrypi_mailbox_read()</blockquote><blockquote class="quoted-plain-text" type="cite">and raspberrypi_mailbox_write().</blockquote><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#endif /* MAILBOX_H */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">\ No newline at end of file</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">diff --git a/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">b/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">index c33e22a..e4ce18f 100644</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">--- a/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+++ b/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">@@ -208,6 +208,52 @@</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">/** @} */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ /**</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ * @name Mailbox Registers</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ *</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ * @{</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+/**</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ * NOTE:</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_BASE (RPI_PERIPHERAL_BASE+0xB880)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_PEEK (BCM2835_MBOX_BASE+0x10)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_READ (BCM2835_MBOX_BASE+0x00)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_WRITE (BCM2835_MBOX_BASE+0x20)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_STATUS (BCM2835_MBOX_BASE+0x18)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_SENDER (BCM2835_MBOX_BASE+0x14)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_CONFIG (BCM2835_MBOX_BASE+0x1C)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+/* Power Manager channel */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_CHANNEL_PM 0</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+/* Framebuffer channel */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_CHANNEL_FB 1</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ /* Virtual UART channel */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_CHANNEL_VUART 2</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ /* VCHIQ channel */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_CHANNEL_VCHIQ 3</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ /* LEDs channel */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_CHANNEL_LED 4</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ /* Button channel */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_CHANNEL_BUTTON 5</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ /* Touch screen channel */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_CHANNEL_TOUCHS 6</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+/* Property tags (ARM <-> Video Core) channel */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_CHANNEL_PROP_AVC 8</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ /* Property tags (Video Core <-> ARM) channel */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_CHANNEL_PROP_VCA 9</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_SUCCESS (BCM2835_MBOX_BASE+0x80000000)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_FULL (BCM2835_MBOX_BASE+0x80000000)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#define BCM2835_MBOX_EMPTY (BCM2835_MBOX_BASE+0x40000000)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+/** @} */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">/** @} */</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">diff --git a/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">b/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">new file mode 100644</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">index 0000000..7bfb7e3</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">--- /dev/null</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+++ b/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">@@ -0,0 +1,22 @@</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite">Need file header documentation</blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#include <stdint.h></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#include <bsp/raspberrypi.h></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+#include <bsp/mailbox.h></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+unsigned int readmailbox ( unsigned int channel )</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+{</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ unsigned int data;</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ unsigned int read_channel;</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ while ( 1 )</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ {</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ while ( BCM2835_REG ( BCM2835_MBOX_STATUS ) &</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">BCM2835_MBOX_EMPTY );</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ data = BCM2835_REG ( BCM2835_MBOX_READ );</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ read_channel = ( unsigned int ) ( data & 0xF );</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ if ( read_channel == channel )</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ return ( data & 0xFFFFFFF0 );</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ }</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite">The white spaces look wrong here. Are they tabs? Or 8 blank spaces?</blockquote><blockquote class="quoted-plain-text" type="cite">Please check the style rules in the Coding Conventions page.</blockquote><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+}</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+void writemailbox( unsigned int channel, unsigned int data )</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+{</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ while ( BCM2835_REG ( BCM2835_MBOX_STATUS ) & BCM2835_MBOX_FULL );</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ BCM2835_REG (BCM2835_MBOX_WRITE) = ( data & 0xFFFFFFF0 ) | (unsigned</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">int) ( channel & 0xF );</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+}</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">\ No newline at end of file</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">diff --git a/c/src/lib/libbsp/arm/raspberrypi/preinstall.am</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">b/c/src/lib/libbsp/arm/raspberrypi/preinstall.am</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">index 70259e2..4cb7ed6 100644</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">--- a/c/src/lib/libbsp/arm/raspberrypi/preinstall.am</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+++ b/c/src/lib/libbsp/arm/raspberrypi/preinstall.am</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">@@ -126,6 +126,10 @@ $(PROJECT_INCLUDE)/bsp/usart.h: include/usart.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">$(PROJECT_INCLUDE)/bsp/$(dirstam</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/usart.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/usart.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+$(PROJECT_INCLUDE)/bsp/mailbox.h: include/mailbox.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">$(PROJECT_INCLUDE)/bsp/$(dirstamp)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/mailbox.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/mailbox.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">+</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">$(PROJECT_INCLUDE)/bsp/raspberrypi.h: include/raspberrypi.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">$(PROJECT_INCLUDE)/bsp/$(dirstamp)</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/raspberrypi.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/raspberrypi.h</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">-----</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">Here is a patch for rpi bsp which include the operation and chanel</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">defininitions for mailbox and its implementations.</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">I've only tested the framebuffer with it and it works well : set the screen</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">size and get the informations.</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">Andre used it for sd card reading. I've checked it out and added full</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">channel definitions.</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">Please point it out if further tests should be done.</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">YANG QIAO</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><br class=""></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">_______________________________________________</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite">devel mailing list</blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><a href="mailto:devel@rtems.org" data-mce-href="mailto:devel@rtems.org" class="">devel@rtems.org</a><div style="width:0px; height:0px;" class=""> </div></blockquote></blockquote><blockquote class="quoted-plain-text" type="cite"><blockquote class="quoted-plain-text" type="cite"><a href="http://lists.rtems.org/mailman/listinfo/devel" data-mce-href="http://lists.rtems.org/mailman/listinfo/devel" class="">http://lists.rtems.org/mailman/listinfo/devel</a><div style="width:0px; height:0px;" class=""> </div></blockquote></blockquote></div></div></blockquote></div></div></div><span id="cid:f535d5ad-70ad-46b4-8720-a4ff179261b1@icloud.com"><mailbox_19_04_2015.patch></span>_______________________________________________<br class="">devel mailing list<br class=""><a href="mailto:devel@rtems.org" class="">devel@rtems.org</a><br class="">http://lists.rtems.org/mailman/listinfo/devel</div></blockquote></div><br class=""></body></html>