From patchwork Mon Mar 23 10:06:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 46177 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 25EC220D10 for ; Mon, 23 Mar 2015 10:07:10 +0000 (UTC) Received: by wghl18 with SMTP id l18sf26073495wgh.1 for ; Mon, 23 Mar 2015 03:07:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=irkKlYEhFWxGhphNq3u+wud1salRXM0lMd/4cKDKErg=; b=gCEW1/WIrX9GU8+tZBOyrs12B+5gu8GbyqDcJF8FGv96lLsXg4WuwFBDZuVZ0IN++Q B6RzzqN7YCjoY2B+o5AuSra0l/xxqRzYY4hz3zH7iDrWcVzCjWNRAHmxyfujlKQBW0ic hjerMKOYyu5RcqW9FLL47IokxwiI2k7rA6mTfqSrp5Q8C5m6KxidZ6IQN3/BE0eNkaio 8tUYCdWXXzjwp3fzKFRuUO3qwNTvMg6z7sOJhor4hul8r4zmVfZMLrtiujV1cqCFWMGW 6Y8VB8KH//s2m5Knjk+bX6wxTtMZb3j5uJINlxCU+bnJxTspHbwnTHyoWib1XhHcoSxO iHYA== X-Gm-Message-State: ALoCoQm2ftmDY9+s3o/FG4neOUz7N/ql55NxFSJ6iIXqI13Z0H7JMgwnTMjP+WAyP0R+2CRvxR5i X-Received: by 10.112.181.166 with SMTP id dx6mr12864604lbc.17.1427105229427; Mon, 23 Mar 2015 03:07:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.193 with SMTP id e1ls667763lag.80.gmail; Mon, 23 Mar 2015 03:07:09 -0700 (PDT) X-Received: by 10.112.141.202 with SMTP id rq10mr8001852lbb.88.1427105229277; Mon, 23 Mar 2015 03:07:09 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id da4si293294lac.31.2015.03.23.03.07.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Mar 2015 03:07:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by labto5 with SMTP id to5so22181725lab.0 for ; Mon, 23 Mar 2015 03:07:09 -0700 (PDT) X-Received: by 10.152.22.67 with SMTP id b3mr81785162laf.117.1427105229160; Mon, 23 Mar 2015 03:07:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp724996lbq; Mon, 23 Mar 2015 03:07:08 -0700 (PDT) X-Received: by 10.194.8.2 with SMTP id n2mr180601081wja.46.1427105226565; Mon, 23 Mar 2015 03:07:06 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id nb8si10979131wic.120.2015.03.23.03.07.05; Mon, 23 Mar 2015 03:07:06 -0700 (PDT) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DF737A7473; Mon, 23 Mar 2015 11:07:02 +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 ybbQslp0iuF3; Mon, 23 Mar 2015 11:07:02 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 01ABDABD8D; Mon, 23 Mar 2015 11:07:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 89C48A7437 for ; Mon, 23 Mar 2015 11:06: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 UJbefliGJU20 for ; Mon, 23 Mar 2015 11:06:50 +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-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by theia.denx.de (Postfix) with ESMTPS id 29158A7436 for ; Mon, 23 Mar 2015 11:06:44 +0100 (CET) Received: by labto5 with SMTP id to5so22172598lab.0 for ; Mon, 23 Mar 2015 03:06:44 -0700 (PDT) X-Received: by 10.152.163.2 with SMTP id ye2mr59768982lab.89.1427105203980; Mon, 23 Mar 2015 03:06:43 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id x7sm87147lag.3.2015.03.23.03.06.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Mar 2015 03:06:42 -0700 (PDT) From: Linus Walleij To: u-boot@lists.denx.de, Albert Aribaud , Tom Rini Date: Mon, 23 Mar 2015 11:06:13 +0100 Message-Id: <1427105174-20072-4-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1427105174-20072-1-git-send-email-linus.walleij@linaro.org> References: <1427105174-20072-1-git-send-email-linus.walleij@linaro.org> Cc: Steve Rae , u-boot-review@google.com Subject: [U-Boot] [PATCH 4/5] armv8: semihosting: delete external interface X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Now that loading files using semihosting can be done using a command in standard scripts, and we have rewritten the boardfile and added it to the Vexpress64, let's delete the external interface to the semihosting file retrieveal and rely solely on these commands, and staticize them inside that file so the whole business is self-contained. Signed-off-by: Linus Walleij --- arch/arm/include/asm/semihosting.h | 17 ------- arch/arm/lib/semihosting.c | 92 -------------------------------------- 2 files changed, 109 deletions(-) delete mode 100644 arch/arm/include/asm/semihosting.h diff --git a/arch/arm/include/asm/semihosting.h b/arch/arm/include/asm/semihosting.h deleted file mode 100644 index 835ca7e4b683..000000000000 --- a/arch/arm/include/asm/semihosting.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014 Broadcom Corporation - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#ifndef __SEMIHOSTING_H__ -#define __SEMIHOSTING_H__ - -/* - * ARM semihosting functions for loading images to memory. See the source - * code for more information. - */ -int smh_load(const char *fname, void *memp, int avail, int verbose); -long smh_len(const char *fname); - -#endif /* __SEMIHOSTING_H__ */ diff --git a/arch/arm/lib/semihosting.c b/arch/arm/lib/semihosting.c index edacb1187731..c3e964eabc13 100644 --- a/arch/arm/lib/semihosting.c +++ b/arch/arm/lib/semihosting.c @@ -14,7 +14,6 @@ */ #include #include -#include #define SYSOPEN 0x01 #define SYSCLOSE 0x02 @@ -145,97 +144,6 @@ static long smh_len_fd(long fd) return ret; } -/* - * Open, load a file into memory, and close it. Check that the available space - * is sufficient to store the entire file. Return the bytes actually read from - * the file as seen by the read function. The verbose flag enables some extra - * printing of successful read status. - */ -int smh_load(const char *fname, void *memp, int avail, int verbose) -{ - long ret; - long fd; - size_t len; - - ret = -1; - - debug("%s: fname \'%s\', avail %u, memp %p\n", __func__, fname, - avail, memp); - - /* Open the file */ - fd = smh_open(fname, "rb"); - if (fd == -1) - return -1; - - /* Get the file length */ - ret = smh_len_fd(fd); - if (ret == -1) { - smh_close(fd); - return -1; - } - - /* Check that the file will fit in the supplied buffer */ - if (ret > avail) { - printf("%s: ERROR ret %ld, avail %u\n", __func__, ret, - avail); - smh_close(fd); - return -1; - } - - len = ret; - - /* Read the file into the buffer */ - ret = smh_read(fd, memp, len); - if (ret == 0) { - /* Print successful load information if requested */ - if (verbose) { - printf("\n%s\n", fname); - printf(" 0x%8p dest\n", memp); - printf(" 0x%08lx size\n", len); - printf(" 0x%08x avail\n", avail); - } - } - - /* Close the file */ - smh_close(fd); - - return ret; -} - -/* - * Get the file length from the filename - */ -long smh_len(const char *fname) -{ - long ret; - long fd; - long len; - - debug("%s: file \'%s\'\n", __func__, fname); - - /* Open the file */ - fd = smh_open(fname, "rb"); - if (fd < 0) - return fd; - - /* Get the file length */ - len = smh_len_fd(fd); - if (len < 0) { - smh_close(fd); - return len; - } - - /* Close the file */ - ret = smh_close(fd); - if (ret < 0) - return ret; - - debug("%s: returning len %ld\n", __func__, len); - - /* Return the file length (or -1 error indication) */ - return len; -} - static int smh_load_file(const char * const name, ulong load_addr, ulong *end_addr) {