mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
FROMGIT: irqchip/gic-v3: Describe the SGI range
As we are about to start making use of SGIs in a more conventional
way, let's describe it is the GICv3 list of interrupt types.
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Bug: 140053385
(cherry picked from commit 70a29c32cf
https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/ipi-as-irq)
Change-Id: I5f89be5a5825b76e05981822cab215580534ae4a
Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
committed by
Eric Biggers
parent
a07218695f
commit
d40dce0edb
@@ -117,6 +117,7 @@ static DEFINE_PER_CPU(bool, has_rss);
|
||||
#define DEFAULT_PMR_VALUE 0xf0
|
||||
|
||||
enum gic_intid_range {
|
||||
SGI_RANGE,
|
||||
PPI_RANGE,
|
||||
SPI_RANGE,
|
||||
EPPI_RANGE,
|
||||
@@ -128,6 +129,8 @@ enum gic_intid_range {
|
||||
static enum gic_intid_range __get_intid_range(irq_hw_number_t hwirq)
|
||||
{
|
||||
switch (hwirq) {
|
||||
case 0 ... 15:
|
||||
return SGI_RANGE;
|
||||
case 16 ... 31:
|
||||
return PPI_RANGE;
|
||||
case 32 ... 1019:
|
||||
@@ -153,15 +156,22 @@ static inline unsigned int gic_irq(struct irq_data *d)
|
||||
return d->hwirq;
|
||||
}
|
||||
|
||||
static inline int gic_irq_in_rdist(struct irq_data *d)
|
||||
static inline bool gic_irq_in_rdist(struct irq_data *d)
|
||||
{
|
||||
enum gic_intid_range range = get_intid_range(d);
|
||||
return range == PPI_RANGE || range == EPPI_RANGE;
|
||||
switch (get_intid_range(d)) {
|
||||
case SGI_RANGE:
|
||||
case PPI_RANGE:
|
||||
case EPPI_RANGE:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void __iomem *gic_dist_base(struct irq_data *d)
|
||||
{
|
||||
switch (get_intid_range(d)) {
|
||||
case SGI_RANGE:
|
||||
case PPI_RANGE:
|
||||
case EPPI_RANGE:
|
||||
/* SGI+PPI -> SGI_base for this CPU */
|
||||
@@ -258,6 +268,7 @@ static void gic_enable_redist(bool enable)
|
||||
static u32 convert_offset_index(struct irq_data *d, u32 offset, u32 *index)
|
||||
{
|
||||
switch (get_intid_range(d)) {
|
||||
case SGI_RANGE:
|
||||
case PPI_RANGE:
|
||||
case SPI_RANGE:
|
||||
*index = d->hwirq;
|
||||
@@ -1305,6 +1316,7 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
|
||||
chip = &gic_eoimode1_chip;
|
||||
|
||||
switch (__get_intid_range(hw)) {
|
||||
case SGI_RANGE:
|
||||
case PPI_RANGE:
|
||||
case EPPI_RANGE:
|
||||
irq_set_percpu_devid(irq);
|
||||
|
||||
Reference in New Issue
Block a user