acpi/acpi: use read32p instead of pointer dereferencing

Using read32p to get the contents of the first 4 bytes of the HPET MMIO
region instead of a pointer dereference should clarify what's done in
that piece of code.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Iecf5452c63635666d7d6b17e07a1bc6aa52e72fa
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62297
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Lance Zhao
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Felix Held
2022-02-23 17:37:27 +01:00
parent ce876aaa8f
commit 7f8c737fe9

View File

@@ -18,6 +18,7 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_ivrs.h> #include <acpi/acpi_ivrs.h>
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <arch/mmio.h>
#include <device/pci.h> #include <device/pci.h>
#include <cbmem.h> #include <cbmem.h>
#include <commonlib/helpers.h> #include <commonlib/helpers.h>
@@ -850,7 +851,7 @@ void acpi_create_hpet(acpi_hpet_t *hpet)
addr->addrl = CONFIG_HPET_ADDRESS & 0xffffffff; addr->addrl = CONFIG_HPET_ADDRESS & 0xffffffff;
addr->addrh = ((unsigned long long)CONFIG_HPET_ADDRESS) >> 32; addr->addrh = ((unsigned long long)CONFIG_HPET_ADDRESS) >> 32;
hpet->id = *(unsigned int *)CONFIG_HPET_ADDRESS; hpet->id = read32p(CONFIG_HPET_ADDRESS);
hpet->number = 0; hpet->number = 0;
hpet->min_tick = CONFIG_HPET_MIN_TICKS; hpet->min_tick = CONFIG_HPET_MIN_TICKS;