From patchwork Sun Sep 18 19:45:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 671457 X-Patchwork-Delegate: trini@ti.com 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 3scfgV5y2Pz9srZ for ; Mon, 19 Sep 2016 05:47:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=hlBFyDFQ; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 26C35A75F5; Sun, 18 Sep 2016 21:46:58 +0200 (CEST) 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 yYSVzncSStki; Sun, 18 Sep 2016 21:46:57 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 20771A7624; Sun, 18 Sep 2016 21:46:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 11EE3A7534 for ; Sun, 18 Sep 2016 21:45:55 +0200 (CEST) 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 0vmPv5LmdSBz for ; Sun, 18 Sep 2016 21:45:54 +0200 (CEST) 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-it0-f51.google.com (mail-it0-f51.google.com [209.85.214.51]) by theia.denx.de (Postfix) with ESMTPS id 1C4F6A7544 for ; Sun, 18 Sep 2016 21:45:45 +0200 (CEST) Received: by mail-it0-f51.google.com with SMTP id n143so54726099ita.1 for ; Sun, 18 Sep 2016 12:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=3T6p7SwXBSkXlRpA4c/qjj4XqE2ViZp12CVDnVFD+2s=; b=hlBFyDFQgPNpg8qlNEZ/OpVcaVs/A0UyR2H3WJea3EoGBAYKNcy9pQLdn/hgJaPeYc YvoCoxtLs1rkRnwUK/7q6+k5hc5mrC4LH9xFSQOu5AgQcU6mDQGrZ86aMO5uHd1OtyXt dD0csIGJFJU5HKr2RX/Vkwj9L1qK+E8l4a+MxRNPfdymvPa+o1KSaNJx76JjgNMDKIds zYDZGxDe4L7BbPJGGNOaVGJAko/CD567zRAQNAZNDojNEFZEDbx3+Ioaa8vOy1BhXFNu nDB34N68KpQq91qffej4iLrfU4F25Marb94Hfe1mDCABAKOe4nAj8vP/nACgefk9j/V3 Q0ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=3T6p7SwXBSkXlRpA4c/qjj4XqE2ViZp12CVDnVFD+2s=; b=dO0DA0zraXibuFAU0erZl4BhJOUQcPOsgOfR2TaDoKJb7R3QZ71uKD1n/MlGE9F4Xc Naue7SijtXOH2pvJ79vjsEs1Mjb6zDHYt7AVtbXYtpQ9/vfoIfjrSCkAOKEEhzBt4Rhz sL+E2di/+LPdGI9AiUN2JShkNRzpZD+rrtPc4fzsmzuLzuY6t9X/5G6VSXDsZ4evTimU u4ve7h6in1wgri8sn6Y1jMh1wz8ZG4Yfv05m9qDhchoxyetLc5A1tCxtyJDNPQd4xLXc AYrib0uZSCCymqPbJsLz/iq9kJTTMRSPfQlBlePeuVVWYHWynFMftanir7UYZikuImXV cMyg== X-Gm-Message-State: AE9vXwM1DcWKD3FmBQpxa28xBy6y4maH1w6HATWVDBPd2MLpj3dpcWtJKeSdjSzTcJd183Jw X-Received: by 10.36.84.135 with SMTP id t129mr8048660ita.63.1474227944422; Sun, 18 Sep 2016 12:45:44 -0700 (PDT) Received: from kaki.bld.corp.google.com ([100.100.202.55]) by smtp.gmail.com with ESMTPSA id y195sm7701678iod.26.2016.09.18.12.45.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Sep 2016 12:45:40 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 5BEC7220BE5; Sun, 18 Sep 2016 13:45:38 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 18 Sep 2016 13:45:01 -0600 Message-Id: <1474227917-9256-13-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1474227917-9256-1-git-send-email-sjg@chromium.org> References: <1474227917-9256-1-git-send-email-sjg@chromium.org> Cc: Marek Vasut , Tom Rini , Stephen Warren , Michal Simek , Scott Wood , Ahmed Samir Khalil Subject: [U-Boot] [PATCH 12/27] spl: Convert spl_nand_load_image() to use linker list 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" Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass --- common/spl/spl.c | 4 ---- common/spl/spl_nand.c | 4 +++- include/spl.h | 3 --- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 5ddc08d..bc51852 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -373,10 +373,6 @@ static int spl_load_image(u32 boot_device) return loader->load_image(&bootdev); switch (boot_device) { -#ifdef CONFIG_SPL_NAND_SUPPORT - case BOOT_DEVICE_NAND: - return spl_nand_load_image(&bootdev); -#endif #ifdef CONFIG_SPL_ONENAND_SUPPORT case BOOT_DEVICE_ONENAND: return spl_onenand_load_image(&bootdev); diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index 575de66..ed758e5 100644 --- a/common/spl/spl_nand.c +++ b/common/spl/spl_nand.c @@ -67,7 +67,7 @@ static int spl_nand_load_element(int offset, struct image_header *header) } } -int spl_nand_load_image(void) +static int spl_nand_load_image(struct spl_boot_device *bootdev) { int err; struct image_header *header; @@ -145,3 +145,5 @@ int spl_nand_load_image(void) return err; } #endif +/* Use priorty 1 so that Ubi can override this */ +SPL_LOAD_IMAGE_METHOD(1, BOOT_DEVICE_NAND, spl_nand_load_image); diff --git a/include/spl.h b/include/spl.h index cdcd88f..86bddd8 100644 --- a/include/spl.h +++ b/include/spl.h @@ -181,9 +181,6 @@ struct spl_image_loader { .load_image = __method, \ } -/* NAND SPL functions */ -int spl_nand_load_image(struct spl_boot_device *bootdev); - /* OneNAND SPL functions */ int spl_onenand_load_image(struct spl_boot_device *bootdev);