xref: /qemu/include/hw/nvram/mac_nvram.h (revision 8be545ba5a315a9aaf7307f143a4a7926a6e605c)
13cbee15bSj_mayer /*
2443f07b7SBALATON Zoltan  * PowerMac NVRAM emulation
33cbee15bSj_mayer  *
43cbee15bSj_mayer  * Copyright (c) 2004-2007 Fabrice Bellard
53cbee15bSj_mayer  * Copyright (c) 2007 Jocelyn Mayer
63cbee15bSj_mayer  *
73cbee15bSj_mayer  * Permission is hereby granted, free of charge, to any person obtaining a copy
83cbee15bSj_mayer  * of this software and associated documentation files (the "Software"), to deal
93cbee15bSj_mayer  * in the Software without restriction, including without limitation the rights
103cbee15bSj_mayer  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
113cbee15bSj_mayer  * copies of the Software, and to permit persons to whom the Software is
123cbee15bSj_mayer  * furnished to do so, subject to the following conditions:
133cbee15bSj_mayer  *
143cbee15bSj_mayer  * The above copyright notice and this permission notice shall be included in
153cbee15bSj_mayer  * all copies or substantial portions of the Software.
163cbee15bSj_mayer  *
173cbee15bSj_mayer  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
183cbee15bSj_mayer  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
193cbee15bSj_mayer  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
203cbee15bSj_mayer  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
213cbee15bSj_mayer  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
223cbee15bSj_mayer  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
233cbee15bSj_mayer  * THE SOFTWARE.
243cbee15bSj_mayer  */
252a6a4076SMarkus Armbruster 
26443f07b7SBALATON Zoltan #ifndef MAC_NVRAM_H
27443f07b7SBALATON Zoltan #define MAC_NVRAM_H
283cbee15bSj_mayer 
29*8be545baSRichard Henderson #include "system/memory.h"
3095ed3b7cSAndreas Färber #include "hw/sysbus.h"
311e39101cSAvi Kivity 
32458586feSBALATON Zoltan #define MACIO_NVRAM_SIZE 0x2000
333cbee15bSj_mayer 
3495ed3b7cSAndreas Färber #define TYPE_MACIO_NVRAM "macio-nvram"
358063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(MacIONVRAMState, MACIO_NVRAM)
363cbee15bSj_mayer 
37db1015e9SEduardo Habkost struct MacIONVRAMState {
3895ed3b7cSAndreas Färber     /*< private >*/
3995ed3b7cSAndreas Färber     SysBusDevice parent_obj;
4095ed3b7cSAndreas Färber     /*< public >*/
4195ed3b7cSAndreas Färber 
4295ed3b7cSAndreas Färber     uint32_t size;
4395ed3b7cSAndreas Färber     uint32_t it_shift;
4495ed3b7cSAndreas Färber 
4595ed3b7cSAndreas Färber     MemoryRegion mem;
4695ed3b7cSAndreas Färber     uint8_t *data;
471f7888e2SBALATON Zoltan     BlockBackend *blk;
48db1015e9SEduardo Habkost };
4995ed3b7cSAndreas Färber 
503cbee15bSj_mayer void pmac_format_nvram_partition(MacIONVRAMState *nvr, int len);
51443f07b7SBALATON Zoltan 
52443f07b7SBALATON Zoltan #endif /* MAC_NVRAM_H */
53