diff options
-rw-r--r-- | arch/arm/Kconfig | 2 | ||||
-rw-r--r-- | drivers/firmware/firmware-zynqmp.c | 47 |
2 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 257a98d795..0c41bc3e5b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1051,6 +1051,7 @@ config ARCH_ZYNQMP select CLK select DM select DM_ETH if NET + select DM_MAILBOX select DM_MMC if MMC select DM_SERIAL select DM_SPI if SPI @@ -1061,6 +1062,7 @@ config ARCH_ZYNQMP select SPL_CLK if SPL select SPL_SEPARATE_BSS if SPL select SUPPORT_SPL + select ZYNQMP_IPI imply BOARD_LATE_INIT imply CMD_DM imply FAT_WRITE diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index 4077126581..5ed2b32c11 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -1,7 +1,54 @@ // SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx Zynq MPSoC Firmware driver + * + * Copyright (C) 2018-2019 Xilinx, Inc. + */ +#include <common.h> #include <dm.h> +#if defined(CONFIG_ZYNQMP_IPI) +#include <mailbox.h> +#include <asm/arch/sys_proto.h> + +struct zynqmp_power { + struct mbox_chan tx_chan; + struct mbox_chan rx_chan; +} zynqmp_power; + +static int zynqmp_power_probe(struct udevice *dev) +{ + int ret = 0; + + debug("%s, (dev=%p)\n", __func__, dev); + + ret = mbox_get_by_name(dev, "tx", &zynqmp_power.tx_chan); + if (ret) { + debug("%s, cannot tx mailbox\n", __func__); + return ret; + } + + ret = mbox_get_by_name(dev, "rx", &zynqmp_power.rx_chan); + if (ret) + debug("%s, cannot rx mailbox\n", __func__); + + return ret; +}; + +static const struct udevice_id zynqmp_power_ids[] = { + { .compatible = "xlnx,zynqmp-power" }, + { } +}; + +U_BOOT_DRIVER(zynqmp_power) = { + .name = "zynqmp_power", + .id = UCLASS_FIRMWARE, + .of_match = zynqmp_power_ids, + .probe = zynqmp_power_probe, +}; +#endif + static const struct udevice_id zynqmp_firmware_ids[] = { { .compatible = "xlnx,zynqmp-firmware" }, { .compatible = "xlnx,versal-firmware"}, |