[gem5-dev] Change in gem5/gem5[develop]: dev: Separate generateDeviceTree into a RiscvUart8250 SimObject.

2021-10-28 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/52144 )


 (

1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.
 )Change subject: dev: Separate generateDeviceTree into a RiscvUart8250  
SimObject.

..

dev: Separate generateDeviceTree into a RiscvUart8250 SimObject.

The only difference between the RiscvUart8250 and the regular Uart8250
is that the Riscv version knows how to generate a device tree node
appropriate for use in a Riscv system. This lets us drop the TARGET_ISA
check from that method, since that should be called iff the target
system is Riscv.

Also update the HiFive platform to use the RiscvUart8250 so that it can
continue to generate device trees successfully.

Change-Id: I306596efffed5e5eed337d3db492d2782ebfaa8d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52144
Reviewed-by: Jason Lowe-Power 
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
---
M src/dev/riscv/HiFive.py
M src/dev/serial/Uart.py
2 files changed, 37 insertions(+), 15 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/dev/riscv/HiFive.py b/src/dev/riscv/HiFive.py
index d945590..2923b88 100755
--- a/src/dev/riscv/HiFive.py
+++ b/src/dev/riscv/HiFive.py
@@ -38,7 +38,7 @@
 from m5.objects.Clint import Clint
 from m5.objects.Plic import Plic
 from m5.objects.RTC import RiscvRTC
-from m5.objects.Uart import Uart8250
+from m5.objects.Uart import RiscvUart8250
 from m5.objects.Terminal import Terminal
 from m5.params import *
 from m5.proxy import *
@@ -106,7 +106,7 @@
 plic = Param.Plic(Plic(pio_addr=0xc00), "PLIC")

 # Uart
-uart = Uart8250(pio_addr=0x1000)
+uart = RiscvUart8250(pio_addr=0x1000)
 # Int source ID to redirect console interrupts to
 # Set to 0 if using a pci interrupt for Uart instead
 uart_int_id = Param.Int(0xa, "PLIC Uart interrupt ID")
diff --git a/src/dev/serial/Uart.py b/src/dev/serial/Uart.py
index aecdfe3..aea6fa6 100644
--- a/src/dev/serial/Uart.py
+++ b/src/dev/serial/Uart.py
@@ -67,17 +67,17 @@
 cxx_class = 'gem5::Uart8250'
 pio_size = Param.Addr(0x8, "Size of address range")

+class RiscvUart8250(Uart8250):
 def generateDeviceTree(self, state):
-if buildEnv['TARGET_ISA'] == "riscv":
-node = self.generateBasicPioDeviceNode(
-state, "uart", self.pio_addr, self.pio_size)
-platform = self.platform.unproxy(self)
-plic = platform.plic
-node.append(
-FdtPropertyWords("interrupts", [platform.uart_int_id]))
-node.append(
-FdtPropertyWords("clock-frequency", [0x384000]))
-node.append(
-FdtPropertyWords("interrupt-parent", state.phandle(plic)))
-node.appendCompatible(["ns8250"])
-yield node
+node = self.generateBasicPioDeviceNode(
+state, "uart", self.pio_addr, self.pio_size)
+platform = self.platform.unproxy(self)
+plic = platform.plic
+node.append(
+FdtPropertyWords("interrupts", [platform.uart_int_id]))
+node.append(
+FdtPropertyWords("clock-frequency", [0x384000]))
+node.append(
+FdtPropertyWords("interrupt-parent", state.phandle(plic)))
+node.appendCompatible(["ns8250"])
+yield node

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/52144
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I306596efffed5e5eed337d3db492d2782ebfaa8d
Gerrit-Change-Number: 52144
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: dev: Separate generateDeviceTree into a RiscvUart8250 SimObject.

2021-10-27 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/52144 )



Change subject: dev: Separate generateDeviceTree into a RiscvUart8250  
SimObject.

..

dev: Separate generateDeviceTree into a RiscvUart8250 SimObject.

The only difference between the RiscvUart8250 and the regular Uart8250
is that the Riscv version knows how to generate a device tree node
appropriate for use in a Riscv system. This lets us drop the TARGET_ISA
check from that method, since that should be called iff the target
system is Riscv.

Also update the HiFive platform to use the RiscvUart8250 so that it can
continue to generate device trees successfully.

Change-Id: I306596efffed5e5eed337d3db492d2782ebfaa8d
---
M src/dev/riscv/HiFive.py
M src/dev/serial/Uart.py
2 files changed, 33 insertions(+), 15 deletions(-)



diff --git a/src/dev/riscv/HiFive.py b/src/dev/riscv/HiFive.py
index d945590..2923b88 100755
--- a/src/dev/riscv/HiFive.py
+++ b/src/dev/riscv/HiFive.py
@@ -38,7 +38,7 @@
 from m5.objects.Clint import Clint
 from m5.objects.Plic import Plic
 from m5.objects.RTC import RiscvRTC
-from m5.objects.Uart import Uart8250
+from m5.objects.Uart import RiscvUart8250
 from m5.objects.Terminal import Terminal
 from m5.params import *
 from m5.proxy import *
@@ -106,7 +106,7 @@
 plic = Param.Plic(Plic(pio_addr=0xc00), "PLIC")

 # Uart
-uart = Uart8250(pio_addr=0x1000)
+uart = RiscvUart8250(pio_addr=0x1000)
 # Int source ID to redirect console interrupts to
 # Set to 0 if using a pci interrupt for Uart instead
 uart_int_id = Param.Int(0xa, "PLIC Uart interrupt ID")
diff --git a/src/dev/serial/Uart.py b/src/dev/serial/Uart.py
index aecdfe3..aea6fa6 100644
--- a/src/dev/serial/Uart.py
+++ b/src/dev/serial/Uart.py
@@ -67,17 +67,17 @@
 cxx_class = 'gem5::Uart8250'
 pio_size = Param.Addr(0x8, "Size of address range")

+class RiscvUart8250(Uart8250):
 def generateDeviceTree(self, state):
-if buildEnv['TARGET_ISA'] == "riscv":
-node = self.generateBasicPioDeviceNode(
-state, "uart", self.pio_addr, self.pio_size)
-platform = self.platform.unproxy(self)
-plic = platform.plic
-node.append(
-FdtPropertyWords("interrupts", [platform.uart_int_id]))
-node.append(
-FdtPropertyWords("clock-frequency", [0x384000]))
-node.append(
-FdtPropertyWords("interrupt-parent", state.phandle(plic)))
-node.appendCompatible(["ns8250"])
-yield node
+node = self.generateBasicPioDeviceNode(
+state, "uart", self.pio_addr, self.pio_size)
+platform = self.platform.unproxy(self)
+plic = platform.plic
+node.append(
+FdtPropertyWords("interrupts", [platform.uart_int_id]))
+node.append(
+FdtPropertyWords("clock-frequency", [0x384000]))
+node.append(
+FdtPropertyWords("interrupt-parent", state.phandle(plic)))
+node.appendCompatible(["ns8250"])
+yield node

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/52144
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I306596efffed5e5eed337d3db492d2782ebfaa8d
Gerrit-Change-Number: 52144
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s