From patchwork Sun Sep 10 13:22:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 812148 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dh2ZclPn"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xqsMz0f1rz9s7g for ; Sun, 10 Sep 2017 23:29:03 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D48DCC21EE4; Sun, 10 Sep 2017 13:26:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 53153C21E1D; Sun, 10 Sep 2017 13:24:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CD902C21F94; Sun, 10 Sep 2017 13:23:32 +0000 (UTC) Received: from mail-qk0-f172.google.com (mail-qk0-f172.google.com [209.85.220.172]) by lists.denx.de (Postfix) with ESMTPS id D7EEFC21F56 for ; Sun, 10 Sep 2017 13:23:23 +0000 (UTC) Received: by mail-qk0-f172.google.com with SMTP id b82so14298512qkc.4 for ; Sun, 10 Sep 2017 06:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FVOt/YC/ElIJ+vQG6Z0RsNRlZ0fWOtQcY9X24GXgOrg=; b=dh2ZclPn9scRVi3G6OUHmdS8ygw6PhoFSuVwPWABV30iF3kOQEdO83h4DTqkDLY88o MGRmx3dY61ge4sFdyO4LIgEbGakuGYJGNg/zr4JNhA2ly1bN4XC8H/23PkbrHsm/DF9H ujzNaxkY3PaSyLHMq/t53axUf3JBjaV3/vkOuDiE1b0jQgwjFHBv/LxeFX/8yDjR4pAD artKyjwMUfWvJuomWkWJvykrmTUlgYJTr2NA+36w7htzQm2DK5OfmRj0gNNxz04gbI5B 80f/KuTKMwgOiB9BbZ3Mh7NU6saznqbebt6oBxv1EZEvdT4j5sbgMSNfSyEll2HP2qJi M/nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FVOt/YC/ElIJ+vQG6Z0RsNRlZ0fWOtQcY9X24GXgOrg=; b=AN91SYlILDh+irr51uZhIhc7FV/4QzHBkcFH6GsOrfNJAW7ltAplMGZG+jeWtUjmeA D34TamKQQdDMp6HLgxsrKEDsnjvVJ0AZrqLTVgKxQcJ5LFYiC/A7na8suXrFmBdwoW2w US3UJScxa+MvUsKtFTl6aKLCPlWR4ZQubAAMktV7yBRSXYoMB0zpbc/WXD+jZAWUzW+r k++zPnvkDCrlnXLZ3U4evtM7PK3Y2olvZZAQcV8Gtosd2kj+XG3UnkIfMuuZJXcRMS2c QdYaIXQn09h+mNgVdQOgGfXsav5zebwgkhYw3Q4C4rgM/NYYtPLECTdGYukRWHGZk9PC r7gA== X-Gm-Message-State: AHPjjUiRSw/mCg+ncemYji40k14GST7VRdOnl0W1ZkVXR7sfcQHiRaAP +p/ZysaXQ0nS5tDGqIw= X-Google-Smtp-Source: AOwi7QBWDhBwPW44VcIusomxaLTWQ8bjfgSJKfBG1PUSvPe21/sKosyHtB/Q5pxlpCUvrL6D8lDpMw== X-Received: by 10.55.165.81 with SMTP id o78mr10891944qke.313.1505049802570; Sun, 10 Sep 2017 06:23:22 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id g31sm4526589qtg.21.2017.09.10.06.23.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Sep 2017 06:23:21 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Sun, 10 Sep 2017 09:22:33 -0400 Message-Id: <20170910132236.14318-13-robdclark@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170910132236.14318-1-robdclark@gmail.com> References: <20170910132236.14318-1-robdclark@gmail.com> Cc: Heinrich Schuchardt , Leif Lindholm Subject: [U-Boot] [PATCH v1 12/12] HACK: efi_loader: hacks for SCT X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Not intended to be merged, just to show the remaning TODOs to get SCT.efi working. --- include/config_distro_bootcmd.h | 2 +- lib/efi_loader/efi_boottime.c | 4 ++-- lib/efi_loader/efi_console.c | 3 ++- lib/efi_loader/efi_file.c | 11 +++++++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index e0d0034ed3..e232a62996 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -88,7 +88,7 @@ #ifdef CONFIG_EFI_LOADER #if defined(CONFIG_ARM64) -#define BOOTEFI_NAME "bootaa64.efi" +#define BOOTEFI_NAME "shell.efi" #elif defined(CONFIG_ARM) #define BOOTEFI_NAME "bootarm.efi" #endif diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 9628bef474..5db8ea9090 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -172,7 +172,7 @@ static efi_status_t efi_unsupported(const char *funcname) static unsigned long EFIAPI efi_raise_tpl(UINTN new_tpl) { EFI_ENTRY("0x%zx", new_tpl); - return EFI_EXIT(0); + return EFI_EXIT(TPL_APPLICATION); } static void EFIAPI efi_restore_tpl(UINTN old_tpl) @@ -1021,7 +1021,7 @@ static efi_status_t EFIAPI efi_set_watchdog_timer(unsigned long timeout, { EFI_ENTRY("%ld, 0x%"PRIx64", %ld, %p", timeout, watchdog_code, data_size, watchdog_data); - return efi_unsupported(__func__); + return EFI_EXIT(EFI_SUCCESS); } static efi_status_t EFIAPI efi_connect_controller( diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c index fcd65ca488..139f7ea55b 100644 --- a/lib/efi_loader/efi_console.c +++ b/lib/efi_loader/efi_console.c @@ -561,7 +561,8 @@ static efi_status_t EFIAPI efi_cin_ex_register_key_notify( efi_handle_t *notify_handle) { EFI_ENTRY("%p, %p, %p", this, notify_fn, notify_handle); - return EFI_EXIT(EFI_OUT_OF_RESOURCES); +// return EFI_EXIT(EFI_OUT_OF_RESOURCES); + return EFI_EXIT(EFI_SUCCESS); } static efi_status_t EFIAPI efi_cin_ex_unregister_key_notify( diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 118d83ad7c..d66b0d0370 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -218,8 +218,8 @@ static efi_status_t EFIAPI efi_file_delete(struct efi_file_handle *file) { struct file_handle *fh = to_fh(file); EFI_ENTRY("%p", file); - file_close(fh); - return EFI_EXIT(EFI_WARN_DELETE_FAILURE); + // TODO need fs_rm().. + return EFI_EXIT(file_close(fh)); } static efi_status_t file_read(struct file_handle *fh, u64 *buffer_size, @@ -340,6 +340,13 @@ static efi_status_t EFIAPI efi_file_write(struct efi_file_handle *file, EFI_ENTRY("%p, %p, %p", file, buffer_size, buffer); + // XXX hack because fat_write is horrible: + if (!fs_exists(fh->path)) { + char *p = fh->path; + while ((p = strchr(p, '/'))) + *p++ = '_'; + } + if (set_blk_dev(fh)) { ret = EFI_DEVICE_ERROR; goto error;