Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp672475yba; Fri, 12 Apr 2019 11:15:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgmxunpo4aWgynUBfNc1YAnbkTjqXdTZ2zOAXFK8Esf9KjTnaGdlUQhkMr9eAbCEILJT4S X-Received: by 2002:a62:2046:: with SMTP id g67mr57681606pfg.121.1555092945403; Fri, 12 Apr 2019 11:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555092945; cv=none; d=google.com; s=arc-20160816; b=z37xA6LXwKyT0N/COKzqsp18HImUEY2tl5iO0gKhjnvl0N+M61wtjuMhpn/D3cjsgA /Qf4OuPfiDj2XeT0NaDDS9b6+qiZHcB9lsDFqtwxBAXsi+asLMbXDntsenMCmzRSwTtj lTIQambgKt2jtDUdwznhx07nfKnMp99ew/4/IPoE2LVGOxwQb+ptJJSXarYDZWfhz+Ug kTpf6AJLpjXvYxRXMVZOQZCvKIkI0krFdUZYVrW+VilC92Md4SpPp/lw7CoKtVSBeJ7n wi6nI3PazbwhiIY9tgU010kIm5dPnbw+KW02OkkcMBZ67iUvnqz1fySVKa+SckE/TY5a LFGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Vy1RTJNul8Gq4kA2LdEWHyvJv8U3hvPPKDySjtoIuxI=; b=IYy2Ghcs4R2qb7m/i2ZL1FkMf/H7Qe/jS05qIneaGkwR6S3OKYLi2c18MUe1eDG8MY rsEbMuGXDRxs+scsh2WBo16LclI3LAhhFlJpkdqYU7ppjdhzEwhhpLqhj9sYxEbVWhwE itdNdtijMhaDAK2JaVyfQ4vAfULnJojWbs3hJKIoro7YDK1YMBaOKIn09PJQ0j9ORMZC 9Es/RDt0C9WDrQ39ae0a/PcEMucl1NEpBvEjM87J3Sebunbj9GifyUO50SQvKnl54q3W B7JliMuhSIw6J2/B+NahNogrMLHdsGGha3uMeDJx2bka3CcZLWEtIFFRtUHzR3bti8jm QQCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Qat6M4p3; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g189si33755478pfb.289.2019.04.12.11.15.29; Fri, 12 Apr 2019 11:15:45 -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=@chromium.org header.s=google header.b=Qat6M4p3; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbfDLSOw (ORCPT + 99 others); Fri, 12 Apr 2019 14:14:52 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:34451 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726912AbfDLSOt (ORCPT ); Fri, 12 Apr 2019 14:14:49 -0400 Received: by mail-it1-f195.google.com with SMTP id z17so1084816itc.1 for ; Fri, 12 Apr 2019 11:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Vy1RTJNul8Gq4kA2LdEWHyvJv8U3hvPPKDySjtoIuxI=; b=Qat6M4p3JWchst2c5rWTulSkKl6l4tu2zvHfsz6x1FLayqa6sq04hQCvHuRogWsr91 MdT1Wp+lxIxlhOQWah4baFSQiFqxPvwGhJIP7c+EurKNREeulGQbJ2UnXnh76yhIYjDq BA9xWL/94yYp7aYgn2Exz60PFDjBW6A8nPi4M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Vy1RTJNul8Gq4kA2LdEWHyvJv8U3hvPPKDySjtoIuxI=; b=GffY75/tXdKkxjFneS9n45JumGvMS0tjfw1UtvEcB3+JuHUxhgNU2w46IzMsYeFfcH G6+LplitaE4NN71wMT3F7SywpG7EQY6Kk75yogejxF91Bd3jiyOISghkXQIDCntf5gAp W7LWXCwTzH7TIJIAZ3aE4IDvgfJCSkNrkVc7C4ykcFOvyP5Od9697/RIoV7Hbd1WH0Hl 4iteXHMtLeOQCGif+tG9yIqBr93mebrqxi1B1yOuHe4XZiUp1ljW5YBbUoRyiaKp2MgP vg9nf/kTrB8V9xwwWwIpI1kybNzXZZGLQYhGH9i0mj4/oq13u1jJxaWuAebb0JmVNcqc Tu1g== X-Gm-Message-State: APjAAAW12d/jXsho9ALkAUhLf5DFjsG+yRNFtkqieD9KK+h0KChNUt96 6wMdzoeBFB4puesehU9M/2dtfw== X-Received: by 2002:a24:e85:: with SMTP id 127mr14575469ite.4.1555092887973; Fri, 12 Apr 2019 11:14:47 -0700 (PDT) Received: from ncrews2.bld.corp.google.com ([2620:15c:183:200:cb43:2cd4:65f5:5c84]) by smtp.gmail.com with ESMTPSA id m30sm4276605iti.41.2019.04.12.11.14.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Apr 2019 11:14:47 -0700 (PDT) From: Nick Crews To: enric.balletbo@collabora.com, bleung@chromium.org Cc: linux-kernel@vger.kernel.org, dlaurie@chromium.org, derat@google.com, groeck@google.com, dtor@google.com, sjg@chromium.org, alevkoy@chromium.org, keithshort@chromium.org, Nick Crews Subject: [PATCH v4 1/2] platform/chrome: wilco_ec: Fix documentation for debugfs raw attribute Date: Fri, 12 Apr 2019 12:14:42 -0600 Message-Id: <20190412181443.239166-1-ncrews@chromium.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In a previous refactor [repo chrome-platform, branch for-next, commit 9cced499d6fdb60434ffa94f8f4b5087ad35802b ("platform/chrome: wilco_ec: Standardize mailbox interface")], the documentation for the raw debugfs attribute became incorrect, but I forgot to fix it. This patch fixes it, as well as de-duplicates the documentation by removing it from the source file header comment. Signed-off-by: Nick Crews --- Documentation/ABI/testing/debugfs-wilco-ec | 32 ++++++++++++++-------- drivers/platform/chrome/wilco_ec/debugfs.c | 27 +----------------- 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/Documentation/ABI/testing/debugfs-wilco-ec b/Documentation/ABI/testing/debugfs-wilco-ec index f814f112e213..7ff6b45be703 100644 --- a/Documentation/ABI/testing/debugfs-wilco-ec +++ b/Documentation/ABI/testing/debugfs-wilco-ec @@ -4,20 +4,30 @@ KernelVersion: 5.1 Description: Write and read raw mailbox commands to the EC. - For writing: - Bytes 0-1 indicate the message type: - 00 F0 = Execute Legacy Command - 00 F2 = Read/Write NVRAM Property - Byte 2 provides the command code - Bytes 3+ consist of the data passed in the request + You can write a hexadecimal sentence to raw, and that series of + bytes will be sent to the EC. Then, you can read the bytes of + response by reading from raw. - At least three bytes are required, for the msg type and command, - with additional bytes optional for additional data. + For writing, bytes 0-1 indicate the message type, one of enum + wilco_ec_msg_type. Byte 2+ consist of the data passed in the + request, starting at MBOX[0] + + At least three bytes are required for writing, two for the type + and at least a single byte of data. Only the first + EC_MAILBOX_DATA_SIZE bytes of MBOX will be used. Example: // Request EC info type 3 (EC firmware build date) - $ echo 00 f0 38 00 03 00 > raw + // Corresponds with sending type 0x00f0 with + // MBOX = [38, 00, 03, 00] + $ echo 00 f0 38 00 03 00 > /sys/kernel/debug/wilco_ec/raw // View the result. The decoded ASCII result "12/21/18" is // included after the raw hex. - $ cat raw - 00 31 32 2f 32 31 2f 31 38 00 38 00 01 00 2f 00 .12/21/18.8... + // Corresponds with MBOX = [00, 00, 31, 32, 2f, 32, 31, 38, ...] + $ cat /sys/kernel/debug/wilco_ec/raw + 00 00 31 32 2f 32 31 2f 31 38 00 38 00 01 00 2f 00 ..12/21/18.8... + + Note that the first 32 bytes of the received MBOX[] will be + printed, even if some of the data is junk. It is up to you to + know how many of the first bytes of data are the actual + response. diff --git a/drivers/platform/chrome/wilco_ec/debugfs.c b/drivers/platform/chrome/wilco_ec/debugfs.c index 17c4c9068aaf..8d307378c1cb 100644 --- a/drivers/platform/chrome/wilco_ec/debugfs.c +++ b/drivers/platform/chrome/wilco_ec/debugfs.c @@ -4,32 +4,7 @@ * * Copyright 2019 Google LLC * - * There is only one attribute used for debugging, called raw. - * You can write a hexadecimal sentence to raw, and that series of bytes - * will be sent to the EC. Then, you can read the bytes of response - * by reading from raw. - * - * For writing: - * Bytes 0-1 indicate the message type, one of enum wilco_ec_msg_type - * Byte 2+ consist of the data passed in the request, starting at MBOX[0] - * - * At least three bytes are required for writing, two for the type and at - * least a single byte of data. Only the first EC_MAILBOX_DATA_SIZE bytes - * of MBOX will be used. - * - * Example: - * // Request EC info type 3 (EC firmware build date) - * // Corresponds with sending type 0x00f0 with MBOX = [38, 00, 03, 00] - * $ echo 00 f0 38 00 03 00 > /sys/kernel/debug/wilco_ec/raw - * // View the result. The decoded ASCII result "12/21/18" is - * // included after the raw hex. - * // Corresponds with MBOX = [00, 00, 31, 32, 2f, 32, 31, ...] - * $ cat /sys/kernel/debug/wilco_ec/raw - * 00 00 31 32 2f 32 31 2f 31 38 00 38 00 01 00 2f 00 ..12/21/18.8... - * - * Note that the first 32 bytes of the received MBOX[] will be printed, - * even if some of the data is junk. It is up to you to know how many of - * the first bytes of data are the actual response. + * See Documentation/ABI/testing/debugfs-wilco-ec for usage. */ #include -- 2.20.1