diff mbox series

[v2] acpi: dbg2: Allow 16550 compatible serial port in DBG2

Message ID 20210630054545.959797-2-gjb@semihalf.com
State Accepted
Headers show
Series [v2] acpi: dbg2: Allow 16550 compatible serial port in DBG2 | expand

Commit Message

Grzegorz Bernacki June 30, 2021, 5:45 a.m. UTC
BSA 1.0 specification allow the serial port to be either
Arm SBSA Generic UART, PL011, or 16550. This patch adds
checking for 16550 port type.

BugLink: https://bugs.launchpad.net/fwts/+bug/1932567

Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
---
 src/acpi/dbg2/dbg2.c | 23 ++++++++++++++------
 1 file changed, 16 insertions(+), 7 deletions(-)

Comments

Alex Hung June 30, 2021, 5:59 a.m. UTC | #1
On 2021-06-29 11:45 p.m., Grzegorz Bernacki wrote:
> BSA 1.0 specification allow the serial port to be either
> Arm SBSA Generic UART, PL011, or 16550. This patch adds
> checking for 16550 port type.
> 
> BugLink: https://bugs.launchpad.net/fwts/+bug/1932567
> 
> Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
> ---
>  src/acpi/dbg2/dbg2.c | 23 ++++++++++++++------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/src/acpi/dbg2/dbg2.c b/src/acpi/dbg2/dbg2.c
> index 6004dc61..88936d72 100644
> --- a/src/acpi/dbg2/dbg2.c
> +++ b/src/acpi/dbg2/dbg2.c
> @@ -28,9 +28,12 @@
>  
>  #include "fwts_acpi_object_eval.h"
>  
> -#define SBBR_DBG2_PORT_SERIAL     0x8000
> -#define SBBR_DBG2_ARM_SBSA_UART   0x000E
> -#define SBBR_DBG2_ARM_PL011_UART  0x0003
> +#define SBBR_DBG2_PORT_SERIAL          0x8000
> +#define SBBR_DBG2_FULLY_16550_COMPAT   0x0000
> +#define SBBR_DBG2_16550_SUBSET_COMPAT  0x0001
> +#define SBBR_DBG2_ARM_PL011_UART       0x0003
> +#define SBBR_DBG2_ARM_SBSA_UART        0x000E
> +#define SBBR_DBG2_16550_COMPAT_GAS     0x0012
>  
>  static fwts_acpi_table_info *table;
>  acpi_table_init(DBG2, &table)
> @@ -53,11 +56,14 @@ static int dbg2_test2(fwts_framework *fw)
>  		if (((uint8_t*)info + info->length) >= ((uint8_t*)table + table->length))
>  			break;
>  		if (info->port_type == SBBR_DBG2_PORT_SERIAL &&
> -		   (info->port_subtype == SBBR_DBG2_ARM_SBSA_UART ||
> -		    info->port_subtype == SBBR_DBG2_ARM_PL011_UART)) {
> +		   (info->port_subtype == SBBR_DBG2_FULLY_16550_COMPAT ||
> +		    info->port_subtype == SBBR_DBG2_16550_SUBSET_COMPAT ||
> +		    info->port_subtype == SBBR_DBG2_ARM_PL011_UART ||
> +		    info->port_subtype == SBBR_DBG2_ARM_SBSA_UART ||
> +		    info->port_subtype == SBBR_DBG2_16550_COMPAT_GAS)) {
>  			fwts_passed(fw,
>  				"DBG2 provides a standard serial debug "
> -				"port and describes ARM SBSA Generic UART");
> +				"port and describes ARM BSA compliant UART");
>  			return FWTS_OK;
>  		}
>  
> @@ -188,6 +194,9 @@ static int dbg2_test1(fwts_framework *fw)
>  			case 0x0010:
>  				subport = "BCM2835";
>  				break;
> +			case 0x0012:
> +				subport = "16550-compatible with parameters in GAS";
> +				break;
>  			default:
>  				break;
>  			}
> @@ -359,7 +368,7 @@ done:
>  
>  static fwts_framework_minor_test dbg2_tests[] = {
>  	{ dbg2_test1, "DBG2 (Debug Port Table 2) test." },
> -	{ dbg2_test2, "DBG2 ARM SBSA Generic UART test," },
> +	{ dbg2_test2, "DBG2 ARM BSA compliant UART test," },
>  	{ NULL, NULL }
>  };
>  
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Colin Ian King June 30, 2021, 6:32 a.m. UTC | #2
On 30/06/2021 06:45, Grzegorz Bernacki wrote:
> BSA 1.0 specification allow the serial port to be either
> Arm SBSA Generic UART, PL011, or 16550. This patch adds
> checking for 16550 port type.
> 
> BugLink: https://bugs.launchpad.net/fwts/+bug/1932567
> 
> Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
> ---
>  src/acpi/dbg2/dbg2.c | 23 ++++++++++++++------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/src/acpi/dbg2/dbg2.c b/src/acpi/dbg2/dbg2.c
> index 6004dc61..88936d72 100644
> --- a/src/acpi/dbg2/dbg2.c
> +++ b/src/acpi/dbg2/dbg2.c
> @@ -28,9 +28,12 @@
>  
>  #include "fwts_acpi_object_eval.h"
>  
> -#define SBBR_DBG2_PORT_SERIAL     0x8000
> -#define SBBR_DBG2_ARM_SBSA_UART   0x000E
> -#define SBBR_DBG2_ARM_PL011_UART  0x0003
> +#define SBBR_DBG2_PORT_SERIAL          0x8000
> +#define SBBR_DBG2_FULLY_16550_COMPAT   0x0000
> +#define SBBR_DBG2_16550_SUBSET_COMPAT  0x0001
> +#define SBBR_DBG2_ARM_PL011_UART       0x0003
> +#define SBBR_DBG2_ARM_SBSA_UART        0x000E
> +#define SBBR_DBG2_16550_COMPAT_GAS     0x0012
>  
>  static fwts_acpi_table_info *table;
>  acpi_table_init(DBG2, &table)
> @@ -53,11 +56,14 @@ static int dbg2_test2(fwts_framework *fw)
>  		if (((uint8_t*)info + info->length) >= ((uint8_t*)table + table->length))
>  			break;
>  		if (info->port_type == SBBR_DBG2_PORT_SERIAL &&
> -		   (info->port_subtype == SBBR_DBG2_ARM_SBSA_UART ||
> -		    info->port_subtype == SBBR_DBG2_ARM_PL011_UART)) {
> +		   (info->port_subtype == SBBR_DBG2_FULLY_16550_COMPAT ||
> +		    info->port_subtype == SBBR_DBG2_16550_SUBSET_COMPAT ||
> +		    info->port_subtype == SBBR_DBG2_ARM_PL011_UART ||
> +		    info->port_subtype == SBBR_DBG2_ARM_SBSA_UART ||
> +		    info->port_subtype == SBBR_DBG2_16550_COMPAT_GAS)) {
>  			fwts_passed(fw,
>  				"DBG2 provides a standard serial debug "
> -				"port and describes ARM SBSA Generic UART");
> +				"port and describes ARM BSA compliant UART");
>  			return FWTS_OK;
>  		}
>  
> @@ -188,6 +194,9 @@ static int dbg2_test1(fwts_framework *fw)
>  			case 0x0010:
>  				subport = "BCM2835";
>  				break;
> +			case 0x0012:
> +				subport = "16550-compatible with parameters in GAS";
> +				break;
>  			default:
>  				break;
>  			}
> @@ -359,7 +368,7 @@ done:
>  
>  static fwts_framework_minor_test dbg2_tests[] = {
>  	{ dbg2_test1, "DBG2 (Debug Port Table 2) test." },
> -	{ dbg2_test2, "DBG2 ARM SBSA Generic UART test," },
> +	{ dbg2_test2, "DBG2 ARM BSA compliant UART test," },
>  	{ NULL, NULL }
>  };
>  
> 


Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/dbg2/dbg2.c b/src/acpi/dbg2/dbg2.c
index 6004dc61..88936d72 100644
--- a/src/acpi/dbg2/dbg2.c
+++ b/src/acpi/dbg2/dbg2.c
@@ -28,9 +28,12 @@ 
 
 #include "fwts_acpi_object_eval.h"
 
