Changeset bb8ae78 in rtems


Ignore:
Timestamp:
Mar 9, 2020, 10:00:58 PM (3 months ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
master
Children:
d582d0e
Parents:
50782bc5
git-author:
Christian Mauderer <christian.mauderer@…> (03/09/20 22:00:58)
git-committer:
Christian Mauderer <oss@…> (04/04/20 16:38:44)
Message:

bsp/raspberry: Add a bsp_fdt_map_intr().

Fixes #3903

Location:
bsps/arm/raspberrypi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bsps/arm/raspberrypi/include/bsp/irq.h

    r50782bc5 rbb8ae78  
    3636#define BCM2835_INTC_TOTAL_IRQ       64 + 8
    3737
     38#define BCM2835_IRQ_SET1_MIN         0
     39#define BCM2835_IRQ_SET2_MIN         32
    3840
    3941#define BCM2835_IRQ_ID_GPU_TIMER_M0  0
     
    7072#define BSP_INTERRUPT_VECTOR_MIN    (0)
    7173#define BSP_INTERRUPT_VECTOR_MAX    (BCM2835_INTC_TOTAL_IRQ - 1)
     74#define BSP_INTERRUPT_VECTOR_INVALID (UINT32_MAX)
    7275
    7376#define BSP_IRQ_COUNT               (BCM2835_INTC_TOTAL_IRQ)
  • bsps/arm/raspberrypi/start/bspstart.c

    r50782bc5 rbb8ae78  
    2424#include <bsp/raspberrypi.h>
    2525#include <bsp/vc.h>
     26#include <bsp/fdt.h>
    2627
    2728#include <libfdt.h>
     
    102103}
    103104
     105#ifdef BSP_FDT_IS_SUPPORTED
     106uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells)
     107{
     108  uint32_t controller = intr[0];
     109  uint32_t source = intr[1];
     110
     111  switch ( controller ) {
     112    case 0:
     113        return source + BCM2835_IRQ_ID_BASIC_BASE_ID;
     114        break;
     115    case 1:
     116        return source + BCM2835_IRQ_SET1_MIN;
     117        break;
     118    case 2:
     119        return source + BCM2835_IRQ_SET2_MIN;
     120        break;
     121    default:
     122        return BSP_INTERRUPT_VECTOR_INVALID;
     123        break;
     124  }
     125}
     126#endif /* BSP_FDT_IS_SUPPORTED */
     127
    104128void bsp_start(void)
    105129{
Note: See TracChangeset for help on using the changeset viewer.