cmd646.c (2c9b15cab12c21e32dffb67c5e18f3dc407ca224) cmd646.c (1437c94b2689c2010362f84d14f14feaa1d8dba3)
1/*
2 * QEMU IDE Emulation: PCI cmd646 support.
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 * Copyright (c) 2006 Openedhand Ltd.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 103 unchanged lines hidden (view full) ---

112
113static void setup_cmd646_bar(PCIIDEState *d, int bus_num)
114{
115 IDEBus *bus = &d->bus[bus_num];
116 CMD646BAR *bar = &d->cmd646_bar[bus_num];
117
118 bar->bus = bus;
119 bar->pci_dev = d;
1/*
2 * QEMU IDE Emulation: PCI cmd646 support.
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 * Copyright (c) 2006 Openedhand Ltd.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 103 unchanged lines hidden (view full) ---

112
113static void setup_cmd646_bar(PCIIDEState *d, int bus_num)
114{
115 IDEBus *bus = &d->bus[bus_num];
116 CMD646BAR *bar = &d->cmd646_bar[bus_num];
117
118 bar->bus = bus;
119 bar->pci_dev = d;
120 memory_region_init_io(&bar->cmd, NULL, &cmd646_cmd_ops, bar, "cmd646-cmd", 4);
121 memory_region_init_io(&bar->data, NULL, &cmd646_data_ops, bar, "cmd646-data", 8);
120 memory_region_init_io(&bar->cmd, OBJECT(d), &cmd646_cmd_ops, bar,
121 "cmd646-cmd", 4);
122 memory_region_init_io(&bar->data, OBJECT(d), &cmd646_data_ops, bar,
123 "cmd646-data", 8);
122}
123
124static uint64_t bmdma_read(void *opaque, hwaddr addr,
125 unsigned size)
126{
127 BMDMAState *bm = opaque;
128 PCIIDEState *pci_dev = bm->pci_dev;
129 uint32_t val;

--- 68 unchanged lines hidden (view full) ---

198 .write = bmdma_write,
199};
200
201static void bmdma_setup_bar(PCIIDEState *d)
202{
203 BMDMAState *bm;
204 int i;
205
124}
125
126static uint64_t bmdma_read(void *opaque, hwaddr addr,
127 unsigned size)
128{
129 BMDMAState *bm = opaque;
130 PCIIDEState *pci_dev = bm->pci_dev;
131 uint32_t val;

--- 68 unchanged lines hidden (view full) ---

200 .write = bmdma_write,
201};
202
203static void bmdma_setup_bar(PCIIDEState *d)
204{
205 BMDMAState *bm;
206 int i;
207
206 memory_region_init(&d->bmdma_bar, NULL, "cmd646-bmdma", 16);
208 memory_region_init(&d->bmdma_bar, OBJECT(d), "cmd646-bmdma", 16);
207 for(i = 0;i < 2; i++) {
208 bm = &d->bmdma[i];
209 for(i = 0;i < 2; i++) {
210 bm = &d->bmdma[i];
209 memory_region_init_io(&bm->extra_io, NULL, &cmd646_bmdma_ops, bm,
211 memory_region_init_io(&bm->extra_io, OBJECT(d), &cmd646_bmdma_ops, bm,
210 "cmd646-bmdma-bus", 4);
211 memory_region_add_subregion(&d->bmdma_bar, i * 8, &bm->extra_io);
212 "cmd646-bmdma-bus", 4);
213 memory_region_add_subregion(&d->bmdma_bar, i * 8, &bm->extra_io);
212 memory_region_init_io(&bm->addr_ioport, NULL, &bmdma_addr_ioport_ops, bm,
214 memory_region_init_io(&bm->addr_ioport, OBJECT(d),
215 &bmdma_addr_ioport_ops, bm,
213 "cmd646-bmdma-ioport", 4);
214 memory_region_add_subregion(&d->bmdma_bar, i * 8 + 4, &bm->addr_ioport);
215 }
216}
217
218/* XXX: call it also when the MRDMODE is changed from the PCI config
219 registers */
220static void cmd646_update_irq(PCIIDEState *d)

--- 137 unchanged lines hidden ---
216 "cmd646-bmdma-ioport", 4);
217 memory_region_add_subregion(&d->bmdma_bar, i * 8 + 4, &bm->addr_ioport);
218 }
219}
220
221/* XXX: call it also when the MRDMODE is changed from the PCI config
222 registers */
223static void cmd646_update_irq(PCIIDEState *d)

--- 137 unchanged lines hidden ---