[rtems commit] bsp/beagle: Add FDT support for Beaglebone Black

Sebastian Huber sebh at rtems.org
Wed Jul 12 06:38:55 UTC 2017


Module:    rtems
Branch:    master
Commit:    f6115d7cd2d1551a05cd257ac9f00476c61e5e0d
Changeset: http://git.rtems.org/rtems/commit/?id=f6115d7cd2d1551a05cd257ac9f00476c61e5e0d

Author:    Sichen Zhao <1473996754 at qq.com>
Date:      Tue Jul 11 18:51:19 2017 +0800

bsp/beagle: Add FDT support for Beaglebone Black

---

 c/src/lib/libbsp/arm/beagle/Makefile.am        | 1 +
 c/src/lib/libbsp/arm/beagle/configure.ac       | 9 +++++++++
 c/src/lib/libbsp/arm/beagle/include/bsp.h      | 6 +++++-
 c/src/lib/libbsp/arm/beagle/startup/bspstart.c | 6 ++++++
 c/src/lib/libbsp/arm/shared/start/start.S      | 5 +++++
 5 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/c/src/lib/libbsp/arm/beagle/Makefile.am b/c/src/lib/libbsp/arm/beagle/Makefile.am
index 8e10ee2..e7c44a1 100644
--- a/c/src/lib/libbsp/arm/beagle/Makefile.am
+++ b/c/src/lib/libbsp/arm/beagle/Makefile.am
@@ -76,6 +76,7 @@ libbsp_a_LIBADD =
 
 # Shared
 libbsp_a_SOURCES += ../../shared/bootcard.c
+libbsp_a_SOURCES += ../../shared/src/bsp-fdt.c
 libbsp_a_SOURCES += ../../shared/bspclean.c
 libbsp_a_SOURCES += ../../shared/bspgetworkarea.c
 libbsp_a_SOURCES += ../../shared/bsppredriverhook.c
diff --git a/c/src/lib/libbsp/arm/beagle/configure.ac b/c/src/lib/libbsp/arm/beagle/configure.ac
index b0c99a3..f5352b5 100644
--- a/c/src/lib/libbsp/arm/beagle/configure.ac
+++ b/c/src/lib/libbsp/arm/beagle/configure.ac
@@ -18,6 +18,15 @@ RTEMS_PROG_CC_FOR_TARGET
 RTEMS_CANONICALIZE_TOOLS
 RTEMS_PROG_CCAS
 
+RTEMS_BSPOPTS_SET([BSP_START_COPY_FDT_FROM_U_BOOT],[*],[1])
+RTEMS_BSPOPTS_HELP([BSP_START_COPY_FDT_FROM_U_BOOT],[copy the U-Boot provided FDT to an internal storage])
+
+RTEMS_BSPOPTS_SET([BSP_FDT_BLOB_SIZE_MAX],[*],[262144])
+RTEMS_BSPOPTS_HELP([BSP_FDT_BLOB_SIZE_MAX],[maximum size of the FDT blob in bytes])
+
+RTEMS_BSPOPTS_SET([BSP_FDT_BLOB_READ_ONLY],[*],[1])
+RTEMS_BSPOPTS_HELP([BSP_FDT_BLOB_READ_ONLY],[place the FDT blob into the read-only data area])
+
 RTEMS_BSPOPTS_SET([IS_DM3730],[beagleboard*],[1])
 RTEMS_BSPOPTS_HELP([IS_DM3730],[true if SOC is DM3730])
 
diff --git a/c/src/lib/libbsp/arm/beagle/include/bsp.h b/c/src/lib/libbsp/arm/beagle/include/bsp.h
index d9fd2ae..1a69b5e 100644
--- a/c/src/lib/libbsp/arm/beagle/include/bsp.h
+++ b/c/src/lib/libbsp/arm/beagle/include/bsp.h
@@ -187,6 +187,10 @@ static inline void flush_data_cache(void)
 #define BSP_GPIO_PINS_PER_BANK 32
 #endif
 
+#if BSP_START_COPY_FDT_FROM_U_BOOT
+#define BSP_FDT_IS_SUPPORTED
+#endif
+
 /* i2c stuff */
 typedef struct {
     uint32_t rx_or_tx;
@@ -357,4 +361,4 @@ static inline void write_ttbr0(uint32_t bar)
  */
 BSP_START_TEXT_SECTION void beagle_setup_mmu_and_cache(void);
 
-#endif /* LIBBSP_ARM_BEAGLE_BSP_H */
\ No newline at end of file
+#endif /* LIBBSP_ARM_BEAGLE_BSP_H */
diff --git a/c/src/lib/libbsp/arm/beagle/startup/bspstart.c b/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
index b156564..3cc6935 100644
--- a/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
@@ -15,6 +15,7 @@
 #include <bsp.h>
 #include <bsp/bootcard.h>
 #include <bsp/irq-generic.h>
+#include <bsp/fdt.h>
 
 void bsp_start(void)
 {
@@ -27,3 +28,8 @@ void bsp_start(void)
   bsp_interrupt_initialize();
   printk("\nRTEMS Beagleboard: %s\n", type);
 }
+
+uint32_t bsp_fdt_map_intr(uint32_t intr)
+{
+  return intr;
+}
diff --git a/c/src/lib/libbsp/arm/shared/start/start.S b/c/src/lib/libbsp/arm/shared/start/start.S
index c5263ec..547cce3 100755
--- a/c/src/lib/libbsp/arm/shared/start/start.S
+++ b/c/src/lib/libbsp/arm/shared/start/start.S
@@ -183,6 +183,11 @@ _start:
 	bl bsp_start_init_registers_core
 #endif
 
+#ifdef BSP_START_COPY_FDT_FROM_U_BOOT
+	mov	r0, r6
+	bl bsp_fdt_copy
+#endif
+
 #ifdef RTEMS_SMP
 	/* Read MPIDR and get current processor index */
 	mrc	p15, 0, r0, c0, c0, 5



More information about the vc mailing list