From patchwork Mon Apr 3 20:44:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sukadev Bhattiprolu X-Patchwork-Id: 746652 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vxkdC74k9z9s0Z for ; Tue, 4 Apr 2017 06:45:19 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vxkdC68R1zDqJl for ; Tue, 4 Apr 2017 06:45:19 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vxkcv73JszDq7Z for ; Tue, 4 Apr 2017 06:45:03 +1000 (AEST) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v33KhltS108280 for ; Mon, 3 Apr 2017 16:45:00 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 29kqbpbrxq-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 03 Apr 2017 16:45:00 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 3 Apr 2017 16:44:59 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 3 Apr 2017 16:44:57 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v33KikWr42991858; Mon, 3 Apr 2017 20:44:46 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 07DEA124035; Mon, 3 Apr 2017 16:44:42 -0400 (EDT) Received: from suka-w540.localdomain (unknown [9.70.94.25]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id A7592124049; Mon, 3 Apr 2017 16:44:41 -0400 (EDT) Received: by suka-w540.localdomain (Postfix, from userid 1000) id A01A4221FDF; Mon, 3 Apr 2017 13:44:44 -0700 (PDT) Date: Mon, 3 Apr 2017 13:44:44 -0700 From: Sukadev Bhattiprolu To: Stewart Smith References: <1485394353-30319-1-git-send-email-sukadev@linux.vnet.ibm.com> <1485394353-30319-6-git-send-email-sukadev@linux.vnet.ibm.com> <20170331053826.GA30599@us.ibm.com> <87shlqmfiw.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87shlqmfiw.fsf@linux.vnet.ibm.com> X-Operating-System: Linux 2.0.32 on an i486 User-Agent: Mutt/1.7.1 (2016-10-04) X-TM-AS-GCONF: 00 x-cbid: 17040320-0044-0000-0000-000002F4DE58 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006877; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00842632; UDB=6.00415091; IPR=6.00620808; BA=6.00005262; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014892; XFM=3.00000013; UTC=2017-04-03 20:44:58 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17040320-0045-0000-0000-00000722DE28 Message-Id: <20170403204444.GA6534@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-03_19:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1704030184 Subject: Re: [Skiboot] [PATCH v5 5/7] vas: Create device tree node X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hbabu@us.ibm.com, apopple@au1.ibm.com, michael.neuling@au1.ibm.com, skiboot@lists.ozlabs.org Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Stewart Smith [stewart@linux.vnet.ibm.com] wrote: > > +static void create_dt_node(struct proc_chip *chip) > > +{ > > + struct dt_node *dn; > > + uint64_t hvwc_start, uwc_start, win_base; > > + > > + win_base = get_window_base_addr(chip); > > + hvwc_start = get_hvwc_mmio_bar(chip->id); > > + uwc_start = get_uwc_mmio_bar(chip->id); > > + > > + dn = dt_new_addr(chip->devnode, "vas", win_base); > > Could we please have a compatible property here? The kernel code of > looking for XSCOM nodes isn't ideal and could break in the future, and > certainly isn't going to work for, say, PowerVM or KVM guests. > > Also, please add documentation to doc/device-tree as to the device tree > bindings. Hi Stewart, Here is the updated patch with some documenation on the VAS dt entries and the compatible property. Thanks, Sukadev ---- From eb16554fb98538fdfb3b1f56d38aefcbcb87933d Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu Date: Wed, 25 Jan 2017 16:05:29 -0800 Subject: [PATCH 1/1] vas: Create device tree node Create a device tree node for VAS and add properties that Linux will need to configure/use VAS. Signed-off-by: Sukadev Bhattiprolu --- Changelog[v5]: [Stewart Smith] Add a compatible "ibm,vas" property and document device tree entries. [Michael Neuling] Rather than having separate properties for HVWC, UWC and window address, make them all "reg" properties. --- core/vas.c | 22 ++++++++++++++++++++++ doc/device-tree/vas.rst | 23 +++++++++++++++++++++++ 2 files changed, 45 insertions(+), 0 deletions(-) create mode 100644 doc/device-tree/vas.rst diff --git a/core/vas.c b/core/vas.c index 6d475f9..cebd481 100644 --- a/core/vas.c +++ b/core/vas.c @@ -256,6 +256,26 @@ static inline uint64_t get_window_base_addr(struct proc_chip *chip) return val; } +static void create_dt_node(struct proc_chip *chip) +{ + struct dt_node *dn; + uint64_t hvwc_start, uwc_start, win_base; + + win_base = get_window_base_addr(chip); + hvwc_start = get_hvwc_mmio_bar(chip->id); + uwc_start = get_uwc_mmio_bar(chip->id); + + dn = dt_new_addr(chip->devnode, "vas", win_base); + + dt_add_property_strings(dn, "compatible", "ibm,vas"); + + dt_add_property_u64s(dn, "reg", hvwc_start, VAS_HVWC_MMIO_BAR_SIZE, + uwc_start, VAS_UWC_MMIO_BAR_SIZE, + win_base, RMA_LSMP_WINID_SHIFT); + + dt_add_property(dn, "vas-id", &chip->vas_id, sizeof(chip->vas_id)); +} + /* * Initialize VAS on one chip */ @@ -275,6 +295,8 @@ static int init_one_chip(struct proc_chip *chip) if (init_rma(chip)) goto out; + create_dt_node(chip); + prlog(PR_INFO, "VAS: Initialized chip %d\n", chip->id); return 0; diff --git a/doc/device-tree/vas.rst b/doc/device-tree/vas.rst new file mode 100644 index 0000000..01bb2e1 --- /dev/null +++ b/doc/device-tree/vas.rst @@ -0,0 +1,23 @@ +Virtual Accelerator Switchboard (VAS) + +VAS is present in P9 or later processors. In P9, each chip has one +instance of VAS. Each instance of VAS is represented by a node in +the device tree, under the xsccom node associated with the P9 chip. +:: + + /xscom@/vas@ + +with unique xscom and vas addresses. + +Each VAS node contains: :: + + compatible: "ibm,vas" + + reg: contains 6 64-bit values. The first two contain the Hypervisor + Window Context BAR start and length values and the next two + contain the OS/User Window Context BAR start and length values. + The last two contain the "window base address" and "window id + shift" values, which are used to compute the hardware paste + address for a send window on this instance of VAS. + + vas-id: unique identifier for each instance of VAS in the system.