1/*
2 * PreP compliant NVRAM access
3 * This needs to be updated for PPC64
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#ifndef _PPC64_NVRAM_H
12#define _PPC64_NVRAM_H
13
14#define NVRAM_AS0  0x74
15#define NVRAM_AS1  0x75
16#define NVRAM_DATA 0x77
17
18
19/* RTC Offsets */
20
21#define MOTO_RTC_SECONDS	0x1FF9
22#define MOTO_RTC_MINUTES	0x1FFA
23#define MOTO_RTC_HOURS		0x1FFB
24#define MOTO_RTC_DAY_OF_WEEK	0x1FFC
25#define MOTO_RTC_DAY_OF_MONTH	0x1FFD
26#define MOTO_RTC_MONTH		0x1FFE
27#define MOTO_RTC_YEAR		0x1FFF
28#define MOTO_RTC_CONTROLA       0x1FF8
29#define MOTO_RTC_CONTROLB       0x1FF9
30
31#ifndef BCD_TO_BIN
32#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
33#endif
34
35#ifndef BIN_TO_BCD
36#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
37#endif
38
39#endif /* _PPC64_NVRAM_H */
40