Lines Matching +full:string +full:- +full:array +full:- +full:property
30 #include "hw/core/sysbus-fdt.h"
31 #include "qemu/error-report.h"
34 #include "hw/platform-bus.h"
35 #include "hw/vfio/vfio-platform.h"
36 #include "hw/vfio/vfio-calxeda-xgmac.h"
37 #include "hw/vfio/vfio-amd-xgbe.h"
38 #include "hw/vfio/vfio-region.h"
40 #include "hw/uefi/var-service-api.h"
74 * copies properties listed in an array from host device tree to
75 * guest device tree. If a non optional property is not found, the
76 * function asserts. An optional property is ignored if not found
78 * @props: array of HostProperty to copy
79 * @nb_props: number of properties in the array
82 * @node_path: host dt node path where the property is supposed to be
103 if (props[i].optional && prop_len == -FDT_ERR_NOTFOUND) { in copy_properties_from_host()
104 /* optional property does not exist */ in copy_properties_from_host()
110 /* mandatory property not found: bail out */ in copy_properties_from_host()
121 {"#clock-cells", false},
122 {"clock-frequency", true},
123 {"clock-output-names", true},
155 == -FDT_ERR_NOSPACE) { in fdt_build_clock_node()
167 if (strcmp(r, "fixed-clock")) { in fdt_build_clock_node()
213 * compatible string, regs, interrupts, dma-coherent
218 PlatformBusDevice *pbus = data->pbus; in add_calxeda_midway_xgmac_fdt_node()
219 void *fdt = data->fdt; in add_calxeda_midway_xgmac_fdt_node()
220 const char *parent_node = data->pbus_node_name; in add_calxeda_midway_xgmac_fdt_node()
226 VFIODevice *vbasedev = &vdev->vbasedev; in add_calxeda_midway_xgmac_fdt_node()
230 vbasedev->name, mmio_base); in add_calxeda_midway_xgmac_fdt_node()
233 compat_str_len = strlen(vdev->compat) + 1; in add_calxeda_midway_xgmac_fdt_node()
235 vdev->compat, compat_str_len); in add_calxeda_midway_xgmac_fdt_node()
237 qemu_fdt_setprop(fdt, nodename, "dma-coherent", "", 0); in add_calxeda_midway_xgmac_fdt_node()
239 reg_attr = g_new(uint32_t, vbasedev->num_regions * 2); in add_calxeda_midway_xgmac_fdt_node()
240 for (i = 0; i < vbasedev->num_regions; i++) { in add_calxeda_midway_xgmac_fdt_node()
244 memory_region_size(vdev->regions[i]->mem)); in add_calxeda_midway_xgmac_fdt_node()
247 vbasedev->num_regions * 2 * sizeof(uint32_t)); in add_calxeda_midway_xgmac_fdt_node()
249 irq_attr = g_new(uint32_t, vbasedev->num_irqs * 3); in add_calxeda_midway_xgmac_fdt_node()
250 for (i = 0; i < vbasedev->num_irqs; i++) { in add_calxeda_midway_xgmac_fdt_node()
252 + data->irq_start; in add_calxeda_midway_xgmac_fdt_node()
258 irq_attr, vbasedev->num_irqs * 3 * sizeof(uint32_t)); in add_calxeda_midway_xgmac_fdt_node()
268 {"dma-coherent", true},
269 {"amd,per-channel-interrupt", true},
270 {"phy-mode", false},
271 {"mac-address", true},
272 {"amd,speed-set", false},
273 {"amd,serdes-blwc", true},
274 {"amd,serdes-cdr-rate", true},
275 {"amd,serdes-pq-skew", true},
276 {"amd,serdes-tx-amp", true},
277 {"amd,serdes-dfe-tap-config", true},
278 {"amd,serdes-dfe-tap-enable", true},
279 {"clock-names", false},
287 * Documentation/devicetree/bindings/net/amd-xgbe.txt:
295 PlatformBusDevice *pbus = data->pbus; in add_amd_xgbe_fdt_node()
297 VFIODevice *vbasedev = &vdev->vbasedev; in add_amd_xgbe_fdt_node()
299 const char *parent_node = data->pbus_node_name; in add_amd_xgbe_fdt_node()
301 void *guest_fdt = data->fdt, *host_fdt; in add_amd_xgbe_fdt_node()
311 dt_name = sysfs_to_dt_name(vbasedev->name); in add_amd_xgbe_fdt_node()
314 __func__, vbasedev->name); in add_amd_xgbe_fdt_node()
317 node_path = qemu_fdt_node_path(host_fdt, dt_name, vdev->compat, in add_amd_xgbe_fdt_node()
321 __func__, dt_name, vdev->compat); in add_amd_xgbe_fdt_node()
327 __func__, dt_name, vdev->compat); in add_amd_xgbe_fdt_node()
333 if (vbasedev->num_regions != 5) { in add_amd_xgbe_fdt_node()
342 error_report("%s clocks property should contain 2 handles", __func__); in add_amd_xgbe_fdt_node()
365 vbasedev->name, mmio_base); in add_amd_xgbe_fdt_node()
377 reg_attr = g_new(uint32_t, vbasedev->num_regions * 2); in add_amd_xgbe_fdt_node()
378 for (i = 0; i < vbasedev->num_regions; i++) { in add_amd_xgbe_fdt_node()
382 memory_region_size(vdev->regions[i]->mem)); in add_amd_xgbe_fdt_node()
385 vbasedev->num_regions * 2 * sizeof(uint32_t)); in add_amd_xgbe_fdt_node()
387 irq_attr = g_new(uint32_t, vbasedev->num_irqs * 3); in add_amd_xgbe_fdt_node()
388 for (i = 0; i < vbasedev->num_irqs; i++) { in add_amd_xgbe_fdt_node()
390 + data->irq_start; in add_amd_xgbe_fdt_node()
394 * General device interrupt and PCS auto-negotiation interrupts are in add_amd_xgbe_fdt_node()
395 * level-sensitive while the 4 per-channel interrupts are edge in add_amd_xgbe_fdt_node()
398 QLIST_FOREACH(intp, &vdev->intp_list, next) { in add_amd_xgbe_fdt_node()
399 if (intp->pin == i) { in add_amd_xgbe_fdt_node()
403 if (intp->flags & VFIO_IRQ_INFO_AUTOMASKED) { in add_amd_xgbe_fdt_node()
410 irq_attr, vbasedev->num_irqs * 3 * sizeof(uint32_t)); in add_amd_xgbe_fdt_node()
428 for (n = vdev->num_compat, compat = vdev->compat; n > 0; in vfio_platform_match()
429 n--, compat += strlen(compat) + 1) { in vfio_platform_match()
430 if (!strcmp(entry->compat, compat)) { in vfio_platform_match()
454 PlatformBusDevice *pbus = data->pbus; in add_tpm_tis_fdt_node()
455 void *fdt = data->fdt; in add_tpm_tis_fdt_node()
456 const char *parent_node = data->pbus_node_name; in add_tpm_tis_fdt_node()
465 qemu_fdt_setprop_string(fdt, nodename, "compatible", "tcg,tpm-tis-mmio"); in add_tpm_tis_fdt_node()
479 PlatformBusDevice *pbus = data->pbus; in add_uefi_vars_node()
480 const char *parent_node = data->pbus_node_name; in add_uefi_vars_node()
481 void *fdt = data->fdt; in add_uefi_vars_node()
506 return !strcmp(object_get_typename(OBJECT(sbdev)), entry->typename); in type_match()
516 VFIO_PLATFORM_BINDING("amd,xgbe-seattle-v1a", add_amd_xgbe_fdt_node),
529 * add_fdt_node - add the device tree node of a dynamic sysbus device
546 if (!iter->match_fn || iter->match_fn(sbdev, iter)) { in add_fdt_node()
547 ret = iter->add_fn(sbdev, opaque); in add_fdt_node()
561 const char platcomp[] = "qemu,platform\0simple-bus"; in platform_bus_add_all_fdt_nodes()
568 node = g_strdup_printf("/platform-bus@%"PRIx64, addr); in platform_bus_add_all_fdt_nodes()
577 qemu_fdt_setprop_cells(fdt, node, "#size-cells", 1); in platform_bus_add_all_fdt_nodes()
578 qemu_fdt_setprop_cells(fdt, node, "#address-cells", 1); in platform_bus_add_all_fdt_nodes()
581 qemu_fdt_setprop_phandle(fdt, node, "interrupt-parent", intc); in platform_bus_add_all_fdt_nodes()