]> git.proxmox.com Git - mirror_qemu.git/commit - include/hw/arm/aspeed_soc.h
aspeed: Refactor UART init for multi-SoC machines
authorPeter Delevoryas <peter@pjd.dev>
Thu, 14 Jul 2022 14:24:38 +0000 (16:24 +0200)
committerCédric Le Goater <clg@kaod.org>
Thu, 14 Jul 2022 14:24:38 +0000 (16:24 +0200)
commitd2b3eaefb4d7ae274ff85001f03d8b1a87ea3a7f
tree69bcc02eee8b62c9c84040da717bb619f02fdcdd
parent72a7c47393b41e406492e257a85589a75476b385
aspeed: Refactor UART init for multi-SoC machines

This change moves the code that connects the SoC UART's to serial_hd's
to the machine.

It makes each UART a proper child member of the SoC, and then allows the
machine to selectively initialize the chardev for each UART with a
serial_hd.

This should preserve backwards compatibility, but also allow multi-SoC
boards to completely change the wiring of serial devices from the
command line to specific SoC UART's.

This also removes the uart-default property from the SoC, since the SoC
doesn't need to know what UART is the "default" on the machine anymore.

I tested this using the images and commands from the previous
refactoring, and another test image for the ast1030:

    wget https://github.com/facebook/openbmc/releases/download/v2021.49.0/fuji.mtd
    wget https://github.com/facebook/openbmc/releases/download/v2021.49.0/wedge100.mtd
    wget https://github.com/peterdelevoryas/OpenBIC/releases/download/oby35-cl-2022.13.01/Y35BCL.elf

Fuji uses UART1:

    qemu-system-arm -machine fuji-bmc \
        -drive file=fuji.mtd,format=raw,if=mtd \
        -nographic

ast2600-evb uses uart-default=UART5:

    qemu-system-arm -machine ast2600-evb \
        -drive file=fuji.mtd,format=raw,if=mtd \
        -serial null -serial mon:stdio -display none

Wedge100 uses UART3:

    qemu-system-arm -machine palmetto-bmc \
        -drive file=wedge100.mtd,format=raw,if=mtd \
        -serial null -serial null -serial null \
        -serial mon:stdio -display none

AST1030 EVB uses UART5:

    qemu-system-arm -machine ast1030-evb \
        -kernel Y35BCL.elf -nographic

Fixes: 6827ff20b2975 ("hw: aspeed: Init all UART's with serial devices")
Signed-off-by: Peter Delevoryas <peter@pjd.dev>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220705191400.41632-4-peter@pjd.dev>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/arm/aspeed.c
hw/arm/aspeed_ast10x0.c
hw/arm/aspeed_ast2600.c
hw/arm/aspeed_soc.c
include/hw/arm/aspeed_soc.h