Lines Matching +full:d +full:- +full:tlb +full:- +full:sets

4  * Copyright (c) 2018-2021 BALATON Zoltan
17 #include "hw/or-irq.h"
18 #include "hw/pci-host/mv64361.h"
22 #include "hw/qdev-properties.h"
28 #include "hw/fw-path-provider.h"
31 #include "qemu/error-report.h"
34 #include "exec/address-spaces.h"
35 #include "qom/qom-qobject.h"
55 #define H_PRIVILEGE -3 /* Caller not privileged */
56 #define H_PARAMETER -4 /* Parameter invalid, out-of-range or conflicting */
101 cpu->env.spr[SPR_HID1] = 7ULL << 28; in pegasos2_cpu_reset()
102 if (pm->vof) { in pegasos2_cpu_reset()
103 cpu->env.gpr[1] = 2 * VOF_STACK_SIZE - 0x20; in pegasos2_cpu_reset()
104 cpu->env.nip = 0x100; in pegasos2_cpu_reset()
106 cpu_ppc_tb_reset(&cpu->env); in pegasos2_cpu_reset()
114 qemu_set_irq(pm->mv_pirq[n], level); in pegasos2_pci_irq()
115 qemu_set_irq(pm->via_pirq[n], level); in pegasos2_pci_irq()
127 const char *fwname = machine->firmware ?: PROM_FILENAME; in pegasos2_init()
134 pm->cpu = POWERPC_CPU(cpu_create(machine->cpu_type)); in pegasos2_init()
135 env = &pm->cpu->env; in pegasos2_init()
141 /* Set time-base frequency */ in pegasos2_init()
143 qemu_register_reset(pegasos2_cpu_reset, pm->cpu); in pegasos2_init()
146 if (machine->ram_size > 2 * GiB) { in pegasos2_init()
150 memory_region_add_subregion(get_system_memory(), 0, machine->ram); in pegasos2_init()
158 if (!machine->firmware && !pm->vof) { in pegasos2_init()
159 pm->vof = g_malloc0(sizeof(*pm->vof)); in pegasos2_init()
166 sz = load_image_targphys(filename, pm->vof ? 0 : PROM_ADDR, PROM_SIZE); in pegasos2_init()
173 if (pm->vof) { in pegasos2_init()
174 pm->vof->fw_size = sz; in pegasos2_init()
178 pm->mv = DEVICE(sysbus_create_simple(TYPE_MV64361, -1, in pegasos2_init()
179 qdev_get_gpio_in(DEVICE(pm->cpu), PPC6xx_INPUT_INT))); in pegasos2_init()
181 pm->mv_pirq[i] = qdev_get_gpio_in_named(pm->mv, "gpp", 12 + i); in pegasos2_init()
183 pci_bus = mv64361_get_pci_bus(pm->mv, 1); in pegasos2_init()
189 if (machine->audiodev) { in pegasos2_init()
191 qdev_prop_set_string(DEVICE(dev), "audiodev", machine->audiodev); in pegasos2_init()
196 pm->via_pirq[i] = qdev_get_gpio_in_named(DEVICE(via), "pirq", i); in pegasos2_init()
198 object_property_add_alias(OBJECT(machine), "rtc-time", in pegasos2_init()
202 qdev_get_gpio_in_named(pm->mv, "gpp", 31)); in pegasos2_init()
209 spd_data = spd_data_generate(DDR, machine->ram_size); in pegasos2_init()
218 g_autofree const char *pn = g_strdup_printf("pcihost%d", h); in pegasos2_init()
220 pd = DEVICE(object_resolve_path_component(OBJECT(pm->mv), pn)); in pegasos2_init()
223 OrIRQState *ori = &pm->orirq[i]; in pegasos2_init()
226 g_autofree const char *n = g_strdup_printf("pci-orirq[%d]", i); in pegasos2_init()
231 "num-lines", "2", NULL); in pegasos2_init()
233 qemu_init_irq(&pm->pci_irqs[i], pegasos2_pci_irq, pm, i); in pegasos2_init()
234 qdev_connect_gpio_out(DEVICE(ori), 0, &pm->pci_irqs[i]); in pegasos2_init()
240 if (machine->kernel_filename) { in pegasos2_init()
241 sz = load_elf(machine->kernel_filename, NULL, NULL, NULL, in pegasos2_init()
242 &pm->kernel_entry, &pm->kernel_addr, NULL, NULL, 1, in pegasos2_init()
246 machine->kernel_filename); in pegasos2_init()
249 pm->kernel_size = sz; in pegasos2_init()
250 if (!pm->vof) { in pegasos2_init()
251 warn_report("Option -kernel may be ineffective with -bios."); in pegasos2_init()
253 } else if (pm->vof && !qtest_enabled()) { in pegasos2_init()
254 warn_report("Using Virtual OpenFirmware but no -kernel option."); in pegasos2_init()
257 if (machine->initrd_filename) { in pegasos2_init()
258 pm->initrd_addr = pm->kernel_addr + pm->kernel_size + 64 * KiB; in pegasos2_init()
259 pm->initrd_addr = ROUND_UP(pm->initrd_addr, 4); in pegasos2_init()
260 pm->initrd_addr = MAX(pm->initrd_addr, INITRD_MIN_ADDR); in pegasos2_init()
261 sz = load_image_targphys(machine->initrd_filename, pm->initrd_addr, in pegasos2_init()
262 machine->ram_size - pm->initrd_addr); in pegasos2_init()
265 machine->initrd_filename); in pegasos2_init()
268 pm->initrd_size = sz; in pegasos2_init()
271 if (!pm->vof && machine->kernel_cmdline && machine->kernel_cmdline[0]) { in pegasos2_init()
272 warn_report("Option -append may be ineffective with -bios."); in pegasos2_init()
279 MemoryRegion *r = sysbus_mmio_get_region(SYS_BUS_DEVICE(pm->mv), 0); in pegasos2_mv_reg_read()
289 MemoryRegion *r = sysbus_mmio_get_region(SYS_BUS_DEVICE(pm->mv), 0); in pegasos2_mv_reg_write()
326 uint64_t d[2]; in pegasos2_machine_reset() local
330 if (!pm->vof) { in pegasos2_machine_reset()
399 vof_init(pm->vof, machine->ram_size, &error_fatal); in pegasos2_machine_reset()
400 if (vof_claim(pm->vof, 0, VOF_STACK_SIZE, VOF_STACK_SIZE) == -1) { in pegasos2_machine_reset()
404 if (pm->kernel_size && in pegasos2_machine_reset()
405 vof_claim(pm->vof, pm->kernel_addr, pm->kernel_size, 0) == -1) { in pegasos2_machine_reset()
409 if (pm->initrd_size && in pegasos2_machine_reset()
410 vof_claim(pm->vof, pm->initrd_addr, pm->initrd_size, 0) == -1) { in pegasos2_machine_reset()
416 d[0] = cpu_to_be64(pm->kernel_entry); in pegasos2_machine_reset()
417 d[1] = cpu_to_be64(pm->kernel_size - (pm->kernel_entry - pm->kernel_addr)); in pegasos2_machine_reset()
418 qemu_fdt_setprop(fdt, "/chosen", "qemu,boot-kernel", d, sizeof(d)); in pegasos2_machine_reset()
421 g_free(pm->fdt_blob); in pegasos2_machine_reset()
422 pm->fdt_blob = fdt; in pegasos2_machine_reset()
424 vof_build_dt(fdt, pm->vof); in pegasos2_machine_reset()
425 vof_client_open_store(fdt, pm->vof, "/chosen", "stdout", "/failsafe"); in pegasos2_machine_reset()
427 /* Set machine->fdt for 'dumpdtb' QMP/HMP command */ in pegasos2_machine_reset()
428 machine->fdt = fdt; in pegasos2_machine_reset()
430 pm->cpu->vhyp = PPC_VIRTUAL_HYPERVISOR(machine); in pegasos2_machine_reset()
431 pm->cpu->vhyp_class = PPC_VIRTUAL_HYPERVISOR_GET_CLASS(pm->cpu->vhyp); in pegasos2_machine_reset()
455 AddressSpace *as = CPU(cpu)->as; in pegasos2_rtas()
470 "rtc-time", &error_fatal); in pegasos2_rtas()
474 stl_be_phys(as, rets, -1); in pegasos2_rtas()
495 stl_be_phys(as, rets, -1); in pegasos2_rtas()
511 stl_be_phys(as, rets, -1); in pegasos2_rtas()
524 stl_be_phys(as, rets, -1); in pegasos2_rtas()
533 stl_be_phys(as, rets, -1); in pegasos2_rtas()
556 CPUPPCState *env = &cpu->env; in pegasos2_hypercall()
561 if (FIELD_EX64(env->msr, MSR, PR)) { in pegasos2_hypercall()
563 env->gpr[3] = H_PRIVILEGE; in pegasos2_hypercall()
564 } else if (env->gpr[3] == KVMPPC_H_RTAS) { in pegasos2_hypercall()
565 env->gpr[3] = pegasos2_rtas(cpu, pm, env->gpr[4]); in pegasos2_hypercall()
566 } else if (env->gpr[3] == KVMPPC_H_VOF_CLIENT) { in pegasos2_hypercall()
567 int ret = vof_client_call(MACHINE(pm), pm->vof, pm->fdt_blob, in pegasos2_hypercall()
568 env->gpr[4]); in pegasos2_hypercall()
569 env->gpr[3] = (ret ? H_PARAMETER : H_SUCCESS); in pegasos2_hypercall()
572 "\n", env->gpr[3]); in pegasos2_hypercall()
573 env->gpr[3] = -1; in pegasos2_hypercall()
583 return POWERPC_CPU(current_cpu)->env.spr[SPR_SDR1]; in vhyp_encode_hpt_for_kvm_pr()
598 mc->desc = "Genesi/bPlan Pegasos II"; in pegasos2_machine_class_init()
599 mc->init = pegasos2_init; in pegasos2_machine_class_init()
600 mc->reset = pegasos2_machine_reset; in pegasos2_machine_class_init()
601 mc->block_default_type = IF_IDE; in pegasos2_machine_class_init()
602 mc->default_boot_order = "cd"; in pegasos2_machine_class_init()
603 mc->default_display = "std"; in pegasos2_machine_class_init()
604 mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("7457_v1.2"); in pegasos2_machine_class_init()
605 mc->default_ram_id = "pegasos2.ram"; in pegasos2_machine_class_init()
606 mc->default_ram_size = 512 * MiB; in pegasos2_machine_class_init()
609 vhc->cpu_in_nested = pegasos2_cpu_in_nested; in pegasos2_machine_class_init()
610 vhc->hypercall = pegasos2_hypercall; in pegasos2_machine_class_init()
611 vhc->cpu_exec_enter = vhyp_nop; in pegasos2_machine_class_init()
612 vhc->cpu_exec_exit = vhyp_nop; in pegasos2_machine_class_init()
613 vhc->encode_hpt_for_kvm_pr = vhyp_encode_hpt_for_kvm_pr; in pegasos2_machine_class_init()
615 vmc->setprop = pegasos2_setprop; in pegasos2_machine_class_init()
646 static void dt_ide(PCIBus *bus, PCIDevice *d, FDTInfo *fi) in dt_ide() argument
648 qemu_fdt_setprop_string(fi->fdt, fi->path, "device_type", "spi"); in dt_ide()
651 static void dt_usb(PCIBus *bus, PCIDevice *d, FDTInfo *fi) in dt_usb() argument
653 qemu_fdt_setprop_cell(fi->fdt, fi->path, "#size-cells", 0); in dt_usb()
654 qemu_fdt_setprop_cell(fi->fdt, fi->path, "#address-cells", 1); in dt_usb()
655 qemu_fdt_setprop_string(fi->fdt, fi->path, "device_type", "usb"); in dt_usb()
658 static void dt_isa(PCIBus *bus, PCIDevice *d, FDTInfo *fi) in dt_isa() argument
663 qemu_fdt_setprop_cell(fi->fdt, fi->path, "#size-cells", 1); in dt_isa()
664 qemu_fdt_setprop_cell(fi->fdt, fi->path, "#address-cells", 2); in dt_isa()
665 qemu_fdt_setprop_string(fi->fdt, fi->path, "device_type", "isa"); in dt_isa()
666 qemu_fdt_setprop_string(fi->fdt, fi->path, "name", "isa"); in dt_isa()
669 g_string_printf(name, "%s/lpt@i3bc", fi->path); in dt_isa()
670 qemu_fdt_add_subnode(fi->fdt, name->str); in dt_isa()
671 qemu_fdt_setprop_cell(fi->fdt, name->str, "clock-frequency", 0); in dt_isa()
674 qemu_fdt_setprop(fi->fdt, name->str, "interrupts", in dt_isa()
679 qemu_fdt_setprop(fi->fdt, name->str, "reg", cells, 3 * sizeof(cells[0])); in dt_isa()
680 qemu_fdt_setprop_string(fi->fdt, name->str, "device_type", "lpt"); in dt_isa()
681 qemu_fdt_setprop_string(fi->fdt, name->str, "name", "lpt"); in dt_isa()
683 g_string_printf(name, "%s/fdc@i3f0", fi->path); in dt_isa()
684 qemu_fdt_add_subnode(fi->fdt, name->str); in dt_isa()
685 qemu_fdt_setprop_cell(fi->fdt, name->str, "clock-frequency", 0); in dt_isa()
688 qemu_fdt_setprop(fi->fdt, name->str, "interrupts", in dt_isa()
693 qemu_fdt_setprop(fi->fdt, name->str, "reg", cells, 3 * sizeof(cells[0])); in dt_isa()
694 qemu_fdt_setprop_string(fi->fdt, name->str, "device_type", "fdc"); in dt_isa()
695 qemu_fdt_setprop_string(fi->fdt, name->str, "name", "fdc"); in dt_isa()
697 g_string_printf(name, "%s/timer@i40", fi->path); in dt_isa()
698 qemu_fdt_add_subnode(fi->fdt, name->str); in dt_isa()
699 qemu_fdt_setprop_cell(fi->fdt, name->str, "clock-frequency", 0); in dt_isa()
703 qemu_fdt_setprop(fi->fdt, name->str, "reg", cells, 3 * sizeof(cells[0])); in dt_isa()
704 qemu_fdt_setprop_string(fi->fdt, name->str, "device_type", "timer"); in dt_isa()
705 qemu_fdt_setprop_string(fi->fdt, name->str, "name", "timer"); in dt_isa()
707 g_string_printf(name, "%s/rtc@i70", fi->path); in dt_isa()
708 qemu_fdt_add_subnode(fi->fdt, name->str); in dt_isa()
709 qemu_fdt_setprop_string(fi->fdt, name->str, "compatible", "ds1385-rtc"); in dt_isa()
710 qemu_fdt_setprop_cell(fi->fdt, name->str, "clock-frequency", 0); in dt_isa()
713 qemu_fdt_setprop(fi->fdt, name->str, "interrupts", in dt_isa()
718 qemu_fdt_setprop(fi->fdt, name->str, "reg", cells, 3 * sizeof(cells[0])); in dt_isa()
719 qemu_fdt_setprop_string(fi->fdt, name->str, "device_type", "rtc"); in dt_isa()
720 qemu_fdt_setprop_string(fi->fdt, name->str, "name", "rtc"); in dt_isa()
722 g_string_printf(name, "%s/keyboard@i60", fi->path); in dt_isa()
723 qemu_fdt_add_subnode(fi->fdt, name->str); in dt_isa()
726 qemu_fdt_setprop(fi->fdt, name->str, "interrupts", in dt_isa()
731 qemu_fdt_setprop(fi->fdt, name->str, "reg", cells, 3 * sizeof(cells[0])); in dt_isa()
732 qemu_fdt_setprop_string(fi->fdt, name->str, "device_type", "keyboard"); in dt_isa()
733 qemu_fdt_setprop_string(fi->fdt, name->str, "name", "keyboard"); in dt_isa()
735 g_string_printf(name, "%s/8042@i60", fi->path); in dt_isa()
736 qemu_fdt_add_subnode(fi->fdt, name->str); in dt_isa()
737 qemu_fdt_setprop_cell(fi->fdt, name->str, "#interrupt-cells", 2); in dt_isa()
738 qemu_fdt_setprop_cell(fi->fdt, name->str, "#size-cells", 0); in dt_isa()
739 qemu_fdt_setprop_cell(fi->fdt, name->str, "#address-cells", 1); in dt_isa()
740 qemu_fdt_setprop_string(fi->fdt, name->str, "interrupt-controller", ""); in dt_isa()
741 qemu_fdt_setprop_cell(fi->fdt, name->str, "clock-frequency", 0); in dt_isa()
745 qemu_fdt_setprop(fi->fdt, name->str, "reg", cells, 3 * sizeof(cells[0])); in dt_isa()
746 qemu_fdt_setprop_string(fi->fdt, name->str, "device_type", ""); in dt_isa()
747 qemu_fdt_setprop_string(fi->fdt, name->str, "name", "8042"); in dt_isa()
749 g_string_printf(name, "%s/serial@i2f8", fi->path); in dt_isa()
750 qemu_fdt_add_subnode(fi->fdt, name->str); in dt_isa()
751 qemu_fdt_setprop_cell(fi->fdt, name->str, "clock-frequency", 0); in dt_isa()
754 qemu_fdt_setprop(fi->fdt, name->str, "interrupts", in dt_isa()
759 qemu_fdt_setprop(fi->fdt, name->str, "reg", cells, 3 * sizeof(cells[0])); in dt_isa()
760 qemu_fdt_setprop_string(fi->fdt, name->str, "device_type", "serial"); in dt_isa()
761 qemu_fdt_setprop_string(fi->fdt, name->str, "name", "serial"); in dt_isa()
769 void (*dtf)(PCIBus *bus, PCIDevice *d, FDTInfo *fi);
781 static void add_pci_device(PCIBus *bus, PCIDevice *d, void *opaque) in add_pci_device() argument
789 pci_get_word(&d->config[PCI_VENDOR_ID]), in add_pci_device()
790 pci_get_word(&d->config[PCI_DEVICE_ID])); in add_pci_device()
792 if (pci_get_word(&d->config[PCI_CLASS_DEVICE]) == in add_pci_device()
795 } else if (pci_get_word(&d->config[PCI_CLASS_DEVICE]) >> 8 == in add_pci_device()
805 g_string_printf(node, "%s/%s@%x", fi->path, (name ?: pn), in add_pci_device()
806 PCI_SLOT(d->devfn)); in add_pci_device()
807 if (PCI_FUNC(d->devfn)) { in add_pci_device()
808 g_string_append_printf(node, ",%x", PCI_FUNC(d->devfn)); in add_pci_device()
811 qemu_fdt_add_subnode(fi->fdt, node->str); in add_pci_device()
813 FDTInfo cfi = { fi->fdt, node->str }; in add_pci_device()
814 device_map[i].dtf(bus, d, &cfi); in add_pci_device()
816 cells[0] = cpu_to_be32(d->devfn << 8); in add_pci_device()
823 if (!d->io_regions[i].size) { in add_pci_device()
830 cells[j] = cpu_to_be32(d->devfn << 8 | cells[j]); in add_pci_device()
831 if (d->io_regions[i].type & PCI_BASE_ADDRESS_SPACE_IO) { in add_pci_device()
834 if (d->io_regions[i].type & PCI_BASE_ADDRESS_MEM_TYPE_64) { in add_pci_device()
839 if (d->io_regions[i].type & PCI_BASE_ADDRESS_MEM_PREFETCH) { in add_pci_device()
845 cells[j + 3] = cpu_to_be32(d->io_regions[i].size >> 32); in add_pci_device()
846 cells[j + 4] = cpu_to_be32(d->io_regions[i].size); in add_pci_device()
849 qemu_fdt_setprop(fi->fdt, node->str, "reg", cells, j * sizeof(cells[0])); in add_pci_device()
850 qemu_fdt_setprop_string(fi->fdt, node->str, "name", name ?: pn); in add_pci_device()
851 if (pci_get_byte(&d->config[PCI_INTERRUPT_PIN])) { in add_pci_device()
852 qemu_fdt_setprop_cell(fi->fdt, node->str, "interrupts", in add_pci_device()
853 pci_get_byte(&d->config[PCI_INTERRUPT_PIN])); in add_pci_device()
855 /* Pegasos2 firmware has subsystem-id amd subsystem-vendor-id swapped */ in add_pci_device()
856 qemu_fdt_setprop_cell(fi->fdt, node->str, "subsystem-vendor-id", in add_pci_device()
857 pci_get_word(&d->config[PCI_SUBSYSTEM_ID])); in add_pci_device()
858 qemu_fdt_setprop_cell(fi->fdt, node->str, "subsystem-id", in add_pci_device()
859 pci_get_word(&d->config[PCI_SUBSYSTEM_VENDOR_ID])); in add_pci_device()
860 cells[0] = pci_get_long(&d->config[PCI_CLASS_REVISION]); in add_pci_device()
861 qemu_fdt_setprop_cell(fi->fdt, node->str, "class-code", cells[0] >> 8); in add_pci_device()
862 qemu_fdt_setprop_cell(fi->fdt, node->str, "revision-id", cells[0] & 0xff); in add_pci_device()
863 qemu_fdt_setprop_cell(fi->fdt, node->str, "device-id", in add_pci_device()
864 pci_get_word(&d->config[PCI_DEVICE_ID])); in add_pci_device()
865 qemu_fdt_setprop_cell(fi->fdt, node->str, "vendor-id", in add_pci_device()
866 pci_get_word(&d->config[PCI_VENDOR_ID])); in add_pci_device()
874 PowerPCCPU *cpu = pm->cpu; in build_fdt()
890 qemu_fdt_setprop_cell(fdt, "/", "#address-cells", 1); in build_fdt()
897 qemu_fdt_setprop(fdt, "/pci@c0000000", "bus-range", in build_fdt()
899 qemu_fdt_setprop_cell(fdt, "/pci@c0000000", "pci-bridge-number", 1); in build_fdt()
917 qemu_fdt_setprop_cell(fdt, "/pci@c0000000", "#size-cells", 2); in build_fdt()
918 qemu_fdt_setprop_cell(fdt, "/pci@c0000000", "#address-cells", 3); in build_fdt()
923 pci_bus = mv64361_get_pci_bus(pm->mv, 0); in build_fdt()
930 qemu_fdt_setprop(fdt, "/pci@80000000", "bus-range", in build_fdt()
932 qemu_fdt_setprop_cell(fdt, "/pci@80000000", "pci-bridge-number", 0); in build_fdt()
936 qemu_fdt_setprop_cell(fdt, "/pci@80000000", "8259-interrupt-acknowledge", in build_fdt()
952 qemu_fdt_setprop_cell(fdt, "/pci@80000000", "#size-cells", 2); in build_fdt()
953 qemu_fdt_setprop_cell(fdt, "/pci@80000000", "#address-cells", 3); in build_fdt()
958 pci_bus = mv64361_get_pci_bus(pm->mv, 1); in build_fdt()
966 qemu_fdt_setprop_cell(fdt, "/rtas", "system-reboot", RTAS_SYSTEM_REBOOT); in build_fdt()
969 qemu_fdt_setprop_cell(fdt, "/rtas", "power-off", RTAS_POWER_OFF); in build_fdt()
970 qemu_fdt_setprop_cell(fdt, "/rtas", "set-indicator", RTAS_SET_INDICATOR); in build_fdt()
971 qemu_fdt_setprop_cell(fdt, "/rtas", "display-character", in build_fdt()
973 qemu_fdt_setprop_cell(fdt, "/rtas", "write-pci-config", in build_fdt()
975 qemu_fdt_setprop_cell(fdt, "/rtas", "read-pci-config", in build_fdt()
977 /* Pegasos2 firmware misspells check-exception and guests use that */ in build_fdt()
978 qemu_fdt_setprop_cell(fdt, "/rtas", "check-execption", in build_fdt()
980 qemu_fdt_setprop_cell(fdt, "/rtas", "event-scan", RTAS_EVENT_SCAN); in build_fdt()
981 qemu_fdt_setprop_cell(fdt, "/rtas", "set-time-of-day", in build_fdt()
983 qemu_fdt_setprop_cell(fdt, "/rtas", "get-time-of-day", in build_fdt()
985 qemu_fdt_setprop_cell(fdt, "/rtas", "nvram-store", RTAS_NVRAM_STORE); in build_fdt()
986 qemu_fdt_setprop_cell(fdt, "/rtas", "nvram-fetch", RTAS_NVRAM_FETCH); in build_fdt()
987 qemu_fdt_setprop_cell(fdt, "/rtas", "restart-rtas", RTAS_RESTART_RTAS); in build_fdt()
988 qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-error-log-max", 0); in build_fdt()
989 qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-event-scan-rate", 0); in build_fdt()
990 qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-display-device", 0); in build_fdt()
991 qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-size", 20); in build_fdt()
992 qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-version", 1); in build_fdt()
998 qemu_fdt_setprop_cell(fdt, "/cpus", "#address-cells", 1); in build_fdt()
999 qemu_fdt_setprop_cell(fdt, "/cpus", "#size-cells", 0); in build_fdt()
1006 qemu_fdt_setprop_cell(fdt, cp, "d-cache-size", 0x8000); in build_fdt()
1007 qemu_fdt_setprop_cell(fdt, cp, "d-cache-block-size", in build_fdt()
1008 cpu->env.dcache_line_size); in build_fdt()
1009 qemu_fdt_setprop_cell(fdt, cp, "d-cache-line-size", in build_fdt()
1010 cpu->env.dcache_line_size); in build_fdt()
1011 qemu_fdt_setprop_cell(fdt, cp, "i-cache-size", 0x8000); in build_fdt()
1012 qemu_fdt_setprop_cell(fdt, cp, "i-cache-block-size", in build_fdt()
1013 cpu->env.icache_line_size); in build_fdt()
1014 qemu_fdt_setprop_cell(fdt, cp, "i-cache-line-size", in build_fdt()
1015 cpu->env.icache_line_size); in build_fdt()
1017 qemu_fdt_setprop_cell(fdt, cp, "i-tlb-sets", cpu->env.nb_ways); in build_fdt()
1018 qemu_fdt_setprop_cell(fdt, cp, "i-tlb-size", cpu->env.tlb_per_way); in build_fdt()
1019 qemu_fdt_setprop_cell(fdt, cp, "d-tlb-sets", cpu->env.nb_ways); in build_fdt()
1020 qemu_fdt_setprop_cell(fdt, cp, "d-tlb-size", cpu->env.tlb_per_way); in build_fdt()
1021 qemu_fdt_setprop_string(fdt, cp, "tlb-split", ""); in build_fdt()
1023 qemu_fdt_setprop_cell(fdt, cp, "tlb-sets", cpu->env.nb_ways); in build_fdt()
1024 qemu_fdt_setprop_cell(fdt, cp, "tlb-size", cpu->env.nb_tlb); in build_fdt()
1026 if (cpu->env.insns_flags & PPC_ALTIVEC) { in build_fdt()
1028 qemu_fdt_setprop_string(fdt, cp, "data-streams", ""); in build_fdt()
1031 * FIXME What flags do data-streams, external-control and in build_fdt()
1032 * performance-monitor depend on? in build_fdt()
1034 qemu_fdt_setprop_string(fdt, cp, "external-control", ""); in build_fdt()
1035 if (cpu->env.insns_flags & PPC_FLOAT_FSQRT) { in build_fdt()
1036 qemu_fdt_setprop_string(fdt, cp, "general-purpose", ""); in build_fdt()
1038 qemu_fdt_setprop_string(fdt, cp, "performance-monitor", ""); in build_fdt()
1039 if (cpu->env.insns_flags & PPC_FLOAT_FRES) { in build_fdt()
1042 qemu_fdt_setprop_cell(fdt, cp, "reservation-granule-size", 4); in build_fdt()
1043 qemu_fdt_setprop_cell(fdt, cp, "timebase-frequency", in build_fdt()
1044 cpu->env.tb_env->tb_freq); in build_fdt()
1045 qemu_fdt_setprop_cell(fdt, cp, "bus-frequency", BUS_FREQ_HZ); in build_fdt()
1046 qemu_fdt_setprop_cell(fdt, cp, "clock-frequency", BUS_FREQ_HZ * 7.5); in build_fdt()
1047 qemu_fdt_setprop_cell(fdt, cp, "cpu-version", cpu->env.spr[SPR_PVR]); in build_fdt()
1057 cells[1] = cpu_to_be32(machine->ram_size); in build_fdt()
1063 if (pm->initrd_addr && pm->initrd_size) { in build_fdt()
1064 qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-end", in build_fdt()
1065 pm->initrd_addr + pm->initrd_size); in build_fdt()
1066 qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-start", in build_fdt()
1067 pm->initrd_addr); in build_fdt()
1070 machine->kernel_cmdline ?: ""); in build_fdt()