From patchwork Sat Dec 21 16:13:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1214536 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="kgWMncSY"; 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47g9g535yXz9s29 for ; Sun, 22 Dec 2019 03:14:41 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 58F5E81642; Sat, 21 Dec 2019 17:14:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="kgWMncSY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CF25D815F1; Sat, 21 Dec 2019 17:13:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (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 982E6808B6 for ; Sat, 21 Dec 2019 17:13:51 +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-io1-xd42.google.com with SMTP id c16so10979841ioh.6 for ; Sat, 21 Dec 2019 08:13:51 -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=nwqFuBm3X32lelEgUpw6qnFJfXgO3eJwfzxiWZaldMc=; b=kgWMncSYidyh0ADERPSBt/oZmWR52Cq65OnWmP5W6oIqUtT8O5eAZs8VB2fHHIL4IU P0Ncv9cMqECGAE/x3KZs68KSPUohvC8NOvNoBhopRF51aebb9jIJIbW0KxPCbsltIpwb oTNdWAtlfz1uM4qBZy5FePIPnB4B5urhzQih4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nwqFuBm3X32lelEgUpw6qnFJfXgO3eJwfzxiWZaldMc=; b=FUT4Jnv+rgCzqfAzzsSpfwg9bu5DvVPK4qhjJzFgq3leuChLdpab1Wb4oI05/rraTK 6ypL0lUV1UMe7T9vneAr8KHNejlrPveJd7sZcuIFIkFsD1WFKoWg+cAOz9WEeO5yahcZ Yjlkd7EV6GdJvjJvjpsXEMlQMmbU3rX98LjJ15kEUBmeoCxC+hfm28SKDAoGvEli3ZzO xA49oKF36KlVe8K1VlLswXLHm8YClmSLQoujk/jjPOGwHr0llxBV/9svNdvva0W5rm6L JFMmeTZBQr7OjiHqXinlCW9wdYsrm6RE9NPGvoVbxX2ZrABH6Nev5rFTxoxegfD1q4eT OTiQ== X-Gm-Message-State: APjAAAXz1Tacb5hz0F3rgW1mSHAQGdNJoQ2QsDqEaiJ6G1S1WG6Tsw1k CpZNaXyccYLnpXE1//NYrXrMfVUzEg4= X-Google-Smtp-Source: APXvYqxFNYKbhAqL50k2Y1pGE4H0gG0LXQxwNoBlT7pDx2TpgPZsBfQe8XYy2UvcSCFcJf/wRvJh+w== X-Received: by 2002:a5d:9c4e:: with SMTP id 14mr14530527iof.166.1576944830262; Sat, 21 Dec 2019 08:13:50 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id g4sm7073700iln.81.2019.12.21.08.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 08:13:49 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH 4/5] dm: Avoid initing built-in devices when chain loading Date: Sat, 21 Dec 2019 09:13:39 -0700 Message-Id: <20191221161340.27047-5-sjg@chromium.org> X-Mailer: git-send-email 2.24.1.735.g03f4e72817-goog In-Reply-To: <20191221161340.27047-1-sjg@chromium.org> References: <20191221161340.27047-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Warren , Heinrich Schuchardt , Joe Hershberger , Alexander Graf , Stefan Roese , Pavel Herrmann Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean When U-Boot is not the first-stage bootloader we don't want to init devices early during boot. Add a check to avoid this. Signed-off-by: Simon Glass --- common/board_r.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/board_r.c b/common/board_r.c index e711de64b5..4e0dfac4fc 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -320,6 +320,9 @@ static int initr_dm_devices(void) { int ret; + if (!ll_boot_init()) + return 0; + if (IS_ENABLED(CONFIG_TIMER_EARLY)) { ret = dm_timer_init(); if (ret)