[time] Add support for the ACPI power management timer

Allow the ACPI power management timer to be used if enabled via
TIMER_ACPI in config/timer.h.  This provides an alternative timer on
systems where the standard 8254 PIT is unavailable or unreliable.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2018-03-20 17:26:49 +02:00
parent e8e9ca3613
commit 3ec2079ce2
4 changed files with 147 additions and 0 deletions

View File

@@ -119,6 +119,10 @@ struct acpi_fadt {
uint32_t pm1a_cnt_blk;
/** PM1b Control Register Block */
uint32_t pm1b_cnt_blk;
/** PM2 Control Register Block */
uint32_t pm2_cnt_blk;
/** PM Timer Control Register Block */
uint32_t pm_tmr_blk;
} __attribute__ (( packed ));
/** ACPI PM1 Control Register (within PM1a_CNT_BLK or PM1A_CNT_BLK) */
@@ -126,6 +130,9 @@ struct acpi_fadt {
#define ACPI_PM1_CNT_SLP_TYP(x) ( (x) << 10 ) /**< Sleep type */
#define ACPI_PM1_CNT_SLP_EN ( 1 << 13 ) /**< Sleep enable */
/** ACPI PM Timer Register (within PM_TMR_BLK) */
#define ACPI_PM_TMR 0
/** Differentiated System Description Table (DSDT) signature */
#define DSDT_SIGNATURE ACPI_SIGNATURE ( 'D', 'S', 'D', 'T' )