/*
 * Copyright (c) 2026, Chloe M.
 * Provided under the BSD-3 clause.
 *
 * Description: HPET registers
 * Author:      Chloe M.
 */

#ifndef _MACHINE_HPETREG_H_
#define _MACHINE_HPETREG_H_ 1

#include <stdef.h>

/* Register offsets */
#define HPET_GENERAL_CAP    0x00
#define HPET_GENERAL_CONF   0x10
#define HPET_MAIN_COUNTER   0xF0

/* General capabilities  */
#define HPET_REV_ID_MASK     0xFF
#define HPET_REV_ID_SHIFT    0
#define HPET_PERIOD_MASK     0xFFFFFFFF
#define HPET_PERIOD_SHIFT    32

/* General conf fields */
#define HPET_GCONF_EN BIT(0)
#define HPET_LEG_RT   BIT(1)

/* Max constants */
#define HPET_MAX_CLK_PERIOD 0x5F5E100

#endif  /* !_MACHINE_HPETREG_H_ */
