From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32C28C433F5 for ; Tue, 11 Jan 2022 07:56:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0622181DF1; Tue, 11 Jan 2022 08:56:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="KW8rNWJw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 18336803CA; Tue, 11 Jan 2022 08:56:19 +0100 (CET) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EC4C0803CA for ; Tue, 11 Jan 2022 08:56:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=a-govindraju@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 20B7txQa093924; Tue, 11 Jan 2022 01:55:59 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1641887759; bh=fMmn3+NT2pXWj7y+uDs7f14aG5umhz6KRnHMUEVKvlA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=KW8rNWJwPOLEMcD2+c/fT9c46e1CfJwjDQXxzL3ZAIs6TmyCFlMpgoDLIKunlDCDd 9zj+BxYMdJS8Ddj7sJmgUdh2Uu107Hy9j6c/L3zsrVxnyvDVgDmHKiIb85un7hI01C zOaPuckWk6sKcNaE7bfBVicHQ0vvkE6I2FCwlbh4= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 20B7txLH092144 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Jan 2022 01:55:59 -0600 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 11 Jan 2022 01:55:59 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Tue, 11 Jan 2022 01:55:59 -0600 Received: from gsaswath-HP-ProBook-640-G5.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 20B7tktE016512; Tue, 11 Jan 2022 01:55:53 -0600 From: Aswath Govindraju To: CC: , Wolfgang Denk , Hari Nagalla , David Huang , Keerthy , Dave Gerlach , Suman Anna , Nishanth Menon , Tero Kristo , Kishon Vijay Abraham I , Vignesh Raghavendra , Christian Hewitt , Tim Harvey , Peter Robinson , Kever Yang , Neil Armstrong , Fabio Estevam , Andre Przywara , Jaehoon Chung , Sean Anderson , Lukasz Majewski , Aswath Govindraju Subject: [PATCH v2 01/20] remoteproc: k3_system_controller: Support optional boot_notification channel Date: Tue, 11 Jan 2022 13:25:26 +0530 Message-ID: <20220111075545.1880-2-a-govindraju@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220111075545.1880-1-a-govindraju@ti.com> References: <20220111075545.1880-1-a-govindraju@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean From: Nishanth Menon If there is an optional boot notification channel that an SoC uses separate from the rx path, use the same. Signed-off-by: Nishanth Menon --- .../remoteproc/k3-system-controller.txt | 3 +++ drivers/remoteproc/k3_system_controller.c | 20 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/doc/device-tree-bindings/remoteproc/k3-system-controller.txt b/doc/device-tree-bindings/remoteproc/k3-system-controller.txt index 32f4720b0d17..33dc46812ed4 100644 --- a/doc/device-tree-bindings/remoteproc/k3-system-controller.txt +++ b/doc/device-tree-bindings/remoteproc/k3-system-controller.txt @@ -13,6 +13,9 @@ Required properties: "rx" for Receive channel - mboxes: Corresponding phandles to mailbox channels. +Optional properties: +-------------------- +- mbox-names: "boot_notify" for Optional alternate boot notification channel. Example: -------- diff --git a/drivers/remoteproc/k3_system_controller.c b/drivers/remoteproc/k3_system_controller.c index 89cb90207dcb..e2affe69c678 100644 --- a/drivers/remoteproc/k3_system_controller.c +++ b/drivers/remoteproc/k3_system_controller.c @@ -77,14 +77,18 @@ struct k3_sysctrler_desc { * struct k3_sysctrler_privdata - Structure representing System Controller data. * @chan_tx: Transmit mailbox channel * @chan_rx: Receive mailbox channel + * @chan_boot_notify: Boot notification channel * @desc: SoC description for this instance * @seq_nr: Counter for number of messages sent. + * @has_boot_notify: Has separate boot notification channel */ struct k3_sysctrler_privdata { struct mbox_chan chan_tx; struct mbox_chan chan_rx; + struct mbox_chan chan_boot_notify; struct k3_sysctrler_desc *desc; u32 seq_nr; + bool has_boot_notify; }; static inline @@ -223,7 +227,8 @@ static int k3_sysctrler_start(struct udevice *dev) debug("%s(dev=%p)\n", __func__, dev); /* Receive the boot notification. Note that it is sent only once. */ - ret = mbox_recv(&priv->chan_rx, &msg, priv->desc->max_rx_timeout_us); + ret = mbox_recv(priv->has_boot_notify ? &priv->chan_boot_notify : + &priv->chan_rx, &msg, priv->desc->max_rx_timeout_us); if (ret) { dev_err(dev, "%s: Boot Notification response failed. ret = %d\n", __func__, ret); @@ -272,6 +277,19 @@ static int k3_of_to_priv(struct udevice *dev, return ret; } + /* Some SoCs may have a optional channel for boot notification. */ + priv->has_boot_notify = 1; + ret = mbox_get_by_name(dev, "boot_notify", &priv->chan_boot_notify); + if (ret == -ENODATA) { + dev_dbg(dev, "%s: Acquiring optional Boot_notify failed. ret = %d. Using Rx\n", + __func__, ret); + priv->has_boot_notify = 0; + } else if (ret) { + dev_err(dev, "%s: Acquiring boot_notify channel failed. ret = %d\n", + __func__, ret); + return ret; + } + return 0; } -- 2.17.1