early_cmos.h 1009 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
  4. */
  5. #ifndef __EARLY_CMOS_H
  6. #define __EARLY_CMOS_H
  7. /* CMOS actually resides in the RTC SRAM */
  8. #define CMOS_IO_PORT 0x70
  9. /**
  10. * cmos_read8() - Get 8-bit data stored at the given address
  11. *
  12. * This reads from CMOS for the 8-bit data stored at the given address.
  13. *
  14. * @addr: RTC SRAM address
  15. * @return: 8-bit data stored at the given address
  16. */
  17. u8 cmos_read8(u8 addr);
  18. /**
  19. * cmos_read16() - Get 16-bit data stored at the given address
  20. *
  21. * This reads from CMOS for the 16-bit data stored at the given address.
  22. *
  23. * @addr: RTC SRAM address
  24. * @return: 16-bit data stored at the given address
  25. */
  26. u16 cmos_read16(u8 addr);
  27. /**
  28. * cmos_read32() - Get 32-bit data stored at the given address
  29. *
  30. * This reads from CMOS for the 32-bit data stored at the given address.
  31. *
  32. * @addr: RTC SRAM address
  33. * @return: 32-bit data stored at the given address
  34. */
  35. u32 cmos_read32(u8 addr);
  36. #endif /* __EARLY_CMOS_H */