summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-08-13 10:36:17 -0600
committerSimon Glass <sjg@chromium.org>2015-08-14 10:00:51 -0600
commit590870e7e8919bca7adfd97069ac5b2a924b3151 (patch)
treec790ad3ef04421f0ee686d6395df1d82fe16e6c8
parentef910819c5a020e96c444d1e73eac917d394456b (diff)
downloadu-boot-imx-590870e7e8919bca7adfd97069ac5b2a924b3151.zip
u-boot-imx-590870e7e8919bca7adfd97069ac5b2a924b3151.tar.gz
u-boot-imx-590870e7e8919bca7adfd97069ac5b2a924b3151.tar.bz2
x86: Add a simple interrupt script to the README
It is a bit tedious to figure out the interrupt configuration for a new x86 platform. Add a script which can do this, based on the output of 'pci long'. This may be helpful in some cases. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r--doc/README.x8615
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/README.x86 b/doc/README.x86
index 9012541..e7dc090 100644
--- a/doc/README.x86
+++ b/doc/README.x86
@@ -718,6 +718,21 @@ allocation and assignment will be done by U-Boot automatically. Now you can
enable CONFIG_GENERATE_PIRQ_TABLE for testing Linux kernel using i8259 PIC and
CONFIG_GENERATE_MP_TABLE for testing Linux kernel using local APIC and I/O APIC.
+This script might be useful. If you feed it the output of 'pci long' from
+U-Boot then it will generate a device tree fragment with the interrupt
+configuration for each device (note it needs gawk 4.0.0):
+
+ $ cat console_output |awk '/PCI/ {device=$4} /interrupt line/ {line=$4} \
+ /interrupt pin/ {pin = $4; if (pin != "0x00" && pin != "0xff") \
+ {patsplit(device, bdf, "[0-9a-f]+"); \
+ printf "PCI_BDF(%d, %d, %d) INT%c PIRQ%c\n", strtonum("0x" bdf[1]), \
+ strtonum("0x" bdf[2]), bdf[3], strtonum(pin) + 64, 64 + strtonum(pin)}}'
+
+Example output:
+ PCI_BDF(0, 2, 0) INTA PIRQA
+ PCI_BDF(0, 3, 0) INTA PIRQA
+...
+
TODO List
---------
- Audio