[Skiboot] [RFC PATCH] plat/qemu: Add BT device

Cédric Le Goater clg at fr.ibm.com
Tue Dec 8 05:41:48 AEDT 2015


On 11/15/2015 07:13 AM, Benjamin Herrenschmidt wrote:
> On Sat, 2015-11-14 at 17:23 +0100, Cédric Le Goater wrote:
>> which he did two days ago : 
>>
>>         http://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg03153.html
>>
>> I missed that. Let's support it then. I will advertise the merge I did
>> and ask a few questions on how we should populate the device tree. 
> 
> We can probably populate it from OPAL. Unless we start to add optional DT
> hooks for ISADevice ... In that case, we could populate the UART too.

I do not really know where to send patches (qemu-devel@). So, here is a try 
on top of your branch :

	https://github.com/legoater/qemu/commits/powernv-benh

It looks for isa devices, static and dynamic like the ipmi-bt will be, and 
populates the device tree as skiboot would do it.

The skiboot qemu platform needs a couple of fixes to survive, such as :  

@@ -53,6 +156,14 @@ static void qemu_dt_fixup_uart(struct dt
 #define UART_IO_COUNT	8
 #define UART_LPC_IRQ	4
 
+	/* First check if the BT interface is already there */
+	dt_for_each_child(lpc, uart) {
+            	if (dt_node_is_compatible(uart, "pnpPNP,501")) {
+                    	prlog(PR_WARNING, "QEMU: uart device already here\n");
+			return;
+                }
+	}
+
 	snprintf(namebuf, sizeof(namebuf), "serial at i%x", UART_IO_BASE);
 	uart = dt_new(lpc, namebuf);
 
@@ -84,6 +195,14 @@ static void qemu_dt_fixup_rtc(struct dt_
 	struct dt_node *rtc;
 	char namebuf[32];
 
+	/* First check if the BT interface is already there */
+	dt_for_each_child(lpc, rtc) {
+            	if (dt_node_is_compatible(rtc, "pnpPNP,b00")) {
+                    	prlog(PR_WARNING, "QEMU: rtc device already here\n");
+			return;
+                }
+	}
+
 	/*
 	 * Follows the structure expected by the kernel file
 	 * arch/powerpc/sysdev/rtc_cmos_setup.c

The rest should be fine. 

Cheers,

C.



More information about the Skiboot mailing list