qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH qemu.git 1/1] hw/arm/virt: make second UART available


From: Axel Heider
Subject: Re: [PATCH qemu.git 1/1] hw/arm/virt: make second UART available
Date: Wed, 30 Nov 2022 19:45:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

Hi,


+    switch(uart) {
+    case VIRT_UART0:
+        break;
+    case VIRT_UART1:

Maybe pass a 'is_secure' boolean?


I don't think this would really make things easier. I wanted to
avoid too many changes in this patch. The price is, that there
are two places where decisions about the configuration are made.
But these are also two independent decisions: (a) which memory
this belongs to and (b) if the UART exists at all. I think the
code is easier to maintain this way, because more UARTs can be
added with a small patch then. Note also, that a parameter
'is_secure' would still not avoid mis-usage, as we still need
the 'mem' parameter for 'secure_sysmem' or 'sysmem', because
this is no available from the 'vms' object.


-    VIRT_SECURE_UART,
+    VIRT_UART1, /* secure UART if vms->secure */

(I'm not sure changing the name is worth the churn).


After this patch is merged, we have two UARTs, so the naming is
a bit more consistent. It's no longer a secure UART only. And
when adding even more UARTs in further customization, it's easier
to understand the order of the UARTs.


Axel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]