diff mbox series

[05/16] acpi: nfit: add Spa Location Cookie as in ACPI 6.4 (mantis 1988)

Message ID 20210126203040.6101-5-alex.hung@canonical.com
State Accepted
Headers show
Series [01/16] acpi: update ACPI version to 6.4 | expand

Commit Message

Alex Hung Jan. 26, 2021, 8:30 p.m. UTC
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/nfit/nfit.c        | 5 ++++-
 src/lib/include/fwts_acpi.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Colin Ian King Jan. 26, 2021, 8:43 p.m. UTC | #1
On 26/01/2021 20:30, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/nfit/nfit.c        | 5 ++++-
>  src/lib/include/fwts_acpi.h | 1 +
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c
> index a167bf96..fbebf39f 100644
> --- a/src/acpi/nfit/nfit.c
> +++ b/src/acpi/nfit/nfit.c
> @@ -171,6 +171,9 @@ static int nfit_test1(fwts_framework *fw)
>  			fwts_log_info_simp_int(fw, "    System Physical Address Range Length:   ", nfit_struct->length);
>  			fwts_log_info_simp_int(fw, "    Address Range Memory Mapping Attribute: ", nfit_struct->memory_mapping);
>  
> +			if (fwts_get_acpi_version(fw) >= FWTS_ACPI_VERSION_64)
> +				fwts_log_info_simp_int(fw, "    SpaLocationCookie:                      ", nfit_struct->spa_location_cookie);
> +
>  			/* SPA Range Structure Index can be 0 for Virtual CD Region and
>  			   Virtual Disk Region (both volatile and persistent) */
>  			for (i = 0; i < 4; i++) {
> @@ -229,7 +232,7 @@ static int nfit_test1(fwts_framework *fw)
>  				}
>  			}
>  
> -			fwts_acpi_reserved_bits_check(fw, "NFIT", "Flags", nfit_struct->flags, sizeof(nfit_struct->flags), 2, 15, &passed);
> +			fwts_acpi_reserved_bits_check(fw, "NFIT", "Flags", nfit_struct->flags, sizeof(nfit_struct->flags), 3, 15, &passed);
>  
>  			if (nfit_struct->reserved != 0)
>  				reserved_passed = nfit_struct->reserved;
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index 25b2d23e..6c759a2a 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -1225,6 +1225,7 @@ typedef struct {
>  	uint64_t	address;
>  	uint64_t	length;
>  	uint64_t	memory_mapping;
> +	uint64_t        spa_location_cookie;
>  } __attribute__ ((packed)) fwts_acpi_table_nfit_system_memory;
>  
>  typedef struct {
> 


Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu Feb. 1, 2021, 6:13 a.m. UTC | #2
On 1/27/21 4:30 AM, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/nfit/nfit.c        | 5 ++++-
>  src/lib/include/fwts_acpi.h | 1 +
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c
> index a167bf96..fbebf39f 100644
> --- a/src/acpi/nfit/nfit.c
> +++ b/src/acpi/nfit/nfit.c
> @@ -171,6 +171,9 @@ static int nfit_test1(fwts_framework *fw)
>  			fwts_log_info_simp_int(fw, "    System Physical Address Range Length:   ", nfit_struct->length);
>  			fwts_log_info_simp_int(fw, "    Address Range Memory Mapping Attribute: ", nfit_struct->memory_mapping);
>  
> +			if (fwts_get_acpi_version(fw) >= FWTS_ACPI_VERSION_64)
> +				fwts_log_info_simp_int(fw, "    SpaLocationCookie:                      ", nfit_struct->spa_location_cookie);
> +
>  			/* SPA Range Structure Index can be 0 for Virtual CD Region and
>  			   Virtual Disk Region (both volatile and persistent) */
>  			for (i = 0; i < 4; i++) {
> @@ -229,7 +232,7 @@ static int nfit_test1(fwts_framework *fw)
>  				}
>  			}
>  
> -			fwts_acpi_reserved_bits_check(fw, "NFIT", "Flags", nfit_struct->flags, sizeof(nfit_struct->flags), 2, 15, &passed);
> +			fwts_acpi_reserved_bits_check(fw, "NFIT", "Flags", nfit_struct->flags, sizeof(nfit_struct->flags), 3, 15, &passed);
>  
>  			if (nfit_struct->reserved != 0)
>  				reserved_passed = nfit_struct->reserved;
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index 25b2d23e..6c759a2a 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -1225,6 +1225,7 @@ typedef struct {
>  	uint64_t	address;
>  	uint64_t	length;
>  	uint64_t	memory_mapping;
> +	uint64_t        spa_location_cookie;
>  } __attribute__ ((packed)) fwts_acpi_table_nfit_system_memory;
>  
>  typedef struct {
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c
index a167bf96..fbebf39f 100644
--- a/src/acpi/nfit/nfit.c
+++ b/src/acpi/nfit/nfit.c
@@ -171,6 +171,9 @@  static int nfit_test1(fwts_framework *fw)
 			fwts_log_info_simp_int(fw, "    System Physical Address Range Length:   ", nfit_struct->length);
 			fwts_log_info_simp_int(fw, "    Address Range Memory Mapping Attribute: ", nfit_struct->memory_mapping);
 
+			if (fwts_get_acpi_version(fw) >= FWTS_ACPI_VERSION_64)
+				fwts_log_info_simp_int(fw, "    SpaLocationCookie:                      ", nfit_struct->spa_location_cookie);
+
 			/* SPA Range Structure Index can be 0 for Virtual CD Region and
 			   Virtual Disk Region (both volatile and persistent) */
 			for (i = 0; i < 4; i++) {
@@ -229,7 +232,7 @@  static int nfit_test1(fwts_framework *fw)
 				}
 			}
 
-			fwts_acpi_reserved_bits_check(fw, "NFIT", "Flags", nfit_struct->flags, sizeof(nfit_struct->flags), 2, 15, &passed);
+			fwts_acpi_reserved_bits_check(fw, "NFIT", "Flags", nfit_struct->flags, sizeof(nfit_struct->flags), 3, 15, &passed);
 
 			if (nfit_struct->reserved != 0)
 				reserved_passed = nfit_struct->reserved;
diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
index 25b2d23e..6c759a2a 100644
--- a/src/lib/include/fwts_acpi.h
+++ b/src/lib/include/fwts_acpi.h
@@ -1225,6 +1225,7 @@  typedef struct {
 	uint64_t	address;
 	uint64_t	length;
 	uint64_t	memory_mapping;
+	uint64_t        spa_location_cookie;
 } __attribute__ ((packed)) fwts_acpi_table_nfit_system_memory;
 
 typedef struct {