root / hw / nvram.h @ 3b1fd90e
History | View | Annotate | Download (1.8 kB)
1 | 87ecb68b | pbrook | #ifndef NVRAM_H
|
---|---|---|---|
2 | 87ecb68b | pbrook | #define NVRAM_H
|
3 | 87ecb68b | pbrook | |
4 | 87ecb68b | pbrook | /* NVRAM helpers */
|
5 | 87ecb68b | pbrook | typedef uint32_t (*nvram_read_t)(void *private, uint32_t addr); |
6 | 87ecb68b | pbrook | typedef void (*nvram_write_t)(void *private, uint32_t addr, uint32_t val); |
7 | 87ecb68b | pbrook | typedef struct nvram_t { |
8 | 87ecb68b | pbrook | void *opaque;
|
9 | 87ecb68b | pbrook | nvram_read_t read_fn; |
10 | 87ecb68b | pbrook | nvram_write_t write_fn; |
11 | 87ecb68b | pbrook | } nvram_t; |
12 | 87ecb68b | pbrook | |
13 | 87ecb68b | pbrook | void NVRAM_set_byte (nvram_t *nvram, uint32_t addr, uint8_t value);
|
14 | 87ecb68b | pbrook | uint8_t NVRAM_get_byte (nvram_t *nvram, uint32_t addr); |
15 | 87ecb68b | pbrook | void NVRAM_set_word (nvram_t *nvram, uint32_t addr, uint16_t value);
|
16 | 87ecb68b | pbrook | uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr); |
17 | 87ecb68b | pbrook | void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value);
|
18 | 87ecb68b | pbrook | uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr); |
19 | 87ecb68b | pbrook | void NVRAM_set_string (nvram_t *nvram, uint32_t addr,
|
20 | b55266b5 | blueswir1 | const char *str, uint32_t max); |
21 | 87ecb68b | pbrook | int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max); |
22 | 87ecb68b | pbrook | void NVRAM_set_crc (nvram_t *nvram, uint32_t addr,
|
23 | 87ecb68b | pbrook | uint32_t start, uint32_t count); |
24 | 87ecb68b | pbrook | 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 | 87ecb68b | pbrook | 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 | 87ecb68b | pbrook | m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base, |
38 | 87ecb68b | pbrook | uint32_t io_base, uint16_t size, |
39 | 87ecb68b | pbrook | int type);
|
40 | 9596ebb7 | pbrook | void m48t59_set_addr (void *opaque, uint32_t addr); |
41 | 87ecb68b | pbrook | |
42 | 87ecb68b | pbrook | #endif /* !NVRAM_H */ |