Lines Matching +full:plic +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2023-2024, Ventana Micro Systems Inc
36 return (elem0->type > elem1->type) - (elem0->type < elem1->type); in irqchip_cmp_func()
40 * On RISC-V, RINTC structures in MADT should be probed before any other
42 * controller subtypes in MADT of ACPI spec for RISC-V are defined in
43 * the incremental order like RINTC(24)->IMSIC(25)->APLIC(26)->PLIC(27).
51 if (nr == 1 || !ACPI_COMPARE_NAMESEG(ACPI_SIG_MADT, ape->id)) in arch_sort_irqchip_probe()
63 if (gsi_base == ext_intc_element->gsi_base) { in riscv_acpi_update_gsi_handle()
64 ext_intc_element->handle = handle; in riscv_acpi_update_gsi_handle()
80 if (ext_intc_element->handle == ACPI_HANDLE_FWNODE(fwnode)) { in riscv_acpi_get_gsi_info()
81 *gsi_base = ext_intc_element->gsi_base; in riscv_acpi_get_gsi_info()
82 *id = ext_intc_element->id; in riscv_acpi_get_gsi_info()
83 *nr_irqs = ext_intc_element->nr_irqs; in riscv_acpi_get_gsi_info()
85 *nr_idcs = ext_intc_element->nr_idcs; in riscv_acpi_get_gsi_info()
91 return -ENODEV; in riscv_acpi_get_gsi_info()
102 if (gsi >= ext_intc_element->gsi_base && in riscv_acpi_get_gsi_domain_id()
103 gsi < (ext_intc_element->gsi_base + ext_intc_element->nr_irqs)) { in riscv_acpi_get_gsi_domain_id()
104 adev = acpi_fetch_acpi_dev(ext_intc_element->handle); in riscv_acpi_get_gsi_domain_id()
122 return -ENOMEM; in riscv_acpi_register_ext_intc()
124 ext_intc_element->gsi_base = gsi_base; in riscv_acpi_register_ext_intc()
125 ext_intc_element->nr_irqs = nr_irqs; in riscv_acpi_register_ext_intc()
126 ext_intc_element->nr_idcs = nr_idcs; in riscv_acpi_register_ext_intc()
127 ext_intc_element->id = id; in riscv_acpi_register_ext_intc()
128 list_add_tail(&ext_intc_element->list, &ext_intc_list); in riscv_acpi_register_ext_intc()
163 return riscv_acpi_register_ext_intc(aplic->gsi_base, aplic->num_sources, aplic->num_idcs, in riscv_acpi_aplic_parse_madt()
164 aplic->id, ACPI_RISCV_IRQCHIP_APLIC); in riscv_acpi_aplic_parse_madt()
170 struct acpi_madt_plic *plic = (struct acpi_madt_plic *)header; in riscv_acpi_plic_parse_madt() local
172 return riscv_acpi_register_ext_intc(plic->gsi_base, plic->num_irqs, 0, in riscv_acpi_plic_parse_madt()
173 plic->id, ACPI_RISCV_IRQCHIP_PLIC); in riscv_acpi_plic_parse_madt()
178 /* There can be either PLIC or APLIC */ in riscv_acpi_init_gsi_mapping()
195 if (gsi >= ext_intc_element->gsi_base && in riscv_acpi_get_gsi_handle()
196 gsi < (ext_intc_element->gsi_base + ext_intc_element->nr_irqs)) in riscv_acpi_get_gsi_handle()
197 return ext_intc_element->handle; in riscv_acpi_get_gsi_handle()
209 switch (ares->type) { in riscv_acpi_irq_get_parent()
211 irq = &ares->data.irq; in riscv_acpi_irq_get_parent()
212 if (ctx->index >= irq->interrupt_count) { in riscv_acpi_irq_get_parent()
213 ctx->index -= irq->interrupt_count; in riscv_acpi_irq_get_parent()
216 ctx->handle = riscv_acpi_get_gsi_handle(irq->interrupts[ctx->index]); in riscv_acpi_irq_get_parent()
219 eirq = &ares->data.extended_irq; in riscv_acpi_irq_get_parent()
220 if (eirq->producer_consumer == ACPI_PRODUCER) in riscv_acpi_irq_get_parent()
223 if (ctx->index >= eirq->interrupt_count) { in riscv_acpi_irq_get_parent()
224 ctx->index -= eirq->interrupt_count; in riscv_acpi_irq_get_parent()
229 if (eirq->resource_source.string_length) in riscv_acpi_irq_get_parent()
232 ctx->handle = riscv_acpi_get_gsi_handle(eirq->interrupts[ctx->index]); in riscv_acpi_irq_get_parent()
241 struct acpi_irq_dep_ctx ctx = {-EINVAL, index, NULL}; in riscv_acpi_irq_get_dep()
249 return 1; in riscv_acpi_irq_get_dep()
272 while (entry && (entry->length > 0)) { in riscv_acpi_add_prt_dep()
273 if (entry->source[0]) { in riscv_acpi_add_prt_dep()
274 acpi_get_handle(handle, entry->source, &link_handle); in riscv_acpi_add_prt_dep()
275 dep_devices.count = 1; in riscv_acpi_add_prt_dep()
276 dep_devices.handles = kcalloc(1, sizeof(*dep_devices.handles), GFP_KERNEL); in riscv_acpi_add_prt_dep()
285 gsi_handle = riscv_acpi_get_gsi_handle(entry->source_index); in riscv_acpi_add_prt_dep()
286 dep_devices.count = 1; in riscv_acpi_add_prt_dep()
287 dep_devices.handles = kcalloc(1, sizeof(*dep_devices.handles), GFP_KERNEL); in riscv_acpi_add_prt_dep()
298 ((unsigned long)entry + entry->length); in riscv_acpi_add_prt_dep()
315 dep_devices.count = 1; in riscv_acpi_add_irq_dep()
316 dep_devices.handles = kcalloc(1, sizeof(*dep_devices.handles), GFP_KERNEL); in riscv_acpi_add_irq_dep()