From patchwork Sun Sep 25 00:20:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 674499 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 3shSZ61qgWz9s9x for ; Sun, 25 Sep 2016 10:26:06 +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=WkWnl1IU; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1B27FA7760; Sun, 25 Sep 2016 02:23:53 +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 Oqab5E-w2Mzv; Sun, 25 Sep 2016 02:23:52 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 27B47A770C; Sun, 25 Sep 2016 02:23:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 92EB6A75E5 for ; Sun, 25 Sep 2016 02:21:49 +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 ZfsudOk9X1Wz for ; Sun, 25 Sep 2016 02:21:49 +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-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) by theia.denx.de (Postfix) with ESMTPS id A90EEA76FC for ; Sun, 25 Sep 2016 02:20:37 +0200 (CEST) Received: by mail-it0-f52.google.com with SMTP id o3so45653648ita.1 for ; Sat, 24 Sep 2016 17:20:37 -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=KmHbKnJCBzX0SJHKRLWf9d6OuOuUXQ8meu6qHV7z2WA=; b=WkWnl1IUexxIm1GBew5209bdgX2z5TfdmLtq9Y4rVRYRn0GFgaHJe0pOMeQyB2yNJr Cl1M93gKlYGAIplMj396AU0TT35vGVOTVRH6X7124Zr2dZ02bnZvDN4O4VLtcoqUQ1uj m7+TdDjP1b1K4Ha1HFbYjA9albTZTBlSGtvfqmbE7FjTKdIxs+gpdpg37QjHaOZu+FO/ uLSN5Jor1+YKixv4tCoj9Gx4Z9A7NVafLw5b/V0ct247ZtJ2TJJxfEMW2iSjVrn+5j1r YdjXY9Q2abhVD5ESO34Et4QSA8yH0s2q3cEuUXydF2pkEC/WoORIIMDMf8ASeB8Zsw5B LFag== 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=KmHbKnJCBzX0SJHKRLWf9d6OuOuUXQ8meu6qHV7z2WA=; b=GVA5L6JOMiOrtK08KI8HTGiWDj9Hu3F/RrAPhuDQfkFVx++Ccl0Qwt5/ivWdezNGS+ UjKmC7oWtrAzwCrlGecvJo7YMFr4bY6TwLt6+Y7x/iYOcRPD0MIpMhNLmn1x/3GUcBiZ YrWaC1uKYfkd/6RkzmrIENId9lNOi4FsXTtq3SUWNJOgZZzhaSJs3TwYhrhknydCJa1U Cy/aCYAhEE/KbfjR8cRi7Eh+UrRXyfEY5JBHGSf5NNsg9r2ymV65QtsIbghv5Hjr9fnW tvm+nsHsf20qTLn1hA1ey1XKFRQ4sIPKrpKVJINAWu3uCzsMXVR6Awl3xZkXwZXiKTo2 xI1Q== X-Gm-Message-State: AA6/9Rnx8ZHQr2CI33WCZ4wjhXc1hB698kkhZ7hYkgAcYix5cG+jb454fQpglHtMoKIJkb6P X-Received: by 10.36.34.204 with SMTP id o195mr10886232ito.29.1474762836056; Sat, 24 Sep 2016 17:20:36 -0700 (PDT) Received: from kaki.bld.corp.google.com ([100.100.202.55]) by smtp.gmail.com with ESMTPSA id u62sm5553707ioe.0.2016.09.24.17.20.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Sep 2016 17:20:33 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 387BC220D57; Sat, 24 Sep 2016 18:20:33 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Sep 2016 18:20:04 -0600 Message-Id: <1474762817-23091-15-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1474762817-23091-1-git-send-email-sjg@chromium.org> References: <1474762817-23091-1-git-send-email-sjg@chromium.org> Cc: Tom Rini , Stephen Warren Subject: [U-Boot] [PATCH v2 14/27] spl: Convert spl_nor_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 Reviewed-by: Tom Rini --- Changes in v2: None common/spl/spl.c | 4 ---- common/spl/spl_nor.c | 3 ++- include/spl.h | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index b838b3a..2ea7c4e 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_NOR_SUPPORT - case BOOT_DEVICE_NOR: - return spl_nor_load_image(&bootdev); -#endif #ifdef CONFIG_SPL_YMODEM_SUPPORT case BOOT_DEVICE_UART: return spl_ymodem_load_image(&bootdev); diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c index f10d679..b55fcc5 100644 --- a/common/spl/spl_nor.c +++ b/common/spl/spl_nor.c @@ -7,7 +7,7 @@ #include #include -int spl_nor_load_image(struct spl_boot_device *bootdev) +static int spl_nor_load_image(struct spl_boot_device *bootdev) { int ret; /* @@ -70,3 +70,4 @@ int spl_nor_load_image(struct spl_boot_device *bootdev) return 0; } +SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_NOR, spl_nor_load_image); diff --git a/include/spl.h b/include/spl.h index b7a3592..6338bcf 100644 --- a/include/spl.h +++ b/include/spl.h @@ -181,9 +181,6 @@ struct spl_image_loader { .load_image = __method, \ } -/* NOR SPL functions */ -int spl_nor_load_image(struct spl_boot_device *bootdev); - /* YMODEM SPL functions */ int spl_ymodem_load_image(struct spl_boot_device *bootdev);