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 636D2C001DF for ; Sun, 30 Jul 2023 17:19:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A179E86AA8; Sun, 30 Jul 2023 19:17:51 +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="JH25virS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AE43686A96; Sun, 30 Jul 2023 19:17:25 +0200 (CEST) Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (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 19F7E86AA5 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-x12f.google.com with SMTP id e9e14a558f8ab-3490cf176feso7841805ab.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=1690737440; x=1691342240; 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=XBfypt8xPaCVAnygDhr5DzT89daulxgRV5mvmjdR2pM=; b=JH25virS3iyujOcFogNcofbmAMdf+cMoM//CltudrZrGM9bXCCNyHMaDoGQcmF2T1d pT6VtZub8DukkGNPNp1Difj4/6aSewUtWCraLpRksZ5OWrlkPlBCFiofZPiKHSB+XwPN jbPWCVcDRkTtcyB+ynRxaXIhRXOSg81feVBm8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690737440; x=1691342240; 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=XBfypt8xPaCVAnygDhr5DzT89daulxgRV5mvmjdR2pM=; b=EvdjFxF4UL+A9Dcw85BDjvxt67qIc3nc7VrPyTB1Xw7xWQZDN/nXRqDtqsGDTOTwRJ RRpup2httQhIfdmNzhUMDC/ENfO9DE1vkvp0qvlTF9cVXC48mqxkzSV4OPs5nTA2bwUL xrx7fjQeJPeALq1p/xH27Ghf7IWquGkyJ17zQU54tkgFaKqIc6A3s6mznTqxuaadvvbL R1fCbwLzxGtY6XG/l1wtnxBaEcxPggfDbJlsDCeCGFwawdcvrkY6DcHbYQyKXVvHvEHO tq/2UMj0I8WmhHyZ2gEX6aocth4DbkHksmZ4tAQ4e9qgTLXx/izLNzoSpAPA/ZxuNlKQ rMzw== X-Gm-Message-State: ABy/qLaSpBd5r6/fvg6WDz+Ja+3L21hlQqKv9mHdCv+Oo1Kynbh1iPvw 4JL21VPlJaZrMTx2fHlmEdTF6OeJIqLe/+AH86g= X-Google-Smtp-Source: APBJJlFoeJ86a6cheliGAUd6nF7kLkEeiskt5icJc1Ma5tP3JQyajcAlk7WO2/HQlKyiBYf20faRzQ== X-Received: by 2002:a92:cdab:0:b0:348:8050:d7a with SMTP id g11-20020a92cdab000000b0034880500d7amr7455183ild.30.1690737440696; Sun, 30 Jul 2023 10:17:20 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jul 2023 10:17:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Alper Nebi Yasak , Simon Glass Subject: [PATCH 07/16] bootstd: Move common zimage functions to bootm.h Date: Sun, 30 Jul 2023 11:16:53 -0600 Message-ID: <20230730171709.917352-8-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 We want to avoid using #ifdefs around header files and in the code. It makes sense to collect the various functions used for loading images into a single header which can be included by all architectures. The best place for this is the arch-neutral bootm.h header, so use that. Move some zimage functions into this bootm.h header. Signed-off-by: Simon Glass --- arch/x86/include/asm/zimage.h | 27 --------------------------- boot/bootmeth_cros.c | 4 +--- include/bootm.h | 28 ++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/arch/x86/include/asm/zimage.h b/arch/x86/include/asm/zimage.h index 9ad74dc0b946..000b38ea8993 100644 --- a/arch/x86/include/asm/zimage.h +++ b/arch/x86/include/asm/zimage.h @@ -72,31 +72,4 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, */ void zimage_dump(struct boot_params *base_ptr); -/** - * zboot_start() - Boot a zimage - * - * Boot a zimage, given the component parts - * - * @addr: Address where the bzImage is moved before booting, either - * BZIMAGE_LOAD_ADDR or ZIMAGE_LOAD_ADDR - * @base: Pointer to the boot parameters, typically at address - * DEFAULT_SETUP_BASE - * @initrd: Address of the initial ramdisk, or 0 if none - * @initrd_size: Size of the initial ramdisk, or 0 if none - * @cmdline: Command line to use for booting - * Return: -EFAULT on error (normally it does not return) - */ -int zboot_start(ulong addr, ulong size, ulong initrd, ulong initrd_size, - ulong base, char *cmdline); - -/* - * zimage_get_kernel_version() - Get the version string from a kernel - * - * @params: boot_params pointer - * @kernel_base: base address of kernel - * Return: Kernel version as a NUL-terminated string - */ -const char *zimage_get_kernel_version(struct boot_params *params, - void *kernel_base); - #endif diff --git a/boot/bootmeth_cros.c b/boot/bootmeth_cros.c index 05284713f67b..3b9e75540aa8 100644 --- a/boot/bootmeth_cros.c +++ b/boot/bootmeth_cros.c @@ -12,15 +12,13 @@ #include #include #include +#include #include #include #include #include #include #include -#ifdef CONFIG_X86 -#include -#endif #include #include "bootmeth_cros.h" diff --git a/include/bootm.h b/include/bootm.h index 044a4797ed36..6fe418e00272 100644 --- a/include/bootm.h +++ b/include/bootm.h @@ -9,6 +9,7 @@ #include +struct boot_params; struct cmd_tbl; #define BOOTM_ERR_RESET (-1) @@ -124,4 +125,31 @@ int bootm_process_cmdline(char *buf, int maxlen, int flags); */ int bootm_process_cmdline_env(int flags); +/** + * zboot_start() - Boot a zimage + * + * Boot a zimage, given the component parts + * + * @addr: Address where the bzImage is moved before booting, either + * BZIMAGE_LOAD_ADDR or ZIMAGE_LOAD_ADDR + * @base: Pointer to the boot parameters, typically at address + * DEFAULT_SETUP_BASE + * @initrd: Address of the initial ramdisk, or 0 if none + * @initrd_size: Size of the initial ramdisk, or 0 if none + * @cmdline: Command line to use for booting + * Return: -EFAULT on error (normally it does not return) + */ +int zboot_start(ulong addr, ulong size, ulong initrd, ulong initrd_size, + ulong base, char *cmdline); + +/* + * zimage_get_kernel_version() - Get the version string from a kernel + * + * @params: boot_params pointer + * @kernel_base: base address of kernel + * Return: Kernel version as a NUL-terminated string + */ +const char *zimage_get_kernel_version(struct boot_params *params, + void *kernel_base); + #endif -- 2.41.0.487.g6d72f3e995-goog