Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3263686rwb; Sat, 12 Nov 2022 02:19:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5KgjhQYkX2TsGQQcIoW+8kLxRQOMGqPQwhHZU5t74Yhk01ok8Tr3uaMkg8us1x9fpD7sLR X-Received: by 2002:a05:6402:28e:b0:461:c937:da3b with SMTP id l14-20020a056402028e00b00461c937da3bmr4917800edv.41.1668248376462; Sat, 12 Nov 2022 02:19:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668248376; cv=none; d=google.com; s=arc-20160816; b=QipmuAeblbkIh7fQjkuhVg9KKA4oWUX0Gu6yyo/0+ExJXJ/7sMeDEJupLGaumEteoE Jw4GL0/rOiar1yYcbUr+F4A2H5V8GgaP6tzqORPAfVH2kIdnaHmGNvVhMOUZvV6q1Dlm EoVwAKxlLMg4zLYErOEPkn1016Lr3013PvYOVQQXe7xrcty57orkbbn5jQYJbXrG7dbe sDFDGHnsDHpGn3WmP+tkPa8/r0YekqM/O7hLEXbRESGR6AZgEsXxtRq2yW8+52lcw/Ar kx63dC2XtTGn83CM52rsoWRyqEnOd13UqrWew4vk/MRcDrOJnU1tT0g8e0FwT9Mx6dlZ bA+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=Vi/LpzbKpV4OW4mgRr88zlkCde9EBYzYQTCFIUCKJT4=; b=y0SsRKVvJL8ksgbsaUaxETkCBBeghFB0jBLkeCadmW0KaXwUeOWvMyFgu2ajHIreUz 6R/OkA3FoNt4fDwLjB28CbniHHzDrIT581Oyv5HaYsgNjVMRuMmvY9KGMcq0ihTT+lw3 TJ8hqbaWzahMKsnBN+CMnAS+gC97rei4+vddNstQj1spX0EOTHK5uX0485fgEa/oIrao PVgFqk9ZWa2tkZnYUW+O+cSrAMpMifJANqAvGDvb4yu4fuZkf+vOoMat+L9hOgbRXccV qIN8Sg8CJ3zyMhNxV3azrbpSgOwJVETKQWOpwXH3Ah/XlPIRL3hgn3vyFPl5F1LP/xdC fIkw== 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 hu9-20020a170907a08900b007ae0db0c454si4516982ejc.635.2022.11.12.02.19.14; Sat, 12 Nov 2022 02:19:36 -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 S234774AbiKLKGa (ORCPT + 91 others); Sat, 12 Nov 2022 05:06:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234542AbiKLKG2 (ORCPT ); Sat, 12 Nov 2022 05:06:28 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24FF72AB for ; Sat, 12 Nov 2022 02:06:27 -0800 (PST) Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4N8WN14NL4zqSLh; Sat, 12 Nov 2022 18:02:41 +0800 (CST) Received: from dggpeml500002.china.huawei.com (7.185.36.158) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 12 Nov 2022 18:06:25 +0800 Received: from [10.67.103.44] (10.67.103.44) by dggpeml500002.china.huawei.com (7.185.36.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 12 Nov 2022 18:06:24 +0800 Subject: Re: [PATCH v12 2/2] Documentation: Add document for UltraSoc SMB drivers To: Yicong Yang , , , , , , References: <20221109135008.9485-1-hejunhao3@huawei.com> <20221109135008.9485-3-hejunhao3@huawei.com> <13e37836-b21c-662b-89b5-518fb091c612@huawei.com> CC: , , , , , , , , From: hejunhao Message-ID: Date: Sat, 12 Nov 2022 18:06:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <13e37836-b21c-662b-89b5-518fb091c612@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.44] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500002.china.huawei.com (7.185.36.158) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 Hi Yicong. On 2022/11/10 20:08, Yicong Yang wrote: > On 2022/11/9 21:50, 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 >> --- >> .../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) \ > I cannot find MEM_RESRC in ACPI Spec 6.4, any references? If it's a self defined macro just expand it here. > > btw, you need to cc linux-doc@vger.kernel.org. > > Thanks. "MEM_RESERVE" is a macro. will update the doc and add cc. Thanks for the comments! >> + }) \ >> + 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}, \ >> + } \ >> + } \ >> + }) \ >> + } >> > . > Best regards, Junhao.