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 DB57BC00528 for ; Sun, 30 Jul 2023 17:20:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 36D5386AB3; Sun, 30 Jul 2023 19:17:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="YTpeRYP3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BA61286971; Sun, 30 Jul 2023 19:17:25 +0200 (CEST) Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 CA0E98692D for ; Sun, 30 Jul 2023 19:17:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-3490cce32c4so9766605ab.0 for ; Sun, 30 Jul 2023 10:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690737441; x=1691342241; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=y/gMsfvKosjmjbo6A/zojK3dZph15uJS8oRRqzpz4kk=; b=YTpeRYP3n7EKlkBlr0lJk35Ntx13qoqu0HpDQZxuBXWq6hwg4Ac8qu0GtDueshrwve KoPvvX4H7vKLs2oJ1bQbRj0wgWLeJJABDcKrrcuM7V7KYGP3aQHWu319BWLWCRH40V73 iA/uXQpj3tHA6j2sSElcqwyKYgcCuDVtUQoB4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690737441; x=1691342241; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y/gMsfvKosjmjbo6A/zojK3dZph15uJS8oRRqzpz4kk=; b=TZrrg/iATqC87y8IqUlUCMeSTg/SfgJKlB44xsEG8mKyPX3Qhc511oiskxkdoZea/b ENP+e3Wl+pWNrNX+AGIu4xJ3FjXFbLng4/YeIXJbaWb4L6bpTJIYHM9KPCOh90wFLCwE mi9KP+rP+B5GY5goyfXe/QiZv/yQ3XBT3yxsHigzW6wRlgtp6hfT9vZIchYaglSqChMr lKjmPEd3Bc6PINKW++GwpjqPHkcyFQhXBbXZusE+h5qCvihnSXzNiVRaeo9RGdTaqrXS JO6fiPmffO7/0CQZyFrTaCC5pj1GrZRpW46RsfRf3dTq04QblHZqa9hB/xcvQF94T+cf pn4Q== X-Gm-Message-State: ABy/qLa1Ji4vDzsEvxVsV6qIrgygEWKusnvErRyTuiKaqpELB82E1MZu gyIDpmpBhKAPLvZnNLIhtmrq3JGzMmWcp9ptvuA= X-Google-Smtp-Source: APBJJlHmB1Qd7xk9EqRewWdOMFxEQMbLKjctF2pXj2jZMXEjH8eCSFufqQMKIrQrBKurqwnOsIqxSw== X-Received: by 2002:a05:6e02:214a:b0:348:ccd2:ce19 with SMTP id d10-20020a056e02214a00b00348ccd2ce19mr7461858ilv.29.1690737441468; Sun, 30 Jul 2023 10:17:21 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id b24-20020a02a598000000b0041cd626ea0csm2537412jam.147.2023.07.30.10.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jul 2023 10:17:21 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Alper Nebi Yasak , Simon Glass Subject: [PATCH 08/16] bootstd: cros: Add docs for the kernel layout Date: Sun, 30 Jul 2023 11:16:54 -0600 Message-ID: <20230730171709.917352-9-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230730171709.917352-1-sjg@chromium.org> References: <20230730171709.917352-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Provide brief documentation about the ChromiumOS kernel layout. Signed-off-by: Simon Glass --- boot/bootmeth_cros.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/boot/bootmeth_cros.c b/boot/bootmeth_cros.c index 3b9e75540aa8..a551d43701d8 100644 --- a/boot/bootmeth_cros.c +++ b/boot/bootmeth_cros.c @@ -22,6 +22,35 @@ #include #include "bootmeth_cros.h" +/* + * Layout of the ChromeOS kernel + * + * Partitions 2 and 4 contain kernels + * + * Contents are: + * + * Offset Contents + * 0 struct vb2_keyblock + * m struct vb2_kernel_preamble + * m + n kernel buffer + * + * m is keyblock->keyblock_size + * n is preamble->preamble_size + * + * The kernel buffer itself consists of various parts: + * + * Offset Contents + * m + n kernel image (Flat vmlinux binary or FIT) + * b - 8KB Command line text + * b - 4KB X86 setup block (struct boot_params, extends for about 16KB) + * b X86 bootloader (continuation of setup block) + * b + 16KB X86 setup block (copy, used for hold data pointed to) + * + * b is m + n + preamble->bootloader_address - preamble->body_load_address + * + * Useful metadata extends from b - 8KB through to b + 32 KB + */ + enum { PROBE_SIZE = SZ_4K, /* initial bytes read from partition */ -- 2.41.0.487.g6d72f3e995-goog