Changeset 9cd20cd in rtems


Ignore:
Timestamp:
03/07/17 09:57:46 (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
6584eb2
Parents:
36338fb
git-author:
Sebastian Huber <sebastian.huber@…> (03/07/17 09:57:46)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/08/17 06:19:00)
Message:

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

Add bsp_fdt_map_intr() intended for the libbsd FDT support.

Location:
c/src/lib/libbsp
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/Makefile.am

    r36338fb r9cd20cd  
    3838include_bsp_HEADERS += shared/include/default-initial-extension.h
    3939include_bsp_HEADERS += shared/include/fatal.h
     40include_bsp_HEADERS += shared/include/fdt.h
    4041include_bsp_HEADERS += shared/include/console-termios.h
    4142include_bsp_HEADERS += shared/include/gpio.h
  • c/src/lib/libbsp/powerpc/qoriq/Makefile.am

    r36338fb r9cd20cd  
    2323        ../../shared/include/irq-info.h \
    2424        ../../shared/include/bootcard.h \
    25         ../../shared/include/fdt.h \
    2625        ../../shared/include/utility.h \
    2726        ../shared/include/start.h \
  • c/src/lib/libbsp/powerpc/qoriq/include/bsp.h

    r36338fb r9cd20cd  
    88
    99/*
    10  * Copyright (c) 2010-2015 embedded brains GmbH.  All rights reserved.
     10 * Copyright (c) 2010, 2017 embedded brains GmbH.  All rights reserved.
    1111 *
    1212 *  embedded brains GmbH
     
    3737
    3838#define BSP_FEATURE_IRQ_EXTENSION
     39
     40#define BSP_FDT_IS_SUPPORTED
    3941
    4042#define QORIQ_CHIP(alpha, num) ((alpha) * 10000 + (num))
  • c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c

    r36338fb r9cd20cd  
    88
    99/*
    10  * Copyright (c) 2010-2015 embedded brains GmbH.  All rights reserved.
     10 * Copyright (c) 2010, 2017 embedded brains GmbH.  All rights reserved.
    1111 *
    1212 *  embedded brains GmbH
     
    170170#endif
    171171}
     172
     173uint32_t bsp_fdt_map_intr(uint32_t intr)
     174{
     175  return intr - 16;
     176}
  • c/src/lib/libbsp/preinstall.am

    r36338fb r9cd20cd  
    2727PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/fatal.h
    2828
     29$(PROJECT_INCLUDE)/bsp/fdt.h: shared/include/fdt.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     30        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/fdt.h
     31PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/fdt.h
     32
    2933$(PROJECT_INCLUDE)/bsp/console-termios.h: shared/include/console-termios.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    3034        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-termios.h
  • c/src/lib/libbsp/shared/include/fdt.h

    r36338fb r9cd20cd  
    11/*
    2  * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2015, 2017 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    1616#define LIBBSP_SHARED_FDT_H
    1717
     18#include <bsp.h>
     19
    1820#ifdef __cplusplus
    1921extern "C" {
    2022#endif /* __cplusplus */
    2123
     24/*
     25 * BSPs that implement the FDT support functions must define
     26 * BSP_FDT_IS_SUPPORTED.
     27 */
     28
     29/**
     30 * @brief Copies the specified source FDT to a dedicated global data area.
     31 *
     32 * The source FDT is usually provided by a bootloader and may be located in a
     33 * memory area that is used by the program.  The low-level initialization
     34 * should copy the FDT for later use.
     35 *
     36 * The copy can be accessed by bsp_fdt_get().
     37 *
     38 * @param[in] src The source FDT.
     39 */
    2240void bsp_fdt_copy(const void *src);
    2341
     42/**
     43 * @brief Returns the FDT of the BSP.
     44 *
     45 * @return The FDT of the BSP.
     46 */
    2447const void *bsp_fdt_get(void);
     48
     49/**
     50 * @brief Maps the interrupt number of the FDT to the interrupt vector used by
     51 * the interrupt management.
     52 *
     53 * This function is used by the libbsd to implement the OFW_BUS_MAP_INTR bus
     54 * method.
     55 *
     56 * @param[in] intr The FDT interrupt number.
     57 *
     58 * @return The interrupt vector of the FDT interrupt number.
     59 */
     60uint32_t bsp_fdt_map_intr(uint32_t intr);
    2561
    2662#ifdef __cplusplus
  • c/src/lib/libbsp/shared/src/bsp-fdt.c

    r36338fb r9cd20cd  
    11/*
    2  * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2015, 2017 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    1717#include <libfdt.h>
    1818
    19 #include <bsp.h>
    2019#include <bsp/fdt.h>
    2120#include <bsp/linker-symbols.h>
     21
     22#ifndef BSP_FDT_IS_SUPPORTED
     23#warning "BSP FDT support indication not defined"
     24#endif
    2225
    2326#ifndef BSP_FDT_BLOB_SIZE_MAX
Note: See TracChangeset for help on using the changeset viewer.