xref: /openbmc/qemu/include/hw/nvram/mac_nvram.h (revision 1f7888e2)
1443f07b7SBALATON Zoltan /*
2443f07b7SBALATON Zoltan  * PowerMac NVRAM emulation
3443f07b7SBALATON Zoltan  *
4443f07b7SBALATON Zoltan  * Copyright (c) 2004-2007 Fabrice Bellard
5443f07b7SBALATON Zoltan  * Copyright (c) 2007 Jocelyn Mayer
6443f07b7SBALATON Zoltan  *
7443f07b7SBALATON Zoltan  * Permission is hereby granted, free of charge, to any person obtaining a copy
8443f07b7SBALATON Zoltan  * of this software and associated documentation files (the "Software"), to deal
9443f07b7SBALATON Zoltan  * in the Software without restriction, including without limitation the rights
10443f07b7SBALATON Zoltan  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11443f07b7SBALATON Zoltan  * copies of the Software, and to permit persons to whom the Software is
12443f07b7SBALATON Zoltan  * furnished to do so, subject to the following conditions:
13443f07b7SBALATON Zoltan  *
14443f07b7SBALATON Zoltan  * The above copyright notice and this permission notice shall be included in
15443f07b7SBALATON Zoltan  * all copies or substantial portions of the Software.
16443f07b7SBALATON Zoltan  *
17443f07b7SBALATON Zoltan  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18443f07b7SBALATON Zoltan  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19443f07b7SBALATON Zoltan  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20443f07b7SBALATON Zoltan  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21443f07b7SBALATON Zoltan  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22443f07b7SBALATON Zoltan  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23443f07b7SBALATON Zoltan  * THE SOFTWARE.
24443f07b7SBALATON Zoltan  */
25443f07b7SBALATON Zoltan 
26443f07b7SBALATON Zoltan #ifndef MAC_NVRAM_H
27443f07b7SBALATON Zoltan #define MAC_NVRAM_H
28443f07b7SBALATON Zoltan 
29443f07b7SBALATON Zoltan #include "exec/memory.h"
30443f07b7SBALATON Zoltan #include "hw/sysbus.h"
31443f07b7SBALATON Zoltan 
32458586feSBALATON Zoltan #define MACIO_NVRAM_SIZE 0x2000
33443f07b7SBALATON Zoltan 
34443f07b7SBALATON Zoltan #define TYPE_MACIO_NVRAM "macio-nvram"
35443f07b7SBALATON Zoltan OBJECT_DECLARE_SIMPLE_TYPE(MacIONVRAMState, MACIO_NVRAM)
36443f07b7SBALATON Zoltan 
37443f07b7SBALATON Zoltan struct MacIONVRAMState {
38443f07b7SBALATON Zoltan     /*< private >*/
39443f07b7SBALATON Zoltan     SysBusDevice parent_obj;
40443f07b7SBALATON Zoltan     /*< public >*/
41443f07b7SBALATON Zoltan 
42443f07b7SBALATON Zoltan     uint32_t size;
43443f07b7SBALATON Zoltan     uint32_t it_shift;
44443f07b7SBALATON Zoltan 
45443f07b7SBALATON Zoltan     MemoryRegion mem;
46443f07b7SBALATON Zoltan     uint8_t *data;
47*1f7888e2SBALATON Zoltan     BlockBackend *blk;
48443f07b7SBALATON Zoltan };
49443f07b7SBALATON Zoltan 
50443f07b7SBALATON Zoltan void pmac_format_nvram_partition(MacIONVRAMState *nvr, int len);
51443f07b7SBALATON Zoltan 
52443f07b7SBALATON Zoltan #endif /* MAC_NVRAM_H */
53