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 1FD38C433EF for ; Mon, 28 Feb 2022 19:11:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6B45683CDD; Mon, 28 Feb 2022 20:10:21 +0100 (CET) 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="htlfnOM+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2F9A583BE2; Mon, 28 Feb 2022 20:09:26 +0100 (CET) Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0: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 C52348312A for ; Mon, 28 Feb 2022 20:09:10 +0100 (CET) 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-ot1-x331.google.com with SMTP id a7-20020a9d5c87000000b005ad1467cb59so10283503oti.5 for ; Mon, 28 Feb 2022 11:09:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oIBCeXk5kxiuQNLX/OTDapJgReqiepXy11PvQqylgtg=; b=htlfnOM+IwifwWTq6rVgXZcKEsCrqSHjNd93aZo976XD/XUunfPLhaZUopzJ3nwhmo 0hVViI6mMNqu0DcCkvfHyWKJofrWiunTiNO0POGNwxIfuS3hAUuBH2vHy/Zxo5qoniH8 bLy6Kq5F18MQL1OCAaswBILUrLCyRp/Jna+2Q= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=oIBCeXk5kxiuQNLX/OTDapJgReqiepXy11PvQqylgtg=; b=fc2R6DF8g1X/0SjfcCvYyblr/gqRqTqs4/JyYq2lK4xRhAFBnLekHrcpEqpSraJIeF C5ASLPYwdS2Wu0QTNENMhi/nA8+LtkgWQZUaxk+Bi10MvWmjqcHszAR3GCorcZMeBhvX Lr/cYcq1aqeGRIBogasFxJn/Z3sFVdowT9bi26thlWuurCQgUdglCZqKbaOS0DnoLBi/ 11eGseHSe6WJHh4blNfNuHwLLEEx5EvlcEyDQoDSVR8ULK7WgRRlfoOzHAtuy7JnkkqO O/zQ44vUFm6DKFQThmJio+8QdPWotLmDC/4/eMXgk2HUznszBNJu68/DtIhgqog35kEQ lk0A== X-Gm-Message-State: AOAM530aO7Tl3MQKWZ1JjmgFUdWika45q1cLGm+4lu3e4Qt79uyuw4n8 qNXha/jEPFmMC2N1AXkNIUmO/v+89PZz2Q== X-Google-Smtp-Source: ABdhPJzWrX1aiS9L1or42PRhKIQhyWrnVnNUPt9yfM6kXfYFDYpklY6kdHL+x8mtGsLO16YUtU6CfA== X-Received: by 2002:a05:6830:1f51:b0:5ad:1f9b:dc43 with SMTP id u17-20020a0568301f5100b005ad1f9bdc43mr10244496oth.369.1646075349389; Mon, 28 Feb 2022 11:09:09 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id f188-20020a4a58c5000000b0031ccb8272f1sm5290577oob.33.2022.02.28.11.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 11:09:09 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Heinrich Schuchardt , Stefan Reinauer Subject: [PATCH 09/18] cbfs: Add some more definititions Date: Mon, 28 Feb 2022 12:08:26 -0700 Message-Id: <20220228190835.1480772-10-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.574.g5d30c73bfb-goog In-Reply-To: <20220228190835.1480772-1-sjg@chromium.org> References: <20220228190835.1480772-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.5 at phobos.denx.de X-Virus-Status: Clean Add definitions for a payload or 'self', which is like an unpacked ELF file. Signed-off-by: Simon Glass --- include/cbfs.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/include/cbfs.h b/include/cbfs.h index 7449873b49..38efb1d2b0 100644 --- a/include/cbfs.h +++ b/include/cbfs.h @@ -24,6 +24,8 @@ enum cbfs_filetype { CBFS_TYPE_CBFSHEADER = 0x02, CBFS_TYPE_STAGE = 0x10, CBFS_TYPE_PAYLOAD = 0x20, + CBFS_TYPE_SELF = CBFS_TYPE_PAYLOAD, + CBFS_TYPE_FIT = 0x21, CBFS_TYPE_OPTIONROM = 0x30, CBFS_TYPE_BOOTSPLASH = 0x40, @@ -120,6 +122,47 @@ struct cbfs_file_attr_hash { u8 hash_data[]; } __packed; +/*** Component sub-headers ***/ + +/* Following are component sub-headers for the "standard" component types */ + +/** + * struct cbfs_stage - sub-header for stage components + * + * Stages are loaded by coreboot during the normal boot process + */ +struct cbfs_stage { + u32 compression; /** Compression type */ + u64 entry; /** entry point */ + u64 load; /** Where to load in memory */ + u32 len; /** length of data to load */ + u32 memlen; /** total length of object in memory */ +} __packed; + +/** + * struct cbfs_payload_segment - sub-header for payload components + * + * Payloads are loaded by coreboot at the end of the boot process + */ +struct cbfs_payload_segment { + u32 type; + u32 compression; + u32 offset; + u64 load_addr; + u32 len; + u32 mem_len; +} __packed; + +struct cbfs_payload { + struct cbfs_payload_segment segments; +}; + +#define PAYLOAD_SEGMENT_CODE 0x45444F43 +#define PAYLOAD_SEGMENT_DATA 0x41544144 +#define PAYLOAD_SEGMENT_BSS 0x20535342 +#define PAYLOAD_SEGMENT_PARAMS 0x41524150 +#define PAYLOAD_SEGMENT_ENTRY 0x52544E45 + struct cbfs_cachenode { struct cbfs_cachenode *next; void *data; -- 2.35.1.574.g5d30c73bfb-goog