blob: 543a9e69f03af995eb9eaa61f422e5bbd4fdcc49 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Bin Meng39f8b082017-04-21 07:24:38 -07002/*
3 * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
Bin Meng39f8b082017-04-21 07:24:38 -07004 */
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 */
20u8 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 */
30u16 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 */
40u32 cmos_read32(u8 addr);
41
42#endif /* __EARLY_CMOS_H */