Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / asm-ppc / nvram.h
blob31ef16e3fc4fca68eacf5d8a4bd7d027d66e5c1d
1 /*
2 * PreP compliant NVRAM access
3 */
5 #ifdef __KERNEL__
6 #ifndef _PPC_NVRAM_H
7 #define _PPC_NVRAM_H
9 #define NVRAM_AS0 0x74
10 #define NVRAM_AS1 0x75
11 #define NVRAM_DATA 0x77
14 /* RTC Offsets */
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
26 /* PowerMac specific nvram stuffs */
28 enum {
29 pmac_nvram_OF, /* Open Firmware partition */
30 pmac_nvram_XPRAM, /* MacOS XPRAM partition */
31 pmac_nvram_NR /* MacOS Name Registry partition */
34 /* Return partition offset in nvram */
35 extern int pmac_get_partition(int partition);
37 /* Direct access to XPRAM on PowerMacs */
38 extern u8 pmac_xpram_read(int xpaddr);
39 extern void pmac_xpram_write(int xpaddr, u8 data);
41 /* Synchronize NVRAM */
42 extern void nvram_sync(void);
44 /* Normal access to NVRAM */
45 extern unsigned char nvram_read_byte(int i);
46 extern void nvram_write_byte(unsigned char c, int i);
48 /* Some offsets in XPRAM */
49 #define PMAC_XPRAM_MACHINE_LOC 0xe4
50 #define PMAC_XPRAM_SOUND_VOLUME 0x08
52 /* Machine location structure in PowerMac XPRAM */
53 struct pmac_machine_location {
54 unsigned int latitude; /* 2+30 bit Fractional number */
55 unsigned int longitude; /* 2+30 bit Fractional number */
56 unsigned int delta; /* mix of GMT delta and DLS */
60 * /dev/nvram ioctls
62 * Note that PMAC_NVRAM_GET_OFFSET is still supported, but is
63 * definitely obsolete. Do not use it if you can avoid it
66 #define OBSOLETE_PMAC_NVRAM_GET_OFFSET \
67 _IOWR('p', 0x40, int)
69 #define IOC_NVRAM_GET_OFFSET _IOWR('p', 0x42, int) /* Get NVRAM partition offset */
70 #define IOC_NVRAM_SYNC _IO('p', 0x43) /* Sync NVRAM image */
72 #endif
73 #endif /* __KERNEL__ */