bsp/qoriq: Use interrupt entry

Avoid heap usage in the basic BSP.
This commit is contained in:
Sebastian Huber
2024-01-16 19:49:18 +01:00
parent 4b0409f10b
commit 7e990236a7
4 changed files with 53 additions and 32 deletions

View File

@@ -99,6 +99,8 @@ static volatile qoriq_pic_global_timer *const qoriq_timecounter =
#define CLOCK_INTERRUPT (QORIQ_IRQ_GT_BASE + QORIQ_CLOCK_TIMER)
static rtems_interrupt_entry qoriq_clock_entry;
static void qoriq_clock_handler_install(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
@@ -121,12 +123,16 @@ static void qoriq_clock_handler_install(void)
rtems_fatal_error_occurred(0xdeadbeef);
}
sc = rtems_interrupt_handler_install(
CLOCK_INTERRUPT,
"Clock",
RTEMS_INTERRUPT_UNIQUE,
rtems_interrupt_entry_initialize(
&qoriq_clock_entry,
Clock_isr,
NULL
NULL,
"Clock"
);
sc = rtems_interrupt_entry_install(
CLOCK_INTERRUPT,
RTEMS_INTERRUPT_UNIQUE,
&qoriq_clock_entry
);
if (sc != RTEMS_SUCCESSFUL) {
rtems_fatal_error_occurred(0xdeadbeef);

View File

@@ -40,8 +40,6 @@
#ifndef TMTESTS_TM27_H
#define TMTESTS_TM27_H
#include <assert.h>
#include <libcpu/powerpc-utility.h>
#include <bsp/irq.h>
@@ -55,33 +53,38 @@
static inline void Install_tm27_vector( rtems_interrupt_handler handler )
{
rtems_status_code sc;
static rtems_interrupt_entry entry_low;
static rtems_interrupt_entry entry_high;
rtems_vector_number low = QORIQ_IRQ_IPI_0 + IPI_INDEX_LOW;
rtems_vector_number high = QORIQ_IRQ_IPI_0 + IPI_INDEX_HIGH;
sc = rtems_interrupt_handler_install(
rtems_interrupt_entry_initialize(
&entry_low,
handler,
NULL,
"tm17 low"
);
(void) rtems_interrupt_entry_install(
low,
"tm17 low",
RTEMS_INTERRUPT_UNIQUE,
handler,
NULL
&entry_low
);
assert(sc == RTEMS_SUCCESSFUL);
sc = qoriq_pic_set_priority(low, 1, NULL);
assert(sc == RTEMS_SUCCESSFUL);
(void) qoriq_pic_set_priority(low, 1, NULL);
sc = rtems_interrupt_handler_install(
rtems_interrupt_entry_initialize(
&entry_high,
handler,
NULL,
"tm17 high"
);
(void) rtems_interrupt_entry_install(
high,
"tm17 high",
RTEMS_INTERRUPT_UNIQUE,
handler,
NULL
&entry_high
);
assert(sc == RTEMS_SUCCESSFUL);
sc = qoriq_pic_set_priority(high, 2, NULL);
assert(sc == RTEMS_SUCCESSFUL);
(void) qoriq_pic_set_priority(high, 2, NULL);
}
static inline void qoriq_tm27_cause(uint32_t ipi_index)

View File

@@ -117,6 +117,8 @@ static void raise_restart_interrupt(void)
ppc_synchronize_instructions();
}
static rtems_interrupt_entry restart_entry;
void bsp_restart(void *addr)
{
rtems_status_code sc;
@@ -130,12 +132,16 @@ void bsp_restart(void *addr)
rtems_cache_flush_multiple_data_lines(spin_table, sizeof(*spin_table));
}
sc = rtems_interrupt_handler_install(
QORIQ_IRQ_IPI_0 + RESTART_IPI_INDEX,
"Restart",
RTEMS_INTERRUPT_UNIQUE,
rtems_interrupt_entry_initialize(
&restart_entry,
restart_interrupt,
addr
addr,
"Restart"
);
sc = rtems_interrupt_entry_install(
QORIQ_IRQ_IPI_0 + RESTART_IPI_INDEX,
RTEMS_INTERRUPT_UNIQUE,
&restart_entry
);
if (sc != RTEMS_SUCCESSFUL) {
bsp_fatal(QORIQ_FATAL_RESTART_INSTALL_INTERRUPT);

View File

@@ -216,17 +216,23 @@ bool _CPU_SMP_Start_processor(uint32_t cpu_index)
#endif
}
static rtems_interrupt_entry qoriq_ipi_entry;
void _CPU_SMP_Finalize_initialization(uint32_t cpu_count)
{
#ifndef QORIQ_IS_HYPERVISOR_GUEST
rtems_status_code sc;
sc = rtems_interrupt_handler_install(
QORIQ_IRQ_IPI_0 + IPI_INDEX,
"IPI",
RTEMS_INTERRUPT_UNIQUE,
rtems_interrupt_entry_initialize(
&qoriq_ipi_entry,
bsp_inter_processor_interrupt,
NULL
NULL,
"IPI"
);
sc = rtems_interrupt_entry_install(
QORIQ_IRQ_IPI_0 + IPI_INDEX,
RTEMS_INTERRUPT_UNIQUE,
&qoriq_ipi_entry
);
if (sc != RTEMS_SUCCESSFUL) {
bsp_fatal(QORIQ_FATAL_SMP_IPI_HANDLER_INSTALL);