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 BE24AC4321E for ; Sat, 26 Nov 2022 17:18:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 11C4E8502C; Sat, 26 Nov 2022 18:18:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="et1dZavf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 31DD2850BD; Sat, 26 Nov 2022 17:59:38 +0100 (CET) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 3D59784494 for ; Sat, 26 Nov 2022 17:59:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=souajih@baylibre.com Received: by mail-wm1-x331.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso5516021wmo.1 for ; Sat, 26 Nov 2022 08:59:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nzR6e8FyLygq27CVT9IEN1VexKf8HzV5pXRxvRfvBsk=; b=et1dZavfjwtm0xIyDFYAA+B+UWfj/RWCK4HD1qxWZIruWcicD1yw6gf8fuppLEkk8k iN68v3btwvwdu3TlkHS/n1lmt7GWu6gExYaNpY2bU33EHlxRFeLKcMINmvwyShEyr/ZV mwrd4DcK67ruSiHA3RBl6y683OBHzrATjkqIeOxhNIdg4432WbZFgYmsbYx1NXRsEoZJ /0QoHb6KWfjBIXamVpdvFka8OQVmn2aTKwVV87UkPVaThigS7CdSMwP/y6U9Ljuf6u+T G83lqHE4qFPHCrMCTlsRDe/MISaj78WX5FicqmYwWxnZosbDlpoRnBRKvReD8GxKQudi fZ8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nzR6e8FyLygq27CVT9IEN1VexKf8HzV5pXRxvRfvBsk=; b=hizv+ekR8qqkgzcKauVd97F23dYr+wtFjoAWUX1tcHFa1MhhoCtakIB8eTfdgImba6 OnimAjF1hRxOgmxurKb5c8EUpi5gt2CMDVRsKyro29LYRXWuX2L2+y9HcRspVhtXps2L c82HiURNnI2RSmgTfXRasfwD+b7GpAtlT61dI5izl3uzuygzn1DXRrH8LUxhRXi8p0U+ uwespclPxMzdFcwOQBaW4mVF42EnaWRO8U26s1tD3QCOyqy7S9CGYhKa+MeWS8DALjsY 71dXYXppSfDc5UHMF0huzyVB1dD90NA3r8HESAsIsGnxvzP+Fv4W0gK3BxlfPpconfEk 0R/w== X-Gm-Message-State: ANoB5pl9xvBVZZo3gcxbkq/texSyDycyx/jpj4adHNbMm9W2Ao3y0Pp9 i5MJinfFbADDyFT0861m/kX3/w== X-Google-Smtp-Source: AA0mqf43lE/gd06654kFvfGzx/NklE4c8UkjvU76LF/YwcE6HpXbzWQNOYjEdpjeL9otkJJ5nIAaww== X-Received: by 2002:a05:600c:22c4:b0:3cf:71b7:7a41 with SMTP id 4-20020a05600c22c400b003cf71b77a41mr33453384wmg.31.1669481974713; Sat, 26 Nov 2022 08:59:34 -0800 (PST) Received: from safae.baylibre.local ([2a04:cec0:11b5:4031:7588:eb2c:a5c2:aa6d]) by smtp.gmail.com with ESMTPSA id c15-20020adfe70f000000b00241e8d00b79sm7462408wrm.54.2022.11.26.08.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 08:59:34 -0800 (PST) From: Safae Ouajih To: sjg@chromium.org Cc: u-boot@lists.denx.de, sean.anderson@seco.com, r.stratiienko@gmail.com, mkorpershoek@baylibre.com, glaroque@baylibre.com, khilman@baylibre.com Subject: [PATCH 00/17] Support android boot image v3/v4 Date: Sat, 26 Nov 2022 17:59:14 +0100 Message-Id: <20221126165931.197607-1-souajih@baylibre.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sat, 26 Nov 2022 18:18:14 +0100 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.6 at phobos.denx.de X-Virus-Status: Clean Hello everyone, * This is based on Roman Stratiienko's work to support boot image header version 3 and 4. * This supports the new boot image headers v3, v4 and bootconfig feature. https://source.android.com/docs/core/architecture/bootloader/boot-image-header https://source.android.com/docs/core/architecture/bootloader/implementing-bootconfig - Tested on Amlogic Khadas vim3l, a reference board for Android Open Source Project https://www.khadas.com/vim3l And on AM625 Texas Instruments board with 5.10 linux kernel Main changes : - New partition : vendor boot, with a specific vendor ramdisk - DTB is stored in the vendor boot partition - The generic ramdisk is placed after the vendor ramdisk - Bootconfig feature support Here is a link to see the related android boot flow changes on KHADAS vim3l as an example: https://gitlab.baylibre.com/baylibre/amlogic/atv/u-boot/-/commits/souajih/BootImagev4/ Safae Ouajih (17): android: boot: rename andr_img_hdr -> andr_boot_img_hdr_v0_v1_v2 android: boot: support vendor boot image in abootimg android: boot: replace android_image_check_header android: boot: add boot image header v3 and v4 structures android: boot: add documentation for boot image header v3/v4 structure android: boot: kcomp: support andr_image_data android: boot: move to andr_image_data structure android: boot: content print is not supported for v3,v4 header version android: boot: boot image header v3,v4 do not support recovery DTBO android: boot: add vendor boot image to prepare for v3,v4 support android: boot: update android_image_get_data to support v3,v4 android: boot: ramdisk: support vendor ramdisk android: boot: support extra command line drivers: fastboot: zImage flashing is not supported for v3,v4 android: boot: support boot image header version 3 and 4 lib: support libxbc android: boot: support bootconfig boot/bootm.c | 29 ++- boot/image-android.c | 367 ++++++++++++++++++++++++++++++-------- boot/image-board.c | 15 +- boot/image-fdt.c | 5 +- cmd/abootimg.c | 66 ++++--- drivers/fastboot/fb_mmc.c | 19 +- include/android_image.h | 220 ++++++++++++++++++++++- include/image.h | 37 ++-- include/xbc.h | 1 + lib/Kconfig | 12 ++ lib/Makefile | 1 + lib/libxbc/Makefile | 1 + lib/libxbc/libxbc.c | 112 ++++++++++++ lib/libxbc/libxbc.h | 54 ++++++ 14 files changed, 806 insertions(+), 133 deletions(-) create mode 100644 include/xbc.h create mode 100644 lib/libxbc/Makefile create mode 100644 lib/libxbc/libxbc.c create mode 100644 lib/libxbc/libxbc.h -- 2.25.1