From patchwork Mon Jan 16 09:16:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1726968 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NwRJX6Xl4z23fp for ; Mon, 16 Jan 2023 20:18:04 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pHLcq-0007oC-KI; Mon, 16 Jan 2023 09:17:56 +0000 Received: from mail-pl1-f179.google.com ([209.85.214.179]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pHLcf-0007SY-1s for kernel-team@lists.ubuntu.com; Mon, 16 Jan 2023 09:17:45 +0000 Received: by mail-pl1-f179.google.com with SMTP id jn22so29684281plb.13 for ; Mon, 16 Jan 2023 01:17:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jNVMytV+T2jGICXqHvfBLJaBchlIEcMMUz3YYbIMuVk=; b=f+EBAtIdNoxTVwXD4vzpBezko136jvKp2hMadbhACacZ8cBMNkyxgV8BA0Ht730o1S xs+fG5SOxUjuSdeariXqDFBSZzxNq6MELzM93zApLt5V/s7sRKNd/hpOBGQG1KNjbqF5 Pvhveo0DZlNKMcMzTqM0fMSWlDYVsJe01qiegZIKO74yOtb8GBZp8oKV86tQ3nIsbX6Q lS+o4KdaIDdW/FUEbY1OL5j/HZ+W64rwHdUHP4D7E2ZDWiDrrZWnRhuGay8GlZ7E6Z9P Xt+C8tLFbN8DAWjpw7Zc7d1HhbW0JH46PcB7szFvhFqlkXhbVmZkUYKm+JvOl6HIpHKR 3/fA== X-Gm-Message-State: AFqh2kp9Lw+iik8RiMTcq+8boxAc4yMxKwGCI9NhblmLDQRKTlOdKVT1 eOq0bzInDwq2i31wemjkYZ/4ex3uh0w= X-Google-Smtp-Source: AMrXdXuGe4jJ9DMMpB97E2xByssRIqMN2Vy+m16ZAm5tzj062ofWKtrEHLKY1l6dplLG90AssvVeeg== X-Received: by 2002:a17:90a:1347:b0:229:a2:a265 with SMTP id y7-20020a17090a134700b0022900a2a265mr16043424pjf.3.1673860660249; Mon, 16 Jan 2023 01:17:40 -0800 (PST) Received: from localhost.localdomain (61-227-102-162.dynamic-ip.hinet.net. [61.227.102.162]) by smtp.gmail.com with ESMTPSA id fa21-20020a17090af0d500b00223f495dc28sm16763637pjb.14.2023.01.16.01.17.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 01:17:39 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 7/7][SRU][OEM-6.0] UBUNTU: SAUCE: net: wwan: t7xx: Devlink documentation Date: Mon, 16 Jan 2023 17:16:42 +0800 Message-Id: <20230116091642.1364398-8-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230116091642.1364398-1-vicamo.yang@canonical.com> References: <20230116091642.1364398-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.179; envelope-from=vicamo@gmail.com; helo=mail-pl1-f179.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: M Chetan Kumar BugLink: https://bugs.launchpad.net/bugs/2002089 Document the t7xx devlink commands usage for fw flashing & coredump collection. Refer to t7xx.rst file for details. Change-Id: I918f6583c776dc537ad13dfbd7cbe0b0c6b305ca Signed-off-by: M Chetan Kumar Signed-off-by: Devegowda Chandrashekar (cherry picked from https://patchwork.kernel.org/project/netdevbpf/patch/20230105154316.198888-1-m.chetan.kumar@linux.intel.com/) Signed-off-by: You-Sheng Yang (vicamo) --- Documentation/networking/devlink/index.rst | 1 + Documentation/networking/devlink/t7xx.rst | 161 +++++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100644 Documentation/networking/devlink/t7xx.rst diff --git a/Documentation/networking/devlink/index.rst b/Documentation/networking/devlink/index.rst index e3a5f985673e..e22e643f7fcf 100644 --- a/Documentation/networking/devlink/index.rst +++ b/Documentation/networking/devlink/index.rst @@ -67,3 +67,4 @@ parameters, info versions, and other features it supports. prestera iosm octeontx2 + t7xx diff --git a/Documentation/networking/devlink/t7xx.rst b/Documentation/networking/devlink/t7xx.rst new file mode 100644 index 000000000000..de220878ad76 --- /dev/null +++ b/Documentation/networking/devlink/t7xx.rst @@ -0,0 +1,161 @@ +.. SPDX-License-Identifier: GPL-2.0 + +==================== +t7xx devlink support +==================== + +This document describes the devlink features implemented by the ``t7xx`` +device driver. + +Parameters +========== +The ``t7xx_driver`` driver implements the following driver-specific parameters. + +.. list-table:: Driver-specific parameters implemented + :widths: 5 5 5 85 + + * - Name + - Type + - Mode + - Description + * - ``fastboot`` + - boolean + - driverinit + - Set this param to enter fastboot mode. + +Flash Update +============ + +The ``t7xx`` driver implements the flash update using the ``devlink-flash`` +interface. + +The driver uses DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT to identify the type of +firmware image that need to be programmed upon the request by user space application. + +The supported list of firmware image types is described below. + +.. list-table:: Firmware Image types + :widths: 15 85 + + * - Name + - Description + * - ``preloader`` + - The first-stage bootloader image + * - ``loader_ext1`` + - Preloader extension image + * - ``tee1`` + - ARM trusted firmware and TEE (Trusted Execution Environment) image + * - ``lk`` + - The second-stage bootloader image + * - ``spmfw`` + - MediaTek in-house ASIC for power management image + * - ``sspm_1`` + - MediaTek in-house ASIC for power management under secure world image + * - ``mcupm_1`` + - MediaTek in-house ASIC for cpu power management image + * - ``dpm_1`` + - MediaTek in-house ASIC for dram power management image + * - ``boot`` + - The kernel and dtb image + * - ``rootfs`` + - Root filesystem image + * - ``md1img`` + - Modem image + * - ``md1dsp`` + - Modem DSP image + * - ``mcf1`` + - Modem OTA image (Modem Configuration Framework) for operators + * - ``mcf2`` + - Modem OTA image (Modem Configuration Framework) for OEM vendors + * - ``mcf3`` + - Modem OTA image (other usage) for OEM configurations + +``t7xx`` driver uses fastboot protocol for fw flashing. In the fw flashing +procedure, fastboot command & response are exchanged between driver and wwan +device. + +The wwan device is put into fastboot mode via devlink reload command, by +passing "driver_reinit" action. + +$ devlink dev reload pci/0000:$bdf action driver_reinit + +Upon completion of fw flashing or coredump collection the wwan device is +reset to normal mode using devlink reload command, by passing "fw_activate" +action. + +$ devlink dev reload pci/0000:$bdf action fw_activate + +Flash Commands: +=============== + +$ devlink dev flash pci/0000:$bdf file preloader_k6880v1_mdot2_datacard.bin component "preloader" + +$ devlink dev flash pci/0000:$bdf file loader_ext-verified.img component "loader_ext1" + +$ devlink dev flash pci/0000:$bdf file tee-verified.img component "tee1" + +$ devlink dev flash pci/0000:$bdf file lk-verified.img component "lk" + +$ devlink dev flash pci/0000:$bdf file spmfw-verified.img component "spmfw" + +$ devlink dev flash pci/0000:$bdf file sspm-verified.img component "sspm_1" + +$ devlink dev flash pci/0000:$bdf file mcupm-verified.img component "mcupm_1" + +$ devlink dev flash pci/0000:$bdf file dpm-verified.img component "dpm_1" + +$ devlink dev flash pci/0000:$bdf file boot-verified.img component "boot" + +$ devlink dev flash pci/0000:$bdf file root.squashfs component "rootfs" + +$ devlink dev flash pci/0000:$bdf file modem-verified.img component "md1img" + +$ devlink dev flash pci/0000:$bdf file dsp-verified.bin component "md1dsp" + +$ devlink dev flash pci/0000:$bdf file OP_OTA.img component "mcf1" + +$ devlink dev flash pci/0000:$bdf file OEM_OTA.img component "mcf2" + +$ devlink dev flash pci/0000:$bdf file DEV_OTA.img component "mcf3" + +Note: Component selects the partition type to be programmed. + +Regions +======= + +The ``t7xx`` driver supports core dump collection when device encounters +an exception. When wwan device encounters an exception, a snapshot of device +internal data will be taken by the driver using fastboot commands. + +Following regions are accessed for device internal data. + +.. list-table:: Regions implemented + :widths: 15 85 + + * - Name + - Description + * - ``mr_dump`` + - The detailed modem component logs are captured in this region + * - ``lk_dump`` + - This region dumps the current snapshot of lk + + +Region commands +=============== + +$ devlink region show + + +$ devlink region new mr_dump + +$ devlink region read mr_dump snapshot 0 address 0 length $len + +$ devlink region del mr_dump snapshot 0 + +$ devlink region new lk_dump + +$ devlink region read lk_dump snapshot 0 address 0 length $len + +$ devlink region del lk_dump snapshot 0 + +Note: $len is actual len to be dumped.