u-boot-brain/arch/x86/include/asm/irq.h
Tom Rini 83d290c56f SPDX: Convert all of our single license tags to Linux Kernel style
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from.  So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry.  Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents.  There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-07 09:34:12 -04:00

69 lines
1.7 KiB
C

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
*/
#ifndef _ARCH_IRQ_H_
#define _ARCH_IRQ_H_
#include <dt-bindings/interrupt-router/intel-irq.h>
/**
* Intel interrupt router configuration mechanism
*
* There are two known ways of Intel interrupt router configuration mechanism
* so far. On most cases, the IRQ routing configuraiton is controlled by PCI
* configuraiton registers on the legacy bridge, normally PCI BDF(0, 31, 0).
* On some newer platforms like BayTrail and Braswell, the IRQ routing is now
* in the IBASE register block where IBASE is memory-mapped.
*/
enum pirq_config {
PIRQ_VIA_PCI,
PIRQ_VIA_IBASE
};
/**
* Intel interrupt router control block
*
* Its members' value will be filled in based on device tree's input.
*
* @config: PIRQ_VIA_PCI or PIRQ_VIA_IBASE
* @link_base: link value base number
* @irq_mask: IRQ mask reprenting the 16 IRQs in 8259, bit N is 1 means
* IRQ N is available to be routed
* @lb_bdf: irq router's PCI bus/device/function number encoding
* @ibase: IBASE register block base address
* @actl_8bit: ACTL register width is 8-bit (for ICH series chipset)
* @actl_addr: ACTL register offset
*/
struct irq_router {
int config;
u32 link_base;
u16 irq_mask;
u32 bdf;
u32 ibase;
bool actl_8bit;
int actl_addr;
};
struct pirq_routing {
int bdf;
int pin;
int pirq;
};
/* PIRQ link number and value conversion */
#define LINK_V2N(link, base) (link - base)
#define LINK_N2V(link, base) (link + base)
#define PIRQ_BITMAP 0xdef8
/**
* irq_router_common_init() - Perform common x86 interrupt init
*
* This creates the PIRQ routing table and routes the IRQs
*/
int irq_router_common_init(struct udevice *dev);
#endif /* _ARCH_IRQ_H_ */