1 /*
2 * PreP compliant NVRAM access
3 */
4
5 #ifdef __KERNEL__
6 #ifndef _PPC_NVRAM_H
7 #define _PPC_NVRAM_H
8
9 #define NVRAM_AS0 0x74
10 #define NVRAM_AS1 0x75
11 #define NVRAM_DATA 0x77
12
13
14 /* RTC Offsets */
15
16 #define MOTO_RTC_SECONDS 0x1FF9
17 #define MOTO_RTC_MINUTES 0x1FFA
18 #define MOTO_RTC_HOURS 0x1FFB
19 #define MOTO_RTC_DAY_OF_WEEK 0x1FFC
20 #define MOTO_RTC_DAY_OF_MONTH 0x1FFD
21 #define MOTO_RTC_MONTH 0x1FFE
22 #define MOTO_RTC_YEAR 0x1FFF
23 #define MOTO_RTC_CONTROLA 0x1FF8
24 #define MOTO_RTC_CONTROLB 0x1FF9
25
26 #ifndef BCD_TO_BIN
27 #define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
28 #endif
29
30 #ifndef BIN_TO_BCD
31 #define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
32 #endif
33
34 /* PowerMac specific nvram stuffs */
35
36 enum {
37 pmac_nvram_OF, /* Open Firmware partition */
38 pmac_nvram_XPRAM, /* MacOS XPRAM partition */
39 pmac_nvram_NR /* MacOS Name Registry partition */
40 };
41
42 #ifdef __KERNEL__
43
44 /* Return partition offset in nvram */
45 extern int pmac_get_partition(int partition);
46
47 /* Direct access to XPRAM */
48 extern u8 pmac_xpram_read(int xpaddr);
49 extern void pmac_xpram_write(int xpaddr, u8 data);
50
51 #endif /* __KERNEL__ */
52
53 /* Some offsets in XPRAM */
54 #define PMAC_XPRAM_MACHINE_LOC 0xe4
55 #define PMAC_XPRAM_SOUND_VOLUME 0x08
56
57 /* Machine location structure in XPRAM */
58 struct pmac_machine_location {
59 unsigned int latitude; /* 2+30 bit Fractional number */
60 unsigned int longitude; /* 2+30 bit Fractional number */
61 unsigned int delta; /* mix of GMT delta and DLS */
62 };
63
64 /* /dev/nvram ioctls */
65 #define PMAC_NVRAM_GET_OFFSET _IOWR('p', 0x40, int) /* Get NVRAM partition offset */
66
67 #endif
68 #endif /* __KERNEL__ */
69
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.