From mboxrd@z Thu Jan 1 00:00:00 1970 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 E6028C38142 for ; Wed, 1 Feb 2023 08:35:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E032185C1E; Wed, 1 Feb 2023 09:35:56 +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="lfaXI2Io"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E014185C21; Wed, 1 Feb 2023 09:35:54 +0100 (CET) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 B928485C02 for ; Wed, 1 Feb 2023 09:35:51 +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=mkorpershoek@baylibre.com Received: by mail-wm1-x334.google.com with SMTP id k16so12059719wms.2 for ; Wed, 01 Feb 2023 00:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=3n4mvp3FHPA+iS8mDFuZJWQRMmYwJuI8e5UBKGYjcXk=; b=lfaXI2IoeUy8D2i/aGqLB7XjoGVXv3HCRBhJkq96CFxbY9GL1rhmFRBNKL7nVltHLN gEf9G3lXw3DaUblnxQDvn1yhsfC26vvAbEo7QM5Ptc3p9sQSgJGzzFuuNSjzfIxB7gPZ 9zjdl0vi4MyohYWR9F2yHEcoVspy78bQraLD27Pdro09JUSC0i9O+e0YitHKdDGdchp8 v3U0y2A3rXMRKj79eVbN8yp8CV2/9j/7a2JfPL5w/AdyQVOOdA/klaSESohrVV09e5Ue nrqbFchAvejnrEQTQB8cLsNOpljMpBERAKlH5YH0hSmJ+5DI8gVuEmTxrJO8Z/+FVDeu IO+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3n4mvp3FHPA+iS8mDFuZJWQRMmYwJuI8e5UBKGYjcXk=; b=gMEJW/FsJ5c6vP8mpD8d1+jRdnT6ga7AYockcvmv/XLfXUpNopQuvFczxTlM1Ou9oT azwCM3pLFbhx9AXJEQyWzjPU2STtWuR/ZkW9HRqHBP/t2uxK+9eNY6n0mMmzLRZltgbK NnpwUmpKGgFTGcY3awbxrkeUDvYd8LaWTa0V43DtNoXbqkrr/m0XWOyUXJiTkdNIq7DI GT9FCapLaC+LUDXDy7Ykk7qaqPapvootjLBuLmmDXjsLUYmoRwKoYRrfCZAiNzsBHITq /cnwKaWMgVDGVzlEMRoJ5Q8hx7xIydc3fpeWodenrkQCgb75BWinrSjn68rVSpNez62j Lf1w== X-Gm-Message-State: AO0yUKXXzQpCkAVv2fOsCnxXogEwVv1iTy/qQvmx3XOv3fywTvtIGMAp TCnRafQVHuHfZg/9g5m9OkqP+Q== X-Google-Smtp-Source: AK7set+q1zXUE421WKpe1bt+/5KFpu5jQZcCjs9Z1Ud7Jnncsq3dCGGle0mlhMDWwQYHPut3W9odrA== X-Received: by 2002:a05:600c:548d:b0:3db:114:a67f with SMTP id iv13-20020a05600c548d00b003db0114a67fmr1150892wmb.17.1675240551245; Wed, 01 Feb 2023 00:35:51 -0800 (PST) Received: from localhost ([82.66.159.240]) by smtp.gmail.com with ESMTPSA id p17-20020a05600c05d100b003dc521f336esm1010744wmd.14.2023.02.01.00.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 00:35:50 -0800 (PST) From: Mattijs Korpershoek To: Simon Glass , Safae Ouajih Cc: u-boot@lists.denx.de, sean.anderson@seco.com, r.stratiienko@gmail.com, glaroque@baylibre.com, khilman@baylibre.com Subject: Re: [PATCH v2 05/17] android: boot: kcomp: support andr_image_data In-Reply-To: References: <20230126160506.1026643-1-souajih@baylibre.com> <20230126160506.1026643-6-souajih@baylibre.com> Date: Wed, 01 Feb 2023 09:35:49 +0100 Message-ID: <87wn51ixzu.fsf@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain 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 On Thu, Jan 26, 2023 at 17:54, Simon Glass wrote: > On Thu, 26 Jan 2023 at 09:05, Safae Ouajih wrote: >> >> andr_image_data structure is used as a global representation of >> boot image header structure. This new structure is introduced to >> support all boot header versions : v0,v1.v2.v3.v4 and will be used >> to support v3 and v4 while maitaining support for v0,v1,v2. The need >> of using andr_image_data comes from the change of header structure in >> both version 3 and 4. >> >> android_image_get_kcomp() is reworked to support this new struct. > > nit: Your commit messages should be in imperative tense. See [1] for > some thoughts on this. > >> >> Signed-off-by: Safae Ouajih >> --- >> boot/image-android.c | 75 ++++++++++++++++++++++++++++++++++++++++- >> include/android_image.h | 27 +++++++++++++++ >> include/image.h | 2 ++ >> 3 files changed, 103 insertions(+), 1 deletion(-) >> > > Reviewed-by: Simon Glass > > But please comment struct andr_image_data. > > [..] Reviewed-by: Mattijs Korpershoek > >> diff --git a/include/android_image.h b/include/android_image.h >> index 4fce363ff7..5b36f96d7b 100644 >> --- a/include/android_image.h >> +++ b/include/android_image.h >> @@ -317,4 +317,31 @@ struct andr_boot_img_hdr_v0 { >> * contained outside boot and vendor boot partitions), otherwise >> * jump to kernel_addr >> */ >> + >> +/* Private struct */ >> +struct andr_image_data { >> + ulong kernel_ptr; >> + u32 kernel_size; >> + u32 ramdisk_size; >> + u32 boot_ramdisk_size; >> + ulong second_ptr; >> + u32 second_size; >> + ulong dtb_ptr; >> + u32 dtb_size; >> + ulong recovery_dtbo_ptr; >> + u32 recovery_dtbo_size; >> + >> + const char *kcmdline; >> + const char *kcmdline_extra; >> + const char *image_name; >> + >> + u32 kernel_addr; >> + ulong ramdisk_addr; >> + ulong ramdisk_ptr; >> + ulong dtb_load_addr; >> + ulong tags_addr; >> + u32 header_version; >> + u32 boot_img_total_size; >> +}; >> + >> #endif >> diff --git a/include/image.h b/include/image.h >> index c1594ee169..9a0bd9d8f2 100644 >> --- a/include/image.h >> +++ b/include/image.h >> @@ -1733,7 +1733,9 @@ struct cipher_algo { >> int fit_image_cipher_get_algo(const void *fit, int noffset, char **algo); >> >> struct cipher_algo *image_get_cipher_algo(const char *full_name); >> +struct andr_image_data; >> >> +bool android_image_get_data(const void *boot_hdr, struct andr_image_data *data); >> struct andr_boot_img_hdr_v0; >> int android_image_get_kernel(const struct andr_boot_img_hdr_v0 *hdr, int verify, >> ulong *os_data, ulong *os_len); >> -- >> 2.34.1 >> > > [1] https://chromium.googlesource.com/chromiumos/docs/+/HEAD/contributing.md#commit-messages