Revision 751c6a17 hw/omap_sx1.c
b/hw/omap_sx1.c | ||
---|---|---|
127 | 127 |
static uint32_t cs2val = 0x00001139; |
128 | 128 |
static uint32_t cs3val = 0x00001139; |
129 | 129 |
ram_addr_t phys_flash; |
130 |
int index;
|
|
130 |
DriveInfo *dinfo;
|
|
131 | 131 |
int fl_idx; |
132 | 132 |
uint32_t flash_size = flash0_size; |
133 | 133 |
|
... | ... | |
151 | 151 |
|
152 | 152 |
fl_idx = 0; |
153 | 153 |
|
154 |
if ((index = drive_get_index(IF_PFLASH, 0, fl_idx)) > -1) {
|
|
154 |
if ((dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) {
|
|
155 | 155 |
if (!pflash_cfi01_register(OMAP_CS0_BASE, qemu_ram_alloc(flash_size), |
156 |
drives_table[index].bdrv, sector_size, flash_size / sector_size,
|
|
156 |
dinfo->bdrv, sector_size, flash_size / sector_size,
|
|
157 | 157 |
4, 0, 0, 0, 0)) { |
158 | 158 |
fprintf(stderr, "qemu: Error registering flash memory %d.\n", |
159 | 159 |
fl_idx); |
... | ... | |
162 | 162 |
} |
163 | 163 |
|
164 | 164 |
if ((version == 1) && |
165 |
(index = drive_get_index(IF_PFLASH, 0, fl_idx)) > -1) {
|
|
165 |
(dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) {
|
|
166 | 166 |
cpu_register_physical_memory(OMAP_CS1_BASE, flash1_size, |
167 | 167 |
(phys_flash = qemu_ram_alloc(flash1_size)) | |
168 | 168 |
IO_MEM_ROM); |
... | ... | |
171 | 171 |
OMAP_CS1_SIZE - flash1_size, io); |
172 | 172 |
|
173 | 173 |
if (!pflash_cfi01_register(OMAP_CS1_BASE, qemu_ram_alloc(flash1_size), |
174 |
drives_table[index].bdrv, sector_size, flash1_size / sector_size,
|
|
174 |
dinfo->bdrv, sector_size, flash1_size / sector_size,
|
|
175 | 175 |
4, 0, 0, 0, 0)) { |
176 | 176 |
fprintf(stderr, "qemu: Error registering flash memory %d.\n", |
177 | 177 |
fl_idx); |
Also available in: Unified diff