summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2004-02-06 14:20:56 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2004-02-06 14:20:56 +1100
commitfea796e8f4af85f7c384f80985c5656577dc5d84 (patch)
tree256969a1ee7a0f56e77a25186e00aa26b79af3dd /include
parent62de9ee32c16270522ee21dd2ee0141d44a36fe8 (diff)
ppc32: Rework nvram management
move drivers/macintosh/nvram.c to drivers/char/generic_nvram.c, update platform hooks, fix powermac nvram driver for newer machines
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc/machdep.h1
-rw-r--r--include/asm-ppc/nvram.h25
2 files changed, 22 insertions, 4 deletions
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h
index 54cb5a93d508..c241973ff78e 100644
--- a/include/asm-ppc/machdep.h
+++ b/include/asm-ppc/machdep.h
@@ -57,6 +57,7 @@ struct machdep_calls {
unsigned char (*nvram_read_val)(int addr);
void (*nvram_write_val)(int addr, unsigned char val);
+ void (*nvram_sync)(void);
/*
* optional PCI "hooks"
diff --git a/include/asm-ppc/nvram.h b/include/asm-ppc/nvram.h
index d65bb55baf9d..31ef16e3fc4f 100644
--- a/include/asm-ppc/nvram.h
+++ b/include/asm-ppc/nvram.h
@@ -34,23 +34,40 @@ enum {
/* Return partition offset in nvram */
extern int pmac_get_partition(int partition);
-/* Direct access to XPRAM */
+/* Direct access to XPRAM on PowerMacs */
extern u8 pmac_xpram_read(int xpaddr);
extern void pmac_xpram_write(int xpaddr, u8 data);
+/* Synchronize NVRAM */
+extern void nvram_sync(void);
+
+/* Normal access to NVRAM */
+extern unsigned char nvram_read_byte(int i);
+extern void nvram_write_byte(unsigned char c, int i);
+
/* Some offsets in XPRAM */
#define PMAC_XPRAM_MACHINE_LOC 0xe4
#define PMAC_XPRAM_SOUND_VOLUME 0x08
-/* Machine location structure in XPRAM */
+/* Machine location structure in PowerMac XPRAM */
struct pmac_machine_location {
unsigned int latitude; /* 2+30 bit Fractional number */
unsigned int longitude; /* 2+30 bit Fractional number */
unsigned int delta; /* mix of GMT delta and DLS */
};
-/* /dev/nvram ioctls */
-#define PMAC_NVRAM_GET_OFFSET _IOWR('p', 0x40, int) /* Get NVRAM partition offset */
+/*
+ * /dev/nvram ioctls
+ *
+ * Note that PMAC_NVRAM_GET_OFFSET is still supported, but is
+ * definitely obsolete. Do not use it if you can avoid it
+ */
+
+#define OBSOLETE_PMAC_NVRAM_GET_OFFSET \
+ _IOWR('p', 0x40, int)
+
+#define IOC_NVRAM_GET_OFFSET _IOWR('p', 0x42, int) /* Get NVRAM partition offset */
+#define IOC_NVRAM_SYNC _IO('p', 0x43) /* Sync NVRAM image */
#endif
#endif /* __KERNEL__ */