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 0A226C433EF for ; Tue, 25 Jan 2022 15:27:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 505F483049; Tue, 25 Jan 2022 16:27: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=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="bruYK8BK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2817D83097; Tue, 25 Jan 2022 16:27:14 +0100 (CET) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (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 579A982849 for ; Tue, 25 Jan 2022 16:27:11 +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 lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 20PFR0ru082731; Tue, 25 Jan 2022 09:27:00 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1643124420; bh=fMmn3+NT2pXWj7y+uDs7f14aG5umhz6KRnHMUEVKvlA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=bruYK8BKQh0RbHZp4vzAzLfp0NicO1UEowWzHnn19EIFc5Fb4xDyqDarAMqXDaXkF MKWu3xpIkyOc8KI/FFgY3vpG8L7psBdF9cGW47kVN4W4nNIN9gREvRJuzOPrHMZiyQ btDbAiMsUD3BT9cmtW/kwog3TQWj0NTVraxhVk0s= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 20PFR083130358 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 25 Jan 2022 09:27:00 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 25 Jan 2022 09:27:00 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE102.ent.ti.com (10.64.6.23) 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, 25 Jan 2022 09:27:00 -0600 Received: from gsaswath-HP-ProBook-640-G5.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 20PFQkT5083420; Tue, 25 Jan 2022 09:26:54 -0600 From: Aswath Govindraju To: CC: Lukasz Majewski , Sean Anderson , Jaehoon Chung , Simon Glass , Fabio Estevam , Andre Przywara , Jagan Teki , Kever Yang , Tim Harvey , Christian Hewitt , Peter Robinson , Dave Gerlach , David Huang , Keerthy , Hari Nagalla , Nishanth Menon , Tero Kristo , Suman Anna , Vignesh Raghavendra , Wolfgang Denk , Kishon Vijay Abraham I , , Tom Rini , Aswath Govindraju Subject: [PATCH v4 01/20] remoteproc: k3_system_controller: Support optional boot_notification channel Date: Tue, 25 Jan 2022 20:56:27 +0530 Message-ID: <20220125152646.3780-2-a-govindraju@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220125152646.3780-1-a-govindraju@ti.com> References: <20220125152646.3780-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.5 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