mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-26 07:17:10 +00:00
remoteproc: migrate uclass to livetree
Use dev_ function to read the name and boolean to support a live tree. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5f8cefb7b1
commit
e2170c29ee
1 changed files with 2 additions and 14 deletions
|
@ -9,19 +9,15 @@
|
||||||
#define pr_fmt(fmt) "%s: " fmt, __func__
|
#define pr_fmt(fmt) "%s: " fmt, __func__
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fdtdec.h>
|
|
||||||
#include <log.h>
|
#include <log.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <remoteproc.h>
|
#include <remoteproc.h>
|
||||||
#include <asm/global_data.h>
|
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <dm/device-internal.h>
|
#include <dm/device-internal.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <dm/uclass.h>
|
#include <dm/uclass.h>
|
||||||
#include <dm/uclass-internal.h>
|
#include <dm/uclass-internal.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* for_each_remoteproc_device() - iterate through the list of rproc devices
|
* for_each_remoteproc_device() - iterate through the list of rproc devices
|
||||||
* @fn: check function to call per match, if this function returns fail,
|
* @fn: check function to call per match, if this function returns fail,
|
||||||
|
@ -121,21 +117,13 @@ static int rproc_pre_probe(struct udevice *dev)
|
||||||
|
|
||||||
if (!dev_get_plat(dev)) {
|
if (!dev_get_plat(dev)) {
|
||||||
#if CONFIG_IS_ENABLED(OF_CONTROL)
|
#if CONFIG_IS_ENABLED(OF_CONTROL)
|
||||||
int node = dev_of_offset(dev);
|
|
||||||
const void *blob = gd->fdt_blob;
|
|
||||||
bool tmp;
|
bool tmp;
|
||||||
if (!blob) {
|
|
||||||
debug("'%s' no dt?\n", dev->name);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
debug("'%s': using fdt\n", dev->name);
|
debug("'%s': using fdt\n", dev->name);
|
||||||
uc_pdata->name = fdt_getprop(blob, node,
|
uc_pdata->name = dev_read_string(dev, "remoteproc-name");
|
||||||
"remoteproc-name", NULL);
|
|
||||||
|
|
||||||
/* Default is internal memory mapped */
|
/* Default is internal memory mapped */
|
||||||
uc_pdata->mem_type = RPROC_INTERNAL_MEMORY_MAPPED;
|
uc_pdata->mem_type = RPROC_INTERNAL_MEMORY_MAPPED;
|
||||||
tmp = fdtdec_get_bool(blob, node,
|
tmp = dev_read_bool(dev, "remoteproc-internal-memory-mapped");
|
||||||
"remoteproc-internal-memory-mapped");
|
|
||||||
if (tmp)
|
if (tmp)
|
||||||
uc_pdata->mem_type = RPROC_INTERNAL_MEMORY_MAPPED;
|
uc_pdata->mem_type = RPROC_INTERNAL_MEMORY_MAPPED;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Reference in a new issue