Ticket #3903: 0001-bsp-raspberry-Add-a-bsp_fdt_map_intr.patch
File 0001-bsp-raspberry-Add-a-bsp_fdt_map_intr.patch, 1.8 KB (added by Christian Mauderer, on 03/10/20 at 07:52:10) |
Untested patch for the problem.
|
-
From 68e7b38d508ace34e7c38cd63d538176d2703199 Mon Sep 17 00:00:00 2001
From: Christian Mauderer <christian.mauderer@embedded-brains.de>
Date: Mon, 9 Mar 2020 23:00:58 +0100
Subject: [PATCH] bsp/raspberry: Add a bsp_fdt_map_intr().
Fixes #3903
---
bsps/arm/raspberrypi/include/bsp/irq.h | 2 ++
bsps/arm/raspberrypi/start/bspstart.c | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/bsps/arm/raspberrypi/include/bsp/irq.h b/bsps/arm/raspberrypi/include/bsp/irq.h
index 6a9d05cba6..6758094519 100644
a
|
b
|
|
35 | 35 | |
36 | 36 | #define BCM2835_INTC_TOTAL_IRQ 64 + 8 |
37 | 37 | |
| 38 | #define BCM2835_IRQ_SET1_MIN 0 |
| 39 | #define BCM2835_IRQ_SET2_MIN 32 |
38 | 40 | |
39 | 41 | #define BCM2835_IRQ_ID_GPU_TIMER_M0 0 |
40 | 42 | #define BCM2835_IRQ_ID_GPU_TIMER_M1 1 |
-
diff --git a/bsps/arm/raspberrypi/start/bspstart.c b/bsps/arm/raspberrypi/start/bspstart.c
index 49896e4d47..89fe8707f1 100644
a
|
b
|
void *raspberrypi_get_reg_of_node(const void *fdt, int node) |
101 | 101 | return (BUS_TO_PHY((void *) fdt32_to_cpu(val[0]))); |
102 | 102 | } |
103 | 103 | |
| 104 | #ifdef BSP_FDT_IS_SUPPORTED |
| 105 | uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells) |
| 106 | { |
| 107 | uint32_t controller = intr[0]; |
| 108 | uint32_t source = intr[1]; |
| 109 | |
| 110 | switch(controller) { |
| 111 | case 0: |
| 112 | return source + BCM2835_IRQ_ID_BASIC_BASE_ID; |
| 113 | break; |
| 114 | case 1: |
| 115 | return source + BCM2835_IRQ_SET1_MIN; |
| 116 | break; |
| 117 | case 2: |
| 118 | return source + BCM2835_IRQ_SET2_MIN; |
| 119 | break; |
| 120 | default: |
| 121 | return (uint32_t)(-1); |
| 122 | break; |
| 123 | } |
| 124 | } |
| 125 | #endif /* BSP_FDT_IS_SUPPORTED */ |
| 126 | |
104 | 127 | void bsp_start(void) |
105 | 128 | { |
106 | 129 | bcm2835_get_board_spec_entries spec = { 0 }; |
Download in other formats: