1 /*        $NetBSD: nvm.h,v 1.1 2014/02/24 07:23:43 skrll Exp $        */
2 
3 /*        $OpenBSD: nvm.h,v 1.2 1998/11/23 03:28:22 mickey Exp $      */
4 
5 /*
6  * Copyright (c) 1990, 1994 The University of Utah and
7  * the Computer Systems Laboratory at the University of Utah (CSL).
8  * All rights reserved.
9  *
10  * Permission to use, copy, modify and distribute this software is hereby
11  * granted provided that (1) source code retains these copyright, permission,
12  * and disclaimer notices, and (2) redistributions including binaries
13  * reproduce the notices in supporting documentation, and (3) all advertising
14  * materials mentioning features or use of this software display the following
15  * acknowledgement: ``This product includes software developed by the
16  * Computer Systems Laboratory at the University of Utah.''
17  *
18  * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
19  * IS" CONDITION.  THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
20  * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
21  *
22  * CSL requests users of this software to return to csl-dist@cs.utah.edu any
23  * improvements that they make and grant CSL redistribution rights.
24  *
25  *        Utah $Hdr: nvm.h 1.4 94/12/14$
26  *        Author: Jeff Forys, University of Utah CSL
27  */
28 
29 #ifndef _MACHINE_NVM_H_
30 #define   _MACHINE_NVM_H_
31 
32 /*
33  * The PDC provides access to Non-Volatile Memory (NVM).  If this
34  * is implemented (it's HVERSION dependent), the first 256 bytes
35  * are formatted as follows:
36  *
37  *        0x000     +----------------------------+
38  *                  | Implementation information |
39  *        0x024     +----------------------------+
40  *                  |                            |
41  *                  |      IPL information       |
42  *                  |                            |
43  *        0x080     +----------------------------+
44  *                  |                            |
45  *                  |                            |
46  *                  |    OS Panic information    |
47  *                  |                            |
48  *                  |                            |
49  *        0x100     +----------------------------+
50  *
51  * It appears that there are at least 256 bytes of NVM, and only
52  * the "OS Panic information" is not architected.  This means that
53  * we can use locations 0x80 - 0xFF for saving information across
54  * boots (e.g. boot flags and boot device).  I think we should use
55  * the higher portions of this space first, to avoid conflicting
56  * with possible future HP-PA plans for the NVM.
57  *
58  * The PDC requires that NVM be read/written to in word multiples.
59  */
60 
61 /*
62  * Boot flags and boot device (0xF4 - 0xFF).
63  */
64 
65 #define   NVM_BOOTDATA        0xF4                /* location of bootdata in NVM */
66 #define   NVM_BOOTMAGIC       0xACCEDE  /* magic used for bootdata cksum */
67 #define   NVM_BOOTCKSUM(bd) \
68           ((unsigned int) NVM_BOOTMAGIC + (bd).flags + (bd).device)
69 
70 struct bootdata {
71           unsigned int cksum;           /* NVM_BOOTMAGIC + flags + device */
72           unsigned int flags;           /* boot flags */
73           unsigned int device;                    /* boot device */
74 };
75 
76 #endif    /* _MACHINE_NVM_H_ */
77