root / hw / nvram.h @ e00e365e
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 | c227f099 | Anthony Liguori | typedef struct m48t59_t m48t59_t; |
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 | c227f099 | Anthony Liguori | m48t59_t *m48t59_init_isa(uint32_t io_base, uint16_t size, int type);
|
38 | c227f099 | Anthony Liguori | m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base, |
39 | 87ecb68b | pbrook | uint32_t io_base, uint16_t size, |
40 | 87ecb68b | pbrook | int type);
|
41 | 9596ebb7 | pbrook | void m48t59_set_addr (void *opaque, uint32_t addr); |
42 | 87ecb68b | pbrook | |
43 | 87ecb68b | pbrook | #endif /* !NVRAM_H */ |