xref: /qemu/include/hw/ppc/ppc4xx.h (revision 629cae617039e03d5bfdc0120ade69135a009d33)
1008ff9d7Sj_mayer /*
2008ff9d7Sj_mayer  * QEMU PowerPC 4xx emulation shared definitions
3008ff9d7Sj_mayer  *
4008ff9d7Sj_mayer  * Copyright (c) 2007 Jocelyn Mayer
5008ff9d7Sj_mayer  *
6008ff9d7Sj_mayer  * Permission is hereby granted, free of charge, to any person obtaining a copy
7008ff9d7Sj_mayer  * of this software and associated documentation files (the "Software"), to deal
8008ff9d7Sj_mayer  * in the Software without restriction, including without limitation the rights
9008ff9d7Sj_mayer  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10008ff9d7Sj_mayer  * copies of the Software, and to permit persons to whom the Software is
11008ff9d7Sj_mayer  * furnished to do so, subject to the following conditions:
12008ff9d7Sj_mayer  *
13008ff9d7Sj_mayer  * The above copyright notice and this permission notice shall be included in
14008ff9d7Sj_mayer  * all copies or substantial portions of the Software.
15008ff9d7Sj_mayer  *
16008ff9d7Sj_mayer  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17008ff9d7Sj_mayer  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18008ff9d7Sj_mayer  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19008ff9d7Sj_mayer  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20008ff9d7Sj_mayer  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21008ff9d7Sj_mayer  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22008ff9d7Sj_mayer  * THE SOFTWARE.
23008ff9d7Sj_mayer  */
24008ff9d7Sj_mayer 
25121d0712SMarkus Armbruster #ifndef PPC4XX_H
26121d0712SMarkus Armbruster #define PPC4XX_H
27008ff9d7Sj_mayer 
28ec150c7eSMarkus Armbruster #include "hw/ppc/ppc.h"
29ec150c7eSMarkus Armbruster #include "exec/memory.h"
30*629cae61SCédric Le Goater #include "hw/sysbus.h"
31ec150c7eSMarkus Armbruster 
32b28f0188SIgor Mammedov void ppc4xx_sdram_banks(MemoryRegion *ram, int nr_banks,
33b6dcbe08SAvi Kivity                         MemoryRegion ram_memories[],
34a0258e4aSIgor Mammedov                         hwaddr ram_bases[], hwaddr ram_sizes[],
357d8ccf58SBALATON Zoltan                         const ram_addr_t sdram_bank_sizes[]);
36b7da58fdSaurel32 
37e2684c0bSAndreas Färber void ppc4xx_sdram_init (CPUPPCState *env, qemu_irq irq, int nbanks,
38b6dcbe08SAvi Kivity                         MemoryRegion ram_memories[],
39a8170e5eSAvi Kivity                         hwaddr *ram_bases,
40a8170e5eSAvi Kivity                         hwaddr *ram_sizes,
4161b24405Saurel32                         int do_init);
4261b24405Saurel32 
4304534280SBALATON Zoltan void ppc4xx_mal_init(CPUPPCState *env, uint8_t txcnum, uint8_t rxcnum,
4404534280SBALATON Zoltan                      qemu_irq irqs[4]);
45517284a7SBALATON Zoltan 
4642c281a2SAndreas Färber #define TYPE_PPC4xx_PCI_HOST_BRIDGE "ppc4xx-pcihost"
4742c281a2SAndreas Färber 
48*629cae61SCédric Le Goater /*
49*629cae61SCédric Le Goater  * Generic DCR device
50*629cae61SCédric Le Goater  */
51*629cae61SCédric Le Goater #define TYPE_PPC4xx_DCR_DEVICE "ppc4xx-dcr-device"
52*629cae61SCédric Le Goater OBJECT_DECLARE_SIMPLE_TYPE(Ppc4xxDcrDeviceState, PPC4xx_DCR_DEVICE);
53*629cae61SCédric Le Goater struct Ppc4xxDcrDeviceState {
54*629cae61SCédric Le Goater     SysBusDevice parent_obj;
55*629cae61SCédric Le Goater 
56*629cae61SCédric Le Goater     PowerPCCPU *cpu;
57*629cae61SCédric Le Goater };
58*629cae61SCédric Le Goater 
59*629cae61SCédric Le Goater void ppc4xx_dcr_register(Ppc4xxDcrDeviceState *dev, int dcrn, void *opaque,
60*629cae61SCédric Le Goater                          dcr_read_cb dcr_read, dcr_write_cb dcr_write);
61*629cae61SCédric Le Goater bool ppc4xx_dcr_realize(Ppc4xxDcrDeviceState *dev, PowerPCCPU *cpu,
62*629cae61SCédric Le Goater                         Error **errp);
63*629cae61SCédric Le Goater 
64121d0712SMarkus Armbruster #endif /* PPC4XX_H */
65