summaryrefslogtreecommitdiffstats
path: root/qemu/roms/SLOF/board-qemu/slof/pci-interrupts.fs
diff options
context:
space:
mode:
authorYang Zhang <yang.z.zhang@intel.com>2015-08-28 09:58:54 +0800
committerYang Zhang <yang.z.zhang@intel.com>2015-09-01 12:44:00 +0800
commite44e3482bdb4d0ebde2d8b41830ac2cdb07948fb (patch)
tree66b09f592c55df2878107a468a91d21506104d3f /qemu/roms/SLOF/board-qemu/slof/pci-interrupts.fs
parent9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (diff)
Add qemu 2.4.0
Change-Id: Ic99cbad4b61f8b127b7dc74d04576c0bcbaaf4f5 Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Diffstat (limited to 'qemu/roms/SLOF/board-qemu/slof/pci-interrupts.fs')
-rw-r--r--qemu/roms/SLOF/board-qemu/slof/pci-interrupts.fs38
1 files changed, 38 insertions, 0 deletions
diff --git a/qemu/roms/SLOF/board-qemu/slof/pci-interrupts.fs b/qemu/roms/SLOF/board-qemu/slof/pci-interrupts.fs
new file mode 100644
index 000000000..e11b77932
--- /dev/null
+++ b/qemu/roms/SLOF/board-qemu/slof/pci-interrupts.fs
@@ -0,0 +1,38 @@
+
+: pci-gen-irq-map-one ( prop-addr prop-len slot pin -- prop-addr prop-len )
+ 2dup + 4 mod ( prop-addr prop-len slot pin parentpin )
+ >r >r ( prop-addr prop-len slot R: swizzledpin pin )
+
+ \ Child slot#
+ B lshift encode-int+ ( prop-addr prop-len R: swizzledpin pin )
+ \ Child 64bit BAR (not really used)
+ 0 encode-64+
+ \ Chile pin#
+ r> encode-int+ ( prop-addr prop-len R: swizzledpin )
+
+ \ Parent phandle
+ get-parent encode-int+
+
+ \ Parent slot#
+ get-node >space
+ pci-addr2dev B lshift ( prop-addr prop-len parent-slot R: swizzledpin )
+ encode-int+
+ \ Parent 64bit BAR (not really used)
+ 0 encode-64+
+ \ Parent pin
+ r> encode-int+ ( prop-addr prop-len R: )
+;
+
+: pci-gen-irq-entry ( prop-addr prop-len config-addr -- prop-addr prop-len )
+ pci-addr2dev 4 mod ( prop-addr prop-len slot )
+ -rot ( slot prop-addr prop-len )
+ 5 1 DO
+ 2 pick i ( slot prop-addr prop-len slot pin )
+ pci-gen-irq-map-one
+ LOOP
+ rot drop
+;
+
+: pci-set-irq-line ( config-addr -- )
+ drop
+;