]>
Commit | Line | Data |
---|---|---|
3475187d | 1 | /* |
c7ba218d | 2 | * QEMU Sun4u/Sun4v System Emulator |
5fafdf24 | 3 | * |
3475187d | 4 | * Copyright (c) 2005 Fabrice Bellard |
5fafdf24 | 5 | * |
3475187d FB |
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | * of this software and associated documentation files (the "Software"), to deal | |
8 | * in the Software without restriction, including without limitation the rights | |
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
10 | * copies of the Software, and to permit persons to whom the Software is | |
11 | * furnished to do so, subject to the following conditions: | |
12 | * | |
13 | * The above copyright notice and this permission notice shall be included in | |
14 | * all copies or substantial portions of the Software. | |
15 | * | |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
22 | * THE SOFTWARE. | |
23 | */ | |
db5ebe5f | 24 | #include "qemu/osdep.h" |
0a2e467b | 25 | #include "qemu/units.h" |
29bd7231 | 26 | #include "qemu/error-report.h" |
da34e65c | 27 | #include "qapi/error.h" |
4771d756 PB |
28 | #include "qemu-common.h" |
29 | #include "cpu.h" | |
83c9f4ca PB |
30 | #include "hw/hw.h" |
31 | #include "hw/pci/pci.h" | |
4272ad40 | 32 | #include "hw/pci/pci_bridge.h" |
6864fa38 | 33 | #include "hw/pci/pci_bus.h" |
0ea833c2 | 34 | #include "hw/pci/pci_host.h" |
9b301794 | 35 | #include "hw/pci-host/sabre.h" |
0d09e41a | 36 | #include "hw/char/serial.h" |
bb3d5ea8 | 37 | #include "hw/char/parallel.h" |
0d09e41a | 38 | #include "hw/timer/m48t59.h" |
47973a2d | 39 | #include "hw/input/i8042.h" |
0d09e41a | 40 | #include "hw/block/fdc.h" |
1422e32d | 41 | #include "net/net.h" |
1de7afc9 | 42 | #include "qemu/timer.h" |
9c17d615 | 43 | #include "sysemu/sysemu.h" |
83c9f4ca | 44 | #include "hw/boards.h" |
c6363bae | 45 | #include "hw/nvram/sun_nvram.h" |
2024c014 | 46 | #include "hw/nvram/chrp_nvram.h" |
fff54d22 | 47 | #include "hw/sparc/sparc64.h" |
0d09e41a | 48 | #include "hw/nvram/fw_cfg.h" |
83c9f4ca PB |
49 | #include "hw/sysbus.h" |
50 | #include "hw/ide.h" | |
6864fa38 | 51 | #include "hw/ide/pci.h" |
83c9f4ca | 52 | #include "hw/loader.h" |
0a1d5c45 | 53 | #include "hw/fw-path-provider.h" |
ca20cf32 | 54 | #include "elf.h" |
69520948 | 55 | #include "trace.h" |
3475187d | 56 | |
83469015 FB |
57 | #define KERNEL_LOAD_ADDR 0x00404000 |
58 | #define CMDLINE_ADDR 0x003ff000 | |
0a2e467b | 59 | #define PROM_SIZE_MAX (4 * MiB) |
f930d07e | 60 | #define PROM_VADDR 0x000ffd00000ULL |
5795162a MCA |
61 | #define PBM_SPECIAL_BASE 0x1fe00000000ULL |
62 | #define PBM_MEM_BASE 0x1ff00000000ULL | |
63 | #define PBM_PCI_IO_BASE (PBM_SPECIAL_BASE + 0x02000000ULL) | |
f930d07e | 64 | #define PROM_FILENAME "openbios-sparc64" |
83469015 | 65 | #define NVRAM_SIZE 0x2000 |
e4bcb14c | 66 | #define MAX_IDE_BUS 2 |
3cce6243 | 67 | #define BIOS_CFG_IOPORT 0x510 |
7589690c BS |
68 | #define FW_CFG_SPARC64_WIDTH (FW_CFG_ARCH_LOCAL + 0x00) |
69 | #define FW_CFG_SPARC64_HEIGHT (FW_CFG_ARCH_LOCAL + 0x01) | |
70 | #define FW_CFG_SPARC64_DEPTH (FW_CFG_ARCH_LOCAL + 0x02) | |
3475187d | 71 | |
852e82f3 | 72 | #define IVEC_MAX 0x40 |
9d926598 | 73 | |
c7ba218d | 74 | struct hwdef { |
905fdcb5 | 75 | uint16_t machine_id; |
e87231d4 BS |
76 | uint64_t prom_addr; |
77 | uint64_t console_serial_base; | |
c7ba218d BS |
78 | }; |
79 | ||
c5e6fb7e | 80 | typedef struct EbusState { |
ad6856e8 MCA |
81 | /*< private >*/ |
82 | PCIDevice parent_obj; | |
83 | ||
8c40b8d9 | 84 | ISABus *isa_bus; |
4b10c8d7 | 85 | qemu_irq isa_bus_irqs[ISA_NUM_IRQS]; |
0fe22ffb | 86 | uint64_t console_serial_base; |
c5e6fb7e AK |
87 | MemoryRegion bar0; |
88 | MemoryRegion bar1; | |
89 | } EbusState; | |
90 | ||
ad6856e8 MCA |
91 | #define TYPE_EBUS "ebus" |
92 | #define EBUS(obj) OBJECT_CHECK(EbusState, (obj), TYPE_EBUS) | |
93 | ||
a2b45ea5 PMD |
94 | const char *fw_cfg_arch_key_name(uint16_t key) |
95 | { | |
96 | static const struct { | |
97 | uint16_t key; | |
98 | const char *name; | |
99 | } fw_cfg_arch_wellknown_keys[] = { | |
100 | {FW_CFG_SPARC64_WIDTH, "width"}, | |
101 | {FW_CFG_SPARC64_HEIGHT, "height"}, | |
102 | {FW_CFG_SPARC64_DEPTH, "depth"}, | |
103 | }; | |
104 | ||
105 | for (size_t i = 0; i < ARRAY_SIZE(fw_cfg_arch_wellknown_keys); i++) { | |
106 | if (fw_cfg_arch_wellknown_keys[i].key == key) { | |
107 | return fw_cfg_arch_wellknown_keys[i].name; | |
108 | } | |
109 | } | |
110 | return NULL; | |
111 | } | |
112 | ||
ddcd5531 GA |
113 | static void fw_cfg_boot_set(void *opaque, const char *boot_device, |
114 | Error **errp) | |
81864572 | 115 | { |
48779e50 | 116 | fw_cfg_modify_i16(opaque, FW_CFG_BOOT_DEVICE, boot_device[0]); |
81864572 BS |
117 | } |
118 | ||
31688246 | 119 | static int sun4u_NVRAM_set_params(Nvram *nvram, uint16_t NVRAM_size, |
43a34704 BS |
120 | const char *arch, ram_addr_t RAM_size, |
121 | const char *boot_devices, | |
122 | uint32_t kernel_image, uint32_t kernel_size, | |
123 | const char *cmdline, | |
124 | uint32_t initrd_image, uint32_t initrd_size, | |
125 | uint32_t NVRAM_image, | |
126 | int width, int height, int depth, | |
127 | const uint8_t *macaddr) | |
83469015 | 128 | { |
66508601 | 129 | unsigned int i; |
2024c014 | 130 | int sysp_end; |
d2c63fc1 | 131 | uint8_t image[0x1ff0]; |
31688246 | 132 | NvramClass *k = NVRAM_GET_CLASS(nvram); |
d2c63fc1 BS |
133 | |
134 | memset(image, '\0', sizeof(image)); | |
135 | ||
2024c014 TH |
136 | /* OpenBIOS nvram variables partition */ |
137 | sysp_end = chrp_nvram_create_system_partition(image, 0); | |
83469015 | 138 | |
2024c014 TH |
139 | /* Free space partition */ |
140 | chrp_nvram_create_free_partition(&image[sysp_end], 0x1fd0 - sysp_end); | |
d2c63fc1 | 141 | |
0d31cb99 BS |
142 | Sun_init_header((struct Sun_nvram *)&image[0x1fd8], macaddr, 0x80); |
143 | ||
31688246 HP |
144 | for (i = 0; i < sizeof(image); i++) { |
145 | (k->write)(nvram, i, image[i]); | |
146 | } | |
66508601 | 147 | |
83469015 | 148 | return 0; |
3475187d | 149 | } |
5f2bf0fe BS |
150 | |
151 | static uint64_t sun4u_load_kernel(const char *kernel_filename, | |
152 | const char *initrd_filename, | |
153 | ram_addr_t RAM_size, uint64_t *initrd_size, | |
154 | uint64_t *initrd_addr, uint64_t *kernel_addr, | |
155 | uint64_t *kernel_entry) | |
636aa70a BS |
156 | { |
157 | int linux_boot; | |
158 | unsigned int i; | |
159 | long kernel_size; | |
6908d9ce | 160 | uint8_t *ptr; |
3ac24188 | 161 | uint64_t kernel_top = 0; |
636aa70a BS |
162 | |
163 | linux_boot = (kernel_filename != NULL); | |
164 | ||
165 | kernel_size = 0; | |
166 | if (linux_boot) { | |
ca20cf32 BS |
167 | int bswap_needed; |
168 | ||
169 | #ifdef BSWAP_NEEDED | |
170 | bswap_needed = 1; | |
171 | #else | |
172 | bswap_needed = 0; | |
173 | #endif | |
4366e1db | 174 | kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, kernel_entry, |
7ef295ea | 175 | kernel_addr, &kernel_top, 1, EM_SPARCV9, 0, 0); |
5f2bf0fe BS |
176 | if (kernel_size < 0) { |
177 | *kernel_addr = KERNEL_LOAD_ADDR; | |
178 | *kernel_entry = KERNEL_LOAD_ADDR; | |
636aa70a | 179 | kernel_size = load_aout(kernel_filename, KERNEL_LOAD_ADDR, |
ca20cf32 BS |
180 | RAM_size - KERNEL_LOAD_ADDR, bswap_needed, |
181 | TARGET_PAGE_SIZE); | |
5f2bf0fe BS |
182 | } |
183 | if (kernel_size < 0) { | |
636aa70a BS |
184 | kernel_size = load_image_targphys(kernel_filename, |
185 | KERNEL_LOAD_ADDR, | |
186 | RAM_size - KERNEL_LOAD_ADDR); | |
5f2bf0fe | 187 | } |
636aa70a | 188 | if (kernel_size < 0) { |
29bd7231 | 189 | error_report("could not load kernel '%s'", kernel_filename); |
636aa70a BS |
190 | exit(1); |
191 | } | |
5f2bf0fe | 192 | /* load initrd above kernel */ |
636aa70a | 193 | *initrd_size = 0; |
3ac24188 | 194 | if (initrd_filename && kernel_top) { |
5f2bf0fe BS |
195 | *initrd_addr = TARGET_PAGE_ALIGN(kernel_top); |
196 | ||
636aa70a | 197 | *initrd_size = load_image_targphys(initrd_filename, |
5f2bf0fe BS |
198 | *initrd_addr, |
199 | RAM_size - *initrd_addr); | |
200 | if ((int)*initrd_size < 0) { | |
29bd7231 AF |
201 | error_report("could not load initial ram disk '%s'", |
202 | initrd_filename); | |
636aa70a BS |
203 | exit(1); |
204 | } | |
205 | } | |
206 | if (*initrd_size > 0) { | |
207 | for (i = 0; i < 64 * TARGET_PAGE_SIZE; i += TARGET_PAGE_SIZE) { | |
0f0f8b61 TH |
208 | ptr = rom_ptr(*kernel_addr + i, 32); |
209 | if (ptr && ldl_p(ptr + 8) == 0x48647253) { /* HdrS */ | |
5f2bf0fe | 210 | stl_p(ptr + 24, *initrd_addr + *kernel_addr); |
6908d9ce | 211 | stl_p(ptr + 28, *initrd_size); |
636aa70a BS |
212 | break; |
213 | } | |
214 | } | |
215 | } | |
216 | } | |
217 | return kernel_size; | |
218 | } | |
3475187d | 219 | |
e87231d4 | 220 | typedef struct ResetData { |
403d7a2d | 221 | SPARCCPU *cpu; |
44a99354 | 222 | uint64_t prom_addr; |
e87231d4 BS |
223 | } ResetData; |
224 | ||
25c5d5ac MCA |
225 | #define TYPE_SUN4U_POWER "power" |
226 | #define SUN4U_POWER(obj) OBJECT_CHECK(PowerDevice, (obj), TYPE_SUN4U_POWER) | |
227 | ||
228 | typedef struct PowerDevice { | |
229 | SysBusDevice parent_obj; | |
230 | ||
231 | MemoryRegion power_mmio; | |
232 | } PowerDevice; | |
233 | ||
234 | /* Power */ | |
ad280559 PP |
235 | static uint64_t power_mem_read(void *opaque, hwaddr addr, unsigned size) |
236 | { | |
237 | return 0; | |
238 | } | |
239 | ||
25c5d5ac MCA |
240 | static void power_mem_write(void *opaque, hwaddr addr, |
241 | uint64_t val, unsigned size) | |
242 | { | |
243 | /* According to a real Ultra 5, bit 24 controls the power */ | |
244 | if (val & 0x1000000) { | |
245 | qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); | |
246 | } | |
247 | } | |
248 | ||
249 | static const MemoryRegionOps power_mem_ops = { | |
ad280559 | 250 | .read = power_mem_read, |
25c5d5ac MCA |
251 | .write = power_mem_write, |
252 | .endianness = DEVICE_NATIVE_ENDIAN, | |
253 | .valid = { | |
254 | .min_access_size = 4, | |
255 | .max_access_size = 4, | |
256 | }, | |
257 | }; | |
258 | ||
259 | static void power_realize(DeviceState *dev, Error **errp) | |
260 | { | |
261 | PowerDevice *d = SUN4U_POWER(dev); | |
262 | SysBusDevice *sbd = SYS_BUS_DEVICE(dev); | |
263 | ||
264 | memory_region_init_io(&d->power_mmio, OBJECT(dev), &power_mem_ops, d, | |
265 | "power", sizeof(uint32_t)); | |
266 | ||
267 | sysbus_init_mmio(sbd, &d->power_mmio); | |
268 | } | |
269 | ||
270 | static void power_class_init(ObjectClass *klass, void *data) | |
271 | { | |
272 | DeviceClass *dc = DEVICE_CLASS(klass); | |
273 | ||
274 | dc->realize = power_realize; | |
275 | } | |
276 | ||
277 | static const TypeInfo power_info = { | |
278 | .name = TYPE_SUN4U_POWER, | |
279 | .parent = TYPE_SYS_BUS_DEVICE, | |
280 | .instance_size = sizeof(PowerDevice), | |
281 | .class_init = power_class_init, | |
282 | }; | |
283 | ||
4b10c8d7 | 284 | static void ebus_isa_irq_handler(void *opaque, int n, int level) |
1387fe4a | 285 | { |
4b10c8d7 MCA |
286 | EbusState *s = EBUS(opaque); |
287 | qemu_irq irq = s->isa_bus_irqs[n]; | |
288 | ||
289 | /* Pass ISA bus IRQs onto their gpio equivalent */ | |
69520948 | 290 | trace_ebus_isa_irq_handler(n, level); |
4b10c8d7 MCA |
291 | if (irq) { |
292 | qemu_set_irq(irq, level); | |
361dea40 | 293 | } |
1387fe4a BS |
294 | } |
295 | ||
c190ea07 | 296 | /* EBUS (Eight bit bus) bridge */ |
ad6856e8 | 297 | static void ebus_realize(PCIDevice *pci_dev, Error **errp) |
53e3c4f9 | 298 | { |
ad6856e8 | 299 | EbusState *s = EBUS(pci_dev); |
25c5d5ac | 300 | SysBusDevice *sbd; |
0fe22ffb | 301 | DeviceState *dev; |
c796edda | 302 | qemu_irq *isa_irq; |
0fe22ffb MCA |
303 | DriveInfo *fd[MAX_FD]; |
304 | int i; | |
c5e6fb7e | 305 | |
8c40b8d9 MCA |
306 | s->isa_bus = isa_bus_new(DEVICE(pci_dev), get_system_memory(), |
307 | pci_address_space_io(pci_dev), errp); | |
308 | if (!s->isa_bus) { | |
309 | error_setg(errp, "unable to instantiate EBUS ISA bus"); | |
d10e5432 MA |
310 | return; |
311 | } | |
c5e6fb7e | 312 | |
4b10c8d7 MCA |
313 | /* ISA bus */ |
314 | isa_irq = qemu_allocate_irqs(ebus_isa_irq_handler, s, ISA_NUM_IRQS); | |
c796edda | 315 | isa_bus_irqs(s->isa_bus, isa_irq); |
4b10c8d7 MCA |
316 | qdev_init_gpio_out_named(DEVICE(s), s->isa_bus_irqs, "isa-irq", |
317 | ISA_NUM_IRQS); | |
c796edda | 318 | |
0fe22ffb MCA |
319 | /* Serial ports */ |
320 | i = 0; | |
321 | if (s->console_serial_base) { | |
322 | serial_mm_init(pci_address_space(pci_dev), s->console_serial_base, | |
9bca0edb | 323 | 0, NULL, 115200, serial_hd(i), DEVICE_BIG_ENDIAN); |
0fe22ffb MCA |
324 | i++; |
325 | } | |
def337ff | 326 | serial_hds_isa_init(s->isa_bus, i, MAX_ISA_SERIAL_PORTS); |
0fe22ffb MCA |
327 | |
328 | /* Parallel ports */ | |
329 | parallel_hds_isa_init(s->isa_bus, MAX_PARALLEL_PORTS); | |
330 | ||
331 | /* Keyboard */ | |
332 | isa_create_simple(s->isa_bus, "i8042"); | |
333 | ||
334 | /* Floppy */ | |
335 | for (i = 0; i < MAX_FD; i++) { | |
336 | fd[i] = drive_get(IF_FLOPPY, 0, i); | |
337 | } | |
338 | dev = DEVICE(isa_create(s->isa_bus, TYPE_ISA_FDC)); | |
339 | if (fd[0]) { | |
340 | qdev_prop_set_drive(dev, "driveA", blk_by_legacy_dinfo(fd[0]), | |
341 | &error_abort); | |
342 | } | |
343 | if (fd[1]) { | |
344 | qdev_prop_set_drive(dev, "driveB", blk_by_legacy_dinfo(fd[1]), | |
345 | &error_abort); | |
346 | } | |
347 | qdev_prop_set_uint32(dev, "dma", -1); | |
348 | qdev_init_nofail(dev); | |
349 | ||
25c5d5ac MCA |
350 | /* Power */ |
351 | dev = qdev_create(NULL, TYPE_SUN4U_POWER); | |
352 | qdev_init_nofail(dev); | |
353 | sbd = SYS_BUS_DEVICE(dev); | |
354 | memory_region_add_subregion(pci_address_space_io(pci_dev), 0x7240, | |
355 | sysbus_mmio_get_region(sbd, 0)); | |
356 | ||
0fe22ffb | 357 | /* PCI */ |
c5e6fb7e AK |
358 | pci_dev->config[0x04] = 0x06; // command = bus master, pci mem |
359 | pci_dev->config[0x05] = 0x00; | |
360 | pci_dev->config[0x06] = 0xa0; // status = fast back-to-back, 66MHz, no error | |
361 | pci_dev->config[0x07] = 0x03; // status = medium devsel | |
362 | pci_dev->config[0x09] = 0x00; // programming i/f | |
363 | pci_dev->config[0x0D] = 0x0a; // latency_timer | |
364 | ||
0a70e094 PB |
365 | memory_region_init_alias(&s->bar0, OBJECT(s), "bar0", get_system_io(), |
366 | 0, 0x1000000); | |
e824b2cc | 367 | pci_register_bar(pci_dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->bar0); |
0a70e094 | 368 | memory_region_init_alias(&s->bar1, OBJECT(s), "bar1", get_system_io(), |
25c5d5ac | 369 | 0, 0x8000); |
a1cf8be5 | 370 | pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &s->bar1); |
c190ea07 BS |
371 | } |
372 | ||
0fe22ffb MCA |
373 | static Property ebus_properties[] = { |
374 | DEFINE_PROP_UINT64("console-serial-base", EbusState, | |
375 | console_serial_base, 0), | |
376 | DEFINE_PROP_END_OF_LIST(), | |
377 | }; | |
378 | ||
40021f08 AL |
379 | static void ebus_class_init(ObjectClass *klass, void *data) |
380 | { | |
381 | PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); | |
0fe22ffb | 382 | DeviceClass *dc = DEVICE_CLASS(klass); |
40021f08 | 383 | |
ad6856e8 | 384 | k->realize = ebus_realize; |
40021f08 AL |
385 | k->vendor_id = PCI_VENDOR_ID_SUN; |
386 | k->device_id = PCI_DEVICE_ID_SUN_EBUS; | |
387 | k->revision = 0x01; | |
388 | k->class_id = PCI_CLASS_BRIDGE_OTHER; | |
0fe22ffb | 389 | dc->props = ebus_properties; |
40021f08 AL |
390 | } |
391 | ||
8c43a6f0 | 392 | static const TypeInfo ebus_info = { |
ad6856e8 | 393 | .name = TYPE_EBUS, |
39bffca2 | 394 | .parent = TYPE_PCI_DEVICE, |
39bffca2 | 395 | .class_init = ebus_class_init, |
ad6856e8 | 396 | .instance_size = sizeof(EbusState), |
fd3b02c8 EH |
397 | .interfaces = (InterfaceInfo[]) { |
398 | { INTERFACE_CONVENTIONAL_PCI_DEVICE }, | |
399 | { }, | |
400 | }, | |
53e3c4f9 BS |
401 | }; |
402 | ||
13575cf6 AF |
403 | #define TYPE_OPENPROM "openprom" |
404 | #define OPENPROM(obj) OBJECT_CHECK(PROMState, (obj), TYPE_OPENPROM) | |
405 | ||
d4edce38 | 406 | typedef struct PROMState { |
13575cf6 AF |
407 | SysBusDevice parent_obj; |
408 | ||
d4edce38 AK |
409 | MemoryRegion prom; |
410 | } PROMState; | |
411 | ||
409dbce5 AJ |
412 | static uint64_t translate_prom_address(void *opaque, uint64_t addr) |
413 | { | |
a8170e5e | 414 | hwaddr *base_addr = (hwaddr *)opaque; |
409dbce5 AJ |
415 | return addr + *base_addr - PROM_VADDR; |
416 | } | |
417 | ||
1baffa46 | 418 | /* Boot PROM (OpenBIOS) */ |
a8170e5e | 419 | static void prom_init(hwaddr addr, const char *bios_name) |
1baffa46 BS |
420 | { |
421 | DeviceState *dev; | |
422 | SysBusDevice *s; | |
423 | char *filename; | |
424 | int ret; | |
425 | ||
13575cf6 | 426 | dev = qdev_create(NULL, TYPE_OPENPROM); |
e23a1b33 | 427 | qdev_init_nofail(dev); |
1356b98d | 428 | s = SYS_BUS_DEVICE(dev); |
1baffa46 BS |
429 | |
430 | sysbus_mmio_map(s, 0, addr); | |
431 | ||
432 | /* load boot prom */ | |
433 | if (bios_name == NULL) { | |
434 | bios_name = PROM_FILENAME; | |
435 | } | |
436 | filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); | |
437 | if (filename) { | |
4366e1db | 438 | ret = load_elf(filename, NULL, translate_prom_address, &addr, |
7ef295ea | 439 | NULL, NULL, NULL, 1, EM_SPARCV9, 0, 0); |
1baffa46 BS |
440 | if (ret < 0 || ret > PROM_SIZE_MAX) { |
441 | ret = load_image_targphys(filename, addr, PROM_SIZE_MAX); | |
442 | } | |
7267c094 | 443 | g_free(filename); |
1baffa46 BS |
444 | } else { |
445 | ret = -1; | |
446 | } | |
447 | if (ret < 0 || ret > PROM_SIZE_MAX) { | |
29bd7231 | 448 | error_report("could not load prom '%s'", bios_name); |
1baffa46 BS |
449 | exit(1); |
450 | } | |
451 | } | |
452 | ||
92b19880 | 453 | static void prom_realize(DeviceState *ds, Error **errp) |
1baffa46 | 454 | { |
92b19880 TH |
455 | PROMState *s = OPENPROM(ds); |
456 | SysBusDevice *dev = SYS_BUS_DEVICE(ds); | |
457 | Error *local_err = NULL; | |
458 | ||
459 | memory_region_init_ram_nomigrate(&s->prom, OBJECT(ds), "sun4u.prom", | |
460 | PROM_SIZE_MAX, &local_err); | |
461 | if (local_err) { | |
462 | error_propagate(errp, local_err); | |
463 | return; | |
464 | } | |
1baffa46 | 465 | |
c5705a77 | 466 | vmstate_register_ram_global(&s->prom); |
d4edce38 | 467 | memory_region_set_readonly(&s->prom, true); |
750ecd44 | 468 | sysbus_init_mmio(dev, &s->prom); |
1baffa46 BS |
469 | } |
470 | ||
999e12bb AL |
471 | static Property prom_properties[] = { |
472 | {/* end of property list */}, | |
473 | }; | |
474 | ||
475 | static void prom_class_init(ObjectClass *klass, void *data) | |
476 | { | |
39bffca2 | 477 | DeviceClass *dc = DEVICE_CLASS(klass); |
999e12bb | 478 | |
39bffca2 | 479 | dc->props = prom_properties; |
92b19880 | 480 | dc->realize = prom_realize; |
999e12bb AL |
481 | } |
482 | ||
8c43a6f0 | 483 | static const TypeInfo prom_info = { |
13575cf6 | 484 | .name = TYPE_OPENPROM, |
39bffca2 AL |
485 | .parent = TYPE_SYS_BUS_DEVICE, |
486 | .instance_size = sizeof(PROMState), | |
487 | .class_init = prom_class_init, | |
1baffa46 BS |
488 | }; |
489 | ||
bda42033 | 490 | |
88c034d5 AF |
491 | #define TYPE_SUN4U_MEMORY "memory" |
492 | #define SUN4U_RAM(obj) OBJECT_CHECK(RamDevice, (obj), TYPE_SUN4U_MEMORY) | |
493 | ||
494 | typedef struct RamDevice { | |
495 | SysBusDevice parent_obj; | |
496 | ||
d4edce38 | 497 | MemoryRegion ram; |
04843626 | 498 | uint64_t size; |
bda42033 BS |
499 | } RamDevice; |
500 | ||
501 | /* System RAM */ | |
78fb261d | 502 | static void ram_realize(DeviceState *dev, Error **errp) |
bda42033 | 503 | { |
88c034d5 | 504 | RamDevice *d = SUN4U_RAM(dev); |
78fb261d | 505 | SysBusDevice *sbd = SYS_BUS_DEVICE(dev); |
bda42033 | 506 | |
1cfe48c1 | 507 | memory_region_init_ram_nomigrate(&d->ram, OBJECT(d), "sun4u.ram", d->size, |
f8ed85ac | 508 | &error_fatal); |
c5705a77 | 509 | vmstate_register_ram_global(&d->ram); |
78fb261d | 510 | sysbus_init_mmio(sbd, &d->ram); |
bda42033 BS |
511 | } |
512 | ||
a8170e5e | 513 | static void ram_init(hwaddr addr, ram_addr_t RAM_size) |
bda42033 BS |
514 | { |
515 | DeviceState *dev; | |
516 | SysBusDevice *s; | |
517 | RamDevice *d; | |
518 | ||
519 | /* allocate RAM */ | |
88c034d5 | 520 | dev = qdev_create(NULL, TYPE_SUN4U_MEMORY); |
1356b98d | 521 | s = SYS_BUS_DEVICE(dev); |
bda42033 | 522 | |
88c034d5 | 523 | d = SUN4U_RAM(dev); |
bda42033 | 524 | d->size = RAM_size; |
e23a1b33 | 525 | qdev_init_nofail(dev); |
bda42033 BS |
526 | |
527 | sysbus_mmio_map(s, 0, addr); | |
528 | } | |
529 | ||
999e12bb AL |
530 | static Property ram_properties[] = { |
531 | DEFINE_PROP_UINT64("size", RamDevice, size, 0), | |
532 | DEFINE_PROP_END_OF_LIST(), | |
533 | }; | |
534 | ||
535 | static void ram_class_init(ObjectClass *klass, void *data) | |
536 | { | |
39bffca2 | 537 | DeviceClass *dc = DEVICE_CLASS(klass); |
999e12bb | 538 | |
78fb261d | 539 | dc->realize = ram_realize; |
39bffca2 | 540 | dc->props = ram_properties; |
999e12bb AL |
541 | } |
542 | ||
8c43a6f0 | 543 | static const TypeInfo ram_info = { |
88c034d5 | 544 | .name = TYPE_SUN4U_MEMORY, |
39bffca2 AL |
545 | .parent = TYPE_SYS_BUS_DEVICE, |
546 | .instance_size = sizeof(RamDevice), | |
547 | .class_init = ram_class_init, | |
bda42033 BS |
548 | }; |
549 | ||
38bc50f7 | 550 | static void sun4uv_init(MemoryRegion *address_space_mem, |
3ef96221 | 551 | MachineState *machine, |
7b833f5b BS |
552 | const struct hwdef *hwdef) |
553 | { | |
f9d1465f | 554 | SPARCCPU *cpu; |
31688246 | 555 | Nvram *nvram; |
7b833f5b | 556 | unsigned int i; |
5f2bf0fe | 557 | uint64_t initrd_addr, initrd_size, kernel_addr, kernel_size, kernel_entry; |
5795162a | 558 | SabreState *sabre; |
311f2b7a | 559 | PCIBus *pci_bus, *pci_busA, *pci_busB; |
8d932971 | 560 | PCIDevice *ebus, *pci_dev; |
f3b18f35 | 561 | SysBusDevice *s; |
f455e98c | 562 | DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; |
aea5b071 | 563 | DeviceState *iommu, *dev; |
a88b362c | 564 | FWCfgState *fw_cfg; |
8d932971 | 565 | NICInfo *nd; |
6864fa38 MCA |
566 | MACAddr macaddr; |
567 | bool onboard_nic; | |
7b833f5b | 568 | |
7b833f5b | 569 | /* init CPUs */ |
58530461 | 570 | cpu = sparc64_cpu_devinit(machine->cpu_type, hwdef->prom_addr); |
7b833f5b | 571 | |
aea5b071 MCA |
572 | /* IOMMU */ |
573 | iommu = qdev_create(NULL, TYPE_SUN4U_IOMMU); | |
574 | qdev_init_nofail(iommu); | |
575 | ||
bda42033 | 576 | /* set up devices */ |
3ef96221 | 577 | ram_init(0, machine->ram_size); |
3475187d | 578 | |
1baffa46 | 579 | prom_init(hwdef->prom_addr, bios_name); |
3475187d | 580 | |
b14dcaf4 | 581 | /* Init sabre (PCI host bridge) */ |
5795162a MCA |
582 | sabre = SABRE_DEVICE(qdev_create(NULL, TYPE_SABRE)); |
583 | qdev_prop_set_uint64(DEVICE(sabre), "special-base", PBM_SPECIAL_BASE); | |
584 | qdev_prop_set_uint64(DEVICE(sabre), "mem-base", PBM_MEM_BASE); | |
585 | object_property_set_link(OBJECT(sabre), OBJECT(iommu), "iommu", | |
586 | &error_abort); | |
587 | qdev_init_nofail(DEVICE(sabre)); | |
2a4d6af5 MCA |
588 | |
589 | /* Wire up PCI interrupts to CPU */ | |
590 | for (i = 0; i < IVEC_MAX; i++) { | |
5795162a | 591 | qdev_connect_gpio_out_named(DEVICE(sabre), "ivec-irq", i, |
2a4d6af5 MCA |
592 | qdev_get_gpio_in_named(DEVICE(cpu), "ivec-irq", i)); |
593 | } | |
594 | ||
5795162a MCA |
595 | pci_bus = PCI_HOST_BRIDGE(sabre)->bus; |
596 | pci_busA = pci_bridge_get_sec_bus(sabre->bridgeA); | |
597 | pci_busB = pci_bridge_get_sec_bus(sabre->bridgeB); | |
83469015 | 598 | |
5795162a | 599 | /* Only in-built Simba APBs can exist on the root bus, slot 0 on busA is |
6864fa38 MCA |
600 | reserved (leaving no slots free after on-board devices) however slots |
601 | 0-3 are free on busB */ | |
602 | pci_bus->slot_reserved_mask = 0xfffffffc; | |
603 | pci_busA->slot_reserved_mask = 0xfffffff1; | |
604 | pci_busB->slot_reserved_mask = 0xfffffff0; | |
605 | ||
ad6856e8 | 606 | ebus = pci_create_multifunction(pci_busA, PCI_DEVFN(1, 0), true, TYPE_EBUS); |
0fe22ffb MCA |
607 | qdev_prop_set_uint64(DEVICE(ebus), "console-serial-base", |
608 | hwdef->console_serial_base); | |
6864fa38 MCA |
609 | qdev_init_nofail(DEVICE(ebus)); |
610 | ||
5795162a | 611 | /* Wire up "well-known" ISA IRQs to PBM legacy obio IRQs */ |
4b10c8d7 | 612 | qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 7, |
5795162a | 613 | qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_LPT_IRQ)); |
4b10c8d7 | 614 | qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 6, |
5795162a | 615 | qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_FDD_IRQ)); |
4b10c8d7 | 616 | qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 1, |
5795162a | 617 | qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_KBD_IRQ)); |
4b10c8d7 | 618 | qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 12, |
5795162a | 619 | qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_MSE_IRQ)); |
4b10c8d7 | 620 | qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 4, |
5795162a | 621 | qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_SER_IRQ)); |
4b10c8d7 | 622 | |
c3019efc TH |
623 | switch (vga_interface_type) { |
624 | case VGA_STD: | |
625 | pci_create_simple(pci_busA, PCI_DEVFN(2, 0), "VGA"); | |
626 | break; | |
627 | case VGA_NONE: | |
628 | break; | |
629 | default: | |
630 | abort(); /* Should not happen - types are checked in vl.c already */ | |
631 | } | |
6864fa38 MCA |
632 | |
633 | memset(&macaddr, 0, sizeof(MACAddr)); | |
634 | onboard_nic = false; | |
8d932971 MCA |
635 | for (i = 0; i < nb_nics; i++) { |
636 | nd = &nd_table[i]; | |
637 | ||
6864fa38 MCA |
638 | if (!nd->model || strcmp(nd->model, "sunhme") == 0) { |
639 | if (!onboard_nic) { | |
640 | pci_dev = pci_create_multifunction(pci_busA, PCI_DEVFN(1, 1), | |
641 | true, "sunhme"); | |
642 | memcpy(&macaddr, &nd->macaddr.a, sizeof(MACAddr)); | |
643 | onboard_nic = true; | |
644 | } else { | |
bcf9e2c2 | 645 | pci_dev = pci_create(pci_busB, -1, "sunhme"); |
6864fa38 | 646 | } |
8d932971 | 647 | } else { |
bcf9e2c2 | 648 | pci_dev = pci_create(pci_busB, -1, nd->model); |
8d932971 | 649 | } |
6864fa38 MCA |
650 | |
651 | dev = &pci_dev->qdev; | |
652 | qdev_set_nic_properties(dev, nd); | |
653 | qdev_init_nofail(dev); | |
654 | } | |
655 | ||
656 | /* If we don't have an onboard NIC, grab a default MAC address so that | |
657 | * we have a valid machine id */ | |
658 | if (!onboard_nic) { | |
659 | qemu_macaddr_default_if_unset(&macaddr); | |
8d932971 | 660 | } |
83469015 | 661 | |
d8f94e1b | 662 | ide_drive_get(hd, ARRAY_SIZE(hd)); |
e4bcb14c | 663 | |
6864fa38 MCA |
664 | pci_dev = pci_create(pci_busA, PCI_DEVFN(3, 0), "cmd646-ide"); |
665 | qdev_prop_set_uint32(&pci_dev->qdev, "secondary", 1); | |
666 | qdev_init_nofail(&pci_dev->qdev); | |
667 | pci_ide_create_devs(pci_dev, hd); | |
3b898dda | 668 | |
f3b18f35 MCA |
669 | /* Map NVRAM into I/O (ebus) space */ |
670 | nvram = m48t59_init(NULL, 0, 0, NVRAM_SIZE, 1968, 59); | |
671 | s = SYS_BUS_DEVICE(nvram); | |
07c84741 | 672 | memory_region_add_subregion(pci_address_space_io(ebus), 0x2000, |
f3b18f35 MCA |
673 | sysbus_mmio_get_region(s, 0)); |
674 | ||
636aa70a | 675 | initrd_size = 0; |
5f2bf0fe | 676 | initrd_addr = 0; |
3ef96221 MA |
677 | kernel_size = sun4u_load_kernel(machine->kernel_filename, |
678 | machine->initrd_filename, | |
5f2bf0fe BS |
679 | ram_size, &initrd_size, &initrd_addr, |
680 | &kernel_addr, &kernel_entry); | |
636aa70a | 681 | |
3ef96221 MA |
682 | sun4u_NVRAM_set_params(nvram, NVRAM_SIZE, "Sun4u", machine->ram_size, |
683 | machine->boot_order, | |
5f2bf0fe | 684 | kernel_addr, kernel_size, |
3ef96221 | 685 | machine->kernel_cmdline, |
5f2bf0fe | 686 | initrd_addr, initrd_size, |
0d31cb99 BS |
687 | /* XXX: need an option to load a NVRAM image */ |
688 | 0, | |
689 | graphic_width, graphic_height, graphic_depth, | |
6864fa38 | 690 | (uint8_t *)&macaddr); |
83469015 | 691 | |
d6acc8a5 MCA |
692 | dev = qdev_create(NULL, TYPE_FW_CFG_IO); |
693 | qdev_prop_set_bit(dev, "dma_enabled", false); | |
07c84741 | 694 | object_property_add_child(OBJECT(ebus), TYPE_FW_CFG, OBJECT(dev), NULL); |
d6acc8a5 | 695 | qdev_init_nofail(dev); |
07c84741 | 696 | memory_region_add_subregion(pci_address_space_io(ebus), BIOS_CFG_IOPORT, |
d6acc8a5 MCA |
697 | &FW_CFG_IO(dev)->comb_iomem); |
698 | ||
699 | fw_cfg = FW_CFG(dev); | |
33decbd2 LX |
700 | fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); |
701 | fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpus); | |
905fdcb5 BS |
702 | fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); |
703 | fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id); | |
5f2bf0fe BS |
704 | fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_entry); |
705 | fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); | |
3ef96221 | 706 | if (machine->kernel_cmdline) { |
9c9b0512 | 707 | fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, |
3ef96221 MA |
708 | strlen(machine->kernel_cmdline) + 1); |
709 | fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, machine->kernel_cmdline); | |
513f789f | 710 | } else { |
9c9b0512 | 711 | fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, 0); |
513f789f | 712 | } |
5f2bf0fe BS |
713 | fw_cfg_add_i64(fw_cfg, FW_CFG_INITRD_ADDR, initrd_addr); |
714 | fw_cfg_add_i64(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size); | |
3ef96221 | 715 | fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, machine->boot_order[0]); |
7589690c BS |
716 | |
717 | fw_cfg_add_i16(fw_cfg, FW_CFG_SPARC64_WIDTH, graphic_width); | |
718 | fw_cfg_add_i16(fw_cfg, FW_CFG_SPARC64_HEIGHT, graphic_height); | |
719 | fw_cfg_add_i16(fw_cfg, FW_CFG_SPARC64_DEPTH, graphic_depth); | |
720 | ||
513f789f | 721 | qemu_register_boot_set(fw_cfg_boot_set, fw_cfg); |
3475187d FB |
722 | } |
723 | ||
905fdcb5 BS |
724 | enum { |
725 | sun4u_id = 0, | |
726 | sun4v_id = 64, | |
727 | }; | |
728 | ||
0a1d5c45 MCA |
729 | /* |
730 | * Implementation of an interface to adjust firmware path | |
731 | * for the bootindex property handling. | |
732 | */ | |
733 | static char *sun4u_fw_dev_path(FWPathProvider *p, BusState *bus, | |
734 | DeviceState *dev) | |
735 | { | |
736 | PCIDevice *pci; | |
737 | IDEBus *ide_bus; | |
738 | IDEState *ide_s; | |
739 | int bus_id; | |
740 | ||
741 | if (!strcmp(object_get_typename(OBJECT(dev)), "pbm-bridge")) { | |
742 | pci = PCI_DEVICE(dev); | |
743 | ||
744 | if (PCI_FUNC(pci->devfn)) { | |
745 | return g_strdup_printf("pci@%x,%x", PCI_SLOT(pci->devfn), | |
746 | PCI_FUNC(pci->devfn)); | |
747 | } else { | |
748 | return g_strdup_printf("pci@%x", PCI_SLOT(pci->devfn)); | |
749 | } | |
750 | } | |
751 | ||
752 | if (!strcmp(object_get_typename(OBJECT(dev)), "ide-drive")) { | |
753 | ide_bus = IDE_BUS(qdev_get_parent_bus(dev)); | |
754 | ide_s = idebus_active_if(ide_bus); | |
755 | bus_id = ide_bus->bus_id; | |
756 | ||
757 | if (ide_s->drive_kind == IDE_CD) { | |
758 | return g_strdup_printf("ide@%x/cdrom", bus_id); | |
759 | } | |
760 | ||
761 | return g_strdup_printf("ide@%x/disk", bus_id); | |
762 | } | |
763 | ||
764 | if (!strcmp(object_get_typename(OBJECT(dev)), "ide-hd")) { | |
765 | return g_strdup("disk"); | |
766 | } | |
767 | ||
768 | if (!strcmp(object_get_typename(OBJECT(dev)), "ide-cd")) { | |
769 | return g_strdup("cdrom"); | |
770 | } | |
771 | ||
772 | if (!strcmp(object_get_typename(OBJECT(dev)), "virtio-blk-device")) { | |
773 | return g_strdup("disk"); | |
774 | } | |
775 | ||
776 | return NULL; | |
777 | } | |
778 | ||
c7ba218d BS |
779 | static const struct hwdef hwdefs[] = { |
780 | /* Sun4u generic PC-like machine */ | |
781 | { | |
905fdcb5 | 782 | .machine_id = sun4u_id, |
e87231d4 BS |
783 | .prom_addr = 0x1fff0000000ULL, |
784 | .console_serial_base = 0, | |
c7ba218d BS |
785 | }, |
786 | /* Sun4v generic PC-like machine */ | |
787 | { | |
905fdcb5 | 788 | .machine_id = sun4v_id, |
e87231d4 BS |
789 | .prom_addr = 0x1fff0000000ULL, |
790 | .console_serial_base = 0, | |
791 | }, | |
c7ba218d BS |
792 | }; |
793 | ||
794 | /* Sun4u hardware initialisation */ | |
3ef96221 | 795 | static void sun4u_init(MachineState *machine) |
5f072e1f | 796 | { |
3ef96221 | 797 | sun4uv_init(get_system_memory(), machine, &hwdefs[0]); |
c7ba218d BS |
798 | } |
799 | ||
800 | /* Sun4v hardware initialisation */ | |
3ef96221 | 801 | static void sun4v_init(MachineState *machine) |
5f072e1f | 802 | { |
3ef96221 | 803 | sun4uv_init(get_system_memory(), machine, &hwdefs[1]); |
c7ba218d BS |
804 | } |
805 | ||
8a661aea | 806 | static void sun4u_class_init(ObjectClass *oc, void *data) |
e264d29d | 807 | { |
8a661aea | 808 | MachineClass *mc = MACHINE_CLASS(oc); |
0a1d5c45 | 809 | FWPathProviderClass *fwc = FW_PATH_PROVIDER_CLASS(oc); |
8a661aea | 810 | |
e264d29d EH |
811 | mc->desc = "Sun4u platform"; |
812 | mc->init = sun4u_init; | |
2059839b | 813 | mc->block_default_type = IF_IDE; |
e264d29d EH |
814 | mc->max_cpus = 1; /* XXX for now */ |
815 | mc->is_default = 1; | |
816 | mc->default_boot_order = "c"; | |
58530461 | 817 | mc->default_cpu_type = SPARC_CPU_TYPE_NAME("TI-UltraSparc-IIi"); |
0a1d5c45 | 818 | mc->ignore_boot_device_suffixes = true; |
9aed808e | 819 | mc->default_display = "std"; |
0a1d5c45 | 820 | fwc->get_dev_path = sun4u_fw_dev_path; |
e264d29d | 821 | } |
c7ba218d | 822 | |
8a661aea AF |
823 | static const TypeInfo sun4u_type = { |
824 | .name = MACHINE_TYPE_NAME("sun4u"), | |
825 | .parent = TYPE_MACHINE, | |
826 | .class_init = sun4u_class_init, | |
0a1d5c45 MCA |
827 | .interfaces = (InterfaceInfo[]) { |
828 | { TYPE_FW_PATH_PROVIDER }, | |
829 | { } | |
830 | }, | |
8a661aea | 831 | }; |
e87231d4 | 832 | |
8a661aea | 833 | static void sun4v_class_init(ObjectClass *oc, void *data) |
e264d29d | 834 | { |
8a661aea AF |
835 | MachineClass *mc = MACHINE_CLASS(oc); |
836 | ||
e264d29d EH |
837 | mc->desc = "Sun4v platform"; |
838 | mc->init = sun4v_init; | |
2059839b | 839 | mc->block_default_type = IF_IDE; |
e264d29d EH |
840 | mc->max_cpus = 1; /* XXX for now */ |
841 | mc->default_boot_order = "c"; | |
58530461 | 842 | mc->default_cpu_type = SPARC_CPU_TYPE_NAME("Sun-UltraSparc-T1"); |
9aed808e | 843 | mc->default_display = "std"; |
e264d29d EH |
844 | } |
845 | ||
8a661aea AF |
846 | static const TypeInfo sun4v_type = { |
847 | .name = MACHINE_TYPE_NAME("sun4v"), | |
848 | .parent = TYPE_MACHINE, | |
849 | .class_init = sun4v_class_init, | |
850 | }; | |
e264d29d | 851 | |
83f7d43a AF |
852 | static void sun4u_register_types(void) |
853 | { | |
25c5d5ac | 854 | type_register_static(&power_info); |
83f7d43a AF |
855 | type_register_static(&ebus_info); |
856 | type_register_static(&prom_info); | |
857 | type_register_static(&ram_info); | |
83f7d43a | 858 | |
8a661aea AF |
859 | type_register_static(&sun4u_type); |
860 | type_register_static(&sun4v_type); | |
8a661aea AF |
861 | } |
862 | ||
83f7d43a | 863 | type_init(sun4u_register_types) |