[rtems commit] bsps: Generalize bsp_fdt_map_intr()
Sebastian Huber
sebh at rtems.org
Fri Sep 22 12:40:38 UTC 2017
Module: rtems
Branch: master
Commit: 05f9858ffde4cb7e8593fd609bb4e7c5dbf3b8bc
Changeset: http://git.rtems.org/rtems/commit/?id=05f9858ffde4cb7e8593fd609bb4e7c5dbf3b8bc
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Sep 13 07:00:57 2017 +0200
bsps: Generalize bsp_fdt_map_intr()
Pass all interrupt cells to bsp_fdt_map_intr() since some platforms use
an array to describe an interrupt.
Update #3090.
---
c/src/lib/libbsp/arm/beagle/startup/bspstart.c | 4 ++--
c/src/lib/libbsp/arm/imx/console/console-config.c | 4 +++-
c/src/lib/libbsp/arm/imx/startup/bspstart.c | 4 ++--
c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c | 4 ++--
c/src/lib/libbsp/shared/include/fdt.h | 5 +++--
5 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/c/src/lib/libbsp/arm/beagle/startup/bspstart.c b/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
index 3cc6935..292b576 100644
--- a/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
@@ -29,7 +29,7 @@ void bsp_start(void)
printk("\nRTEMS Beagleboard: %s\n", type);
}
-uint32_t bsp_fdt_map_intr(uint32_t intr)
+uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells)
{
- return intr;
+ return intr[0];
}
diff --git a/c/src/lib/libbsp/arm/imx/console/console-config.c b/c/src/lib/libbsp/arm/imx/console/console-config.c
index a5b3682..c965468 100644
--- a/c/src/lib/libbsp/arm/imx/console/console-config.c
+++ b/c/src/lib/libbsp/arm/imx/console/console-config.c
@@ -86,7 +86,9 @@ static void imx_uart_init_context(
#ifdef CONSOLE_USE_INTERRUPTS
val = fdt_getprop(fdt, node, "interrupts", &len);
if (val != NULL && len >= 8) {
- ctx->irq = bsp_fdt_map_intr(fdt32_to_cpu(val[1]));
+ uint32_t cpu_val[2];
+ cpu_val[1] = fdt32_to_cpu(val[1]);
+ ctx->irq = bsp_fdt_map_intr(cpu_val, 2);
}
#endif
}
diff --git a/c/src/lib/libbsp/arm/imx/startup/bspstart.c b/c/src/lib/libbsp/arm/imx/startup/bspstart.c
index eb2ba29..e28fe2b 100644
--- a/c/src/lib/libbsp/arm/imx/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/imx/startup/bspstart.c
@@ -20,9 +20,9 @@
#include <libfdt.h>
-uint32_t bsp_fdt_map_intr(uint32_t intr)
+uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells)
{
- return intr + 32;
+ return intr[1] + 32;
}
void arm_generic_timer_get_config(
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
index ec95076..859171d 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
@@ -205,7 +205,7 @@ void bsp_start(void)
#endif
}
-uint32_t bsp_fdt_map_intr(uint32_t intr)
+uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells)
{
- return intr - 16;
+ return intr[0] - 16;
}
diff --git a/c/src/lib/libbsp/shared/include/fdt.h b/c/src/lib/libbsp/shared/include/fdt.h
index bb71f7d..4ed05b1 100644
--- a/c/src/lib/libbsp/shared/include/fdt.h
+++ b/c/src/lib/libbsp/shared/include/fdt.h
@@ -53,11 +53,12 @@ const void *bsp_fdt_get(void);
* This function is used by the libbsd to implement the OFW_BUS_MAP_INTR bus
* method.
*
- * @param[in] intr The FDT interrupt number.
+ * @param[in] intr The FDT interrupt number cells.
+ * @param[in] icells The FDT interrupt cell count.
*
* @return The interrupt vector of the FDT interrupt number.
*/
-uint32_t bsp_fdt_map_intr(uint32_t intr);
+uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells);
#ifdef __cplusplus
}
More information about the vc
mailing list