xref: /openbmc/qemu/include/hw/nvram/mac_nvram.h (revision 443f07b7)
1*443f07b7SBALATON Zoltan /*
2*443f07b7SBALATON Zoltan  * PowerMac NVRAM emulation
3*443f07b7SBALATON Zoltan  *
4*443f07b7SBALATON Zoltan  * Copyright (c) 2004-2007 Fabrice Bellard
5*443f07b7SBALATON Zoltan  * Copyright (c) 2007 Jocelyn Mayer
6*443f07b7SBALATON Zoltan  *
7*443f07b7SBALATON Zoltan  * Permission is hereby granted, free of charge, to any person obtaining a copy
8*443f07b7SBALATON Zoltan  * of this software and associated documentation files (the "Software"), to deal
9*443f07b7SBALATON Zoltan  * in the Software without restriction, including without limitation the rights
10*443f07b7SBALATON Zoltan  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11*443f07b7SBALATON Zoltan  * copies of the Software, and to permit persons to whom the Software is
12*443f07b7SBALATON Zoltan  * furnished to do so, subject to the following conditions:
13*443f07b7SBALATON Zoltan  *
14*443f07b7SBALATON Zoltan  * The above copyright notice and this permission notice shall be included in
15*443f07b7SBALATON Zoltan  * all copies or substantial portions of the Software.
16*443f07b7SBALATON Zoltan  *
17*443f07b7SBALATON Zoltan  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18*443f07b7SBALATON Zoltan  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19*443f07b7SBALATON Zoltan  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20*443f07b7SBALATON Zoltan  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21*443f07b7SBALATON Zoltan  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22*443f07b7SBALATON Zoltan  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23*443f07b7SBALATON Zoltan  * THE SOFTWARE.
24*443f07b7SBALATON Zoltan  */
25*443f07b7SBALATON Zoltan 
26*443f07b7SBALATON Zoltan #ifndef MAC_NVRAM_H
27*443f07b7SBALATON Zoltan #define MAC_NVRAM_H
28*443f07b7SBALATON Zoltan 
29*443f07b7SBALATON Zoltan #include "exec/memory.h"
30*443f07b7SBALATON Zoltan #include "hw/sysbus.h"
31*443f07b7SBALATON Zoltan 
32*443f07b7SBALATON Zoltan #define NVRAM_SIZE        0x2000
33*443f07b7SBALATON Zoltan 
34*443f07b7SBALATON Zoltan /* Mac NVRAM */
35*443f07b7SBALATON Zoltan #define TYPE_MACIO_NVRAM "macio-nvram"
36*443f07b7SBALATON Zoltan OBJECT_DECLARE_SIMPLE_TYPE(MacIONVRAMState, MACIO_NVRAM)
37*443f07b7SBALATON Zoltan 
38*443f07b7SBALATON Zoltan struct MacIONVRAMState {
39*443f07b7SBALATON Zoltan     /*< private >*/
40*443f07b7SBALATON Zoltan     SysBusDevice parent_obj;
41*443f07b7SBALATON Zoltan     /*< public >*/
42*443f07b7SBALATON Zoltan 
43*443f07b7SBALATON Zoltan     uint32_t size;
44*443f07b7SBALATON Zoltan     uint32_t it_shift;
45*443f07b7SBALATON Zoltan 
46*443f07b7SBALATON Zoltan     MemoryRegion mem;
47*443f07b7SBALATON Zoltan     uint8_t *data;
48*443f07b7SBALATON Zoltan };
49*443f07b7SBALATON Zoltan 
50*443f07b7SBALATON Zoltan void pmac_format_nvram_partition(MacIONVRAMState *nvr, int len);
51*443f07b7SBALATON Zoltan 
52*443f07b7SBALATON Zoltan #endif /* MAC_NVRAM_H */
53