Lines Matching +full:nvmem +full:- +full:rmem
1 // SPDX-License-Identifier: GPL-2.0+
16 #include <linux/dma-mapping.h>
25 { .compatible = "simple-bus", },
26 { .compatible = "simple-mfd", },
29 { .compatible = "arm,amba-bus", },
35 { .compatible = "operating-points-v2", },
40 * of_find_device_by_node - Find the platform_device associated with a node
67 * of_device_make_bus_id - Use the device node data to assign a unique name
76 struct device_node *node = dev->of_node; in of_device_make_bus_id()
82 while (node->parent) { in of_device_make_bus_id()
91 addr, ffs(mask) - 1, node, dev_name(dev)); in of_device_make_bus_id()
101 kbasename(node->full_name), dev_name(dev)); in of_device_make_bus_id()
102 node = node->parent; in of_device_make_bus_id()
107 * of_device_alloc - Allocate and initialize an of_device
136 dev->num_resources = num_reg; in of_device_alloc()
137 dev->resource = res; in of_device_alloc()
144 dev->dev.of_node = of_node_get(np); in of_device_alloc()
145 dev->dev.fwnode = &np->fwnode; in of_device_alloc()
146 dev->dev.parent = parent ? : &platform_bus; in of_device_alloc()
149 dev_set_name(&dev->dev, "%s", bus_id); in of_device_alloc()
151 of_device_make_bus_id(&dev->dev); in of_device_alloc()
158 * of_platform_device_create_pdata - Alloc, initialize and register an of_device
183 dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); in of_platform_device_create_pdata()
184 if (!dev->dev.dma_mask) in of_platform_device_create_pdata()
185 dev->dev.dma_mask = &dev->dev.coherent_dma_mask; in of_platform_device_create_pdata()
186 dev->dev.bus = &platform_bus_type; in of_platform_device_create_pdata()
187 dev->dev.platform_data = platform_data; in of_platform_device_create_pdata()
188 of_msi_configure(&dev->dev, dev->dev.of_node); in of_platform_device_create_pdata()
203 * of_platform_device_create - Alloc, initialize and register an of_device
240 dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); in of_amba_device_create()
241 dev->dev.dma_mask = &dev->dev.coherent_dma_mask; in of_amba_device_create()
244 dev->dev.of_node = of_node_get(node); in of_amba_device_create()
245 dev->dev.fwnode = &node->fwnode; in of_amba_device_create()
246 dev->dev.parent = parent ? : &platform_bus; in of_amba_device_create()
247 dev->dev.platform_data = platform_data; in of_amba_device_create()
249 dev_set_name(&dev->dev, "%s", bus_id); in of_amba_device_create()
251 of_device_make_bus_id(&dev->dev); in of_amba_device_create()
254 prop = of_get_property(node, "arm,primecell-periphid", NULL); in of_amba_device_create()
256 dev->periphid = of_read_ulong(prop, 1); in of_amba_device_create()
258 ret = of_address_to_resource(node, 0, &dev->res); in of_amba_device_create()
291 * of_dev_lookup() - Given a device node, lookup the preferred Linux name
304 for (; auxdata->compatible; auxdata++) { in of_dev_lookup()
305 if (!of_device_is_compatible(np, auxdata->compatible)) in of_dev_lookup()
309 if (res.start != auxdata->phys_addr) in of_dev_lookup()
311 pr_debug("%pOF: devname=%s\n", np, auxdata->name); in of_dev_lookup()
320 for (; auxdata->compatible; auxdata++) { in of_dev_lookup()
321 if (!of_device_is_compatible(np, auxdata->compatible)) in of_dev_lookup()
323 if (!auxdata->phys_addr && !auxdata->name) { in of_dev_lookup()
333 * of_platform_bus_create() - Create a device for a node and its children.
357 pr_debug("%s() - skipping %pOF, no compatible prop\n", in of_platform_bus_create()
364 pr_debug("%s() - skipping %pOF node\n", __func__, bus); in of_platform_bus_create()
369 pr_debug("%s() - skipping %pOF, already populated\n", in of_platform_bus_create()
376 bus_id = auxdata->name; in of_platform_bus_create()
377 platform_data = auxdata->platform_data; in of_platform_bus_create()
395 rc = of_platform_bus_create(child, matches, lookup, &dev->dev, strict); in of_platform_bus_create()
406 * of_platform_bus_probe() - Probe the device-tree for platform buses
423 return -EINVAL; in of_platform_bus_probe()
447 * of_platform_populate() - Populate platform_devices from device tree data
475 return -EINVAL; in of_platform_populate()
508 { .compatible = "qcom,rmtfs-mem" },
509 { .compatible = "qcom,cmd-db" },
512 { .compatible = "nvmem-rmem" },
513 { .compatible = "google,open-dice" },
524 return -ENODEV; in of_platform_default_populate_init()
532 if (of_get_property(of_chosen, "linux,bootx-noscreen", NULL)) { in of_platform_default_populate_init()
540 dev = platform_device_alloc("bootx-noscreen", 0); in of_platform_default_populate_init()
542 return -ENOMEM; in of_platform_default_populate_init()
557 !of_get_property(node, "linux,boot-display", NULL)) in of_platform_default_populate_init()
559 dev = of_platform_device_create(node, "of-display", NULL); in of_platform_default_populate_init()
561 return -ENOMEM; in of_platform_default_populate_init()
568 of_platform_device_create(node, "of-display", NULL); in of_platform_default_populate_init()
574 * platform_devices for every node in /reserved-memory with a in of_platform_default_populate_init()
586 node = of_get_compatible_child(of_chosen, "simple-framebuffer"); in of_platform_default_populate_init()
608 if (!dev->of_node || !of_node_check_flag(dev->of_node, OF_POPULATED)) in of_platform_device_destroy()
612 if (of_node_check_flag(dev->of_node, OF_POPULATED_BUS)) in of_platform_device_destroy()
615 of_node_clear_flag(dev->of_node, OF_POPULATED); in of_platform_device_destroy()
616 of_node_clear_flag(dev->of_node, OF_POPULATED_BUS); in of_platform_device_destroy()
618 if (dev->bus == &platform_bus_type) in of_platform_device_destroy()
621 else if (dev->bus == &amba_bustype) in of_platform_device_destroy()
630 * of_platform_depopulate() - Remove devices populated from device tree
636 * leaving others - eg. manually created - unharmed).
640 if (parent->of_node && of_node_check_flag(parent->of_node, OF_POPULATED_BUS)) { in of_platform_depopulate()
642 of_node_clear_flag(parent->of_node, OF_POPULATED_BUS); in of_platform_depopulate()
653 * devm_of_platform_populate() - Populate platform_devices from device tree data
667 return -EINVAL; in devm_of_platform_populate()
672 return -ENOMEM; in devm_of_platform_populate()
674 ret = of_platform_populate(dev->of_node, NULL, NULL, dev); in devm_of_platform_populate()
699 * devm_of_platform_depopulate() - Remove devices populated from device tree
705 * leaving others - eg. manually created - unharmed).
729 if (!of_node_check_flag(rd->dn->parent, OF_POPULATED_BUS)) in of_platform_notify()
733 if (of_node_check_flag(rd->dn, OF_POPULATED)) in of_platform_notify()
737 pdev_parent = of_find_device_by_node(rd->dn->parent); in of_platform_notify()
738 pdev = of_platform_device_create(rd->dn, NULL, in of_platform_notify()
739 pdev_parent ? &pdev_parent->dev : NULL); in of_platform_notify()
744 __func__, rd->dn); in of_platform_notify()
746 return notifier_from_errno(-EINVAL); in of_platform_notify()
753 if (!of_node_check_flag(rd->dn, OF_POPULATED)) in of_platform_notify()
757 pdev = of_find_device_by_node(rd->dn); in of_platform_notify()
762 of_platform_device_destroy(&pdev->dev, &children_left); in of_platform_notify()