Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  * NVRAM definitions and access functions.
0004  *
0005  * This program is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU General Public License
0007  * as published by the Free Software Foundation; either version
0008  * 2 of the License, or (at your option) any later version.
0009  */
0010 
0011 #ifndef _UAPI_ASM_POWERPC_NVRAM_H
0012 #define _UAPI_ASM_POWERPC_NVRAM_H
0013 
0014 /* Signatures for nvram partitions */
0015 #define NVRAM_SIG_SP    0x02    /* support processor */
0016 #define NVRAM_SIG_OF    0x50    /* open firmware config */
0017 #define NVRAM_SIG_FW    0x51    /* general firmware */
0018 #define NVRAM_SIG_HW    0x52    /* hardware (VPD) */
0019 #define NVRAM_SIG_FLIP  0x5a    /* Apple flip/flop header */
0020 #define NVRAM_SIG_APPL  0x5f    /* Apple "system" (???) */
0021 #define NVRAM_SIG_SYS   0x70    /* system env vars */
0022 #define NVRAM_SIG_CFG   0x71    /* config data */
0023 #define NVRAM_SIG_ELOG  0x72    /* error log */
0024 #define NVRAM_SIG_VEND  0x7e    /* vendor defined */
0025 #define NVRAM_SIG_FREE  0x7f    /* Free space */
0026 #define NVRAM_SIG_OS    0xa0    /* OS defined */
0027 #define NVRAM_SIG_PANIC 0xa1    /* Apple OSX "panic" */
0028 
0029 
0030 /* PowerMac specific nvram stuffs */
0031 
0032 enum {
0033     pmac_nvram_OF,      /* Open Firmware partition */
0034     pmac_nvram_XPRAM,   /* MacOS XPRAM partition */
0035     pmac_nvram_NR       /* MacOS Name Registry partition */
0036 };
0037 
0038 
0039 /* Some offsets in XPRAM */
0040 #define PMAC_XPRAM_MACHINE_LOC  0xe4
0041 #define PMAC_XPRAM_SOUND_VOLUME 0x08
0042 
0043 /* Machine location structure in PowerMac XPRAM */
0044 struct pmac_machine_location {
0045     unsigned int    latitude;   /* 2+30 bit Fractional number */
0046     unsigned int    longitude;  /* 2+30 bit Fractional number */
0047     unsigned int    delta;      /* mix of GMT delta and DLS */
0048 };
0049 
0050 /*
0051  * /dev/nvram ioctls
0052  *
0053  * Note that PMAC_NVRAM_GET_OFFSET is still supported, but is
0054  * definitely obsolete. Do not use it if you can avoid it
0055  */
0056 
0057 #define OBSOLETE_PMAC_NVRAM_GET_OFFSET \
0058                 _IOWR('p', 0x40, int)
0059 
0060 #define IOC_NVRAM_GET_OFFSET    _IOWR('p', 0x42, int)   /* Get NVRAM partition offset */
0061 #define IOC_NVRAM_SYNC      _IO('p', 0x43)      /* Sync NVRAM image */
0062 
0063 #endif /* _UAPI_ASM_POWERPC_NVRAM_H */