Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/macppc/dev NVRAM read/write functions.
details: https://anonhg.NetBSD.org/src/rev/8e2c4641c37e
branches: trunk
changeset: 473932:8e2c4641c37e
user: tsubai <tsubai%NetBSD.org@localhost>
date: Tue Jun 22 13:12:11 1999 +0000
description:
NVRAM read/write functions.
diffstat:
sys/arch/macppc/dev/pm_direct.c | 39 +++++++++++++++++++++++++++++++++++----
sys/arch/macppc/dev/pm_direct.h | 9 +++++++--
2 files changed, 42 insertions(+), 6 deletions(-)
diffs (87 lines):
diff -r 09eb7b164de7 -r 8e2c4641c37e sys/arch/macppc/dev/pm_direct.c
--- a/sys/arch/macppc/dev/pm_direct.c Tue Jun 22 12:45:26 1999 +0000
+++ b/sys/arch/macppc/dev/pm_direct.c Tue Jun 22 13:12:11 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pm_direct.c,v 1.4 1999/06/22 11:29:11 tsubai Exp $ */
+/* $NetBSD: pm_direct.c,v 1.5 1999/06/22 13:12:11 tsubai Exp $ */
/*
* Copyright (C) 1997 Takashi Hamada
@@ -96,8 +96,8 @@
0x00, 0x00, -1, -1, -1, -1, -1, 0x00,
-1, 0x00, 0x02, 0x01, 0x01, -1, -1, -1,
0x00, -1, -1, -1, -1, -1, -1, -1,
- 0x04, 0x14, -1, -1, -1, -1, -1, -1,
- 0x00, 0x00, 0x02, -1, -1, -1, -1, -1,
+ 0x04, 0x14, -1, 0x03, -1, -1, -1, -1,
+ 0x00, 0x00, 0x02, 0x02, -1, -1, -1, -1,
0x01, 0x01, -1, -1, -1, -1, -1, -1,
0x00, 0x00, -1, -1, -1, -1, -1, -1,
0x01, 0x00, 0x02, 0x02, -1, 0x01, 0x03, 0x01,
@@ -133,7 +133,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-1, -1, -1, -1, -1, -1, -1, -1,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x05, 0x15, -1, -1, -1, -1, -1, -1,
+ 0x05, 0x15, -1, 0x02, -1, -1, -1, -1,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x02, -1, -1, -1, -1, -1, -1,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1199,3 +1199,34 @@
bcopy(&time, p.data, 4);
pmgrop(&p);
}
+
+int
+pm_read_nvram(addr)
+ int addr;
+{
+ PMData p;
+
+ p.command = PMU_READ_NVRAM;
+ p.num_data = 2;
+ p.s_buf = p.r_buf = p.data;
+ p.data[0] = addr >> 8;
+ p.data[1] = addr;
+ pmgrop(&p);
+
+ return p.data[0];
+}
+
+void
+pm_write_nvram(addr, val)
+ int addr, val;
+{
+ PMData p;
+
+ p.command = PMU_WRITE_NVRAM;
+ p.num_data = 3;
+ p.s_buf = p.r_buf = p.data;
+ p.data[0] = addr >> 8;
+ p.data[1] = addr;
+ p.data[2] = val;
+ pmgrop(&p);
+}
diff -r 09eb7b164de7 -r 8e2c4641c37e sys/arch/macppc/dev/pm_direct.h
--- a/sys/arch/macppc/dev/pm_direct.h Tue Jun 22 12:45:26 1999 +0000
+++ b/sys/arch/macppc/dev/pm_direct.h Tue Jun 22 13:12:11 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pm_direct.h,v 1.2 1999/06/16 07:43:58 tsubai Exp $ */
+/* $NetBSD: pm_direct.h,v 1.3 1999/06/22 13:12:11 tsubai Exp $ */
/*
* Copyright (C) 1997 Takashi Hamada
@@ -44,7 +44,12 @@
char data[32]; /* data buffer (is it too much?) */
} PMData;
-int pmgrop(PMData *);
+int pmgrop __P((PMData *));
+void pm_adb_restart __P((void));
+void pm_read_date_time __P((u_long *));
+void pm_set_date_time __P((u_long));
+int pm_read_nvram __P((int));
+void pm_write_nvram __P((int, int));
/* PMU commands */
#define PMU_POWER_OFF 0x7e /* Turn Power off */
Home |
Main Index |
Thread Index |
Old Index