[PATCH v2 1/2] Add FDT support for Beaglebone Black.

Sichen Zhao 1473996754 at qq.com
Tue Jul 11 10:51:19 UTC 2017


---
 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 | 5 +++++
 c/src/lib/libbsp/arm/shared/start/start.S      | 5 +++++
 5 files changed, 25 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..ad09a62 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_FROM_U_BOOT],[beaglebone*],[1])
+RTEMS_BSPOPTS_HELP([BSP_START_COPY_FROM_U_BOOT],[enables U-Boot support using FDT])
+
+RTEMS_BSPOPTS_SET([BSP_FDT_BLOB_SIZE_MAX],[beaglebone*],[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],[beaglebone*],[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..8a45480 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_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..c527ea0 100644
--- a/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
@@ -27,3 +27,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..a2fc671 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_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
-- 
2.7.4





More information about the devel mailing list