From patchwork Fri Sep 27 13:34:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1168523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="hIn1UBAM"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46ftHW49z7z9sDB for ; Fri, 27 Sep 2019 23:41:26 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A0F08C22037; Fri, 27 Sep 2019 13:37:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 78E7BC21FC6; Fri, 27 Sep 2019 13:36:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 87604C21FC0; Fri, 27 Sep 2019 13:35:21 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by lists.denx.de (Postfix) with ESMTPS id 452ABC21FA1 for ; Fri, 27 Sep 2019 13:35:19 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id w12so2772630wro.5 for ; Fri, 27 Sep 2019 06:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=pgrVd2l/+ejhn0rLoroH4AprExNBwBOF9m9t1OMOeVU=; b=hIn1UBAMZADUgH/gBfBOEIDCnOe13es8L+EEXy3HsK6/8879tR0/otbX/H1u0gt35a qmpyTKYyI7iXmr1C2PhELA4ZROCjbuMeROOM6vN48myYyZ8d1xUMAO1wXKfLd0GVHBc0 h6CLMsQn0zsiX6POnsofZb/COF0KM7yp8e3JwLKfuaTjJ7/coo7aK45f5gLtQESSRsq7 YiQcHyiGY8hdXJwDjw6U47sH40ihegfevJmGf8efskpGiiyyvzD1pxC5BUTQAruUH2va IRQaLZRcdX5BaOsVBUyfF3vxaQIprUxCSUmBO4uCouaINRtXkHdw3Cj3b7oRNiYHBkLa FsiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=pgrVd2l/+ejhn0rLoroH4AprExNBwBOF9m9t1OMOeVU=; b=dLzdgEL0oqapnSfY8Z3OGlLuXbAW3l7q7oZmlspfAEbY7h4GRdrK5MLSBZADiexO1x bwiC1D2CfyxmElcCKvzHxgXmwJ9tT8rVPoxnuHqmreCeMc/D7nKAVQ+wfV4l4i9BwyzA t2MXCsNQSd5yLTZUOk3ww1QKQfoJ7keQJd/vbPpOL+bFqdqGVmS3nCqPX991SvAWcpc2 bX+LJhNKAsD9XY2WAkKW6dTPzv3vBWeDq969fvuxms/i4dJmnC8yHaepIED6WmsztZxt GxJjvHK75jS+uvKEeOXrCY9/fgxm3knzSyO7yQAbOCVYN3hXWd72TrlyIPrTQZ+XOFYz 1OhA== X-Gm-Message-State: APjAAAXa6ShQy2hnJZjScAGOw/pa1uezn+4g/IOdap7yA6KPu/gaJQ7o FUt3fG+6jwJeuAPKnfESqGQ5fhUJ6R7/6g== X-Google-Smtp-Source: APXvYqxWE/Dbr5WBcUvBFymxdZ8uPVj3Ra/Qppm5xuW4GPvmK3cZmIXA/cBz3toipr7F56dJDoUm7A== X-Received: by 2002:a5d:5592:: with SMTP id i18mr2978589wrv.316.1569591318559; Fri, 27 Sep 2019 06:35:18 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id h7sm2577053wrt.17.2019.09.27.06.35.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Sep 2019 06:35:17 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Date: Fri, 27 Sep 2019 15:34:55 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Cc: Rajan Vaja , luca@lucaceresoli.net, ibai.erkiaga-elorza@xilinx.com Subject: [U-Boot] [PATCH 04/13] firmware: zynqmp: Add zynqmp-power support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Ibai Erkiaga zynqmp-power driver for ZynqMP to handle the communication with the PMU firmware. Firmware driver just probes subnodes and power driver handles communication with PMU using the IPI mailbox driver. Signed-off-by: Ibai Erkiaga Signed-off-by: Michal Simek --- drivers/firmware/Kconfig | 2 ++ drivers/firmware/firmware-zynqmp.c | 40 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index b70a2063551c..9596ec16c7f7 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -30,6 +30,8 @@ config TI_SCI_PROTOCOL config ZYNQMP_FIRMWARE bool "ZynqMP Firmware interface" select FIRMWARE + select ZYNQMP_IPI + select DM_MAILBOX help Firmware interface driver is used by different drivers to communicate with the firmware for diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index 6644a7166ca0..b0930447b988 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -1,6 +1,46 @@ // SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx Zynq MPSoC Firmware driver + * + * Copyright (C) 2018-2019 Xilinx, Inc. + */ +#include #include +#include +#include + +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); + ret |= mbox_get_by_name(dev, "rx", &zynqmp_power.rx_chan); + + if (ret) + debug("%s, cannot get mailboxes\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, +}; static const struct udevice_id zynqmp_firmware_ids[] = { { .compatible = "xlnx,zynqmp-firmware" },