-#define SBBR_DBG2_PORT_SERIAL     0x8000
-#define SBBR_DBG2_ARM_SBSA_UART   0x000E
-#define SBBR_DBG2_ARM_PL011_UART  0x0003
+#define SBBR_DBG2_PORT_SERIAL          0x8000
+#define SBBR_DBG2_FULLY_16550_COMPAT   0x0000
+#define SBBR_DBG2_16550_SUBSET_COMPAT  0x0001
+#define SBBR_DBG2_ARM_PL011_UART       0x0003
+#define SBBR_DBG2_ARM_SBSA_UART        0x000E
+#define SBBR_DBG2_16550_COMPAT_GAS     0x0012
 
 static fwts_acpi_table_info *table;
 acpi_table_init(DBG2, &table)
@@ -53,11 +56,14 @@  static int dbg2_test2(fwts_framework *fw)
 		if (((uint8_t*)info + info->length) >= ((uint8_t*)table + table->length))
 			break;
 		if (info->port_type == SBBR_DBG2_PORT_SERIAL &&
-		   (info->port_subtype == SBBR_DBG2_ARM_SBSA_UART ||
-		    info->port_subtype == SBBR_DBG2_ARM_PL011_UART)) {
+		   (info->port_subtype == SBBR_DBG2_FULLY_16550_COMPAT ||
+		    info->port_subtype == SBBR_DBG2_16550_SUBSET_COMPAT ||
+		    info->port_subtype == SBBR_DBG2_ARM_PL011_UART ||
+		    info->port_subtype == SBBR_DBG2_ARM_SBSA_UART ||
+		    info->port_subtype == SBBR_DBG2_16550_COMPAT_GAS)) {
 			fwts_passed(fw,
 				"DBG2 provides a standard serial debug "
-				"port and describes ARM SBSA Generic UART");
+				"port and describes ARM BSA compliant UART");
 			return FWTS_OK;
 		}
 
@@ -188,6 +194,9 @@  static int dbg2_test1(fwts_framework *fw)
 			case 0x0010:
 				subport = "BCM2835";
 				break;
+			case 0x0012:
+				subport = "16550-compatible with parameters in GAS";
+				break;
 			default:
 				break;
 			}
@@ -359,7 +368,7 @@  done:
 
 static fwts_framework_minor_test dbg2_tests[] = {
 	{ dbg2_test1, "DBG2 (Debug Port Table 2) test." },
-	{ dbg2_test2, "DBG2 ARM SBSA Generic UART test," },
+	{ dbg2_test2, "DBG2 ARM BSA compliant UART test," },
 	{ NULL, NULL }
 };