Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Bin Meng | 39f8b08 | 2017-04-21 07:24:38 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com> |
Bin Meng | 39f8b08 | 2017-04-21 07:24:38 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __EARLY_CMOS_H |
| 7 | #define __EARLY_CMOS_H |
| 8 | |
Tom Rini | dec7ea0 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 9 | #include <linux/types.h> |
| 10 | |
Bin Meng | 39f8b08 | 2017-04-21 07:24:38 -0700 | [diff] [blame] | 11 | /* CMOS actually resides in the RTC SRAM */ |
| 12 | #define CMOS_IO_PORT 0x70 |
| 13 | |
| 14 | /** |
| 15 | * cmos_read8() - Get 8-bit data stored at the given address |
| 16 | * |
| 17 | * This reads from CMOS for the 8-bit data stored at the given address. |
| 18 | * |
| 19 | * @addr: RTC SRAM address |
| 20 | * @return: 8-bit data stored at the given address |
| 21 | */ |
| 22 | u8 cmos_read8(u8 addr); |
| 23 | |
| 24 | /** |
| 25 | * cmos_read16() - Get 16-bit data stored at the given address |
| 26 | * |
| 27 | * This reads from CMOS for the 16-bit data stored at the given address. |
| 28 | * |
| 29 | * @addr: RTC SRAM address |
| 30 | * @return: 16-bit data stored at the given address |
| 31 | */ |
| 32 | u16 cmos_read16(u8 addr); |
| 33 | |
| 34 | /** |
| 35 | * cmos_read32() - Get 32-bit data stored at the given address |
| 36 | * |
| 37 | * This reads from CMOS for the 32-bit data stored at the given address. |
| 38 | * |
| 39 | * @addr: RTC SRAM address |
| 40 | * @return: 32-bit data stored at the given address |
| 41 | */ |
| 42 | u32 cmos_read32(u8 addr); |
| 43 | |
| 44 | #endif /* __EARLY_CMOS_H */ |