From patchwork Fri Feb 19 23:39:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 62420 Delivered-To: patches@linaro.org Received: by 10.112.43.199 with SMTP id y7csp78481lbl; Fri, 19 Feb 2016 15:40:30 -0800 (PST) X-Received: by 10.60.117.137 with SMTP id ke9mr14311683oeb.16.1455925230387; Fri, 19 Feb 2016 15:40:30 -0800 (PST) Return-Path: Received: from mail-oi0-x235.google.com (mail-oi0-x235.google.com. [2607:f8b0:4003:c06::235]) by mx.google.com with ESMTPS id r66si2646572oih.68.2016.02.19.15.40.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Feb 2016 15:40:30 -0800 (PST) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c06::235 as permitted sender) client-ip=2607:f8b0:4003:c06::235; Authentication-Results: mx.google.com; spf=pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c06::235 as permitted sender) smtp.mailfrom=al.stone@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-oi0-x235.google.com with SMTP id j125so22997193oih.0 for ; Fri, 19 Feb 2016 15:40:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ADeHtq+WkL+PK+7FumNT9VSebYtiSfQoCRZtmx5/FOw=; b=ZcULAP2k1URz44TTR++CAqkKIsiAx73KemcOCflNzoty4S7t6wSOMgt+zIZXuEGs93 a5hWR1Fqn9gWzEbxkWISkOc7qJju0GEQk4dfXwZZU+ZZqBXg6+2sfLzHZu3WwF8F+bNp PHYuhO8mFoZIOR09cU6sAD2Y09NttY83uLk/U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ADeHtq+WkL+PK+7FumNT9VSebYtiSfQoCRZtmx5/FOw=; b=VsmoJZNUt0Jy4WLNp+IcRLiubFOzlhuu7fBCz69uplvXE4PZyGK7hn1yjB3tJ9pZ6E WqvLOKnHMdxAkndo7PmWAbHTXaI2FL1uo3+TOZvQCbGRkoKZ9bh3AwfIJxBL5y9yF1z9 gvOA/seY8g6DaE0Xmv34Bhqq34VOaMkr+DmgLacOLaZS6PgyiqRZ+g8rfpVlS9LnBj4H wiHUszjJEDmvpulW/5gm2Q6D5qWZY/jrW7atU6tJX0kt3/F1zAoy3Z4hbSPMJuW0zNr3 kpJ/lLnkw7hE7A1BSHJFmAiAGIObyWoUE+wNSdjiehtHaLyNoc3f2mWKPKgIOFbvEFOp hVHA== X-Gm-Message-State: AG10YOQu9ctaD4daOCYJXjgqseAobKxH+SPySORGv9lDouYZM8x0zEzNNDmRbsIb3JRD1oXd63Y= X-Received: by 10.202.240.68 with SMTP id o65mr13128180oih.70.1455925230067; Fri, 19 Feb 2016 15:40:30 -0800 (PST) Return-Path: Received: from fidelio.ahs3.com (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by smtp.googlemail.com with ESMTPSA id kg7sm8655217obb.27.2016.02.19.15.40.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Feb 2016 15:40:29 -0800 (PST) From: Al Stone To: fwts-devel@lists.ubuntu.com Cc: linaro-acpi@lists.linaro.org, patches@linaro.org, Al Stone Subject: [PATCH v2 04/23] FADT: add in code to log basic info about the various FADT flag fields Date: Fri, 19 Feb 2016 16:39:40 -0700 Message-Id: <1455925199-8587-5-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455925199-8587-1-git-send-email-al.stone@linaro.org> References: <1455925199-8587-1-git-send-email-al.stone@linaro.org> Add in some log messages that report on the state of all of the flag fields in the FADT: flags, itself, plus the IA-PC boot architecture flags and the ARM boot architecture flags. Having this info in the log should make it more straightforward to understand test results later on in the FADT tests. Signed-off-by: Al Stone --- src/acpi/fadt/fadt.c | 83 +++++++++++++++++++++++++++++++++++++++++++++ src/lib/include/fwts_acpi.h | 30 ++++++++++++++++ 2 files changed, 113 insertions(+) -- 2.5.0 diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c index cbe8f05..90f5d54 100644 --- a/src/acpi/fadt/fadt.c +++ b/src/acpi/fadt/fadt.c @@ -72,6 +72,88 @@ static int fadt_init(fwts_framework *fw) return FWTS_OK; } +static void flag_info(fwts_framework *fw, const char *name, int state) +{ + const char *enabled = "set"; + const char *disabled = "not set"; + const char *ptr; + + ptr = (state) ? enabled : disabled; + fwts_log_info(fw, " %s is %s", name, ptr); +} + +static int fadt_info(fwts_framework *fw) +{ + fwts_log_info(fw, "FADT: flag states"); + flag_info(fw, "WBINVD", + fadt->flags & FWTS_FACP_FLAG_WBINVD); + flag_info(fw, "WBINVD_FLUSH", + fadt->flags & FWTS_FACP_FLAG_WBINVD_FLUSH); + flag_info(fw, "PROC_C1", + fadt->flags & FWTS_FACP_FLAG_PROC_C1); + flag_info(fw, "P_LVL2_UP", + fadt->flags & FWTS_FACP_FLAG_P_LVL2_UP); + flag_info(fw, "PWR_BUTTON", + fadt->flags & FWTS_FACP_FLAG_PWR_BUTTON); + flag_info(fw, "SLP_BUTTON", + fadt->flags & FWTS_FACP_FLAG_SLP_BUTTON); + flag_info(fw, "FIX_RTC", + fadt->flags & FWTS_FACP_FLAG_FIX_RTC); + flag_info(fw, "RTC_S4", + fadt->flags & FWTS_FACP_FLAG_RTC_S4); + flag_info(fw, "TMR_VAL_EXT", + fadt->flags & FWTS_FACP_FLAG_TMR_VAL_EXT); + flag_info(fw, "DCK_CAP", + fadt->flags & FWTS_FACP_FLAG_DCK_CAP); + flag_info(fw, "RESET_REG_SUP", + fadt->flags & FWTS_FACP_FLAG_RESET_REG_SUP); + flag_info(fw, "SEALED_CASE", + fadt->flags & FWTS_FACP_FLAG_SEALED_CASE); + flag_info(fw, "HEADLESS", + fadt->flags & FWTS_FACP_FLAG_HEADLESS); + flag_info(fw, "CPU_SW_SLP", + fadt->flags & FWTS_FACP_FLAG_CPU_SW_SLP); + flag_info(fw, "PCI_EXP_WAK", + fadt->flags & FWTS_FACP_FLAG_PCI_EXP_WAK); + flag_info(fw, "USE_PLATFORM_CLOCK", + fadt->flags & FWTS_FACP_FLAG_USE_PLATFORM_CLOCK); + flag_info(fw, "S4_RTC_STS_VALID", + fadt->flags & FWTS_FACP_FLAG_S4_RTC_STS_VALID); + flag_info(fw, "REMOTE_POWER_ON_CAPABLE", + fadt->flags & FWTS_FACP_FLAG_REMOTE_POWER_ON_CAPABLE); + flag_info(fw, "FORCE_APIC_CLUSTER_MODEL", + fadt->flags & FWTS_FACP_FLAG_FORCE_APIC_CLUSTER_MODEL); + flag_info(fw, "FORCE_APIC_PHYSICAL_DESTINATION_MODE", + fadt->flags & FWTS_FACP_FLAG_FORCE_APIC_PHYSICAL_DESTINATION_MODE); + flag_info(fw, "HW_REDUCED_ACPI", + fadt->flags & FWTS_FACP_FLAG_HW_REDUCED_ACPI); + flag_info(fw, "LOW_POWER_S0_IDLE_CAPABLE", + fadt->flags & FWTS_FACP_FLAG_LOW_POWER_S0_IDLE_CAPABLE); + + fwts_log_info(fw, "FADT: IA-PC Boot Architecture flag states"); + flag_info(fw, "LEGACY_DEVICES", fadt->iapc_boot_arch & + FWTS_FACP_IAPC_BOOT_ARCH_LEGACY_DEVICES); + flag_info(fw, "8042", fadt->iapc_boot_arch & + FWTS_FACP_IAPC_BOOT_ARCH_8042); + flag_info(fw, "VGA_NOT_PRESENT", fadt->iapc_boot_arch & + FWTS_FACP_IAPC_BOOT_ARCH_VGA_NOT_PRESENT); + flag_info(fw, "MSI_NOT_SUPPORTED", fadt->iapc_boot_arch & + FWTS_FACP_IAPC_BOOT_ARCH_MSI_NOT_SUPPORTED); + flag_info(fw, "PCIE_ASPM_CONTROLS", fadt->iapc_boot_arch & + FWTS_FACP_IAPC_BOOT_ARCH_PCIE_ASPM_CONTROLS); + flag_info(fw, "CMOS_RTC_NOT_PRESENT", fadt->iapc_boot_arch & + FWTS_FACP_IAPC_BOOT_ARCH_CMOS_RTC_NOT_PRESENT); + + fwts_log_info(fw, "FADT: ARM Boot Architecture flag states"); + flag_info(fw, "PSCI_COMPLIANT", fadt->arm_boot_flags & + FWTS_FACP_ARM_BOOT_ARCH_PSCI_COMPLIANT); + flag_info(fw, "PSCI_USE_HVC", fadt->arm_boot_flags & + FWTS_FACP_ARM_BOOT_ARCH_PSCI_USE_HVC); + + fwts_infoonly(fw); + return FWTS_OK; +} + static void acpi_table_check_fadt_firmware_control( fwts_framework *fw, const fwts_acpi_table_fadt *fadt, @@ -559,6 +641,7 @@ static int fadt_test3(fwts_framework *fw) } static fwts_framework_minor_test fadt_tests[] = { + { fadt_info, "FADT ACPI Description Table flag info." }, { fadt_test1, "Test FADT ACPI Description Table tests." }, { fadt_test2, "Test FADT SCI_EN bit is enabled." }, { fadt_test3, "Test FADT reset register." }, diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h index a8a8276..8f80286 100644 --- a/src/lib/include/fwts_acpi.h +++ b/src/lib/include/fwts_acpi.h @@ -32,11 +32,41 @@ #define FWTS_FACP_PERFORMANCE_SERVER (0x07) #define FWTS_FACP_TABLET (0x08) +#define FWTS_FACP_FLAG_WBINVD (0x00000001) +#define FWTS_FACP_FLAG_WBINVD_FLUSH (0x00000002) +#define FWTS_FACP_FLAG_PROC_C1 (0x00000004) +#define FWTS_FACP_FLAG_P_LVL2_UP (0x00000008) +#define FWTS_FACP_FLAG_PWR_BUTTON (0x00000010) +#define FWTS_FACP_FLAG_SLP_BUTTON (0x00000020) +#define FWTS_FACP_FLAG_FIX_RTC (0x00000040) +#define FWTS_FACP_FLAG_RTC_S4 (0x00000080) +#define FWTS_FACP_FLAG_TMR_VAL_EXT (0x00000100) +#define FWTS_FACP_FLAG_DCK_CAP (0x00000200) +#define FWTS_FACP_FLAG_RESET_REG_SUP (0x00000400) +#define FWTS_FACP_FLAG_SEALED_CASE (0x00000800) +#define FWTS_FACP_FLAG_HEADLESS (0x00001000) +#define FWTS_FACP_FLAG_CPU_SW_SLP (0x00002000) +#define FWTS_FACP_FLAG_PCI_EXP_WAK (0x00004000) +#define FWTS_FACP_FLAG_USE_PLATFORM_CLOCK (0x00008000) +#define FWTS_FACP_FLAG_S4_RTC_STS_VALID (0x00010000) +#define FWTS_FACP_FLAG_REMOTE_POWER_ON_CAPABLE (0x00020000) +#define FWTS_FACP_FLAG_FORCE_APIC_CLUSTER_MODEL (0x00040000) +#define FWTS_FACP_FLAG_FORCE_APIC_PHYSICAL_DESTINATION_MODE (0x00080000) +#define FWTS_FACP_FLAG_HW_REDUCED_ACPI (0x00100000) +#define FWTS_FACP_FLAG_LOW_POWER_S0_IDLE_CAPABLE (0x00200000) +#define FWTS_FACP_FLAG_RESERVED_MASK (0xffc00000) + #define FWTS_FACP_IAPC_BOOT_ARCH_LEGACY_DEVICES (0x0001) #define FWTS_FACP_IAPC_BOOT_ARCH_8042 (0x0002) #define FWTS_FACP_IAPC_BOOT_ARCH_VGA_NOT_PRESENT (0x0004) #define FWTS_FACP_IAPC_BOOT_ARCH_MSI_NOT_SUPPORTED (0x0008) #define FWTS_FACP_IAPC_BOOT_ARCH_PCIE_ASPM_CONTROLS (0x0010) +#define FWTS_FACP_IAPC_BOOT_ARCH_CMOS_RTC_NOT_PRESENT (0x0020) +#define FWTS_FACP_IAPC_BOOT_ARCH_RESERVED_MASK (0xffc0) + +#define FWTS_FACP_ARM_BOOT_ARCH_PSCI_COMPLIANT (0x0001) +#define FWTS_FACP_ARM_BOOT_ARCH_PSCI_USE_HVC (0x0002) +#define FWTS_FACP_ARM_BOOT_ARCH_RESERVED_MASK (0xfffc) #define FWTS_GAS_ADDR_SPACE_ID_SYSTEM_MEMORY (0x00) #define FWTS_GAS_ADDR_SPACE_ID_SYSTEM_IO (0x01)