Statistics
| Branch: | Revision:

root / hw / nvram.h @ c1ded3dc

History | View | Annotate | Download (1.9 kB)

1 87ecb68b pbrook
#ifndef NVRAM_H
2 87ecb68b pbrook
#define NVRAM_H
3 87ecb68b pbrook
4 87ecb68b pbrook
/* NVRAM helpers */
5 c227f099 Anthony Liguori
typedef uint32_t (*nvram_read_t)(void *private, uint32_t addr);
6 c227f099 Anthony Liguori
typedef void (*nvram_write_t)(void *private, uint32_t addr, uint32_t val);
7 c227f099 Anthony Liguori
typedef struct nvram_t {
8 87ecb68b pbrook
    void *opaque;
9 c227f099 Anthony Liguori
    nvram_read_t read_fn;
10 c227f099 Anthony Liguori
    nvram_write_t write_fn;
11 c227f099 Anthony Liguori
} nvram_t;
12 87ecb68b pbrook
13 c227f099 Anthony Liguori
void NVRAM_set_byte (nvram_t *nvram, uint32_t addr, uint8_t value);
14 c227f099 Anthony Liguori
uint8_t NVRAM_get_byte (nvram_t *nvram, uint32_t addr);
15 c227f099 Anthony Liguori
void NVRAM_set_word (nvram_t *nvram, uint32_t addr, uint16_t value);
16 c227f099 Anthony Liguori
uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr);
17 c227f099 Anthony Liguori
void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value);
18 c227f099 Anthony Liguori
uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr);
19 c227f099 Anthony Liguori
void NVRAM_set_string (nvram_t *nvram, uint32_t addr,
20 b55266b5 blueswir1
                       const char *str, uint32_t max);
21 c227f099 Anthony Liguori
int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max);
22 c227f099 Anthony Liguori
void NVRAM_set_crc (nvram_t *nvram, uint32_t addr,
23 87ecb68b pbrook
                    uint32_t start, uint32_t count);
24 c227f099 Anthony Liguori
int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size,
25 b55266b5 blueswir1
                          const char *arch,
26 87ecb68b pbrook
                          uint32_t RAM_size, int boot_device,
27 87ecb68b pbrook
                          uint32_t kernel_image, uint32_t kernel_size,
28 87ecb68b pbrook
                          const char *cmdline,
29 87ecb68b pbrook
                          uint32_t initrd_image, uint32_t initrd_size,
30 87ecb68b pbrook
                          uint32_t NVRAM_image,
31 87ecb68b pbrook
                          int width, int height, int depth);
32 43a34704 Blue Swirl
typedef struct M48t59State M48t59State;
33 87ecb68b pbrook
34 87ecb68b pbrook
void m48t59_write (void *private, uint32_t addr, uint32_t val);
35 87ecb68b pbrook
uint32_t m48t59_read (void *private, uint32_t addr);
36 87ecb68b pbrook
void m48t59_toggle_lock (void *private, int lock);
37 43a34704 Blue Swirl
M48t59State *m48t59_init_isa(uint32_t io_base, uint16_t size, int type);
38 43a34704 Blue Swirl
M48t59State *m48t59_init(qemu_irq IRQ, target_phys_addr_t mem_base,
39 43a34704 Blue Swirl
                         uint32_t io_base, uint16_t size, int type);
40 9596ebb7 pbrook
void m48t59_set_addr (void *opaque, uint32_t addr);
41 87ecb68b pbrook
42 87ecb68b pbrook
#endif /* !NVRAM_H */