]> Git Repo - qemu.git/blame - include/hw/timer/m48t59.h
m48t59: add a Nvram interface
[qemu.git] / include / hw / timer / m48t59.h
CommitLineData
87ecb68b
PB
1#ifndef NVRAM_H
2#define NVRAM_H
3
43745328
HP
4#include "qemu-common.h"
5#include "qom/object.h"
6
87ecb68b 7/* NVRAM helpers */
c227f099
AL
8typedef uint32_t (*nvram_read_t)(void *private, uint32_t addr);
9typedef void (*nvram_write_t)(void *private, uint32_t addr, uint32_t val);
10typedef struct nvram_t {
87ecb68b 11 void *opaque;
c227f099
AL
12 nvram_read_t read_fn;
13 nvram_write_t write_fn;
14} nvram_t;
87ecb68b 15
c227f099 16uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr);
c227f099 17int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max);
43448292 18
c227f099 19int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size,
b55266b5 20 const char *arch,
87ecb68b
PB
21 uint32_t RAM_size, int boot_device,
22 uint32_t kernel_image, uint32_t kernel_size,
23 const char *cmdline,
24 uint32_t initrd_image, uint32_t initrd_size,
25 uint32_t NVRAM_image,
26 int width, int height, int depth);
29d1ffc3
AF
27
28#define TYPE_SYSBUS_M48T59 "m48t59"
29
43a34704 30typedef struct M48t59State M48t59State;
87ecb68b
PB
31
32void m48t59_write (void *private, uint32_t addr, uint32_t val);
33uint32_t m48t59_read (void *private, uint32_t addr);
34void m48t59_toggle_lock (void *private, int lock);
48a18b3c
HP
35M48t59State *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
36 int type);
a8170e5e 37M48t59State *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
43a34704 38 uint32_t io_base, uint16_t size, int type);
87ecb68b 39
43745328
HP
40#define TYPE_NVRAM "nvram"
41
42#define NVRAM_CLASS(klass) \
43 OBJECT_CLASS_CHECK(NvramClass, (klass), TYPE_NVRAM)
44#define NVRAM_GET_CLASS(obj) \
45 OBJECT_GET_CLASS(NvramClass, (obj), TYPE_NVRAM)
46#define NVRAM(obj) \
47 INTERFACE_CHECK(Nvram, (obj), TYPE_NVRAM)
48
49typedef struct Nvram {
50 Object parent;
51} Nvram;
52
53typedef struct NvramClass {
54 InterfaceClass parent;
55
56 uint32_t (*read)(Nvram *obj, uint32_t addr);
57 void (*write)(Nvram *obj, uint32_t addr, uint32_t val);
58 void (*toggle_lock)(Nvram *obj, int lock);
59} NvramClass;
60
87ecb68b 61#endif /* !NVRAM_H */
This page took 0.692372 seconds and 4 git commands to generate.