From patchwork Fri Sep 9 15:17:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1676116 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=KKvwdamQ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MPKRm0Gyxz1yhP for ; Sat, 10 Sep 2022 01:20:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8784684BA1; Fri, 9 Sep 2022 17:19:06 +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="KKvwdamQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0DA7884B79; Fri, 9 Sep 2022 17:18:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) (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 39C5284B2C for ; Fri, 9 Sep 2022 17:18:49 +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-oa1-x29.google.com with SMTP id 586e51a60fabf-127dca21a7dso4636516fac.12 for ; Fri, 09 Sep 2022 08:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=WaZqBf1YRz4t4/zjcqT+wiX3JTrEedQ4iUF6/SxkVF8=; b=KKvwdamQukTitq+6pDKFdL8422fF/XCLeWGwJn3rwSc01p91YNg5Iwfw4rFTqtkQYs 3Hs6pcbnrF+/WMcz8I4HOe9ewhKQiVfb6r7HnySdoYI+v0FQdyc0NRgdw3K8nM/LZ9Hu RARF5v5RkzVsdcq/7syDaqCMxlXCpt86KJ8c8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=WaZqBf1YRz4t4/zjcqT+wiX3JTrEedQ4iUF6/SxkVF8=; b=n8NtUSzzxpxQkrdZFioRANCJw1Up3d+M9DOl/XQGO/0azcmFq1twQn2/+YAA1fliOy 22WlmopQFXnQWM8JbYM3qQSk5672+qKCTUgyKAWhrTczDubfGoXkCjJKy/OT6BNzOp9+ kDT+wA+os1Bd7ehVdyKu2F57Ljp6xbQe/XzqUwgfMO+OHGE94F+mCbn+iDQHps9sr4nG A/nKLjmZHc9HerINuh89Xq2MWdX+0o1s9YgXzRblpQr7WwaIyEeuA7rZFE9QVWXZwkKl FlgEJzoFoXxQFoCvt05VXiJoxOPlUWN/UT7Wc0YEjkp1+c64B3Rga8pi7Z5T04cjVDQo aYjg== X-Gm-Message-State: ACgBeo3ynvj6EgbhYp9wdKah8xc7HtlJy8ZNX0XVHUXOom8bleNmiPBu lPZMGPXIFHNwQ+6NNd3ZBmhXxaKZfWFxpw== X-Google-Smtp-Source: AA6agR5IAdgXu7mPvdrpyS453B/imMx9bNkG6wlCueS1hZw3f+AzZBmwMl2YTapOFPcfXYr5DPghMg== X-Received: by 2002:a05:6870:d1c5:b0:127:4089:929d with SMTP id b5-20020a056870d1c500b001274089929dmr5272073oac.203.1662736728452; Fri, 09 Sep 2022 08:18:48 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id eq22-20020a056870a91600b0012779ba00fesm591977oab.2.2022.09.09.08.18.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 08:18:48 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 09/14] sandbox: Support FDT fixups Date: Fri, 9 Sep 2022 09:17:56 -0600 Message-Id: <20220909151801.336551-10-sjg@chromium.org> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220909151801.336551-1-sjg@chromium.org> References: <20220909151801.336551-1-sjg@chromium.org> MIME-Version: 1.0 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 Add support for doing device tree fixups in sandbox. This allows us to test that functionality in CI. Signed-off-by: Simon Glass --- arch/sandbox/lib/bootm.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/sandbox/lib/bootm.c b/arch/sandbox/lib/bootm.c index c1742f94de7..28f4a746fb6 100644 --- a/arch/sandbox/lib/bootm.c +++ b/arch/sandbox/lib/bootm.c @@ -50,8 +50,25 @@ int bootz_setup(ulong image, ulong *start, ulong *end) return ret; } +/* Subcommand: PREP */ +static int boot_prep_linux(struct bootm_headers *images) +{ + int ret; + + if (CONFIG_IS_ENABLED(LMB)) { + ret = image_setup_linux(images); + if (ret) + return ret; + } + + return 0; +} + int do_bootm_linux(int flag, int argc, char *argv[], struct bootm_headers *images) { + if (flag & BOOTM_STATE_OS_PREP) + return boot_prep_linux(images); + if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) { bootstage_mark(BOOTSTAGE_ID_RUN_OS); printf("## Transferring control to Linux (at address %08lx)...\n",