[PATCH] arm: Kconfig: disable stellaris if Rust is enabled

Paolo Bonzini posted 1 patch 12 hours ago
hw/arm/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] arm: Kconfig: disable stellaris if Rust is enabled
Posted by Paolo Bonzini 12 hours ago
The stellaris board requires the pl011-luminary variant of pl011,
which is not supported by the Rust implementation.

There are at least three possibilities: 1) implement the subclass
(a bit harder in Rust since the language does not have subclasses)
2) change the ID to a property 3) split pl011-luminary to a separate
Kconfig symbol and leave the subclass as C code.

Just for the sake of starting the discussion, this RFC patch uses
the big axe and disables stellaris.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/arm/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index e7fd9338d11..d5ade150d23 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -219,12 +219,12 @@ config STELLARIS
     bool
     default y
     depends on TCG && ARM
+    depends on !HAVE_RUST # Rust does not implement pl011-luminary
     imply I2C_DEVICES
     select ARM_V7M
     select CMSDK_APB_WATCHDOG
     select I2C
-    select PL011 if !HAVE_RUST # UART
-    select X_PL011_RUST if HAVE_RUST # UART
+    select PL011 # UART
     select PL022 # SPI
     select PL061 # GPIO
     select SSD0303 # OLED display
-- 
2.46.2
Re: [PATCH] arm: Kconfig: disable stellaris if Rust is enabled
Posted by Peter Maydell 11 hours ago
On Tue, 22 Oct 2024 at 09:54, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The stellaris board requires the pl011-luminary variant of pl011,
> which is not supported by the Rust implementation.
>
> There are at least three possibilities: 1) implement the subclass
> (a bit harder in Rust since the language does not have subclasses)
> 2) change the ID to a property 3) split pl011-luminary to a separate
> Kconfig symbol and leave the subclass as C code.
>
> Just for the sake of starting the discussion, this RFC patch uses
> the big axe and disables stellaris.

Reasonable enough as a starter. For the longer term, we should
figure out how we want to handle this kind of "we have a common
base QOM class that implements almost all of the behaviour
and we subclass it to implement different minor variants"
in Rust, because we use it a fair amount in the existing C code.

-- PMM