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