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 02537C433F5 for ; Tue, 18 Jan 2022 07:28:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AD2C1831C0; Tue, 18 Jan 2022 08:28:41 +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="IHNcPQZG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 706148365E; Tue, 18 Jan 2022 08:28:36 +0100 (CET) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 281F48313E for ; Tue, 18 Jan 2022 08:28:31 +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 lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 20I7SLjH018463; Tue, 18 Jan 2022 01:28:21 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1642490901; bh=fMmn3+NT2pXWj7y+uDs7f14aG5umhz6KRnHMUEVKvlA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=IHNcPQZGN4RJ65uFPW1VDln/r6yqmfKCfbR77Bgpbp4Hmiasj8kLaaUCx5WJ8RbzE 4MEktiKYSaSKXA5FRhBcI1eAg4/at5TMlUdZ/ki2hP/pklu0gTATpVLGsbIaL/GbKO Z5zTr1Uru8d0HeY8OiZKtqZLt6cYIT6wvq8aXjug= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 20I7SLYm023046 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 18 Jan 2022 01:28:21 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 18 Jan 2022 01:28:21 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE103.ent.ti.com (10.64.6.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, 18 Jan 2022 01:28:21 -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 20I7S7pa100474; Tue, 18 Jan 2022 01:28:15 -0600 From: Aswath Govindraju To: CC: Aswath Govindraju , 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 , Subject: [PATCH v3 01/20] remoteproc: k3_system_controller: Support optional boot_notification channel Date: Tue, 18 Jan 2022 12:57:48 +0530 Message-ID: <20220118072807.11586-2-a-govindraju@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220118072807.11586-1-a-govindraju@ti.com> References: <20220118072807.11586-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