Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/drivers/imx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ add_local_sources(sof
interrupt.c
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could cleanup commit message, be deleting DO NOT MERGE and this commit requires the cleanup. Also, would be nice to add a link to a RM containing SDMA bits. Maybe link to 8MQ RM.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a reminder for myself that I need to clean up some bits from this commit. We have seen how unreliable direct links for the RM are so I will look into how to make a reasonably-persistent link for future reference.

ipc.c
timer.c
sdma.c
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Add selectable config for SDMA. e.g: CONFIG_IMX_SDMA. This can be done later.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I can do this in the same PR that will have the implementation.

if(CONFIG_IMX_EDMA)
Expand Down
25 changes: 25 additions & 0 deletions src/drivers/imx/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ static inline void handle_irq_batch(struct irq_cascade_desc *cascade,
/* Mask this interrupt so it won't happen again */
irqstr_mask_int(line_index * IRQSTR_IRQS_PER_LINE + bit);
}

trace_irq_error("irq_handler(): handled %d", line_index * IRQSTR_IRQS_PER_LINE + bit);
}
}

Expand Down Expand Up @@ -372,6 +374,19 @@ int irqstr_get_sof_int(int irqstr_int)
return interrupt_get_irq(irq, irq_name_irqsteer[line]);
}

static void hndlr(void *arg) {
int i = (int)arg;

trace_irq_error("IRQ_STEER: Handler for %d called", i);
}

void register_dummy_irqstr(void);
void register_dummy_irqstr(void)
{
for (int i = 0; i < IRQSTR_IRQS_NUM; i++)
interrupt_register(irqstr_get_sof_int(i), hndlr, (void *)i);
}

void platform_interrupt_init(void)
{
int i;
Expand All @@ -380,12 +395,22 @@ void platform_interrupt_init(void)
* initializing
*/
irqstr_disable_hw();

trace_irq_error("irqstr_chan: 0x%08x", irqstr_read(IRQSTR_CHANCTL));
/* Mask every external IRQ first */
for (i = 0; i < IRQSTR_IRQS_REGISTERS_NUM; i++)
irqstr_write(IRQSTR_CH_MASK(i), 0);
/* DEBUG ONLY
* Unmask all external IRQs; they will be masked at first IRQ
* without handler
*/
for (i = 0; i < IRQSTR_IRQS_REGISTERS_NUM; i++)
irqstr_write(IRQSTR_CH_MASK(i), 0xFFFFFFFF);
/* Turn on the IRQ_STEER hardware */
irqstr_enable_hw();

trace_irq_error("irqstr_chan: 0x%08x", irqstr_read(IRQSTR_CHANCTL));

for (i = 0; i < ARRAY_SIZE(dsp_irq); i++)
interrupt_cascade_register(dsp_irq + i);
}
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/imx/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void irq_handler(void *arg)
/* Interrupt arrived, check src */
status = imx_mu_read(IMX_MU_xSR);

tracev_ipc("ipc: irq isr 0x%x", status);
//tracev_ipc("ipc: irq isr 0x%x", status);

/* reply message(done) from host */
if (status & IMX_MU_xSR_GIPn(1)) {
Expand Down Expand Up @@ -129,7 +129,7 @@ int ipc_platform_send_msg(struct ipc_msg *msg)
/* now send the message */
mailbox_dspbox_write(0, msg->tx_data, msg->tx_size);
list_item_del(&msg->list);
tracev_ipc("ipc: msg tx -> 0x%x", msg->header);
//tracev_ipc("ipc: msg tx -> 0x%x", msg->header);

ipc->is_notification_pending = true;

Expand Down
Loading