From 78f2f4fd6d26472c03404d289d570cdee4f2abd8 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Wed, 29 Jul 2020 11:50:36 +0100 Subject: [PATCH] dev-arm: generateBasicPioDeviceNode requiring an ArmInterruptPin Change-Id: I16ed3b689158defe2a43cccfa053d48dec4a1e41 Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31941 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- src/dev/Device.py | 4 ++-- src/dev/arm/RealView.py | 10 +++++----- src/dev/arm/VirtIOMMIO.py | 4 +--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/dev/Device.py b/src/dev/Device.py index d42541d1f..8950763e3 100644 --- a/src/dev/Device.py +++ b/src/dev/Device.py @@ -57,14 +57,14 @@ class PioDevice(ClockedObject): state.sizeCells(size) )) if interrupts: - if any([i < 32 for i in interrupts]): + if any([i.num < 32 for i in interrupts]): raise(("Interrupt number smaller than 32 "+ " in PioDevice %s") % name) # subtracting 32 because Linux assumes that SPIs start at 0, while # gem5 uses the internal GIC numbering (SPIs start at 32) node.append(FdtPropertyWords("interrupts", sum( - [[0, i - 32, 4] for i in interrupts], []) )) + [[0, i.num - 32, 4] for i in interrupts], []) )) return node diff --git a/src/dev/arm/RealView.py b/src/dev/arm/RealView.py index 5bfc12e87..684567fa0 100644 --- a/src/dev/arm/RealView.py +++ b/src/dev/arm/RealView.py @@ -373,7 +373,7 @@ class Pl011(Uart): def generateDeviceTree(self, state): node = self.generateBasicPioDeviceNode(state, 'uart', self.pio_addr, - 0x1000, [int(self.interrupt.num)]) + 0x1000, [ self.interrupt ]) node.appendCompatible(["arm,pl011", "arm,primecell"]) # Hardcoded reference to the realview platform clocks, because the @@ -409,7 +409,7 @@ Reference: def generateDeviceTree(self, state): node = self.generateBasicPioDeviceNode(state, 'watchdog', - self.pio_addr, 0x1000, [int(self.interrupt.num)]) + self.pio_addr, 0x1000, [ self.interrupt ]) node.appendCompatible(['arm,sp805', 'arm,primecell']) clocks = [state.phandle(self.clk_domain.unproxy(self))] clock_names = ['wdogclk'] @@ -442,7 +442,7 @@ class PL031(AmbaIntDevice): def generateDeviceTree(self, state): node = self.generateBasicPioDeviceNode(state, 'rtc', self.pio_addr, - 0x1000, [int(self.interrupt.num)]) + 0x1000, [ self.interrupt ]) node.appendCompatible(["arm,pl031", "arm,primecell"]) clock = state.phandle(self.clk_domain.unproxy(self)) @@ -460,7 +460,7 @@ class Pl050(AmbaIntDevice): def generateDeviceTree(self, state): node = self.generateBasicPioDeviceNode(state, 'kmi', self.pio_addr, - 0x1000, [int(self.interrupt.num)]) + 0x1000, [ self.interrupt ]) node.appendCompatible(["arm,pl050", "arm,primecell"]) clock = state.phandle(self.clk_domain.unproxy(self)) @@ -523,7 +523,7 @@ class HDLcd(AmbaDmaDevice): port_node.append(endpoint_node) node = self.generateBasicPioDeviceNode(state, 'hdlcd', - self.pio_addr, 0x1000, [ self.interrupt.num ]) + self.pio_addr, 0x1000, [ self.interrupt ]) node.appendCompatible(["arm,hdlcd"]) node.append(FdtPropertyWords("clocks", state.phandle(self.pxl_clk))) diff --git a/src/dev/arm/VirtIOMMIO.py b/src/dev/arm/VirtIOMMIO.py index 919755b8f..60aee1654 100644 --- a/src/dev/arm/VirtIOMMIO.py +++ b/src/dev/arm/VirtIOMMIO.py @@ -54,8 +54,6 @@ class MmioVirtIO(BasicPioDevice): def generateDeviceTree(self, state): node = self.generateBasicPioDeviceNode(state, 'virtio', self.pio_addr, - int(self.pio_size), [ - int(self.interrupt.num), - ]) + int(self.pio_size), [ self.interrupt ]) node.appendCompatible(["virtio,mmio"]) yield node -- 2.30.2