1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2a439fe51SSam Ravnborg /* 3a439fe51SSam Ravnborg * Machine dependent access functions for RTC registers. 4a439fe51SSam Ravnborg */ 5a439fe51SSam Ravnborg #ifndef __ASM_SPARC64_MC146818RTC_H 6a439fe51SSam Ravnborg #define __ASM_SPARC64_MC146818RTC_H 7a439fe51SSam Ravnborg 8a439fe51SSam Ravnborg #include <asm/io.h> 9a439fe51SSam Ravnborg 10a439fe51SSam Ravnborg #ifndef RTC_PORT 11da86783dSDavid S. Miller extern unsigned long cmos_regs; 12da86783dSDavid S. Miller #define RTC_PORT(x) (cmos_regs + (x)) 13a439fe51SSam Ravnborg #define RTC_ALWAYS_BCD 0 14a439fe51SSam Ravnborg #endif 15a439fe51SSam Ravnborg 16a439fe51SSam Ravnborg /* 17a439fe51SSam Ravnborg * The yet supported machines all access the RTC index register via 18a439fe51SSam Ravnborg * an ISA port access but the way to access the date register differs ... 19a439fe51SSam Ravnborg */ 20a439fe51SSam Ravnborg #define CMOS_READ(addr) ({ \ 21a439fe51SSam Ravnborg outb_p((addr),RTC_PORT(0)); \ 22a439fe51SSam Ravnborg inb_p(RTC_PORT(1)); \ 23a439fe51SSam Ravnborg }) 24a439fe51SSam Ravnborg #define CMOS_WRITE(val, addr) ({ \ 25a439fe51SSam Ravnborg outb_p((addr),RTC_PORT(0)); \ 26a439fe51SSam Ravnborg outb_p((val),RTC_PORT(1)); \ 27a439fe51SSam Ravnborg }) 28a439fe51SSam Ravnborg 29a439fe51SSam Ravnborg #endif /* __ASM_SPARC64_MC146818RTC_H */ 30