[PATCH 1/2] Add FDT support for Beaglebone Black.
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed Jul 5 05:12:00 UTC 2017
Hello Sichen,
congratulations to add FDT support to the first ARM BSP.
On 05/07/17 04:52, Sichen Zhao wrote:
> ---
> 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..a0192f3 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([U_BOOT_USE_FDT],[beaglebone*],[1])
> +RTEMS_BSPOPTS_HELP([U_BOOT_USE_FDT],[enables U-Boot support using FDT])
New BSP-specific defines should have a BSP prefix. I don't think we
should make this optional. I would remove this BSP option here and simply
#define BSP_START_COPY_FDT_FROM_U_BOOT
to <bsp.h> along with BSP_FDT_IS_SUPPORTED.
> +
> +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..efd02a8 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 U_BOOT_USE_FDT
> +#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..d20adea 100755
> --- a/c/src/lib/libbsp/arm/shared/start/start.S
> +++ b/c/src/lib/libbsp/arm/shared/start/start.S
> @@ -179,10 +179,15 @@ _start:
> #ifndef BSP_START_NEEDS_REGISTER_INITIALIZATION
> mov r5, r1 /* machine type number or ~0 for DT boot */
> mov r6, r2 /* physical address of ATAGs or DTB */
> + mov r0, r2
This mov r0, r2 should be replaced with a ...
> #else /* BSP_START_NEEDS_REGISTER_INITIALIZATION */
> bl bsp_start_init_registers_core
> #endif
>
> +#ifdef U_BOOT_USE_FDT
... mov r0, r6 here.
> + bl bsp_fdt_copy
> +#endif
> +
> #ifdef RTEMS_SMP
> /* Read MPIDR and get current processor index */
> mrc p15, 0, r0, c0, c0, 5
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber at embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the devel
mailing list