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