[TEST PATCH 14/14] acpi: add early parameter to set CMOS RTC Not Present bit for testing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a patch for testing that will not go to any git tree.

Add a early kernel parameter to set CMOS RTC Not Present bit in
acpi_gbl_FADT variable for testing. Use acpi_no_cmos_rtc=1 to enable
this bit to block rtc cmos interface.

Signed-off-by: Lee, Chun-Yi <jlee@xxxxxxxx>
---
 arch/x86/kernel/acpi/boot.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 6c0b43b..64925dd 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -83,6 +83,8 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 #warning ACPI uses CMPXCHG, i486 and later hardware
 #endif
 
+static bool acpi_no_cmos_rtc;
+
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
    -------------------------------------------------------------------------- */
@@ -1531,6 +1533,13 @@ int __init acpi_boot_init(void)
 	 */
 	acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt);
 
+	/* Dummy NO_CMOS_RTC enable option to fake out RTC CMOS */
+	if (acpi_no_cmos_rtc) {
+		acpi_gbl_FADT.header.revision = 5;
+		acpi_gbl_FADT.boot_flags |= ACPI_FADT_NO_CMOS_RTC;
+		pr_info("acpi: Set NO_CMOS_RTC bit in FADT for testing\n");
+	}
+
 	/*
 	 * Process the Multiple APIC Description Table (MADT), if present
 	 */
@@ -1673,3 +1682,11 @@ void __init arch_reserve_mem_area(acpi_physical_address addr, size_t size)
 	e820_add_region(addr, size, E820_ACPI);
 	update_e820();
 }
+
+/* Dummy NO_CMOS_RTC enable option to fake out RTC CMOS */
+static int __init setup_acpi_no_cmos_rtc(char *arg)
+{
+	acpi_no_cmos_rtc = true;
+	return 0;
+}
+early_param("acpi_no_cmos_rtc", setup_acpi_no_cmos_rtc);
-- 
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux