MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / ofw_parse_irq_cells

Function ofw_parse_irq_cells

components/drivers/ofw/irq.c:365–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365static rt_err_t ofw_parse_irq_cells(struct rt_ofw_node *np, int index, struct rt_ofw_cell_args *out_irq_args)
366{
367 rt_err_t err;
368
369 /*
370 * interrupts-extended:
371 *
372 * The interrupts-extended property lists the interrupt(s) generated by a
373 * device. interrupts-extended should be used instead of interrupts when a
374 * device is connected to multiple interrupt controllers as it encodes a
375 * parent phandle with each interrupt specifier. Example:
376 *
377 * pic: interrupt-controller@0 {
378 * interrupt-controller;
379 * #interrupt-cells = <1>;
380 * };
381 *
382 * gic: interrupt-controller@1 {
383 * interrupt-controller;
384 * #interrupt-cells = <3>;
385 * };
386 *
387 * node: node {
388 * interrupts-extended = <&pic 9>, <&gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
389 * };
390 *
391 * call `rt_ofw_parse_phandle_cells` to get irq info;
392 */
393
394 err = rt_ofw_parse_phandle_cells(np, "interrupts-extended", "#interrupt-cells", index, out_irq_args);
395
396 do {
397 int interrupt_cells;
398 const fdt32_t *cell;
399 rt_ssize_t interrupt_len;
400 struct rt_ofw_node *ic_np;
401
402 if (!err)
403 {
404 break;
405 }
406
407 /*
408 * interrupts (old style):
409 *
410 * The interrupts property of a device node defines the interrupt or
411 * interrupts that are generated by the device. The value of the
412 * interrupts property consists of an arbitrary number of interrupt
413 * specifiers. The format of an interrupt specifier is defined by the
414 * binding of the interrupt domain root.
415 * interrupts is overridden by the interrupts-extended property and
416 * normally only one or the other should be used. Example:
417 *
418 * pic: interrupt-controller@0 {
419 * interrupt-controller;
420 * #interrupt-cells = <1>;
421 * };
422 *

Callers 3

rt_ofw_parse_irq_cellsFunction · 0.85
rt_ofw_get_irq_countFunction · 0.85
rt_ofw_get_irqFunction · 0.85

Calls 4

rt_ofw_prop_read_rawFunction · 0.85
rt_ofw_find_irq_parentFunction · 0.85
fdt32_to_cpuFunction · 0.50

Tested by

no test coverage detected