From patchwork Sun Sep 25 00:20:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 674500 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 3shSZK0SY5z9s9x for ; Sun, 25 Sep 2016 10:26:17 +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=cpLOemJm; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9B964A76CB; Sun, 25 Sep 2016 02:24:01 +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 bC5qPB4_FcAx; Sun, 25 Sep 2016 02:24:01 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A28D8A76BC; Sun, 25 Sep 2016 02:23:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A1FF8A7631 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 RJcfP6OTlwpi 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-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by theia.denx.de (Postfix) with ESMTPS id A741AA76E4 for ; Sun, 25 Sep 2016 02:20:38 +0200 (CEST) Received: by mail-io0-f176.google.com with SMTP id m186so151275735ioa.2 for ; Sat, 24 Sep 2016 17:20:38 -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=kW2MTNov9+Uoqwtme9OxqM/jMc7v2UN4ujh89fAhNyI=; b=cpLOemJmxwj63G1qiYL7dtnG9izR95oOgq94a7O45ZZABfOAFbnfZbnJwUDU7z3zcD BmXQDZTiRsBhfgUN77U+4j/ul1YR4qBj1VjkGp44QgggWKySpIz+WlkU07eO/6SLMYxO 5rT1jjmyzXXqTkuR0VvuRzK6IN40CnhvsL0rx3MXuEA8bn5JcH5AA3xNDiybnj6vBN5A OzD17BWpxvEibHHAG9V7i/6ChJetIiXvT/YLgEm31JbRR8VJtrRdzIGfJCXaTRJV5BAt XDUoMa0fWHBy0KEbC1gD7iLceM9U1CZaxsDLUxxY18estakvVMapzpVYFH59f1NXM+RW GG3w== 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=kW2MTNov9+Uoqwtme9OxqM/jMc7v2UN4ujh89fAhNyI=; b=Vy40BcuTPtk0cF76+heufDkY2iZlmXo8sfs2S5rRy/sEtNu1TodEmjXPUzAsv7Zk4q wt1ssHRYvztJZYUmO/jn2UfxgFdLSEwFN1Uepz1DbHh98x9P6A/6sff1NxXdthoQaa8+ ijxwFV6Jl292foDFSSYe8gOn5ke7mIqssrp5e/6EMt7fxRhO7TTr/Q94dFP81ipZOKfF tnnK9cs1ZgxMmTg33BF60k50J4zxTurHoH11O0rY09M1rcroRlCDH1ge3eksohHDDJL+ W2AymB4/GwXo9IzTf9EYLeGsmxW+21clt0ROLILsM2hUAs9XdSMyIPFTXBvoky6T4FJ6 Pkqg== X-Gm-Message-State: AA6/9Rm8FDwfpRQ+KlKEnJ/BbH1noNnYFauLASR4iMH7FTylE2S4dmlsTAs5xY6Spcyxv0of X-Received: by 10.107.167.8 with SMTP id q8mr16436019ioe.110.1474762836850; Sat, 24 Sep 2016 17:20:36 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:1005:12:342c:5c86:e706:e595]) by smtp.gmail.com with ESMTPSA id y133sm5543312ioy.8.2016.09.24.17.20.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Sep 2016 17:20:36 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 0DEB6220E1A; Sat, 24 Sep 2016 18:20:34 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Sep 2016 18:20:05 -0600 Message-Id: <1474762817-23091-16-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 15/27] spl: Convert spl_ymodem_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_ymodem.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 2ea7c4e..1d037f5 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_YMODEM_SUPPORT - case BOOT_DEVICE_UART: - return spl_ymodem_load_image(&bootdev); -#endif #if defined(CONFIG_SPL_SPI_SUPPORT) || defined(CONFIG_SPL_SPI_FLASH_SUPPORT) case BOOT_DEVICE_SPI: return spl_spi_load_image(&bootdev); diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c index d82b138..168b951 100644 --- a/common/spl/spl_ymodem.c +++ b/common/spl/spl_ymodem.c @@ -68,7 +68,7 @@ static ulong ymodem_read_fit(struct spl_load_info *load, ulong offset, return size; } -int spl_ymodem_load_image(struct spl_boot_device *bootdev) +static int spl_ymodem_load_image(struct spl_boot_device *bootdev) { int size = 0; int err; @@ -132,3 +132,4 @@ end_stream: printf("Loaded %d bytes\n", size); return 0; } +SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_UART, spl_ymodem_load_image); diff --git a/include/spl.h b/include/spl.h index 6338bcf..3605911 100644 --- a/include/spl.h +++ b/include/spl.h @@ -181,9 +181,6 @@ struct spl_image_loader { .load_image = __method, \ } -/* YMODEM SPL functions */ -int spl_ymodem_load_image(struct spl_boot_device *bootdev); - /* SPI SPL functions */ int spl_spi_load_image(struct spl_boot_device *bootdev);