Re: [PATCH v3 1/3] hw/char: add K230 DW 8250-compatible UART

WX Chen <[email protected]>
Newsgroups org.nongnu.qemu-riscv,org.nongnu.qemu-devel
Message-ID <[email protected]>
On 8/15/26 21:57, Philippe Mathieu-Daudé wrote:
> How much this diverges of the generic 8250 model we have?
>
> In order to reduce maintenance burden with duplicated code, the
> project preference is to use the inheritance pattern of oriented
> bject programming, in particular with QOM APIs.
>
> This model could inherit from our generic model with:
>
>   TypeInfo::parent = TYPE_SERIAL
>
> then override its specific methods.
>
> Could you have a look and justify the full rewrite? 

Hi Phil,

Thanks for the review.

The rewrite was not meant as a replacement for the generic 8250. I
was following the K230 TRM as closely as I could, and I did not
realize the preferred approach was to reuse the in-tree 8250 via
QOM rather than reimplement the 16550 core.

I agree the duplication is not justified. I will respin this to
inherit from / reuse the generic serial model as you suggested,
and keep the DesignWare probe window that Linux 8250_dw needs
(UCV/CPR/CTR/DLF/USR).

One open question: the TRM (and CPR) advertise some DesignWare
extras beyond a plain 16550 — for example a 32-byte FIFO, THRE
mode, shadow registers, and USR busy-detect. The first version
implemented several of these, which is why it grew into a full
rewrite. For the respin, should I:

   1) keep only the minimal probe window (CPR not advertising
      features the generic model does not implement), or
   2) plan follow-up work to model some of those DW extras?

I am happy either way; I mainly want to know which level of
fidelity is good.

If the pending generic dw8250 lands first, I can also switch the
K230 board over to that type instead of keeping a parallel model.

Thanks,
WX Chen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.