From patchwork Sat Feb 28 05:06:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 444794 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4F3091400D5 for ; Mon, 2 Mar 2015 07:12:22 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 557E54B660; Sun, 1 Mar 2015 21:11:50 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZF8S9Xbloxwe; Sun, 1 Mar 2015 21:11:50 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D69BC4B58F; Sun, 1 Mar 2015 21:11:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D69A54B58F for ; Sat, 28 Feb 2015 06:36:35 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rq1IHZo6tci9 for ; Sat, 28 Feb 2015 06:36:35 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f73.google.com (mail-pa0-f73.google.com [209.85.220.73]) by theia.denx.de (Postfix) with ESMTPS id 433264B5F5 for ; Sat, 28 Feb 2015 06:29:21 +0100 (CET) Received: by pablf10 with SMTP id lf10so7249526pab.0 for ; Fri, 27 Feb 2015 21:29:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sKYP8zvEHTi5XNEJ7lX/J2Fy3bPMhcKt0OVKGX/ppbU=; b=jipn6JGIU415ZchR+9olRX/mwuHo8Os4y7mS64kEUwx8avwJgdbykwcpFZPx+qR9Wt RWEd/MDxxuwjFc1emaljojC9brS5bi6452geDxgJRAmDNZ43nss6rBmsofXBe8JJvxzH ghtrR83fLck//14veSWj13iYHC4PoUPXWmgb2MGQu++YUHpwUBqvTU2e3Kajb2n868AI oiX39rCaBOSsouac84vvOedOaLf75n2gTalA757K14Ad87I3cdCzx5/FtTzAEG7+1WDy wtCO/RRlwMAVaws5eZvL+OO4h/qtjmoytOIHq7xxinfEQyZaHu6Xnp9+i+9pcE/uFQii 0hhA== X-Gm-Message-State: ALoCoQk1z4yfI6v2EUO9O5PqZ89RufLQbynBr4j7JB/vzfuZHqvL+80/iAXrDzJRewZohVBweg86 X-Received: by 10.66.131.37 with SMTP id oj5mr16590776pab.12.1425100053775; Fri, 27 Feb 2015 21:07:33 -0800 (PST) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id f23si237822yho.7.2015.02.27.21.07.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 21:07:33 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id MSkUkf1q.2; Fri, 27 Feb 2015 21:07:33 -0800 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 3DE7E220E60; Fri, 27 Feb 2015 22:07:33 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 27 Feb 2015 22:06:42 -0700 Message-Id: <1425100013-4796-19-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1425100013-4796-1-git-send-email-sjg@chromium.org> References: <1425100013-4796-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH 18/29] dm: Init device tree as well as driver model in SPL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" If enabled, make sure that the device tree is available in SPL before setting up driver model. Signed-off-by: Simon Glass --- common/spl/spl.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index c655332..1e263b3 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -139,6 +139,8 @@ static void spl_ram_load_image(void) void board_init_r(gd_t *dummy1, ulong dummy2) { u32 boot_device; + int ret; + debug(">>spl:board_init_r()\n"); #if defined(CONFIG_SYS_SPL_MALLOC_START) @@ -149,9 +151,21 @@ void board_init_r(gd_t *dummy1, ulong dummy2) gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN; gd->malloc_ptr = 0; #endif -#ifdef CONFIG_SPL_DM - dm_init_and_scan(true); -#endif + if (IS_ENABLED(CONFIG_OF_CONTROL) && + !IS_ENABLED(CONFIG_SPL_DISABLE_OF_CONTROL)) { + ret = fdtdec_setup(); + if (ret) { + debug("fdtdec_setup() returned error %d\n", ret); + hang(); + } + } + if (IS_ENABLED(CONFIG_SPL_DM)) { + ret = dm_init_and_scan(true); + if (ret) { + debug("dm_init_and_scan() returned error %d\n", ret); + hang(); + } + } #ifndef CONFIG_PPC /*