Message ID | 1513621711-7976-1-git-send-email-sakar.arora@arm.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/3] acpi: dbg2: sbbr: allow PL011 UART as a valid subtype | expand |
On 2017-12-19 02:28 AM, Sakar Arora wrote: > The ARM PL011 UART is a superset of ARM SBSA UART and some ARM server > implementations use it. > > Signed-off-by: Sakar Arora <sakar.arora@arm.com> > --- > src/acpi/dbg2/dbg2.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/src/acpi/dbg2/dbg2.c b/src/acpi/dbg2/dbg2.c > index b826c27..eef5ee7 100644 > --- a/src/acpi/dbg2/dbg2.c > +++ b/src/acpi/dbg2/dbg2.c > @@ -28,8 +28,9 @@ > > #include "fwts_acpi_object_eval.h" > > -#define SBBR_DBG2_PORT_SERIAL 0x8000 > -#define SBBR_DBG2_ARM_SBSA_UART 0x000E > +#define SBBR_DBG2_PORT_SERIAL 0x8000 > +#define SBBR_DBG2_ARM_SBSA_UART 0x000E > +#define SBBR_DBG2_ARM_PL011_UART 0x0003 > > static fwts_acpi_table_info *table; > > @@ -71,8 +72,9 @@ static int dbg2_test2(fwts_framework *fw) > break; > 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)) { > + if (info->port_type == SBBR_DBG2_PORT_SERIAL && > + (info->port_subtype == SBBR_DBG2_ARM_SBSA_UART || > + info->port_subtype == SBBR_DBG2_ARM_PL011_UART)) { > fwts_passed(fw, > "DBG2 provides a standard serial debug " > "port and describes ARM SBSA Generic UART"); > Acked-by: Alex Hung <alex.hung@canonical.com>
On 2017-12-19 02:28 AM, Sakar Arora wrote: > A valid combination of mif/maf values is not mandatory, > as per SBBR spec. So, an invalid combination should only > cause a warning. > > Signed-off-by: Sakar Arora <sakar.arora@arm.com> > --- > src/lib/src/fwts_acpi_object_eval.c | 149 ++++++++++++++++++++++++------------ > 1 file changed, 102 insertions(+), 47 deletions(-) > > diff --git a/src/lib/src/fwts_acpi_object_eval.c b/src/lib/src/fwts_acpi_object_eval.c > index b356441..b3537b0 100644 > --- a/src/lib/src/fwts_acpi_object_eval.c > +++ b/src/lib/src/fwts_acpi_object_eval.c > @@ -1270,32 +1270,51 @@ static void method_test_CRS_mif_maf( > if (len == 0) { > if ((mif == 1) && (maf == 1)) { > snprintf(tmp, sizeof(tmp), "Method%s%sMifMafBothOne", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s _MIF and _MAF flags are both " > - "set to one which is invalid when " > - "the length field is 0.", > - name, type); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s _MIF and _MAF flags are both " > + "set to one which is invalid when " > + "the length field is 0.", > + name, type); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s _MIF and _MAF flags are both " > + "set to one which is invalid when " > + "the length field is 0.", > + name, type); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if ((mif == 1) && (min % (granularity + 1) != 0)) { > snprintf(tmp, sizeof(tmp), "Method%s%sMinNotMultipleOfGran", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s _MIN address is not a multiple " > - "of the granularity when _MIF is 1.", > - name, type); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s _MIN address is not a multiple " > + "of the granularity when _MIF is 1.", > + name, type); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s _MIN address is not a multiple " > + "of the granularity when _MIF is 1.", > + name, type); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if ((maf == 1) && (max % (granularity - 1) != 0)) { > snprintf(tmp, sizeof(tmp), "Method%s%sMaxNotMultipleOfGran", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s _MAX address is not a multiple " > - "of the granularity when _MAF is 1.", > - name, type); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s _MAX address is not a multiple " > + "of the granularity when _MAF is 1.", > + name, type); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s _MAX address is not a multiple " > + "of the granularity when _MAF is 1.", > + name, type); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > @@ -1303,58 +1322,94 @@ static void method_test_CRS_mif_maf( > if ((mif == 0) && (maf == 0) && > (len % (granularity + 1) != 0)) { > snprintf(tmp, sizeof(tmp), "Method%s%sLenNotMultipleOfGran", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s length is not a multiple " > - "of the granularity when _MIF " > - "and _MIF are 0.", > - name, type); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s length is not a multiple " > + "of the granularity when _MIF " > + "and _MIF are 0.", > + name, type); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s length is not a multiple " > + "of the granularity when _MIF " > + "and _MIF are 0.", > + name, type); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if (((mif == 0) && (maf == 1)) || ((mif == 1) && (maf == 0))) { > snprintf(tmp, sizeof(tmp), "Method%s%sMifMafInvalid", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s _MIF and _MAF flags are either " > - "0 and 1 or 1 and 0 which is invalid when " > - "the length field is non-zero.", > - name, type); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s _MIF and _MAF flags are either " > + "0 and 1 or 1 and 0 which is invalid when " > + "the length field is non-zero.", > + name, type); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s _MIF and _MAF flags are either " > + "0 and 1 or 1 and 0 which is invalid when " > + "the length field is non-zero.", > + name, type); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if ((mif == 1) && (maf == 1)) { > if (granularity != 0) { > snprintf(tmp, sizeof(tmp), "Method%s%sGranularityNotZero", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s granularity 0x%" PRIx64 > - " is not zero as expected when " > - "_MIF and _MAF are both 1.", > - name, type, granularity); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s granularity 0x%" PRIx64 > + " is not zero as expected when " > + "_MIF and _MAF are both 1.", > + name, type, granularity); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s granularity 0x%" PRIx64 > + " is not zero as expected when " > + "_MIF and _MAF are both 1.", > + name, type, granularity); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if (min > max) { > snprintf(tmp, sizeof(tmp), "Method%s%sMaxLessThanMin", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s minimum address range 0x%" PRIx64 > - " is greater than the maximum address " > - "range 0x%" PRIx64 ".", > - name, type, min, max); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s minimum address range 0x%" PRIx64 > + " is greater than the maximum address " > + "range 0x%" PRIx64 ".", > + name, type, min, max); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s minimum address range 0x%" PRIx64 > + " is greater than the maximum address " > + "range 0x%" PRIx64 ".", > + name, type, min, max); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if (max - min + 1 != len) { > snprintf(tmp, sizeof(tmp), "Method%s%sLengthInvalid", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s length 0x%" PRIx64 > - " does not match the difference between " > - "the minimum and maximum address ranges " > - "0x%" PRIx64 "-0x%" PRIx64 ".", > - name, type, len, min, max); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s length 0x%" PRIx64 > + " does not match the difference between " > + "the minimum and maximum address ranges " > + "0x%" PRIx64 "-0x%" PRIx64 ".", > + name, type, len, min, max); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s length 0x%" PRIx64 > + " does not match the difference between " > + "the minimum and maximum address ranges " > + "0x%" PRIx64 "-0x%" PRIx64 ".", > + name, type, len, min, max); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > Acked-by: Alex Hung <alex.hung@canonical.com>
On 12/19/2017 02:28 AM, Sakar Arora wrote: > The ARM PL011 UART is a superset of ARM SBSA UART and some ARM server > implementations use it. > > Signed-off-by: Sakar Arora <sakar.arora@arm.com> > --- > src/acpi/dbg2/dbg2.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/src/acpi/dbg2/dbg2.c b/src/acpi/dbg2/dbg2.c > index b826c27..eef5ee7 100644 > --- a/src/acpi/dbg2/dbg2.c > +++ b/src/acpi/dbg2/dbg2.c > @@ -28,8 +28,9 @@ > > #include "fwts_acpi_object_eval.h" > > -#define SBBR_DBG2_PORT_SERIAL 0x8000 > -#define SBBR_DBG2_ARM_SBSA_UART 0x000E > +#define SBBR_DBG2_PORT_SERIAL 0x8000 > +#define SBBR_DBG2_ARM_SBSA_UART 0x000E > +#define SBBR_DBG2_ARM_PL011_UART 0x0003 > > static fwts_acpi_table_info *table; > > @@ -71,8 +72,9 @@ static int dbg2_test2(fwts_framework *fw) > break; > 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)) { > + if (info->port_type == SBBR_DBG2_PORT_SERIAL && > + (info->port_subtype == SBBR_DBG2_ARM_SBSA_UART || > + info->port_subtype == SBBR_DBG2_ARM_PL011_UART)) { > fwts_passed(fw, > "DBG2 provides a standard serial debug " > "port and describes ARM SBSA Generic UART"); Acked-by: Ivan Hu <ivan.hu@canonical.com>
On 12/19/2017 02:28 AM, Sakar Arora wrote: > A valid combination of mif/maf values is not mandatory, > as per SBBR spec. So, an invalid combination should only > cause a warning. > > Signed-off-by: Sakar Arora <sakar.arora@arm.com> > --- > src/lib/src/fwts_acpi_object_eval.c | 149 ++++++++++++++++++++++++------------ > 1 file changed, 102 insertions(+), 47 deletions(-) > > diff --git a/src/lib/src/fwts_acpi_object_eval.c b/src/lib/src/fwts_acpi_object_eval.c > index b356441..b3537b0 100644 > --- a/src/lib/src/fwts_acpi_object_eval.c > +++ b/src/lib/src/fwts_acpi_object_eval.c > @@ -1270,32 +1270,51 @@ static void method_test_CRS_mif_maf( > if (len == 0) { > if ((mif == 1) && (maf == 1)) { > snprintf(tmp, sizeof(tmp), "Method%s%sMifMafBothOne", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s _MIF and _MAF flags are both " > - "set to one which is invalid when " > - "the length field is 0.", > - name, type); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s _MIF and _MAF flags are both " > + "set to one which is invalid when " > + "the length field is 0.", > + name, type); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s _MIF and _MAF flags are both " > + "set to one which is invalid when " > + "the length field is 0.", > + name, type); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if ((mif == 1) && (min % (granularity + 1) != 0)) { > snprintf(tmp, sizeof(tmp), "Method%s%sMinNotMultipleOfGran", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s _MIN address is not a multiple " > - "of the granularity when _MIF is 1.", > - name, type); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s _MIN address is not a multiple " > + "of the granularity when _MIF is 1.", > + name, type); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s _MIN address is not a multiple " > + "of the granularity when _MIF is 1.", > + name, type); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if ((maf == 1) && (max % (granularity - 1) != 0)) { > snprintf(tmp, sizeof(tmp), "Method%s%sMaxNotMultipleOfGran", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s _MAX address is not a multiple " > - "of the granularity when _MAF is 1.", > - name, type); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s _MAX address is not a multiple " > + "of the granularity when _MAF is 1.", > + name, type); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s _MAX address is not a multiple " > + "of the granularity when _MAF is 1.", > + name, type); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > @@ -1303,58 +1322,94 @@ static void method_test_CRS_mif_maf( > if ((mif == 0) && (maf == 0) && > (len % (granularity + 1) != 0)) { > snprintf(tmp, sizeof(tmp), "Method%s%sLenNotMultipleOfGran", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s length is not a multiple " > - "of the granularity when _MIF " > - "and _MIF are 0.", > - name, type); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s length is not a multiple " > + "of the granularity when _MIF " > + "and _MIF are 0.", > + name, type); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s length is not a multiple " > + "of the granularity when _MIF " > + "and _MIF are 0.", > + name, type); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if (((mif == 0) && (maf == 1)) || ((mif == 1) && (maf == 0))) { > snprintf(tmp, sizeof(tmp), "Method%s%sMifMafInvalid", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s _MIF and _MAF flags are either " > - "0 and 1 or 1 and 0 which is invalid when " > - "the length field is non-zero.", > - name, type); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s _MIF and _MAF flags are either " > + "0 and 1 or 1 and 0 which is invalid when " > + "the length field is non-zero.", > + name, type); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s _MIF and _MAF flags are either " > + "0 and 1 or 1 and 0 which is invalid when " > + "the length field is non-zero.", > + name, type); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if ((mif == 1) && (maf == 1)) { > if (granularity != 0) { > snprintf(tmp, sizeof(tmp), "Method%s%sGranularityNotZero", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s granularity 0x%" PRIx64 > - " is not zero as expected when " > - "_MIF and _MAF are both 1.", > - name, type, granularity); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s granularity 0x%" PRIx64 > + " is not zero as expected when " > + "_MIF and _MAF are both 1.", > + name, type, granularity); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s granularity 0x%" PRIx64 > + " is not zero as expected when " > + "_MIF and _MAF are both 1.", > + name, type, granularity); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if (min > max) { > snprintf(tmp, sizeof(tmp), "Method%s%sMaxLessThanMin", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s minimum address range 0x%" PRIx64 > - " is greater than the maximum address " > - "range 0x%" PRIx64 ".", > - name, type, min, max); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s minimum address range 0x%" PRIx64 > + " is greater than the maximum address " > + "range 0x%" PRIx64 ".", > + name, type, min, max); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s minimum address range 0x%" PRIx64 > + " is greater than the maximum address " > + "range 0x%" PRIx64 ".", > + name, type, min, max); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } > if (max - min + 1 != len) { > snprintf(tmp, sizeof(tmp), "Method%s%sLengthInvalid", objname, tag); > - fwts_failed(fw, LOG_LEVEL_MEDIUM, > - tmp, > - "%s %s length 0x%" PRIx64 > - " does not match the difference between " > - "the minimum and maximum address ranges " > - "0x%" PRIx64 "-0x%" PRIx64 ".", > - name, type, len, min, max); > + if (fw->flags & FWTS_FLAG_TEST_SBBR) > + fwts_warning(fw, tmp, > + "%s %s length 0x%" PRIx64 > + " does not match the difference between " > + "the minimum and maximum address ranges " > + "0x%" PRIx64 "-0x%" PRIx64 ".", > + name, type, len, min, max); > + else > + fwts_failed(fw, LOG_LEVEL_MEDIUM, > + tmp, > + "%s %s length 0x%" PRIx64 > + " does not match the difference between " > + "the minimum and maximum address ranges " > + "0x%" PRIx64 "-0x%" PRIx64 ".", > + name, type, len, min, max); > fwts_advice(fw, "%s", mif_maf_advice); > *passed = false; > } Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/acpi/dbg2/dbg2.c b/src/acpi/dbg2/dbg2.c index b826c27..eef5ee7 100644 --- a/src/acpi/dbg2/dbg2.c +++ b/src/acpi/dbg2/dbg2.c @@ -28,8 +28,9 @@ #include "fwts_acpi_object_eval.h" -#define SBBR_DBG2_PORT_SERIAL 0x8000 -#define SBBR_DBG2_ARM_SBSA_UART 0x000E +#define SBBR_DBG2_PORT_SERIAL 0x8000 +#define SBBR_DBG2_ARM_SBSA_UART 0x000E +#define SBBR_DBG2_ARM_PL011_UART 0x0003 static fwts_acpi_table_info *table; @@ -71,8 +72,9 @@ static int dbg2_test2(fwts_framework *fw) break; 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)) { + if (info->port_type == SBBR_DBG2_PORT_SERIAL && + (info->port_subtype == SBBR_DBG2_ARM_SBSA_UART || + info->port_subtype == SBBR_DBG2_ARM_PL011_UART)) { fwts_passed(fw, "DBG2 provides a standard serial debug " "port and describes ARM SBSA Generic UART");
The ARM PL011 UART is a superset of ARM SBSA UART and some ARM server implementations use it. Signed-off-by: Sakar Arora <sakar.arora@arm.com> --- src/acpi/dbg2/dbg2.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)