Jeenu Viswambharan | b1e957e | 2017-09-22 08:32:09 +0100 | [diff] [blame] | 1 | Platform Interrupt Controller API documentation |
| 2 | =============================================== |
| 3 | |
| 4 | .. section-numbering:: |
| 5 | :suffix: . |
| 6 | |
| 7 | .. contents:: |
| 8 | |
| 9 | This document lists the optional platform interrupt controller API that |
| 10 | abstracts the runtime configuration and control of interrupt controller from the |
| 11 | generic code. The mandatory APIs are described in the `porting guide`__. |
| 12 | |
| 13 | .. __: porting-guide.rst#interrupt-management-framework-in-bl31 |
| 14 | |
| 15 | Function: unsigned int plat_ic_get_running_priority(void); [optional] |
| 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 17 | |
| 18 | :: |
| 19 | |
| 20 | Argument : void |
| 21 | Return : unsigned int |
| 22 | |
| 23 | This API should return the priority of the interrupt the PE is currently |
| 24 | servicing. This must be be called only after an interrupt has already been |
| 25 | acknowledged via. ``plat_ic_acknowledge_interrupt``. |
| 26 | |
| 27 | In the case of ARM standard platforms using GIC, the *Running Priority Register* |
| 28 | is read to determine the priority of the interrupt. |
| 29 | |
Jeenu Viswambharan | 522a465 | 2017-09-22 08:32:09 +0100 | [diff] [blame] | 30 | Function: int plat_ic_is_spi(unsigned int id); [optional] |
| 31 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 32 | |
| 33 | :: |
| 34 | |
| 35 | Argument : unsigned int |
| 36 | Return : int |
| 37 | |
| 38 | The API should return whether the interrupt ID (first parameter) is categorized |
| 39 | as a Shared Peripheral Interrupt. Shared Peripheral Interrupts are typically |
| 40 | associated to system-wide peripherals, and these interrupts can target any PE in |
| 41 | the system. |
| 42 | |
| 43 | Function: int plat_ic_is_ppi(unsigned int id); [optional] |
| 44 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 45 | |
| 46 | :: |
| 47 | |
| 48 | Argument : unsigned int |
| 49 | Return : int |
| 50 | |
| 51 | The API should return whether the interrupt ID (first parameter) is categorized |
| 52 | as a Private Peripheral Interrupt. Private Peripheral Interrupts are typically |
| 53 | associated with peripherals that are private to each PE. Interrupts from private |
| 54 | peripherals target to that PE only. |
| 55 | |
| 56 | Function: int plat_ic_is_sgi(unsigned int id); [optional] |
| 57 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 58 | |
| 59 | :: |
| 60 | |
| 61 | Argument : unsigned int |
| 62 | Return : int |
| 63 | |
| 64 | The API should return whether the interrupt ID (first parameter) is categorized |
| 65 | as a Software Generated Interrupt. Software Generated Interrupts are raised by |
| 66 | explicit programming by software, and are typically used in inter-PE |
| 67 | communication. Secure SGIs are reserved for use by Secure world software. |
| 68 | |
Jeenu Viswambharan | 24e7029 | 2017-09-22 08:32:09 +0100 | [diff] [blame] | 69 | Function: unsigned int plat_ic_get_interrupt_active(unsigned int id); [optional] |
| 70 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 71 | |
| 72 | :: |
| 73 | |
| 74 | Argument : unsigned int |
| 75 | Return : int |
| 76 | |
| 77 | This API should return the *active* status of the interrupt ID specified by the |
| 78 | first parameter, ``id``. |
| 79 | |
| 80 | In case of ARM standard platforms using GIC, the implementation of the API reads |
| 81 | the GIC *Set Active Register* to read and return the active status of the |
| 82 | interrupt. |
| 83 | |
Jeenu Viswambharan | 0fcdfff | 2017-09-22 08:32:09 +0100 | [diff] [blame] | 84 | Function: void plat_ic_enable_interrupt(unsigned int id); [optional] |
| 85 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 86 | |
| 87 | :: |
| 88 | |
| 89 | Argument : unsigned int |
| 90 | Return : void |
| 91 | |
| 92 | This API should enable the interrupt ID specified by the first parameter, |
| 93 | ``id``. PEs in the system are expected to receive only enabled interrupts. |
| 94 | |
| 95 | In case of ARM standard platforms using GIC, the implementation of the API |
| 96 | inserts barrier to make memory updates visible before enabling interrupt, and |
| 97 | then writes to GIC *Set Enable Register* to enable the interrupt. |
| 98 | |
| 99 | Function: void plat_ic_disable_interrupt(unsigned int id); [optional] |
| 100 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 101 | |
| 102 | :: |
| 103 | |
| 104 | Argument : unsigned int |
| 105 | Return : void |
| 106 | |
| 107 | This API should disable the interrupt ID specified by the first parameter, |
| 108 | ``id``. PEs in the system are not expected to receive disabled interrupts. |
| 109 | |
| 110 | In case of ARM standard platforms using GIC, the implementation of the API |
| 111 | writes to GIC *Clear Enable Register* to disable the interrupt, and inserts |
| 112 | barrier to make memory updates visible afterwards. |
| 113 | |
Jeenu Viswambharan | 447b89d | 2017-09-22 08:32:09 +0100 | [diff] [blame^] | 114 | Function: void plat_ic_set_interrupt_priority(unsigned int id, unsigned int priority); [optional] |
| 115 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 116 | |
| 117 | :: |
| 118 | |
| 119 | Argument : unsigned int |
| 120 | Argument : unsigned int |
| 121 | Return : void |
| 122 | |
| 123 | This API should set the priority of the interrupt specified by first parameter |
| 124 | ``id`` to the value set by the second parameter ``priority``. |
| 125 | |
| 126 | In case of ARM standard platforms using GIC, the implementation of the API |
| 127 | writes to GIC *Priority Register* set interrupt priority. |
| 128 | |
Jeenu Viswambharan | b1e957e | 2017-09-22 08:32:09 +0100 | [diff] [blame] | 129 | ---- |
| 130 | |
| 131 | *Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.* |