Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp908001rwb; Wed, 9 Nov 2022 10:04:41 -0800 (PST) X-Google-Smtp-Source: AMsMyM5Dz16LRMV60jBm/XWQhPq0gnGbOVnNpXi61G1cOA8Dd5+hliCeeOIaVGy5CbZrDKZusMZM X-Received: by 2002:a17:90a:5517:b0:213:b122:41b3 with SMTP id b23-20020a17090a551700b00213b12241b3mr60519290pji.121.1668017081667; Wed, 09 Nov 2022 10:04:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668017081; cv=none; d=google.com; s=arc-20160816; b=M9x/U6vfoU11ESqNxS28capSD6jkAC19zkHp5cPYtnsK+eXZCl6xqWuSXV2v2vwA3+ /up6LzzV93UMemVcK///o+XRp5ssyKekG13o9lmA9N3t2khmcvDRoJJ0VtufRid74dv3 mAxD/7YWYDMbU+7CQySvV3D2FM/ZQaRm5Z36EjClpudMP4xRB09Ow05flF13wAHgMAj/ aWMGUSCDl9EZvuTZUgQS8qZiCn+jtJEhqq1mYb+3Jzqht2x4Fq3O0GXfiidM+oEUwPKW oA/HlSz0K6h3O8fCiKBnkGws+CBOE4kayfodFZdrjSFK0sptZYPrK/ZKOUWRl9htCWUj BExQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=lalPxM6lWceKSoexfKojzj7FYXmG6saMaoOSP4frpV0=; b=HDjZVSjj25RgFH2tb8zcjQFnlTTRif3MAY3rGqNXyuKaNYq+BF1P87f6kNyJ3jaje/ uMh9Bde6p/RCsFcDoJA4DO77l9F8N/PuxHQdleob3hG2WXNmdfR2vBvfvzGvajX8DVZO k9Pvl64JEBkBMQajepH6U1tgaU5FcLzJGwbRBrVS/6LSnLOdDfT5AC7Dj4rromcSD9I5 D99aBe01qZ9Tysy5lxsJIQ7A70l+qx5LS2/JVbAVTk2hPulNmsl7E0br+ZMoiUK1uBbs vCnHhVPXf/qjLFViQBVzmCB9H3Lw+7ayy0OggNkvqFEzdoMpKOeplabXVSXrHlH95biS k6Wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd32-20020a056a0027a000b0056368cb7d1asi19588924pfb.104.2022.11.09.10.04.29; Wed, 09 Nov 2022 10:04:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229499AbiKIRBH (ORCPT + 92 others); Wed, 9 Nov 2022 12:01:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231350AbiKIRAh (ORCPT ); Wed, 9 Nov 2022 12:00:37 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4566326109 for ; Wed, 9 Nov 2022 08:57:31 -0800 (PST) Received: from fraeml705-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4N6rgQ4MDQz67ykV; Thu, 10 Nov 2022 00:55:14 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by fraeml705-chm.china.huawei.com (10.206.15.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.31; Wed, 9 Nov 2022 17:57:29 +0100 Received: from localhost (10.45.145.27) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 9 Nov 2022 16:57:26 +0000 Date: Wed, 9 Nov 2022 16:57:24 +0000 From: Jonathan Cameron To: Junhao He CC: , , , , , , , , , , , , Subject: Re: [PATCH v12 2/2] Documentation: Add document for UltraSoc SMB drivers Message-ID: <20221109165724.000024ca@Huawei.com> In-Reply-To: <20221109135008.9485-3-hejunhao3@huawei.com> References: <20221109135008.9485-1-hejunhao3@huawei.com> <20221109135008.9485-3-hejunhao3@huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.45.145.27] X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Nov 2022 21:50:08 +0800 Junhao He wrote: > From: Qi Liu > > This patch bring in documentation for UltraSoc SMB drivers. > It simply describes the device, sysfs interface and the > firmware bindings. > > Signed-off-by: Qi Liu > Signed-off-by: Junhao He LTGM Reviewed-by: Jonathan Cameron Thanks, Jonathan > --- > .../sysfs-bus-coresight-devices-ultra_smb | 31 +++++++ > .../trace/coresight/ultrasoc-smb.rst | 80 +++++++++++++++++++ > 2 files changed, 111 insertions(+) > create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-ultra_smb > create mode 100644 Documentation/trace/coresight/ultrasoc-smb.rst > > diff --git a/Documentation/ABI/testing/sysfs-bus-coresight-devices-ultra_smb b/Documentation/ABI/testing/sysfs-bus-coresight-devices-ultra_smb > new file mode 100644 > index 000000000000..deaefd508105 > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-bus-coresight-devices-ultra_smb > @@ -0,0 +1,31 @@ > +What: /sys/bus/coresight/devices/ultra_smb/enable_sink > +Date: November 2022 > +KernelVersion: 6.2 > +Contact: Junhao He > +Description: (RW) Add/remove a SMB device from a trace path. There can be > + multiple sources for a single SMB device. > + > +What: /sys/bus/coresight/devices/ultra_smb/mgmt/buf_size > +Date: November 2022 > +KernelVersion: 6.2 > +Contact: Junhao He > +Description: (Read) Shows the buffer size of each UltraSoc SMB device. > + > +What: /sys/bus/coresight/devices/ultra_smb/mgmt/buf_status > +Date: November 2022 > +KernelVersion: 6.2 > +Contact: Junhao He > +Description: (Read) Shows the value held by UltraSoc SMB status register. > + BIT(0) is zero means buffer is empty. > + > +What: /sys/bus/coresight/devices/ultra_smb/mgmt/read_pos > +Date: November 2022 > +KernelVersion: 6.2 > +Contact: Junhao He > +Description: (Read) Shows the value held by UltraSoc SMB Read Pointer register. > + > +What: /sys/bus/coresight/devices/ultra_smb/mgmt/write_pos > +Date: November 2022 > +KernelVersion: 6.2 > +Contact: Junhao He > +Description: (Read) Shows the value held by UltraSoc SMB Write Pointer register. > diff --git a/Documentation/trace/coresight/ultrasoc-smb.rst b/Documentation/trace/coresight/ultrasoc-smb.rst > new file mode 100644 > index 000000000000..6d28ef0f6c88 > --- /dev/null > +++ b/Documentation/trace/coresight/ultrasoc-smb.rst > @@ -0,0 +1,80 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +====================================== > +UltraSoc - HW Assisted Tracing on SoC > +====================================== > + :Author: Qi Liu > + :Date: March 2022 > + > +Introduction > +------------ > + > +UltraSoc SMB is a per SCCL(Super CPU Cluster) hardware, and it provides a > +way to buffer and store CPU trace messages in a region of shared system > +memory. SMB is plugged as a coresight sink device and the corresponding > +trace generators (ETM) are plugged in as source devices. > + > +Sysfs files and directories > +--------------------------- > + > +The SMB devices appear on the existing coresight bus alongside the other > +coresight devices:: > + > + $# ls /sys/bus/coresight/devices/ > + ultra_smb0 ultra_smb1 ultra_smb2 ultra_smb3 > + > +The ``ultra_smb`` named SMB associated with SCCL.:: > + > + $# ls /sys/bus/coresight/devices/ultra_smb0 > + enable_sink mgmt > + $# ls /sys/bus/coresight/devices/ultra_smb0/mgmt > + buf_size buf_status read_pos write_pos > + > +*Key file items are:-* > + * ``read_pos``: Shows the value held by UltraSoc SMB Read Pointer register. > + * ``write_pos``: Shows the value held by UltraSoc SMB Write Pointer register. > + * ``buf_status``: Shows the value held by UltraSoc SMB status register. > + BIT(0) is zero means buffer is empty. > + * ``buf_size``: Shows the buffer size of each UltraSoc SMB device. > + > +Firmware Bindings > +--------------------------- > + > +SMB device is only supported with ACPI, and ACPI binding of SMB device > +describes SMB device indentifier, resource information and graph structure. > + > +SMB is identified by ACPI HID "HISI03A1", resource of device is declared using > +the _CRS method. Each SMB must present two base address, the first one is the > +configuration base address of SMB device, the second one is the base address of > +shared system memory. > + > +examples:: > + > + Device(USMB) { \ > + Name(_HID, "HISI03A1") \ > + Name(_CRS, ResourceTemplate() { \ > + MEM_RESRC(0x95100000, 0x951FFFFF, 0x100000) \ > + MEM_RESRC(0x50000000, 0x53FFFFFF, 0x4000000) \ > + }) \ > + Name(_DSD, Package() { \ > + ToUUID("ab02a46b-74c7-45a2-bd68-f7d344ef2153"), \ > + /* Use CoreSight Graph ACPI bindings to describe connections topology */ > + Package() { \ > + 0, \ > + 1, \ > + Package() { \ > + 1, \ > + ToUUID("3ecbc8b6-1d0e-4fb3-8107-e627f805c6cd"), \ > + 8, \ > + Package() {0x8, 0, \_SB.S00.SL11.CL28.F008, 0}, \ > + Package() {0x9, 0, \_SB.S00.SL11.CL29.F009, 0}, \ > + Package() {0xa, 0, \_SB.S00.SL11.CL2A.F010, 0}, \ > + Package() {0xb, 0, \_SB.S00.SL11.CL2B.F011, 0}, \ > + Package() {0xc, 0, \_SB.S00.SL11.CL2C.F012, 0}, \ > + Package() {0xd, 0, \_SB.S00.SL11.CL2D.F013, 0}, \ > + Package() {0xe, 0, \_SB.S00.SL11.CL2E.F014, 0}, \ > + Package() {0xf, 0, \_SB.S00.SL11.CL2F.F015, 0}, \ > + } \ > + } \ > + }) \ > + }