From patchwork Wed Dec 2 09:41:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 335973 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp778953ejs; Wed, 2 Dec 2020 01:46:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+RDIQvFQcwlm08GTgiOcYZCpbNeNrkNmv1cyeDLqiKkxw89QOvv4XTZM8ovKlONfYZ5HF X-Received: by 2002:a05:6402:3d9:: with SMTP id t25mr1694969edw.338.1606902404674; Wed, 02 Dec 2020 01:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606902404; cv=none; d=google.com; s=arc-20160816; b=d2a0qKDD0ghClxzSFeZ3DfZMml0g6GnBT5Rro+uj8AsiX5Or+RbonRGljmV5RmfUI5 +4+UlaXdo1oBif6m6AnUD4coQ/FeFz5nO+wcl4yLjBRApuBXFCy/cTaVEl1JN6bLs3op Les6XznnlkfrAuHL+KXmagxmHM/O4rkMc55DeWbXeU8wQRIaNurgG7/5e/2NBcbiOSHo vBnk/RaYm9R14v3UajC8MqhoK+FYfJ6/RacbJK8JciDi2hzTWmuz5KPwQSq78Fh+eH9E NP150+mw4btoAIRaS8Vangp/pmdWbpkiOw37be0frB0c7gQ2h1oSXFuVS9qRPbVNd0J8 kvZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qCehJ5/nwTgtth9aagxkj9DlJP9D+xsxv+nF6q0eHjo=; b=gxC+aMD//dPhMLhSD0FhnI6w0WjMBaQMqQZ4gUquKa338uY1ZaaShV1cJ4Dc0EgCl1 CfmpYqwTdH7VoIb8DMyJXXJdsZQfl2XmPeeQoHjP0oIu7RXunk/CRWaPBW1rNLLMxfqM YV3Cw5ngH0fgELOExEeSYl5CVm3bpuRn8aE2/wCwSAq9lyeq0PChEii6ic2aUyJpcoqF MSMGkYkG3BxSWmu92koSv72H2YCk0dk1y/1wQGdDOPSNQ1X7FlYQNIrLatk/tziLaUrd Yxdh9MmQMOih1W9tquZyrbjA8gRJgEUVfHkkHIB5SGmitpgAdGDIQZ6J/GfTa/z8UYZi C0Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G7zlsEwL; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d27si564967ejt.291.2020.12.02.01.46.44; Wed, 02 Dec 2020 01:46:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G7zlsEwL; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388475AbgLBJoK (ORCPT + 15 others); Wed, 2 Dec 2020 04:44:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388474AbgLBJoJ (ORCPT ); Wed, 2 Dec 2020 04:44:09 -0500 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 476CDC08E85E for ; Wed, 2 Dec 2020 01:43:18 -0800 (PST) Received: by mail-pl1-x642.google.com with SMTP id r2so831069pls.3 for ; Wed, 02 Dec 2020 01:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qCehJ5/nwTgtth9aagxkj9DlJP9D+xsxv+nF6q0eHjo=; b=G7zlsEwLrIeqPDlswh4th2Xiqv2KsB6xMy7RqU+lFTvmaa7N9o5j6lH1G+S4nRiKDd K2BvhKrkzV0tlNj55QGRdyZ5khhU0uVBGV//AiJix5s3SWUTREikvE8pXCJgzDPVXKXX k3mQq6llGXsD0pOW+MPtcohMLV/JE+HTIx67DYQjbPQm6PAFvrZl9bJPj/V03VL4EVG4 s5erTQJjKqdKyFqzXjmfbGx9hpmIeriBDYmrvNKmBF8jbx8MQA7h/byN1MwuJw+CmQDM nBZWvfVLenek6nDdmBD3Gt0xkSB44LMjrx0lEJld2l2aAPCXR9easvqAmJSh05tQ0FP/ lsbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qCehJ5/nwTgtth9aagxkj9DlJP9D+xsxv+nF6q0eHjo=; b=aw4zZkr6ZP2JrOSfcca/jcX34HHO32dXIaVodAjnrNd5Vd7PJ3lxmOJzdKs55kbanO pS9lgwapLmKyDNlSuoiqsgL5VdeW5OOvKcLwQCmzOdLx2tBcF+7GMK0pYTohIROgqtgh rqmV43IREUlHoBhummVKwGalRPnDaOZfJcGKHUXYSGZihAjha6n6Jwiea6g/gnxwPMjc SFwf+9jtkEZRJilz1jyIstW+mkw3N1/t0+Dn8EUmwWaMl25OIvaHcjyJxSk5imj4OVTl Zx1m63fHiTFR6BRdgfwWg565jgjCk+D4gZ5/9ugJFlSP86w+YIxov21u2m5TDlsjrfOX S+qg== X-Gm-Message-State: AOAM5336wCaN4KE9f/yZiW4zsVRhyfcEGonQlT+ou9BB8IlxRhPw8h73 4oDXPdCUu+hlmt2weGoJn6G9dqxu6Wp0 X-Received: by 2002:a17:902:6acc:b029:d8:c6ee:6d6c with SMTP id i12-20020a1709026accb02900d8c6ee6d6cmr1866601plt.7.1606902197790; Wed, 02 Dec 2020 01:43:17 -0800 (PST) Received: from localhost.localdomain ([103.59.133.81]) by smtp.gmail.com with ESMTPSA id bg8sm1393990pjb.52.2020.12.02.01.43.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 01:43:17 -0800 (PST) From: Manivannan Sadhasivam To: gregkh@linuxfoundation.org Cc: hemantk@codeaurora.org, bbhatt@codeaurora.org, linux-arm-msm@vger.kernel.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, loic.poulain@linaro.org, Manivannan Sadhasivam Subject: [PATCH 13/29] bus: mhi: core: Use appropriate names for firmware load functions Date: Wed, 2 Dec 2020 15:11:43 +0530 Message-Id: <20201202094159.107075-14-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201202094159.107075-1-manivannan.sadhasivam@linaro.org> References: <20201202094159.107075-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bhaumik Bhatt mhi_fw_load_sbl() function is currently used to transfer SBL or EDL images over BHI (Boot Host Interface). Same goes with mhi_fw_load_amss() which uses BHIe. However, the contents of these functions do not indicate support for a specific set of images. Since these can be used for any image download over BHI or BHIe, rename them based on the protocol used. Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/boot.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/drivers/bus/mhi/core/boot.c b/drivers/bus/mhi/core/boot.c index 6f0cfb9922b4..2d7752cd9ccc 100644 --- a/drivers/bus/mhi/core/boot.c +++ b/drivers/bus/mhi/core/boot.c @@ -176,7 +176,7 @@ int mhi_download_rddm_image(struct mhi_controller *mhi_cntrl, bool in_panic) } EXPORT_SYMBOL_GPL(mhi_download_rddm_image); -static int mhi_fw_load_amss(struct mhi_controller *mhi_cntrl, +static int mhi_fw_load_bhie(struct mhi_controller *mhi_cntrl, const struct mhi_buf *mhi_buf) { void __iomem *base = mhi_cntrl->bhie; @@ -192,7 +192,7 @@ static int mhi_fw_load_amss(struct mhi_controller *mhi_cntrl, } sequence_id = MHI_RANDOM_U32_NONZERO(BHIE_TXVECSTATUS_SEQNUM_BMSK); - dev_dbg(dev, "Starting AMSS download via BHIe. Sequence ID:%u\n", + dev_dbg(dev, "Starting image download via BHIe. Sequence ID: %u\n", sequence_id); mhi_write_reg(mhi_cntrl, base, BHIE_TXVECADDR_HIGH_OFFS, upper_32_bits(mhi_buf->dma_addr)); @@ -223,7 +223,7 @@ static int mhi_fw_load_amss(struct mhi_controller *mhi_cntrl, return (!ret) ? -ETIMEDOUT : 0; } -static int mhi_fw_load_sbl(struct mhi_controller *mhi_cntrl, +static int mhi_fw_load_bhi(struct mhi_controller *mhi_cntrl, dma_addr_t dma_addr, size_t size) { @@ -250,7 +250,7 @@ static int mhi_fw_load_sbl(struct mhi_controller *mhi_cntrl, } session_id = MHI_RANDOM_U32_NONZERO(BHI_TXDB_SEQNUM_BMSK); - dev_dbg(dev, "Starting SBL download via BHI. Session ID:%u\n", + dev_dbg(dev, "Starting image download via BHI. Session ID: %u\n", session_id); mhi_write_reg(mhi_cntrl, base, BHI_STATUS, 0); mhi_write_reg(mhi_cntrl, base, BHI_IMGADDR_HIGH, @@ -449,9 +449,9 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) return; } - /* Download SBL image */ + /* Download image using BHI */ memcpy(buf, firmware->data, size); - ret = mhi_fw_load_sbl(mhi_cntrl, dma_addr, size); + ret = mhi_fw_load_bhi(mhi_cntrl, dma_addr, size); mhi_free_coherent(mhi_cntrl, size, buf, dma_addr); if (!mhi_cntrl->fbc_download || ret || mhi_cntrl->ee == MHI_EE_EDL) @@ -459,7 +459,7 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) /* Error or in EDL mode, we're done */ if (ret) { - dev_err(dev, "MHI did not load SBL, ret:%d\n", ret); + dev_err(dev, "MHI did not load image over BHI, ret: %d\n", ret); return; } @@ -509,11 +509,12 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) /* Start full firmware image download */ image_info = mhi_cntrl->fbc_image; - ret = mhi_fw_load_amss(mhi_cntrl, + ret = mhi_fw_load_bhie(mhi_cntrl, /* Vector table is the last entry */ &image_info->mhi_buf[image_info->entries - 1]); if (ret) - dev_err(dev, "MHI did not load AMSS, ret:%d\n", ret); + dev_err(dev, "MHI did not load image over BHIe, ret: %d\n", + ret); release_firmware(firmware);