From patchwork Sat Oct 10 08:47:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 528556 X-Patchwork-Delegate: sjg@chromium.org 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 0C9AC14030B for ; Sat, 10 Oct 2015 19:45:46 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=0HRhVsef; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5870C4B88E; Sat, 10 Oct 2015 10:45:40 +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 yzT9yZfc4ZBj; Sat, 10 Oct 2015 10:45:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AA7274B866; Sat, 10 Oct 2015 10:45:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9636A4B849 for ; Sat, 10 Oct 2015 10:45:32 +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 G4tK8HJINL8V for ; Sat, 10 Oct 2015 10:45:32 +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-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by theia.denx.de (Postfix) with ESMTPS id 3189C4B836 for ; Sat, 10 Oct 2015 10:45:28 +0200 (CEST) Received: by padhy16 with SMTP id hy16so108060712pad.1 for ; Sat, 10 Oct 2015 01:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=siyz+kEa+lpl0j0k4vSsMutzh30CkWQpVK3AdN/JH+c=; b=0HRhVsefuJyFXHk5hbgE9KmDdys+tyf/xUqG7n8PdHSw1H/f9CXYYLEwykb8I77lhm sr7z78NrK3aJxxEnKUtYPsPfZABBCW1YBL2wb1yXgdIpsE6A/UQWOF5+6aMrth3Ov4F9 AxY8BXF4l9mjyssqc60PoRCk7uhu2IGsLAvy37t0khQUgxr0esRh9t3uIBBkPEsRLHTs E/kJ30BzUoea3doUCRCBcfLRPWJ8yd8km+IQZs8c8LKqu/h/LGjXfRWp2qIPXbXEqtFp c5fQXoJ6TdM7DHJhQy1Ws/qYLQr7AQoAmAqjxFPvpZYhUqj6WPigb/lf0980zFDYBPSq 6iNA== X-Received: by 10.66.136.39 with SMTP id px7mr20639901pab.23.1444466726457; Sat, 10 Oct 2015 01:45:26 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-157-139.windriver.com. [147.11.157.139]) by smtp.gmail.com with ESMTPSA id gv1sm6842888pbc.38.2015.10.10.01.45.25 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Oct 2015 01:45:26 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Sat, 10 Oct 2015 01:47:58 -0700 Message-Id: <1444466879-24281-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1444466879-24281-1-git-send-email-bmeng.cn@gmail.com> References: <1444466879-24281-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 3/4] x86: fsp: Make hob command a sub-command to fsp 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" Introduce a new fsp command and make the existing hob command a sub-command to fsp for future extension. Also move cmd_hob.c to the dedicated fsp sub-directory in arch/x86/lib. Signed-off-by: Bin Meng Acked-by: Simon Glass --- arch/x86/lib/Makefile | 1 - arch/x86/lib/fsp/Makefile | 1 + arch/x86/lib/{cmd_hob.c => fsp/cmd_fsp.c} | 33 +++++++++++++++++++++++++------ doc/README.x86 | 5 ++--- 4 files changed, 30 insertions(+), 10 deletions(-) rename arch/x86/lib/{cmd_hob.c => fsp/cmd_fsp.c} (65%) diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index 4ac9956..fa95944 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -10,7 +10,6 @@ obj-y += bios_asm.o obj-y += bios_interrupts.o obj-$(CONFIG_CMD_BOOTM) += bootm.o obj-y += cmd_boot.o -obj-$(CONFIG_HAVE_FSP) += cmd_hob.o obj-$(CONFIG_EFI) += efi/ obj-y += e820.o obj-y += gcc.o diff --git a/arch/x86/lib/fsp/Makefile b/arch/x86/lib/fsp/Makefile index 5b12c12..3ea4880 100644 --- a/arch/x86/lib/fsp/Makefile +++ b/arch/x86/lib/fsp/Makefile @@ -4,6 +4,7 @@ # SPDX-License-Identifier: GPL-2.0+ # +obj-y += cmd_fsp.o obj-y += fsp_car.o obj-y += fsp_common.o obj-y += fsp_dram.o diff --git a/arch/x86/lib/cmd_hob.c b/arch/x86/lib/fsp/cmd_fsp.c similarity index 65% rename from arch/x86/lib/cmd_hob.c rename to arch/x86/lib/fsp/cmd_fsp.c index 4a29aee..b0b1875 100644 --- a/arch/x86/lib/cmd_hob.c +++ b/arch/x86/lib/fsp/cmd_fsp.c @@ -1,12 +1,11 @@ /* - * Copyright (C) 2014, Bin Meng + * Copyright (C) 2014-2015, Bin Meng * * SPDX-License-Identifier: GPL-2.0+ */ #include #include -#include #include DECLARE_GLOBAL_DATA_PTR; @@ -26,7 +25,7 @@ static char *hob_type[] = { "Capsule", }; -int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { const struct hob_header *hdr; uint type; @@ -74,8 +73,30 @@ int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } +static cmd_tbl_t fsp_commands[] = { + U_BOOT_CMD_MKENT(hob, 0, 1, do_hob, "", ""), +}; + +static int do_fsp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + cmd_tbl_t *fsp_cmd; + int ret; + + if (argc < 2) + return CMD_RET_USAGE; + fsp_cmd = find_cmd_tbl(argv[1], fsp_commands, ARRAY_SIZE(fsp_commands)); + argc -= 2; + argv += 2; + if (!fsp_cmd || argc > fsp_cmd->maxargs) + return CMD_RET_USAGE; + + ret = fsp_cmd->cmd(fsp_cmd, flag, argc, argv); + + return cmd_process_error(fsp_cmd, ret); +} + U_BOOT_CMD( - hob, 1, 1, do_hob, - "print Firmware Support Package (FSP) Hand-Off Block information", - "" + fsp, 2, 1, do_fsp, + "Show Intel Firmware Support Package (FSP) related information", + "hob - Print FSP Hand-Off Block (HOB) information" ); diff --git a/doc/README.x86 b/doc/README.x86 index 18fed82..a9d0e0f 100644 --- a/doc/README.x86 +++ b/doc/README.x86 @@ -332,9 +332,8 @@ In keeping with the U-Boot philosophy of providing functions to check and adjust internal settings, there are several x86-specific commands that may be useful: -hob - Display information about Firmware Support Package (FSP) Hand-off - Block. This is only available on platforms which use FSP, mostly - Atom. +fsp - Display information about Intel Firmware Support Package (FSP). + This is only available on platforms which use FSP, mostly Atom. iod - Display I/O memory iow - Write I/O memory mtrr - List and set the Memory Type Range Registers (MTRR). These are used to