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#ifndef PPC405_H
26#define PPC405_H
27
28#include "qom/object.h"
29#include "hw/ppc/ppc4xx.h"
30#include "hw/intc/ppc-uic.h"
31#include "hw/i2c/ppc4xx_i2c.h"
32
33
34#define TYPE_PPC405_POB "ppc405-pob"
35OBJECT_DECLARE_SIMPLE_TYPE(Ppc405PobState, PPC405_POB);
36struct Ppc405PobState {
37 Ppc4xxDcrDeviceState parent_obj;
38
39 uint32_t bear;
40 uint32_t besr0;
41 uint32_t besr1;
42};
43
44
45#define TYPE_PPC405_OPBA "ppc405-opba"
46OBJECT_DECLARE_SIMPLE_TYPE(Ppc405OpbaState, PPC405_OPBA);
47struct Ppc405OpbaState {
48 SysBusDevice parent_obj;
49
50 MemoryRegion io;
51 uint8_t cr;
52 uint8_t pr;
53};
54
55
56#define TYPE_PPC405_DMA "ppc405-dma"
57OBJECT_DECLARE_SIMPLE_TYPE(Ppc405DmaState, PPC405_DMA);
58struct Ppc405DmaState {
59 Ppc4xxDcrDeviceState parent_obj;
60
61 qemu_irq irqs[4];
62 uint32_t cr[4];
63 uint32_t ct[4];
64 uint32_t da[4];
65 uint32_t sa[4];
66 uint32_t sg[4];
67 uint32_t sr;
68 uint32_t sgc;
69 uint32_t slp;
70 uint32_t pol;
71};
72
73
74#define TYPE_PPC405_GPIO "ppc405-gpio"
75OBJECT_DECLARE_SIMPLE_TYPE(Ppc405GpioState, PPC405_GPIO);
76struct Ppc405GpioState {
77 SysBusDevice parent_obj;
78
79 MemoryRegion io;
80 uint32_t or;
81 uint32_t tcr;
82 uint32_t osrh;
83 uint32_t osrl;
84 uint32_t tsrh;
85 uint32_t tsrl;
86 uint32_t odr;
87 uint32_t ir;
88 uint32_t rr1;
89 uint32_t isr1h;
90 uint32_t isr1l;
91};
92
93
94#define TYPE_PPC405_OCM "ppc405-ocm"
95OBJECT_DECLARE_SIMPLE_TYPE(Ppc405OcmState, PPC405_OCM);
96struct Ppc405OcmState {
97 Ppc4xxDcrDeviceState parent_obj;
98
99 MemoryRegion ram;
100 MemoryRegion isarc_ram;
101 MemoryRegion dsarc_ram;
102 uint32_t isarc;
103 uint32_t isacntl;
104 uint32_t dsarc;
105 uint32_t dsacntl;
106};
107
108
109#define TYPE_PPC405_GPT "ppc405-gpt"
110OBJECT_DECLARE_SIMPLE_TYPE(Ppc405GptState, PPC405_GPT);
111struct Ppc405GptState {
112 SysBusDevice parent_obj;
113
114 MemoryRegion iomem;
115
116 int64_t tb_offset;
117 uint32_t tb_freq;
118 QEMUTimer *timer;
119 qemu_irq irqs[5];
120 uint32_t oe;
121 uint32_t ol;
122 uint32_t im;
123 uint32_t is;
124 uint32_t ie;
125 uint32_t comp[5];
126 uint32_t mask[5];
127};
128
129#define TYPE_PPC405_CPC "ppc405-cpc"
130OBJECT_DECLARE_SIMPLE_TYPE(Ppc405CpcState, PPC405_CPC);
131
132enum {
133 PPC405EP_CPU_CLK = 0,
134 PPC405EP_PLB_CLK = 1,
135 PPC405EP_OPB_CLK = 2,
136 PPC405EP_EBC_CLK = 3,
137 PPC405EP_MAL_CLK = 4,
138 PPC405EP_PCI_CLK = 5,
139 PPC405EP_UART0_CLK = 6,
140 PPC405EP_UART1_CLK = 7,
141 PPC405EP_CLK_NB = 8,
142};
143
144struct Ppc405CpcState {
145 Ppc4xxDcrDeviceState parent_obj;
146
147 uint32_t sysclk;
148 clk_setup_t clk_setup[PPC405EP_CLK_NB];
149 uint32_t boot;
150 uint32_t epctl;
151 uint32_t pllmr[2];
152 uint32_t ucr;
153 uint32_t srr;
154 uint32_t jtagid;
155 uint32_t pci;
156
157 uint32_t er;
158 uint32_t fr;
159 uint32_t sr;
160};
161
162#define TYPE_PPC405_SOC "ppc405-soc"
163OBJECT_DECLARE_SIMPLE_TYPE(Ppc405SoCState, PPC405_SOC);
164
165struct Ppc405SoCState {
166
167 DeviceState parent_obj;
168
169
170 PowerPCCPU cpu;
171 PPCUIC uic;
172 Ppc405CpcState cpc;
173 Ppc405GptState gpt;
174 Ppc405OcmState ocm;
175 Ppc405GpioState gpio;
176 Ppc405DmaState dma;
177 PPC4xxI2CState i2c;
178 Ppc4xxEbcState ebc;
179 Ppc405OpbaState opba;
180 Ppc405PobState pob;
181 Ppc4xxPlbState plb;
182 Ppc4xxMalState mal;
183 Ppc4xxSdramDdrState sdram;
184};
185
186#endif
187