From patchwork Mon Jan 21 03:12:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 156139 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp5899177jaa; Sun, 20 Jan 2019 19:12:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN5D2EhYzfJaY2w0Td2GkN4msuKRr7qhUdbyHdZWr7HcZD7awu0qzkPsErxYDfn//Lay/kV1 X-Received: by 2002:a17:906:4d2:: with SMTP id g18-v6mr22952384eja.182.1548040372542; Sun, 20 Jan 2019 19:12:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548040372; cv=none; d=google.com; s=arc-20160816; b=Dg12QIaVpAkBKpaP6g+yy4HY7Sj1K1VxO3QD7WXAIFUfyg4egrf6vqFMc8jEqn9mdE n1sL+9XaZIYkXBq9BgP4MWjILif+5EANXc/OqF00sf8f/lyFmYpGwk/WpWq+Kg+yBRPB FD42KOOLEnVe7OaEuVd3ff7E09aMI5aYvifXQfGtFP6qjkDIKmMJ1lNQLVk+SDwkRAKZ 2x0+fBAQm+NTsWFP8D544zo56CtnNST/tR47SsuMJKnXdBMZq+qAGpaGf2YjEhjOEOLQ 039dBjpuptFJb+rva3AymaYoqDMyc5FkdoxREKOhkSWeLbWTsQUPLKFmToW8rOhHExVb sGUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature; bh=tdOx/szBr4BukRK9T9TE1A24CNeGa2vo/kVEtdo22lU=; b=MSjoi8Wwqq8nPPDUjZq6yPlbywbES2KJ0S1vaTk/VI9ZHUEiwGEcXRbqARsEAOTwU4 aeOyp4vGQpPmTkjmbxIEMY6D3vrdFDSdyc+xkrVMc1eN7G07dujAbzyGLpjVp3F9QmgO PJUEzzv+UjS3ru6ymqaOeOokeXDybm471YIYl4EMlR3tYV6to8CJEfliTUnvuLy811jC ZkYQvBedu+EtGfjtkpscvHMAe5Izd4j0hFyEsdT/Nvm+nqStaaGxlP50SIgYzmF2UsFN 1hmiavlohseCiVK0bA4tfz4g832q2gptq8xQFJKwD+MfUZNq05O55I7h27VkDjlgxmV6 ZmvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DlBHDTXz; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r53si7413713eda.218.2019.01.20.19.12.52; Sun, 20 Jan 2019 19:12:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DlBHDTXz; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 2B460C21DFF; Mon, 21 Jan 2019 03:12:50 +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=RCVD_IN_DNSWL_NONE, 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 3E8C0C21C51; Mon, 21 Jan 2019 03:12:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9B4B1C21C51; Mon, 21 Jan 2019 03:12:47 +0000 (UTC) Received: from mail-yb1-f195.google.com (mail-yb1-f195.google.com [209.85.219.195]) by lists.denx.de (Postfix) with ESMTPS id 0B936C21C38 for ; Mon, 21 Jan 2019 03:12:47 +0000 (UTC) Received: by mail-yb1-f195.google.com with SMTP id i6so6625775ybo.7 for ; Sun, 20 Jan 2019 19:12:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wFZ13g5QhRBR5MpOn2u2rNogvFf0VkmPmhIUeI6Z8Go=; b=DlBHDTXzL37AiuVi1EIEek9xYGSvqfbRo7HTdecEK2dkX3JSXgrFhmQKQ0iTkArteZ 3NnJ1V+YV21qYZ+M+HYnclJoGeulyx9mH4FiRogZpIZi0mkfBSi+loP9SzsznH7dQz3+ edCH7gtwjeaEsFBrtFO0ebPLH8JKrSarMfTV0= 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:mime-version :content-transfer-encoding; bh=wFZ13g5QhRBR5MpOn2u2rNogvFf0VkmPmhIUeI6Z8Go=; b=NlbXFROkRexHY67ae13tCcwcWDjkTHjGqI/8PpgPVPX+Wwr2PmqeCkqYNgt41dBYJ0 R2ekEnlV1dlz8WjeAvLDoj+HJ+yb3zEBCoP1ddNzIcso7D8zFJIninRtVCHCjvufoCc6 fqEyG3qg7LUUviYMZ6fX72qFJQdHbMJ1XQtYL+eUIoA2YBZH0i9cDh+JrqZIw2oQYrUN PaCiaEu99YcN4pXfiZCHslSkBn7z6mmC4JRWXGcZJpR7ZK2l4yUAvpvuJ1zCNJM/ytyR dSmE4ZzD2O9QoH7qUN3MDNg38rVPS1/RKTenxIxak7gOdb1c/8aDdYxfWOUYxgHmvMMw p+mg== X-Gm-Message-State: AJcUukfk5jZvsB+3ZyQK653ZM2uzYVo+eFWT55DfzE82hBv2WVeyswm0 NlB8CaPT2b2n9gh0nx04z9Ypuw== X-Received: by 2002:a25:21c5:: with SMTP id h188mr15321525ybh.424.1548040365935; Sun, 20 Jan 2019 19:12:45 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id b129sm5420951ywc.106.2019.01.20.19.12.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jan 2019 19:12:45 -0800 (PST) From: AKASHI Takahiro To: trini@konsulko.com, agraf@suse.de, xypron.glpk@gmx.de Date: Mon, 21 Jan 2019 12:12:56 +0900 Message-Id: <20190121031301.1808-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3 0/5] subject: efi_loader: add HII database protocol 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" HII database protocol is the last missing (major?) piece of code so that we can run unmodified EDKII's shell and UEFI SCT on EFI-enabled u-boot. The original code was initially written by Leif and Rob a year ago[1], and now I'm reworking it. The implementation has not been much enhanced from the original, but I tried to give it clearer implementation to be able to add more functionality easily later on. I also addressed the comments by Alex[2] and added a self test on request of Heinrich. HII configuration routing protocol and access protocol have only a skeleton and should be implemented when we need to have *drivers* that require configuration mechanism. # Please note that a bunch of warnings are generated by checkpatch.pl, # but there are also good reasons for not fixing them. Changes in v3 (Jan 21, 2019) * drope v2's patch#1("lib: add u16_strcpy/strdup functions") as it has been merged * define a "key" value as u32 in efi_key_descriptor * simplify "if" condition in export_package_lists() * access "packed" structures of HII packages through get_unaligned_xx() * implement GetSecondaryLanguages() * compare a language in case-insensitive way in GetString() & GetLanguages() * cosmetic changes (including variable/struct member names) Changes in v2 (Nov 16, 2018) * add some descriptions to newly added functions * rename EFI_HII_PACKAGE_[TYPE|LEN]_* to __EFI_HII_PACKAGE_[TYPE|LEN]_* as they are of internal use only * cast a return value (of efi_status_t) to "unsigned int" for printing [1] https://lists.denx.de/pipermail/u-boot/2017-October/308999.html [2] https://lists.denx.de/pipermail/u-boot/2017-October/309116.html AKASHI Takahiro (4): efi: hii: add guid package support efi: hii: add keyboard layout package support efi: hii: add HII config routing/access protocols efi_selftest: add HII database protocols test Leif Lindholm (1): efi_loader: Initial HII database protocols include/efi_api.h | 421 ++++++++- include/efi_loader.h | 8 + lib/efi_loader/Makefile | 1 + lib/efi_loader/efi_boottime.c | 18 + lib/efi_loader/efi_hii.c | 1095 ++++++++++++++++++++++ lib/efi_loader/efi_hii_config.c | 146 +++ lib/efi_selftest/Makefile | 1 + lib/efi_selftest/efi_selftest_hii.c | 1046 +++++++++++++++++++++ lib/efi_selftest/efi_selftest_hii_data.c | 453 +++++++++ 9 files changed, 3188 insertions(+), 1 deletion(-) create mode 100644 lib/efi_loader/efi_hii.c create mode 100644 lib/efi_loader/efi_hii_config.c create mode 100644 lib/efi_selftest/efi_selftest_hii.c create mode 100644 lib/efi_selftest/efi_selftest_hii_data.c Reviewed-by: Alexander Graf