static void __init spear320_dt_init(void) { pl080_plat_data.slave_channels = spear320_dma_info; pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear320_dma_info); of_platform_default_populate(NULL, spear320_auxdata_lookup, NULL); }
static void __init orion5x_dt_init(void) { char *dev_name; u32 dev, rev; orion5x_id(&dev, &rev, &dev_name); printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); BUG_ON(mvebu_mbus_dt_init(false)); /* * Setup Orion address map */ orion5x_setup_wins(); /* * Don't issue "Wait for Interrupt" instruction if we are * running on D0 5281 silicon. */ if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) { printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n"); cpu_idle_poll_ctrl(true); } if (of_machine_is_compatible("maxtor,shared-storage-2")) mss2_init(); of_platform_default_populate(NULL, orion5x_auxdata_lookup, NULL); }
static int __init plat_of_setup(void) { if (!of_have_populated_dt()) panic("Device tree not present"); pic32_of_prepare_platform_data(pic32_auxdata_lookup); if (of_platform_default_populate(NULL, pic32_auxdata_lookup, NULL)) panic("Failed to populate DT"); return 0; }
static void __init at91rm9200_dt_device_init(void) { struct soc_device *soc; struct device *soc_dev = NULL; soc = at91_soc_init(rm9200_socs); if (soc != NULL) soc_dev = soc_device_to_device(soc); of_platform_default_populate(NULL, NULL, soc_dev); at91rm9200_pm_init(); }
static int __init customize_machine(void) { /* * Traverses flattened DeviceTree - registering platform devices * (if any) complete with their resources */ of_platform_default_populate(NULL, NULL, NULL); if (machine_desc->init_machine) machine_desc->init_machine(); return 0; }
static void __init intcp_init_of(void) { struct device_node *cpcon; cpcon = of_find_matching_node(NULL, intcp_syscon_match); if (!cpcon) return; intcp_con_base = of_iomap(cpcon, 0); if (!intcp_con_base) return; of_platform_default_populate(NULL, intcp_auxdata_lookup, NULL); }
static void __init imx6sx_init_machine(void) { struct device *parent; parent = imx_soc_device_init(); if (parent == NULL) pr_warn("failed to initialize soc device\n"); of_platform_default_populate(NULL, NULL, parent); imx6sx_enet_init(); imx_anatop_init(); imx6sx_pm_init(); }
static int uniphier_system_bus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct uniphier_system_bus_priv *priv; struct resource *regs; const __be32 *ranges; u32 cells, addr, size; u64 paddr; int pna, bank, rlen, rone, ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->membase = devm_ioremap_resource(dev, regs); if (IS_ERR(priv->membase)) return PTR_ERR(priv->membase); priv->dev = dev; pna = of_n_addr_cells(dev->of_node); ret = of_property_read_u32(dev->of_node, "#address-cells", &cells); if (ret) { dev_err(dev, "failed to get #address-cells\n"); return ret; } if (cells != 2) { dev_err(dev, "#address-cells must be 2\n"); return -EINVAL; } ret = of_property_read_u32(dev->of_node, "#size-cells", &cells); if (ret) { dev_err(dev, "failed to get #size-cells\n"); return ret; } if (cells != 1) { dev_err(dev, "#size-cells must be 1\n"); return -EINVAL; } ranges = of_get_property(dev->of_node, "ranges", &rlen); if (!ranges) { dev_err(dev, "failed to get ranges property\n"); return -ENOENT; } rlen /= sizeof(*ranges); rone = pna + 2; for (; rlen >= rone; rlen -= rone) { bank = be32_to_cpup(ranges++); addr = be32_to_cpup(ranges++); paddr = of_translate_address(dev->of_node, ranges); if (paddr == OF_BAD_ADDR) return -EINVAL; ranges += pna; size = be32_to_cpup(ranges++); ret = uniphier_system_bus_add_bank(priv, bank, addr, paddr, size); if (ret) return ret; } ret = uniphier_system_bus_check_overlap(priv); if (ret) return ret; uniphier_system_bus_check_boot_swap(priv); uniphier_system_bus_set_reg(priv); platform_set_drvdata(pdev, priv); /* Now, the bus is configured. Populate platform_devices below it */ return of_platform_default_populate(dev->of_node, NULL, dev); }