aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/e500.h
blob: 3fd9f825cac3ad409f8e1aeb62f8e3a7f2486552 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef PPCE500_H
#define PPCE500_H

#include "hw/boards.h"
#include "hw/platform-bus.h"

typedef struct PPCE500MachineState {
    /*< private >*/
    MachineState parent_obj;

    /* points to instance of TYPE_PLATFORM_BUS_DEVICE if
     * board supports dynamic sysbus devices
     */
    PlatformBusDevice *pbus_dev;
} PPCE500MachineState;

typedef struct PPCE500MachineClass {
    /*< private >*/
    MachineClass parent_class;

    /* required -- must at least add toplevel board compatible */
    void (*fixup_devtree)(void *fdt);

    int pci_first_slot;
    int pci_nr_slots;

    int mpic_version;
    bool has_mpc8xxx_gpio;
    bool has_platform_bus;
    hwaddr platform_bus_base;
    hwaddr platform_bus_size;
    int platform_bus_first_irq;
    int platform_bus_num_irqs;
    hwaddr ccsrbar_base;
    hwaddr pci_pio_base;
    hwaddr pci_mmio_base;
    hwaddr pci_mmio_bus_base;
    hwaddr spin_base;
} PPCE500MachineClass;

void ppce500_init(MachineState *machine);

hwaddr booke206_page_size_to_tlb(uint64_t size);

#define TYPE_PPCE500_MACHINE      "ppce500-base-machine"
#define PPCE500_MACHINE(obj) \
    OBJECT_CHECK(PPCE500MachineState, (obj), TYPE_PPCE500_MACHINE)
#define PPCE500_MACHINE_GET_CLASS(obj) \
    OBJECT_GET_CLASS(PPCE500MachineClass, obj, TYPE_PPCE500_MACHINE)
#define PPCE500_MACHINE_CLASS(klass) \
    OBJECT_CLASS_CHECK(PPCE500MachineClass, klass, TYPE_PPCE500_MACHINE)

#endif