On Fri, Sep 06, 2024 at 04:34:53PM +0800, maobibo wrote:
> > +    for (i = 0; i < VIRT_UART_COUNT; ++i) {
> How about adding serial_hd(i) checking here, such as
>    for (i = 0; (i < VIRT_UART_COUNT) && serial_hd(i); ++i) {

That doesn't seem to do anything, unfortunately.

> 
> > +        hwaddr base = VIRT_UART_BASE + i * VIRT_UART_SIZE;
> > +        int irq = VIRT_UART_IRQ + i - VIRT_GSI_BASE;
> > +        serial_mm_init(get_system_memory(), base, 0,
> > +                       qdev_get_gpio_in(pch_pic, irq),
> > +                       115200, serial_hd(VIRT_UART_COUNT - 1 - i),
> is it serial_hd(i) here rather than serial_hd(VIRT_UART_COUNT - 1 - i)? 
> In general serial_hd(0) is default serial.

They've got to be added in reverse order. The chosen calculation needed
to be fixed though, in the line below:

> > +        fdt_add_uart_node(lvms, pch_pic_phandle, base, irq, i == 0);

That now checks for the last index.

> By the way, serial port for acpi table should be refreshed also, such as

Thanks. Will send you a v2.

Jason

Reply via email to