summaryrefslogtreecommitdiff
path: root/lib/utils/cppc/fdt_cppc_drivers.carray
diff options
context:
space:
mode:
authorPawandeep Oza <[email protected]>2026-07-21 14:48:25 -0700
committerAnup Patel <[email protected]>2026-07-22 13:07:40 +0530
commit5ee055944559e0823c020222a05e5cac48e0c110 (patch)
tree000e72f56be76ff2a691d095ee785a98cb294919 /lib/utils/cppc/fdt_cppc_drivers.carray
parentc504877ed00bd7c38168a6574db25562e3615a38 (diff)
lib: utils/irqchip/aplic: implement direct mode irqchip callbacks
Add inline register accessors (aplic_sourcecfg_write/read, aplic_target_write, aplic_irq_setie/clrie/clrip, aplic_idc_base/ read/write) to consolidate all MMIO access behind typed helpers and eliminate open-coded address arithmetic throughout the driver. Add field-packing macros APLIC_TARGET_HART_IDX, APLIC_TARGET_IPRIO, and APLIC_TARGET_GUEST_IDX for constructing APLIC_TARGET register values. Add aplic_is_direct_mode() mode helper, aplic_hwirq_flags_to_sourcecfg() to map generic hwirq flags to APLIC source modes, aplic_hwirq_is_delegated() to detect S-mode delegated sources, aplic_find_idc_index() to map a hart index to its IDC slot, and aplic_first_target_hart() to select the first available IDC hart for initial interrupt targeting. Implement the full sbi_irqchip callback set for direct (IDC) mode: - warm_init: enables IDC interrupt delivery and threshold per hart - process_hwirqs: reads TOPI and dispatches via sbi_irqchip_process_hwirq, skipping delegated sources - hwirq_setup: programs sourcecfg from hwirq_flags and sets the TARGET register to the first available IDC hart - hwirq_cleanup: clears IE, IP, sourcecfg, and TARGET on teardown - hwirq_eoi: reads CLAIMI to acknowledge the interrupt on the IDC - hwirq_set_affinity: reprograms TARGET to the specified hart index - hwirq_mask/unmask: clears/sets IE via CLRIENUM/SETIENUM Register the irqchip device and populate target_harts from idc_map only when targets_mmode is set in aplic_cold_irqchip_init(). Co-developed-by: Raymond Mao <[email protected]> Signed-off-by Raymond Mao <[email protected]> Signed-off-by: Oza Pawandeep <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib/utils/cppc/fdt_cppc_drivers.carray')
0 files changed, 0 insertions, 0 deletions