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