Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10774821ybi; Thu, 25 Jul 2019 05:05:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXP0540z1RBKN6Ny2Q0DOT4234Uudo/XrqVe3266+loKgRTlCcOE2XKzmt7/5kD5Q3qyVb X-Received: by 2002:a17:902:2889:: with SMTP id f9mr86070687plb.230.1564056308796; Thu, 25 Jul 2019 05:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564056308; cv=none; d=google.com; s=arc-20160816; b=pdyeWUI2ru0RMXa1jCuGQFuf6F582cOedCk51ypEo2IIqYY5RtMkKST7GfRA/mXs9e Ire1D1FFchYifroB2DRcSyZIbXOe9vjXHVHSkEKQIBf+1S/AGewshPa+3awSMjBJYOoD i6ig2DKGmBVb7B6xKZYHQblQgt7+ofoxRXkB/HJaPYIsA6S6XQKmgV8wwaargL4rgdjk T0/R/z/pFtytv/eBGrYXIK15VuNZzjWVThZRK9iGuW/617ofFy8vQXHbBPa9o6F1DhJw K9Za4NkJ8QkNAOa1wAds2jUFfTo48KDYo4DNhOQirb6JcicHh4cgpE+3dj9Y2bmgvSmL 7tAA== 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=o/xQzeFmrXfN9GrQrV3x3TwaygukSzElS0GwgvVLQYY=; b=Krq/k2YIbYKfV7M5vosNcDnxMfmOYL50G7DHDqvUiillyhGG2Wuku0hk/yIIHmL/nn CPNr1ZZmcjp593WDfiCkKAkDtnxhzXj3HINrdhHwTSPx2MG37chTlKUisTOm41Ufwgd1 bQoYNjB24qG014YkALDvrcmM9lbZ/VmOiAXb+dYU3Bi2Mre+qnQqS/mPjt/Ry9nZd6a2 LSDrxO8e4oVA+zjHENCfyBrUL/gjRTNW903PCbjUVV43dun1fZUvwVxyFcXTMt0KpRhg PfoliD0AXwdGl8WgmBNmrOPzHmKnvxK1znWCN02G7DNj/43EyaQuiLRYlT6VeLUhfDi6 U0Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eppOzwZM; 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 u189si16468250pgc.385.2019.07.25.05.04.40; Thu, 25 Jul 2019 05:05:08 -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=eppOzwZM; 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 S1729170AbfGYFuN (ORCPT + 99 others); Thu, 25 Jul 2019 01:50:13 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:45178 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728080AbfGYFuK (ORCPT ); Thu, 25 Jul 2019 01:50:10 -0400 Received: by mail-io1-f66.google.com with SMTP id g20so94686327ioc.12; Wed, 24 Jul 2019 22:50:10 -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=o/xQzeFmrXfN9GrQrV3x3TwaygukSzElS0GwgvVLQYY=; b=eppOzwZMTD+AI6zP0MSUHdIXvb1HKRttkJ/w9XacRFWaNL2ca0VA0nWB8FQZzjEOab nvNtSRvzngDlMRJzQxixwZclK+KN7U5/hAytvG5VevBa3hYPheZ1v1cu/zhuK/wx9ka0 Y8MNMwCdDhclorfCGXiv6dOQTgyH/lzXol6PCa6bXLe5qJPiusuyew+HuWpv1b0aUBM7 HO62tEzicrgQbufXMnA2zMfUJNgHEGjMlq4Du5PLGEzvYs8+hRf2G/Tgf9qs0JO1XAfE B8BMXGLMJsUbRMswOi/9iM6lKczTP6gCxwItJce3Qug9svfigJqK/P5EoLxxoZkPy0MW bJOg== 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=o/xQzeFmrXfN9GrQrV3x3TwaygukSzElS0GwgvVLQYY=; b=jeVBoGPy3D5yt4SSgPjXQ6qOOShI99Pc6eg+kpk7ePmRS0rCOEsMvf5SXIv2j1QDfn eUxIrOtuflaKmMP1p32lmZsBJITU8V94/t45QqtDBsmJDmakcv7OyFn9IpZfJ5eiF4HA 7Ytey8p82POyX2x7Go8Nwd9ZjMRedXCeAdTo5Zawk3MfoyaOMHRVyOpDNmseh5jWvs5D i+90G2cZNiFhh5b91kOnqxYdxioCEOoo38CymoLd4zOtktOzmQZuM5EnufzXwfj7Gct8 B9yRbihb3kz5pWIjdgnHCUfpPL1mUBGjYDfVHP+lbZEvsf/r/A1jUbDCTsoBg4uVl+FJ nyXw== X-Gm-Message-State: APjAAAXpCQNX0rK38NTeo2jJGPrMe7fhJoPphfFtSKwn03v7YdEiOZ/y mHvYQB4zOTWJ7ZMIFkV7wH6rJFY/31jcoEhC+zCZ4fzd X-Received: by 2002:a02:a703:: with SMTP id k3mr21491322jam.12.1564033809556; Wed, 24 Jul 2019 22:50:09 -0700 (PDT) MIME-Version: 1.0 References: <20190717192616.1731-1-tushar.khandelwal@arm.com> <20190717192616.1731-2-tushar.khandelwal@arm.com> In-Reply-To: From: Jassi Brar Date: Thu, 25 Jul 2019 00:49:58 -0500 Message-ID: Subject: Re: [PATCH 1/4] mailbox: arm_mhuv2: add device tree binding documentation To: Tushar Khandelwal Cc: Linux Kernel Mailing List , tushar.2nov@gmail.com, morten_bp@live.dk, nd@arm.com, Morten Borup Petersen , Rob Herring , Mark Rutland , Devicetree List 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 Sun, Jul 21, 2019 at 4:58 PM Jassi Brar wrote: > > On Wed, Jul 17, 2019 at 2:26 PM Tushar Khandelwal > wrote: > > > diff --git a/Documentation/devicetree/bindings/mailbox/arm,mhuv2.txt b/Documentation/devicetree/bindings/mailbox/arm,mhuv2.txt > > new file mode 100644 > > index 000000000000..3a05593414bc > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/mailbox/arm,mhuv2.txt > > @@ -0,0 +1,108 @@ > > +Arm MHUv2 Mailbox Driver > > +======================== > > + > > +The Arm Message-Handling-Unit (MHU) Version 2 is a mailbox controller that has > > +between 1 and 124 channel windows to provide unidirectional communication with > > +remote processor(s). > > + > > +Given the unidirectional nature of the device, an MHUv2 mailbox may only be > > +written to or read from. If a pair of MHU devices is implemented between two > > +processing elements to provide bidirectional communication, these must be > > +specified as two separate mailboxes. > > + > > +A device tree node for an Arm MHUv2 device must specify either a receiver frame > > +or a sender frame, indicating which end of the unidirectional MHU device which > > +the device node entry describes. > > + > > +An MHU device must be specified with a transport protocol. The transport > > +protocol of an MHU device determines the method of data transmission as well as > > +the number of provided mailboxes. > > +Following are the possible transport protocol types: > > +- Single-word: An MHU device implements as many mailboxes as it > > + provides channel windows. Data is transmitted through > > + the MHU registers. > > +- Multi-word: An MHU device implements a single mailbox. All channel windows > > + will be used during transmission. Data is transmitted through > > + the MHU registers. > > +- Doorbell: An MHU device implements as many mailboxes as there are flag > > + bits available in its channel windows. Optionally, data may > > + be transmitted through a shared memory region, wherein the MHU > > + is used strictly as an interrupt generation mechanism. > > + > > +Mailbox Device Node: > > +==================== > > + > > +Required properties: > > +-------------------- > > +- compatible: Shall be "arm,mhuv2" & "arm,primecell" > > +- reg: Contains the mailbox register address range (base > > + address and length) > > +- #mbox-cells Shall be 1 - the index of the channel needed. > > +- mhu-frame Frame type of the device. > > + Shall be either "sender" or "receiver" > > +- mhu-protocol Transport protocol of the device. Shall be one of the > > + following: "single-word", "multi-word", "doorbell" > > + > > +Required properties (receiver frame): > > +------------------------------------- > > +- interrupts: Contains the interrupt information corresponding to the > > + combined interrupt of the receiver frame > > + > > +Example: > > +-------- > > + > > + mbox_mw_tx: mhu@10000000 { > > + compatible = "arm,mhuv2","arm,primecell"; > > + reg = <0x10000000 0x1000>; > > + clocks = <&refclk100mhz>; > > + clock-names = "apb_pclk"; > > + #mbox-cells = <1>; > > + mhu-protocol = "multi-word"; > > + mhu-frame = "sender"; > > + }; > > + > > + mbox_sw_tx: mhu@10000000 { > > + compatible = "arm,mhuv2","arm,primecell"; > > + reg = <0x11000000 0x1000>; > > + clocks = <&refclk100mhz>; > > + clock-names = "apb_pclk"; > > + #mbox-cells = <1>; > > + mhu-protocol = "single-word"; > > + mhu-frame = "sender"; > > + }; > > + > > + mbox_db_rx: mhu@10000000 { > > + compatible = "arm,mhuv2","arm,primecell"; > > + reg = <0x12000000 0x1000>; > > + clocks = <&refclk100mhz>; > > + clock-names = "apb_pclk"; > > + #mbox-cells = <1>; > > + interrupts = <0 45 4>; > > + interrupt-names = "mhu_rx"; > > + mhu-protocol = "doorbell"; > > + mhu-frame = "receiver"; > > + }; > > + > > + mhu_client: scb@2e000000 { > > + compatible = "fujitsu,mb86s70-scb-1.0"; > > + reg = <0 0x2e000000 0x4000>; > > + mboxes = > > + // For multi-word frames, client may only instantiate a single > > + // mailbox for a mailbox controller > > + <&mbox_mw_tx 0>, > > + > > + // For single-word frames, client may instantiate as many > > + // mailboxes as there are channel windows in the MHU > > + <&mbox_sw_tx 0>, > > + <&mbox_sw_tx 1>, > > + <&mbox_sw_tx 2>, > > + <&mbox_sw_tx 3>, > > + > > + // For doorbell frames, client may instantiate as many mailboxes > > + // as there are bits available in the combined number of channel > > + // windows ((channel windows * 32) mailboxes) > > + , > > + , > > + ... > > + ; > > + }; > > If the mhuv2 instance implements, say, 3 channel windows between > sender (linux) and receiver (firmware), and Linux runs two protocols > each requiring 1 and 2-word sized messages respectively. The hardware > supports that by assigning windows [0] and [1,2] to each protocol. > However, I don't think the driver can support that. Or does it? > Thinking about it, IMO, the mbox-cell should carry a 128 (4x32) bit mask specifying the set of windows (corresponding to the bits set in the mask) associated with the channel. And the controller driver should see any channel as associated with variable number of windows 'N', where N is [0,124] mhu_client1: proto1@2e000000 { ..... mboxes = <&mbox 0x0 0x0 0x0 0x1> } mhu_client2: proto2@2f000000 { ..... mboxes = <&mbox 0x0 0x0 0x0 0x6> } Cheers!