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