Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88195C433EF for ; Tue, 25 Jan 2022 13:55:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8BC50833C2; Tue, 25 Jan 2022 14:55:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KNWryamE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C2EC48331E; Tue, 25 Jan 2022 14:55:49 +0100 (CET) Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0913E80F9E for ; Tue, 25 Jan 2022 14:55:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=grandpaul@gmail.com Received: by mail-pj1-x1030.google.com with SMTP id g9-20020a17090a67c900b001b4f1d71e4fso2880426pjm.4 for ; Tue, 25 Jan 2022 05:55:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JuRGyAfV86pKpTEfieec0z7Vs41ki8ATKFj/x+5CxCk=; b=KNWryamE2/zyzUUC5LOqZUpiNm4kUQM4pmOUK/jFc1dNImqMZI96vBkZqFsXvGTqJe Y8tNNPxiCTwyFfSSIy9kIcZVvTuhGJplwPtqclnlGbOTl73MCcCI1JFIg/vM5RyC25vQ wjs4B/3NKZck+59YgWsGRkMZmDO8ZuIhLs5oj5oMPDi7/n2hVuccH13tL/OKTP/2O9jg 6CLm7JnJ55tSaZntaxX/l1c1/hYjk5uSDWPTRuRv8PNY4cZoYvYbD+nyQbdldRgN9ssL k1gQ7vdri+7SEK0wvZCxd6KkKCCXpEtyk3TpWvAAW0ymkOiRjH/emEcQ/WM3dwWd2AHy 6zwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JuRGyAfV86pKpTEfieec0z7Vs41ki8ATKFj/x+5CxCk=; b=2hGCqWSdM7v0UKYwkWVef8646jBjuhuDzP2o9sWmtVFDr32PQYu4b8+9ljIWn+n8Ar Wzvlpu4uxCkaBe+nyb+ayR21fyhqdqQSeJevkJ6wFu5t0+5CPRJNtvnH62AALIEjXUe5 9k9u06pQYvQMAyjk09CaNMre8gP/jfzb8oiTzbVk9NWpTqTYVIPMMEGxG41SvL3FQbAF RSWehwR/4pQgxjEV8HO5mOaRFQEPh5RycjyH135qJZWvL2byZVZvqp5DseBIJVBjFZrU 5QunwykDzIsCeanTTJSKvJgxJAYtf5zjXhhYEn1ShdvaH7l1Mry6Elkgr++tXjhbDtkI M/uA== X-Gm-Message-State: AOAM530RO477B5osbnXiWdaTkqNvqFmetsWhraXmBOTLAYLymMr2rK8Y ABmN8wbUX0UszsDb8rbjzp/wgiomxSc= X-Google-Smtp-Source: ABdhPJzGpN2zLdh2QFUvli2hAh1t6K+YCVRevUoyU38fOVIjJUXbbcfCq9vPh3fitG6QrQ6uq/7n8g== X-Received: by 2002:a17:902:f24a:b0:14a:f56d:8acb with SMTP id j10-20020a170902f24a00b0014af56d8acbmr19175412plc.91.1643118944824; Tue, 25 Jan 2022 05:55:44 -0800 (PST) Received: from localhost (host-111-184-129-17.dynamic.kbtelecom.net. [111.184.129.17]) by smtp.gmail.com with ESMTPSA id f9sm1685108pgj.92.2022.01.25.05.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jan 2022 05:55:44 -0800 (PST) From: Ying-Chun Liu To: u-boot@lists.denx.de Cc: "Ying-Chun Liu (PaulLiu)" Subject: [RFC 0/2] A/B firmware update based in eMMC boot partition. Date: Tue, 25 Jan 2022 21:55:33 +0800 Message-Id: <20220125135535.224061-1-grandpaul@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: "Ying-Chun Liu (PaulLiu)" Hi all, I've implemented A/B firmware update based on eMMC hw partitions. Normally we have 2 boot partitions on eMMC. One is active and another is inactive. We can then flash the firmware to the inactive one and make it active. Also when booting we can write protect the current active one. And left the inactive partition still writable. So I make 2 commits that implements the following features: 1. Write protect "active" boot area when board init. 2. flash firmware to inactive boot area. 3. Change the inactive boot area after firmware update. Thanks. Ying-Chun Liu (PaulLiu) (2): drivers: mmc: write protect active boot area after mmc init. drivers: dfu: flash firmware to inactive boot area and active it drivers/dfu/dfu_mmc.c | 32 +++++++++++++++++++++--- drivers/mmc/Kconfig | 10 ++++++++ drivers/mmc/mmc.c | 58 +++++++++++++++++++++++++++++++++++++++++++ include/dfu.h | 1 + 4 files changed, 98 insertions(+), 3 deletions(-) -- 2.34.1