From 2e55ff352f2bd1c36f5b33f9c852430f123205ce Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Mon, 12 Aug 2019 19:56:00 +0100 Subject: dev-arm: Add HDLcd DTB autogeneration A Display has been defined. Its sole purpose is to generate the device tree node to be referenced by the HDLcd device. The encoder parameters are based on the existing node defined in: system/arm/dt/armv8.dts Change-Id: I6cdeb0437dce207dbd0f2c65c16b224245eb74e1 Signed-off-by: Giacomo Travaglini Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20330 Maintainer: Andreas Sandberg Tested-by: kokoro --- src/dev/arm/RealView.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/dev/arm/RealView.py') diff --git a/src/dev/arm/RealView.py b/src/dev/arm/RealView.py index 99f79eed8..b53cd9922 100644 --- a/src/dev/arm/RealView.py +++ b/src/dev/arm/RealView.py @@ -65,6 +65,7 @@ from m5.objects.Graphics import ImageFormat from m5.objects.ClockedObject import ClockedObject from m5.objects.PS2 import * from m5.objects.VirtIOMMIO import MmioVirtIO +from m5.objects.Display import Display, Display1080p # Platforms with KVM support should generally use in-kernel GIC # emulation. Use a GIC model that automatically switches between @@ -491,7 +492,29 @@ class HDLcd(AmbaDmaDevice): virt_refresh_rate = Param.Frequency("20Hz", "Frame refresh rate " "in KVM mode") + encoder = Param.Display(Display1080p(), "Display encoder") + + def endpointPhandle(self): + return "hdlcd_endpoint" + def generateDeviceTree(self, state): + endpoint_node = FdtNode("endpoint") + endpoint_node.appendPhandle(self.endpointPhandle()) + + for encoder_node in self.encoder.generateDeviceTree(state): + encoder_endpoint = self.encoder.endpointNode() + + # Endpoint subnode + endpoint_node.append(FdtPropertyWords("remote-endpoint", + [ state.phandle(self.encoder.endpointPhandle()) ])) + encoder_endpoint.append(FdtPropertyWords("remote-endpoint", + [ state.phandle(self.endpointPhandle()) ])) + + yield encoder_node + + port_node = FdtNode("port") + port_node.append(endpoint_node) + # Interrupt number is hardcoded; it is not a property of this class node = self.generateBasicPioDeviceNode(state, 'hdlcd', self.pio_addr, 0x1000, [63]) @@ -508,6 +531,8 @@ class HDLcd(AmbaDmaDevice): self.addIommuProperty(state, node) + node.append(port_node) + yield node class RealView(Platform): -- cgit v1.2.3