From patchwork Fri Jul 19 12:57:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1134034 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="wGw9j3y7"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45qrfh3Vv4z9s3l for ; Fri, 19 Jul 2019 22:58:52 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 05BE1C21E0F; Fri, 19 Jul 2019 12:58:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6F668C21DD7; Fri, 19 Jul 2019 12:57:50 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2068BC21CB6; Fri, 19 Jul 2019 12:57:46 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 84BA5C21C57 for ; Fri, 19 Jul 2019 12:57:43 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6JCqjFq014622; Fri, 19 Jul 2019 14:57:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=UdFnnQC28CHz1RBPytxAfpUTZfrGFctfOI91XrIaJas=; b=wGw9j3y7Iign2GvcDYNDwxlLhRy+AOnXjTs0VE5cZ7zn8HQsEnMCM6Y0z3gCpOpTdUMO cYC8X4tR5vgpZ8Z0yMiIl47lSi2bGLpPJK9JQnTAvyEwy44jJwn1Z4GgqhqDH0+iv+Ay KQJuTjKprM++RS9aUKc6AM8Bbrgc9x99ndbwok6Yyk+73egNg7SYranjVlt+PeX3nFvx hrfto0ZW+l/GJlGK//DPbie5VyWQsQjzbIazNPLuAMqnVcninb34wPZbv6PqxfnMqqft UZpO2cKets1PWux0YRVqPw6FPwLYgvFHOAtUP8JujC63+4n/KJiWWniDn63GvY/yD3EY cw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2tq4s28gv2-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 19 Jul 2019 14:57:38 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D9B6C5C; Fri, 19 Jul 2019 12:57:29 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B8A2A2D4F; Fri, 19 Jul 2019 12:57:29 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 19 Jul 2019 14:57:29 +0200 Received: from localhost (10.201.23.85) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 19 Jul 2019 14:57:29 +0200 From: Patrick Delaunay To: Date: Fri, 19 Jul 2019 14:57:12 +0200 Message-ID: <1563541046-6432-1-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.201.23.85] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-19_09:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [RFC PATCH 00/14] dfu: update dfu stack and use them for stm32mp1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This serie based on v2019.07 propose some update on the DFU stack: - add capability to have several DFU backend running in parallel - add MTD backend for NAND, NOR or SPI-NAND - add VIRTUAL backend for board/command specific behavior - add some weak callback To test the feature and as example, I update the stm32mp1 to use the new features (tested with command "dfu 0") This serie prepares the DFU backend for communication with STM32CubeProgrammer on stm32mp1 platform (stm32prog command). This STMicroelectronics tool is based on DFU protocol and update the boot devices and the OTPs on the ST boards. Patrick Delaunay (14): dfu: cosmetic: cleanup sf to avoid checkpatch error dfu: sf: add partition support for nor backend dfu: prepare the support of multiple interface dfu: allow to manage DFU on several devices dfu: allow read with 0 data for EOF indication dfu: add backend for MTD device dfu: add partition support for MTD backend dfu: add DFU virtual backend dfu: add callback for flush and initiated operation stm32mp1: activate DFU support and command MTD stm32mp1: activate SET_DFU_ALT_INFO stp32mp1: configs: activate CONFIG_MTD_SPI_NAND stm32mp1: board: add spi nand support stm32mp1: add support for virtual partition read board/st/stm32mp1/README | 111 +++++++++++++ board/st/stm32mp1/stm32mp1.c | 165 ++++++++++++++++++- cmd/dfu.c | 21 ++- configs/stm32mp15_basic_defconfig | 6 + configs/stm32mp15_trusted_defconfig | 6 + drivers/dfu/Kconfig | 13 ++ drivers/dfu/Makefile | 2 + drivers/dfu/dfu.c | 145 +++++++++++++++-- drivers/dfu/dfu_mtd.c | 306 ++++++++++++++++++++++++++++++++++++ drivers/dfu/dfu_sf.c | 55 ++++++- drivers/dfu/dfu_virt.c | 49 ++++++ include/configs/stm32mp1.h | 38 ++++- include/dfu.h | 51 ++++++ 13 files changed, 939 insertions(+), 29 deletions(-) create mode 100644 drivers/dfu/dfu_mtd.c create mode 100644 drivers/dfu/dfu_virt.c