]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[spcr] Accept alternative type value for a 16550-compatible UART coverity_scan master
authorMichael Brown <mcb30@ipxe.org>
Wed, 5 Nov 2025 20:06:53 +0000 (20:06 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 5 Nov 2025 20:06:53 +0000 (20:06 +0000)
Some systems (observed on an AWS EC2 m7i.metal-24xl instance in
eu-south-2) use the newer "16550-compatible with parameters defined in
Generic Address Structure" type value.  (There does not appear to be
any particular reason why the newer value needs to be used: the UART
is still a standard 16550 with single-byte registers.)

Accept this additional type value for a 16550-compatible UART.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/spcr.c
src/include/ipxe/spcr.h

index 88914cac78c558a7073703bdd99169e3a115b685..b1cee16080dc0654bb3c1de7ea01aff79aa0d3e1 100644 (file)
@@ -143,6 +143,7 @@ static struct uart * spcr_console ( void ) {
        switch ( spcr->type ) {
        case SPCR_TYPE_16550:
        case SPCR_TYPE_16450:
+       case SPCR_TYPE_16550_GAS:
                if ( ( rc = spcr_16550 ( spcr, uart ) ) != 0 )
                        goto err_type;
                break;
index ff41a4b89abffc40395ff3e44e9f44da0497b449..366092ade246a2857138f2cb59ec03e3cf0ccfc3 100644 (file)
@@ -74,6 +74,7 @@ struct spcr_table {
 /* SPCR interface types */
 #define SPCR_TYPE_16550                0x0000          /**< 16550-compatible */
 #define SPCR_TYPE_16450                0x0001          /**< 16450-compatible */
+#define SPCR_TYPE_16550_GAS    0x0012          /**< 16550-compatible */
 
 /** SPCR baud rates */
 enum spcr_baud {