[PATCH] bsps: Provide <bsp/fdt.h> for every BSP

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Mar 7 14:33:04 UTC 2017


On 07/03/17 15:29, Gedare Bloom wrote:
> On Tue, Mar 7, 2017 at 9:12 AM, Sebastian Huber
> <sebastian.huber at embedded-brains.de> wrote:
>> Add bsp_fdt_map_intr() intended for the libbsd FDT support.
>> ---
>>   c/src/lib/libbsp/Makefile.am                      |  1 +
>>   c/src/lib/libbsp/powerpc/qoriq/Makefile.am        |  1 -
>>   c/src/lib/libbsp/powerpc/qoriq/include/bsp.h      |  4 +++-
>>   c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c |  7 +++++-
>>   c/src/lib/libbsp/preinstall.am                    |  4 ++++
>>   c/src/lib/libbsp/shared/include/fdt.h             | 27 ++++++++++++++++++++++-
>>   c/src/lib/libbsp/shared/src/bsp-fdt.c             |  7 ++++--
>>   7 files changed, 45 insertions(+), 6 deletions(-)
>>
>> diff --git a/c/src/lib/libbsp/Makefile.am b/c/src/lib/libbsp/Makefile.am
>> index c54fdcb..85ddbe2 100644
>> --- a/c/src/lib/libbsp/Makefile.am
>> +++ b/c/src/lib/libbsp/Makefile.am
>> @@ -37,6 +37,7 @@ include_bspdir = $(includedir)/bsp
>>   include_bsp_HEADERS =
>>   include_bsp_HEADERS += shared/include/default-initial-extension.h
>>   include_bsp_HEADERS += shared/include/fatal.h
>> +include_bsp_HEADERS += shared/include/fdt.h
>>   include_bsp_HEADERS += shared/include/console-termios.h
>>   include_bsp_HEADERS += shared/include/gpio.h
>>
>> diff --git a/c/src/lib/libbsp/powerpc/qoriq/Makefile.am b/c/src/lib/libbsp/powerpc/qoriq/Makefile.am
>> index 64ef08d..93473ab 100644
>> --- a/c/src/lib/libbsp/powerpc/qoriq/Makefile.am
>> +++ b/c/src/lib/libbsp/powerpc/qoriq/Makefile.am
>> @@ -22,7 +22,6 @@ include_bsp_HEADERS = include/irq.h \
>>          ../../shared/include/irq-generic.h \
>>          ../../shared/include/irq-info.h \
>>          ../../shared/include/bootcard.h \
>> -       ../../shared/include/fdt.h \
>>          ../../shared/include/utility.h \
>>          ../shared/include/start.h \
>>          ../shared/include/tictac.h \
>> diff --git a/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h b/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h
>> index d1fd907..7469ab1 100644
>> --- a/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h
>> +++ b/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h
>> @@ -7,7 +7,7 @@
>>    */
>>
>>   /*
>> - * Copyright (c) 2010-2015 embedded brains GmbH.  All rights reserved.
>> + * Copyright (c) 2010, 2017 embedded brains GmbH.  All rights reserved.
>>    *
>>    *  embedded brains GmbH
>>    *  Dornierstr. 4
>> @@ -37,6 +37,8 @@ extern "C" {
>>
>>   #define BSP_FEATURE_IRQ_EXTENSION
>>
>> +#define BSP_FDT_IS_SUPPORTED
>> +
> This seems fairly reasonable. It needs an addition to the BSP guide.

We need a completely new BSP guide.

>
>>   #define QORIQ_CHIP(alpha, num) ((alpha) * 10000 + (num))
>>
>>   #define QORIQ_CHIP_P1020 QORIQ_CHIP('P', 1020)
>> diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
>> index cbe1970..7aba178 100644
>> --- a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
>> +++ b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
>> @@ -7,7 +7,7 @@
>>    */
>>
>>   /*
>> - * Copyright (c) 2010-2015 embedded brains GmbH.  All rights reserved.
>> + * Copyright (c) 2010, 2017 embedded brains GmbH.  All rights reserved.
>>    *
>>    *  embedded brains GmbH
>>    *  Dornierstr. 4
>> @@ -169,3 +169,8 @@ void bsp_start(void)
>>     qoriq.lcc.bptr &= ~BPTR_EN;
>>   #endif
>>   }
>> +
>> +uint32_t bsp_fdt_map_intr(uint32_t intr)
>> +{
>> +  return intr - 16;
>> +}
>> diff --git a/c/src/lib/libbsp/preinstall.am b/c/src/lib/libbsp/preinstall.am
>> index bbcb7c5..505803f 100644
>> --- a/c/src/lib/libbsp/preinstall.am
>> +++ b/c/src/lib/libbsp/preinstall.am
>> @@ -26,6 +26,10 @@ $(PROJECT_INCLUDE)/bsp/fatal.h: shared/include/fatal.h $(PROJECT_INCLUDE)/bsp/$(
>>          $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/fatal.h
>>   PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/fatal.h
>>
>> +$(PROJECT_INCLUDE)/bsp/fdt.h: shared/include/fdt.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
>> +       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/fdt.h
>> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/fdt.h
>> +
>>   $(PROJECT_INCLUDE)/bsp/console-termios.h: shared/include/console-termios.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
>>          $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-termios.h
>>   PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-termios.h
>> diff --git a/c/src/lib/libbsp/shared/include/fdt.h b/c/src/lib/libbsp/shared/include/fdt.h
>> index a4c7df6..44298f4 100644
>> --- a/c/src/lib/libbsp/shared/include/fdt.h
>> +++ b/c/src/lib/libbsp/shared/include/fdt.h
>> @@ -1,5 +1,5 @@
>>   /*
>> - * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
>> + * Copyright (c) 2015, 2017 embedded brains GmbH.  All rights reserved.
>>    *
>>    *  embedded brains GmbH
>>    *  Dornierstr. 4
>> @@ -15,14 +15,39 @@
>>   #ifndef LIBBSP_SHARED_FDT_H
>>   #define LIBBSP_SHARED_FDT_H
>>
>> +#include <bsp.h>
>> +
>>   #ifdef __cplusplus
>>   extern "C" {
>>   #endif /* __cplusplus */
>>
>> +/*
>> + * BSPs that implement the FDT support functions must define
>> + * BSP_FDT_IS_SUPPORTED.
>> + */
>> +
>>   void bsp_fdt_copy(const void *src);
>>
> Missing doxygen for this function.

Ok, I will add something. This is more or less an internal low-level 
function.

-- 
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