Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3054165imm; Mon, 10 Sep 2018 10:15:35 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb1fajb+pxuVd8fYpRAJjdHiYHgFIMXMfB5wm+jW7SJMpEIQ5PLdUeoav9QK5WHlm8JrHgA X-Received: by 2002:a65:6499:: with SMTP id e25-v6mr23087884pgv.224.1536599735808; Mon, 10 Sep 2018 10:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536599735; cv=none; d=google.com; s=arc-20160816; b=ZKrUKbx5vZ4PKuwHApeTr7R9+8UYEU1taNECi8dlaKCK7XxLDz6UJfbvW2weUYLRUz S1CWS2nILNJW+TDTVIg+9hZycczu1kshJHb1V51I7zZzyGHh5LBMK264pOas9ESyuf2V 7nIQ6dIFwEhg+wBVYKpgZcTpErVOLy9gWAifPIUIucag4D4LyW2+38pKE7IwjaqlPk8b T62LCEc8N0a+buk8RgSgupbQH3vRMageNVnJLwO/SeFZTplEpODpSgKAEHP8RcCdinqT SLzEQEsJC5nDmCJV73HDujX//8Bk2UxaJUGY5X/uvHpYZzUfejS4jncJ18WkqiTbA2CM 7/yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qpiXGPhFepwUIXaL9NlaQ1hCx3xDrFv4GP95+nUw8ts=; b=Fzga1i4w5PBAVcVzs6umIAQcihuDHnX86v2Hg5qdnaJCMP9p6aRTHRsZ/IaE/qWu1I OsEAZ0T0DcPE50zUog+38Jf+VWbdy6dSBn9g0t7nVXEXgAf1wRQMtamaE5NRPGQis7hn uczlDNl0nTOQ+ibPzyqK80SNYnfafuuSh2VQaSn8z32ttxHFO0juaO88xWnbBn3cG5nH 6IUDhTeZBJaqAvUxaeo8lgxGp3T0kWPcwHdC9qIh7iPvp3DIKv3sfoczsFdDSDgNEzbP NaQINRI0FXdSfx/sIuRhMarvsbRGcgRNVYlwr7C+nPz5RT871cAZZb8ubcSF3I0A46ce wtvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NcDjyPuE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m126-v6si19651621pfb.126.2018.09.10.10.15.18; Mon, 10 Sep 2018 10:15:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NcDjyPuE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727764AbeIJWIt (ORCPT + 99 others); Mon, 10 Sep 2018 18:08:49 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42398 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbeIJWIt (ORCPT ); Mon, 10 Sep 2018 18:08:49 -0400 Received: by mail-pl1-f195.google.com with SMTP id g23-v6so10019979plq.9; Mon, 10 Sep 2018 10:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qpiXGPhFepwUIXaL9NlaQ1hCx3xDrFv4GP95+nUw8ts=; b=NcDjyPuE/MGsF7MQb3B18TK8hZ1HtyQJrqYCGjdiKgDUMQoIyZwIbLS8mkvlP8mHoJ 7dETJHIfjq0KL6po8ZzX6cvTFOMcfArtFJu1CwAQAB1J1bKq6a1gEtqUl4oqeKVQmVKb LT7LU6FbfF6oRBdWaQVSMDZSYIwh/YlvqWDD/czUhnwtTLIQUpbyCZULQL7dh0tD0RWA bUUXjblQhfIeRcSnAIv+kH43V7E3TGuQtPB6WAylagcBduSTVoTecJ5MWgBMIwi4RsKv iEJb1X6b68z7Rs4tWYZ7Dour0ww1SEopqufp/vkDumJQjFDtDphtAHsXTsrLRIoGujQY AIbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qpiXGPhFepwUIXaL9NlaQ1hCx3xDrFv4GP95+nUw8ts=; b=nAoXqW8rrHzaZ2hJ6hHLbwNsI8C9MKOSa7//5wvy5kCL/Nq9IMuyJiHJL97nU3rqgJ j8eb6MqZBj6h9y0sMJg9xQNCj3rn+gXmhtSHG7OsyQd1xIUMkd382OgxYbhWAYnloR9U K3Q7WHAo9khN422KUHyWuuxF+DM7PuamkzU/HQxI9szQSJp4lShAvLQMg2KUNLOwnYUe 2LF4lhEv0LWgx+pw8BExWPfqYXrOCJIC3LKo0+wVZMDLfcoc64UL8INIBR9F/MWyzU48 p3+fb9dyYJbVD4LIztu1mOkQaaD9tLRDGcNZ48sibr71TUJogSSk4Hx10/87LvOwKLiz 1sVw== X-Gm-Message-State: APzg51AkCF3I/xP/hewVbZ5trxGeP4Tfa+eLRN4wt1hpQmB2dLyeCwOA BzHJ4b6Kb2sf3VTJJ8kWkTbyq0vznjDyqimLAr0= X-Received: by 2002:a17:902:6f16:: with SMTP id w22-v6mr23248590plk.127.1536599624699; Mon, 10 Sep 2018 10:13:44 -0700 (PDT) MIME-Version: 1.0 References: <1515109891-17133-1-git-send-email-jliang@xilinx.com> <1515109891-17133-3-git-send-email-jliang@xilinx.com> In-Reply-To: From: Wendy Liang Date: Mon, 10 Sep 2018 10:13:33 -0700 Message-ID: Subject: Re: [PATCH v3 2/2] dt-bindings: mailbox: Add Xilinx IPI Mailbox To: Jassi Brar Cc: Wendy Liang , Michal Simek , Rob Herring , Mark Rutland , linux-arm-kernel , Devicetree List , Linux Kernel Mailing List , Sudeep Holla , Andre Przywara Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 2:31 PM Wendy Liang wrote: > > On Tue, Jan 9, 2018 at 8:42 PM, Jassi Brar wrote: > > On Wed, Jan 10, 2018 at 6:52 AM, Jiaying Liang wrote: > >>> From: Jassi Brar [mailto:jassisinghbrar@gmail.com] > > > >>> > + > >>> > +Controller Device Node: > >>> > +=========================== > >>> > +Required properties: > >>> > +-------------------- > >>> > +- compatible: Shall be: "xlnx,zynqmp-ipi-mailbox" > >>> > +- reg: IPI buffers address ranges > >>> > +- reg-names: Names of the reg resources. It should have: > >>> > + * local_request_region > >>> > + - IPI request msg buffer written by local and read > >>> > + by remote > >>> > + * local_response_region > >>> > + - IPI response msg buffer written by local and read > >>> > + by remote > >>> > + * remote_request_region > >>> > + - IPI request msg buffer written by remote and read > >>> > + by local > >>> > + * remote_response_region > >>> > + - IPI response msg buffer written by remote and read > >>> > + by local > >>> > > >>> shmem is option and external to the controller. It should be passed via > >>> client's binding. > >>> Please have a look at Sudeep's proposed patch > >>> https://www.spinics.net/lists/arm-kernel/msg626120.html > >> [Wendy] thanks for the link, but those 'buffers" are registers in the hardware > >> but not memory. > >> > > No, that is for memory, not registers. > > Please have a more careful look at the patch. > > Sorry for very late response. > > Those are not the normal memory but device memories, > they are 32bytes fixed request buffers and response buffers per > channel. They come > from the IPI hardware block. > > The mailbox framework API "mbox_send_message()" allows users to send message > to the mailbox. in this case, just not clear on why we cannot have the > buffer in the > controller? These memories are not for sharing data, but just for > short notification > messages. > > > > >>> > >>> > +- #mbox-cells: Shall be 1. It contains: > >>> > + * tx(0) or rx(1) channel > >>> > +- xlnx,ipi-ids: Xilinx IPI agent IDs of the two peers of the > >>> > + Xilinx IPI communication channel. > >>> > +- interrupt-parent: Phandle for the interrupt controller > >>> > +- interrupts: Interrupt information corresponding to the > >>> > + interrupt-names property. > >>> > + > >>> > +Optional properties: > >>> > +-------------------- > >>> > +- method: The method of accessing the IPI agent registers. > >>> > + Permitted values are: "smc" and "hvc". Default is > >>> > + "smc". > >>> > + > >>> Andre almost implemented the generic driver. Can you please have a look at > >>> https://www.spinics.net/lists/arm-kernel/msg595416.html > >>> and see if you can just finish it off? > >> [Wendy] This mailbox controller is about to use Xilinx IPI hardware as mailbox. > >> > > I couldn't find anything specific to Xilinx h/w > > zynqmp_ipi_fw_call() is same as arm_smc_send_data() in Andre's driver > > (though it needs to pass on [R2,R7] as I suggested in reply to him). > > > >> We use it to send notification/short request to firmware (usually running on > >> another core on SoC), > >> > > So does Andre's driver. Which is precise and generic, so I much prefer that. > > > >> and also to receive notification/short request from firmware. > >> Interrupt is used in the receiving direction. It looks different to the usage of > >> mailbox driver from the link. > >> > > Yes, there is some difference. But nothing related to your h/w. > > Andre's driver assume synchronous transmits where the response is > > filled in the regs upon return. > > What kind of calls do you make to your remote firmware? I would expect > > them to be 'fast'. > > The reason to have this mailbox driver is because, we have an hardware block > for IPI, this hardware block has registers and buffers and we want to > to use Linux > kernel mailbox framework APIs such as mbox_send_message() and rx_callback in > client drivers to send notification or short request to other > processors and receive > response and request. > > The reason to use SMC calls to access the registers is because we have the case > that both the ATF and Linux kernel drive will need to access the same registers. > > I have looked at the arm_smc patch, it looks like it is for > synchronous request, and only > allow 32bit message. In our case, we need to: > * besides synchronous request, we also need to handle asynchronous request. > The driver will monitor the interrupt to see if there is a message > from the other core. > If yes, it will notify the client from rx_callback. > * put 32bytes short message to the mailbox. > > Thanks, > Wendy Hi Jassi, Ping. I posted some questions on another email to the ARM SMC mailbox driver. But no response yet. There are some issues with the latest ARM SMC mailbox driver I have seen so far. * The message length is very limited. In our case, in order to send or receive message from our mailbox hardware, we will need to extend the message length, in our case it is 32bytes. Here is what I am thinking about: * Opt 1: pass pointer from kernel to ATF to allow ATF to read/write to the pointer. * Opt 2: define ARM-SMC message as struct arm_smc_msg { u32 len; void *msg; void *resp; }; When sends to the message, use multiple SMC calls to copy the message content to the SMCC parameters. Also use multiple SMC calls to get the response from SMCC parameters. * Opt3: even if our driver is using SMCC to send and receive messages, but those SMCC calls will be specific to our hardware. Instead of using a generic ARM-SMC mailbox driver, we have our vendor specific mailbox driver in Linux kernel. How do you think about the above options? Thanks, Wendy > > > > >> Is there a plan to extend the ARM SMC mailbox driver > >> to both trigger firmware actions and receive request from firmware? > >> > > Sure if we have a genuine requirement we can support RX path as well. > > > > Thanks.