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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD0D0C433F5 for ; Fri, 15 Oct 2021 03:19:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1A89061090 for ; Fri, 15 Oct 2021 03:19:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1A89061090 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F0E01837F2; Fri, 15 Oct 2021 05:19:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org 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=sholland.org header.i=@sholland.org header.b="E0uH2eTq"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="iVDRNfR5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D336183806; Fri, 15 Oct 2021 05:19:24 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E1F45837D6 for ; Fri, 15 Oct 2021 05:19:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C536A5C0160; Thu, 14 Oct 2021 23:19:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 14 Oct 2021 23:19:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=fm1; bh=oRucrhrmHlSlCXAFMqGGJ99oFI D22dcWzjwNvLycISY=; b=E0uH2eTqBrdTgzW/L9Y30cyJCb1tfSCwRkBSzmN38E az11YbFJF3HCuHiJyazXaAwxnZpujNjoU+XwLGrhVPbaWuJ65PKPdAxU0eRx+d6I GR/unVXvP1uROg+Jt9evSBJJTY63AwNrpp47jowxSvBhw+8UkYh/c1N7skwj5PLc x6IuPx23UJQ1tPgDlgSrc+FMF1XxMFtBoeDGYWiCItx+qyOWGzRT0XNMhlfVJMVt 8qiafxjSmTv4E2X5KTqv69KZLP62zePlubV7uoX6v+K36EwJm6IPAq1DiXOkVtI6 NFBV77kSUuGnKqk7z5G+Wm73YhJKdIx/atZOfdr77+Mw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=oRucrh rmHlSlCXAFMqGGJ99oFID22dcWzjwNvLycISY=; b=iVDRNfR5V8tQBAC40QNXwN v2qRFw709pMXkzOXFvvg2uaaqWpjJKnbZlLeQFA1/bMEm9LHsnC3m2cCV2z1Ac0f AExeJltQ+Gz5UyAjvT7ZeOilHy31EZr46z6REPc+S3VwWhO9Rxo4IYCpTKmpDMRj bg+fLHfJ4s35Ijov0yWiYQS2QPiZUjD0nbbzzUkHavID6ys4i3MXg+v0zKPimcIY FqnGCA8i1LlJgnaYmSHntJKM9lf2WsD4t/Og5iimxlEyAjSBWGqMjITU96+1KSvu SYuXgp+7iI6OmGC5hQH1vbDzHuFdL7aJuv/qU2WsOehLxsr7viOuIu28qgf6uzIg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddufedgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffogggtgfesthekredtredtjeenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepvdfhffekjeffueelvdefhfekuedutdejgfdvhfevgeegleekgfefhfev kedttedunecuffhomhgrihhnpehoiihlrggsshdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu rdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 14 Oct 2021 23:19:17 -0400 (EDT) From: Samuel Holland To: u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: =?UTF-8?q?Pali=20Roh=C3=A1r?= , Samuel Holland , Alexandru Gagniuc , Chris Packham , "NXP i.MX U-Boot Team" , Naoki Hayama Subject: [PATCH v3 0/4] sunxi: TOC0 image type support Date: Thu, 14 Oct 2021 22:19:12 -0500 Message-Id: <20211015031916.44461-1-samuel@sholland.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean This series adds support for the TOC0 image format used by the Allwinner secure boot ROM (SBROM). This series has been tested on the following SoCs/boards, with the eFuse burnt to enable secure mode: - A50: Ainol Q88 Tablet - A64: Pine A64 Plus - H5: Orange Pi Zero Plus - H6: Pine H64 Model B - H616: Orange Pi Zero 2 This time I also tested it on boards that are not switched to secure mode (with A64, H3, and H5). Due to both series changing Makefile.spl, the last patch depends on: https://patchwork.ozlabs.org/project/uboot/list/?series=267136 Changes in v3: - Selected TOOLS_LIBCRYPTO on all platforms that use kwbimage (as best as I can tell, using the suggestions from Pali Rohár) - Removed TOOLS_LIBCRYPTO selection for sunxi, since most boards do not need it - Added __packed to all new "ABI" structs - Added entry to MAINTAINERS for sunxi tools - Fixed offset of magic passed to memcmp - Refactored functions to not return pointers (fixes ambiguous NULL) Changes in v2: - Refactored the first patch on top of TOOLS_LIBCRYPTO - Moved certificate and key item structures out of sunxi_image.h - Renamed "main" and "item" variables for clarity - Improved error messages, and added a hint about key generation - Added a comment explaining the purpose of the various key files - Mentioned testing this code on A50 in the commit message - Moved SPL header signature checks out of sunxi_image.h - Refactored SPL header signature checks to use fewer casts - Rebase on top of Icenowy's RISC-V support series - Rename Kconfig symbols to include the full image type name Samuel Holland (4): tools: Separate image types which depend on OpenSSL tools: mkimage: Add Allwinner TOC0 support sunxi: Support SPL in both eGON and TOC0 images sunxi: Support building a SPL as a TOC0 image MAINTAINERS | 1 + arch/arm/Kconfig | 3 + arch/arm/include/asm/arch-sunxi/spl.h | 2 - arch/arm/mach-imx/mxs/Kconfig | 2 + arch/arm/mach-sunxi/Kconfig | 2 + arch/arm/mach-sunxi/board.c | 34 +- board/sunxi/Kconfig | 24 + common/image.c | 1 + include/image.h | 1 + include/sunxi_image.h | 37 ++ scripts/Makefile.spl | 5 +- scripts/config_whitelist.txt | 1 - tools/Makefile | 20 +- tools/mxsimage.c | 3 - tools/sunxi_toc0.c | 907 ++++++++++++++++++++++++++ 15 files changed, 1016 insertions(+), 27 deletions(-) create mode 100644 board/sunxi/Kconfig create mode 100644 tools/sunxi_toc0.c -- 2.32.0