#include <image.h>
#include <malloc.h>
#include <asm/io.h>
+#include <dm/device_compat.h>
#include <linux/errno.h>
#include <u-boot/crc.h>
#include <dm.h>
/* Init common part of FM, index is fm num# like fm as above */
#ifdef CONFIG_TFABOOT
-int fm_init_common(int index, struct ccsr_fman *reg)
+int fm_init_common(int index, struct ccsr_fman *reg, const char *firmware_name)
{
int rc;
void *addr = NULL;
return fm_init_bmi(index, ®->fm_bmi_common);
}
#else
-int fm_init_common(int index, struct ccsr_fman *reg)
+int fm_init_common(int index, struct ccsr_fman *reg, const char *firmware_name)
{
int rc;
#if defined(CONFIG_SYS_QE_FMAN_FW_IN_NOR)
static int fman_probe(struct udevice *dev)
{
+ const char *firmware_name = NULL;
+ int ret;
struct fman_priv *priv = dev_get_priv(dev);
priv->reg = (struct ccsr_fman *)(uintptr_t)dev_read_addr(dev);
return -EINVAL;
}
- return fm_init_common(priv->fman_id, priv->reg);
+ ret = dev_read_string_index(dev, "firmware-name", 0, &firmware_name);
+ if (ret && ret != -EINVAL) {
+ dev_dbg(dev, "Could not read firmware-name\n");
+ return ret;
+ }
+
+ return fm_init_common(priv->fman_id, priv->reg, firmware_name);
}
static int fman_remove(struct udevice *dev)
void *fm_muram_alloc(int fm_idx, size_t size, ulong align);
void *fm_muram_base(int fm_idx);
-int fm_init_common(int index, struct ccsr_fman *reg);
+int fm_init_common(int index, struct ccsr_fman *reg, const char *firmware_name);
int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info);
phy_interface_t fman_port_enet_if(enum fm_port port);
void fman_disable_port(enum fm_port port);