From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from so254-9.mailgun.net (so254-9.mailgun.net [198.61.254.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A51F2ED0 for ; Tue, 15 Feb 2022 01:14:36 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1644887676; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: From: References: Cc: To: Subject: MIME-Version: Date: Message-ID: Sender; bh=iVlJD7hevk745hR82UWssLvOu64dOiqyn3Bntky6xx8=; b=uWiV9HVt/WBKJRNXQRBzQvikAxJsYHxxjTYxVGqEiBhZMXrsKDFEg2P1Gbq222GE9Z7Qij8m OPGx04uKvLxApCC7rotOSRbqaq4s/IpMjRCgMBv9K3tSW5mjNlpCAyax1uoOJIXlCWhOwZqj O1s3Z84hyCBzBZ6OyoJQiMdrmmE= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyIyZTBmZSIsICJtaGlAbGlzdHMubGludXguZGV2IiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 620afe7b19d16b66a9d2d514 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 15 Feb 2022 01:14:35 GMT Sender: hemantk=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2F2A5C4360C; Tue, 15 Feb 2022 01:14:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.1.14] (cpe-76-176-73-171.san.res.rr.com [76.176.73.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: hemantk) by smtp.codeaurora.org (Postfix) with ESMTPSA id D9A6AC4338F; Tue, 15 Feb 2022 01:14:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org D9A6AC4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org Message-ID: <54bcb1c0-d264-5b82-e9f6-0343579d4978@codeaurora.org> Date: Mon, 14 Feb 2022 17:14:33 -0800 Precedence: bulk X-Mailing-List: mhi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH v3 11/25] bus: mhi: ep: Add support for managing MMIO registers Content-Language: en-US To: Manivannan Sadhasivam , mhi@lists.linux.dev Cc: quic_hemantk@quicinc.com, quic_bbhatt@quicinc.com, quic_jhugo@quicinc.com, vinod.koul@linaro.org, bjorn.andersson@linaro.org, dmitry.baryshkov@linaro.org, quic_vbadigan@quicinc.com, quic_cang@quicinc.com, quic_skananth@quicinc.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, elder@linaro.org References: <20220212182117.49438-1-manivannan.sadhasivam@linaro.org> <20220212182117.49438-12-manivannan.sadhasivam@linaro.org> From: Hemant Kumar In-Reply-To: <20220212182117.49438-12-manivannan.sadhasivam@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Mani On 2/12/2022 10:21 AM, Manivannan Sadhasivam wrote: > Add support for managing the Memory Mapped Input Output (MMIO) registers > of the MHI bus. All MHI operations are carried out using the MMIO registers > by both host and the endpoint device. > > The MMIO registers reside inside the endpoint device memory (fixed > location based on the platform) and the address is passed by the MHI EP > controller driver during its registration. > > Signed-off-by: Manivannan Sadhasivam > --- > drivers/bus/mhi/ep/Makefile | 2 +- > drivers/bus/mhi/ep/internal.h | 37 +++++ > drivers/bus/mhi/ep/main.c | 6 +- > drivers/bus/mhi/ep/mmio.c | 274 ++++++++++++++++++++++++++++++++++ > include/linux/mhi_ep.h | 18 +++ > 5 files changed, 335 insertions(+), 2 deletions(-) > create mode 100644 drivers/bus/mhi/ep/mmio.c > > diff --git a/drivers/bus/mhi/ep/Makefile b/drivers/bus/mhi/ep/Makefile > index 64e29252b608..a1555ae287ad 100644 > --- a/drivers/bus/mhi/ep/Makefile > +++ b/drivers/bus/mhi/ep/Makefile > @@ -1,2 +1,2 @@ > obj-$(CONFIG_MHI_BUS_EP) += mhi_ep.o > -mhi_ep-y := main.o > +mhi_ep-y := main.o mmio.o > diff --git a/drivers/bus/mhi/ep/internal.h b/drivers/bus/mhi/ep/internal.h > index e313a2546664..2c756a90774c 100644 > --- a/drivers/bus/mhi/ep/internal.h > +++ b/drivers/bus/mhi/ep/internal.h > @@ -101,6 +101,17 @@ struct mhi_generic_ctx { > __u64 wp __packed __aligned(4); > }; > > +/** > + * enum mhi_ep_execenv - MHI Endpoint Execution Environment > + * @MHI_EP_SBL_EE: Secondary Bootloader > + * @MHI_EP_AMSS_EE: Advanced Mode Subscriber Software > + */ > +enum mhi_ep_execenv { > + MHI_EP_SBL_EE = 1, > + MHI_EP_AMSS_EE = 2, > + MHI_EP_UNRESERVED > +}; can we move or use the exec env definitions from common header ? > + > enum mhi_ep_ring_type { > RING_TYPE_CMD = 0, > RING_TYPE_ER, > @@ -157,4 +168,30 @@ struct mhi_ep_chan { > bool skip_td; > }; > > +/* MMIO related functions */ > +u32 mhi_ep_mmio_read(struct mhi_ep_cntrl *mhi_cntrl, u32 offset); > +void mhi_ep_mmio_write(struct mhi_ep_cntrl *mhi_cntrl, u32 offset, u32 val); > +void mhi_ep_mmio_masked_write(struct mhi_ep_cntrl *mhi_cntrl, u32 offset, u32 mask, u32 val); > +u32 mhi_ep_mmio_masked_read(struct mhi_ep_cntrl *dev, u32 offset, u32 mask); > +void mhi_ep_mmio_enable_ctrl_interrupt(struct mhi_ep_cntrl *mhi_cntrl); > +void mhi_ep_mmio_disable_ctrl_interrupt(struct mhi_ep_cntrl *mhi_cntrl); > +void mhi_ep_mmio_enable_cmdb_interrupt(struct mhi_ep_cntrl *mhi_cntrl); > +void mhi_ep_mmio_disable_cmdb_interrupt(struct mhi_ep_cntrl *mhi_cntrl); > +void mhi_ep_mmio_enable_chdb_a7(struct mhi_ep_cntrl *mhi_cntrl, u32 chdb_id); can we get rid of a7 from function and macros ? > +void mhi_ep_mmio_disable_chdb_a7(struct mhi_ep_cntrl *mhi_cntrl, u32 chdb_id); [..] -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project