Skip to contentSkip to conversation

try #2 for nvram patch + new maintainer?

PATCH New Tim Hockin 1 participant 1 message Oct 23, 2001

Subsystems (2)
lore
Share & tools
lore

Tim Hockin

author
#0 lore raw

PATCH 1/1 try #2 for nvram patch + new maintainer?

OK, So I came to the realization that some of the things we had added to the nvram driver we were no longer using. So I ripped them out. If we need them later, we can deal with it :)

Attached you will find the first patch to the nvram driver:

* Configure correction
* Minor cleanups of global state
* Add Cobalt Networks CMOS data support
* Export some additional functions

I have another patch which is just formatting (so all tabstops work properly!). I'll send that later.

Please apply this for the next 2.4.x. It appears there is no maintainer for this driver. If so, I'd like to take it over. We're using it, so someone here may as well maintain it.

Tim

Signature · 4 lines
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
[email protected]
Documentation/Configure.help +3 -2
diff -ruN dist-2.4.12+patches/Documentation/Configure.help cvs-2.4.12+patches/Documentation/Configure.help
@@ -14952,9 +15177,10 @@
 CONFIG_NVRAM
   If you say Y here and create a character special file /dev/nvram
   with major number 10 and minor number 144 using mknod ("man mknod"),
-  you get read and write access to the 50 bytes of non-volatile memory
+  you get read and write access to the extra bytes of non-volatile memory
   in the real time clock (RTC), which is contained in every PC and
-  most Ataris. 
+  most Ataris.  The actual number of bytes varies, depending on the 
+  nvram in the system, but is usually 114.  
 
   This memory is conventionally called "CMOS RAM" on PCs and "NVRAM"
   on Ataris. /dev/nvram may be used to view settings there, or to
drivers/char/nvram.c +279 -56

502 lines not on this page · raw message

include/linux/cobalt-nvram.h +112 -0

112 lines not on this page · raw message

include/linux/nvram.h +18 -6
diff -ruN dist-2.4.12+patches/include/linux/nvram.h cvs-2.4.12+patches/include/linux/nvram.h
@@ -4,14 +4,26 @@
 #include <linux/ioctl.h>
 
 /* /dev/nvram ioctls */
-#define NVRAM_INIT		_IO('p', 0x40) /* initialize NVRAM and set checksum */
-#define	NVRAM_SETCKS	_IO('p', 0x41) /* recalculate checksum */
+#define NVRAM_INIT        _IO('p', 0x40) /* initialize NVRAM and set checksum */
+#define NVRAM_SETCKS      _IO('p', 0x41) /* recalculate checksum */
+
+
+/* for all current systems, this is where NVRAM starts */
+#define NVRAM_FIRST_BYTE    14
+
+/* all these functions expect an NVRAM offset, not an absolute */
+#define NVRAM_OFFSET(x)   ((x)-NVRAM_FIRST_BYTE)
 
 #ifdef __KERNEL__
-extern unsigned char nvram_read_byte( int i );
-extern void nvram_write_byte( unsigned char c, int i );
-extern int nvram_check_checksum( void );
-extern void nvram_set_checksum( void );
+/* __foo is foo without grabbing the rtc_lock - get it yourself */
+extern unsigned char nvram_read_byte(int i);
+extern unsigned char __nvram_read_byte(int i);
+extern void nvram_write_byte(unsigned char c, int i);
+extern void __nvram_write_byte(unsigned char c, int i);
+extern int nvram_check_checksum(void);
+extern int __nvram_check_checksum(void);
+extern void nvram_set_checksum(void);
+extern void __nvram_set_checksum(void);
 #endif
 
 #endif  /* _LINUX_NVRAM_H */