From patchwork Fri Aug 2 07:03:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Park, Aiden" X-Patchwork-Id: 1140981 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; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 460J631TkMz9sBF for ; Fri, 2 Aug 2019 17:03:23 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D6C66C21C50; Fri, 2 Aug 2019 07:03:15 +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=none 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 76C48C21C27; Fri, 2 Aug 2019 07:03:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8228BC21C27; Fri, 2 Aug 2019 07:03:12 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lists.denx.de (Postfix) with ESMTPS id 91BF8C21BE5 for ; Fri, 2 Aug 2019 07:03:11 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2019 00:03:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,337,1559545200"; d="scan'208";a="256894872" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga001.jf.intel.com with ESMTP; 02 Aug 2019 00:03:09 -0700 Received: from orsmsx114.amr.corp.intel.com (10.22.240.10) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 2 Aug 2019 00:03:09 -0700 Received: from orsmsx116.amr.corp.intel.com ([169.254.7.85]) by ORSMSX114.amr.corp.intel.com ([169.254.8.237]) with mapi id 14.03.0439.000; Fri, 2 Aug 2019 00:03:08 -0700 From: "Park, Aiden" To: Bin Meng , Andy Shevchenko , U-Boot Mailing List , Simon Glass Thread-Topic: [PATCH v8 0/9] x86: Add basic Slim Bootloader payload support Thread-Index: AdVI/s19bh2vPVOAQfKfc3c4kQRhLA== Date: Fri, 2 Aug 2019 07:03:07 +0000 Message-ID: Accept-Language: ko-KR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmFhMDBmMjctMjA5OS00Y2I1LWE2YjMtMTAxNGMzZmEwOWMyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWmQ2bkNtbDBFc2xhNkZieFQwbzlGWTJicE04bkZKTkExaEZKNitpRUh2dlRmVG8wbU5VSUZhTzZBYlwvK2JnWDkifQ== x-ctpclassification: CTP_NT x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Subject: [U-Boot] [PATCH v8 0/9] x86: Add basic Slim Bootloader payload support 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" This patch is to enable U-Boot as a payload which runs on top of Slim Bootloader (https://github.com/slimbootloader/slimbootloader) boot firmware for x86 platforms. The Slim Bootloader is designed with multi-stage architecture for the execution from reset vector to OS hand-off, and supports QEMU, Apollolake, Whiskeylake and Coffeelake platforms consuming Intel FSP (https://github.com/IntelFsp/FSP) for silicon initialization including CAR and memory initialization. As multi-stage architecture, the Slim Bootloader adopts payload concept which is responsible for OS load from media devices and boot OS and it supports 32-bit PE32, EFI FV, ELF and RAW format payloads. The Slim Bootloader generate HOB (Hand Off Block) list pointer, which has debug serial port info, memory map info, performance data info and etc., and passes it to a payload. U-Boot configures serial port, dram, pci, tsc and others with the information from the HOB. The compiled U-Boot supports USB, SATA and SD/MMC boot which have been verified on QEMU and other supported platforms. Changes in v8: * Add a space between acronym and (definition) * Remove unnecessary parentheses reported from checkpatch * Change for_each condition check to avoid ERROR from checkpatch Changes in v7: * Split HOB library into EFI_GUID pre-work and making a common lirary * Use for_each macro for memory entry search Changes in v6: * Add CONFIG_USE_HOB * Move USB_STORAGE and USB_KEYBOARD from CPU Kconfig to board Kconfig * Remove RTL8169 until required * Use EFI_GUID and efi_guid_t instead of struct efi_guid * Use less generic struct name in Slim Bootloader specific files * Convert README to reST doc/board/intel/slimbootloader.rst Changes in v5: * Remove X86_LOAD_FROM_32_BIT from slimbootloader_defconfig Changes in v4: * Use arch/x86/cpu/start.S with CONFIG_SYS_SLIMBOOTLOADER condition * Update U-boot or u-boot to U-Boot in commit message * Add static keyword in static function Changes in v3: * Add a brief description about Slim Bootloader in 1st patch * Add a common HOB library to be used by both FSP and Slim Bootloader * Move board/slimbootloader/slimbootloader to board/intel/slimbootloader * Add more description board/intel/slimbootloader/README * Fix comments from the code review Changes in v2: * Split a single patch to 8 patches * Add more comment for each structure and functions Aiden Park (9): x86: Add new slimbootloader CPU type x86: lib: fsp: Use EFI_GUID and efi_guid_t x86: Add a common HOB library x86: slimbootloader: Add memory configuration x86: slimbootloader: Add serial driver x86: slimbootloader: Set TSC information for tsc_timer x86: slimbootloader: Add a slimbootloader device tree board: intel: Add new slimbootloader board x86: Skip setting up MTRRs in slimbootloader arch/x86/Kconfig | 9 + arch/x86/cpu/Makefile | 1 + arch/x86/cpu/slimbootloader/Kconfig | 19 ++ arch/x86/cpu/slimbootloader/Makefile | 5 + arch/x86/cpu/slimbootloader/car.S | 14 + arch/x86/cpu/slimbootloader/sdram.c | 149 +++++++++++ arch/x86/cpu/slimbootloader/serial.c | 67 +++++ arch/x86/cpu/slimbootloader/slimbootloader.c | 58 ++++ arch/x86/cpu/start.S | 6 +- arch/x86/dts/Makefile | 1 + arch/x86/dts/slimbootloader.dts | 27 ++ .../asm/arch-slimbootloader/slimbootloader.h | 115 ++++++++ arch/x86/include/asm/fsp/fsp_ffs.h | 4 +- arch/x86/include/asm/fsp/fsp_fv.h | 4 +- arch/x86/include/asm/fsp/fsp_hob.h | 252 +++--------------- arch/x86/include/asm/fsp/fsp_support.h | 39 +-- arch/x86/include/asm/fsp/fsp_types.h | 8 - arch/x86/include/asm/global_data.h | 2 +- arch/x86/include/asm/{fsp/fsp_hob.h => hob.h} | 202 ++++++-------- arch/x86/lib/Makefile | 1 + arch/x86/lib/asm-offsets.c | 2 +- arch/x86/lib/fsp/fsp_support.c | 123 ++------- arch/x86/lib/hob.c | 84 ++++++ arch/x86/lib/init_helpers.c | 3 +- board/intel/Kconfig | 14 + board/intel/slimbootloader/Kconfig | 28 ++ board/intel/slimbootloader/Makefile | 5 + board/intel/slimbootloader/slimbootloader.c | 21 ++ board/intel/slimbootloader/start.S | 9 + cmd/x86/Makefile | 1 + cmd/x86/fsp.c | 67 +---- cmd/x86/hob.c | 77 ++++++ configs/slimbootloader_defconfig | 22 ++ doc/board/intel/index.rst | 1 + doc/board/intel/slimbootloader.rst | 174 ++++++++++++ include/configs/slimbootloader.h | 62 +++++ 36 files changed, 1120 insertions(+), 556 deletions(-) create mode 100644 arch/x86/cpu/slimbootloader/Kconfig create mode 100644 arch/x86/cpu/slimbootloader/Makefile create mode 100644 arch/x86/cpu/slimbootloader/car.S create mode 100644 arch/x86/cpu/slimbootloader/sdram.c create mode 100644 arch/x86/cpu/slimbootloader/serial.c create mode 100644 arch/x86/cpu/slimbootloader/slimbootloader.c create mode 100644 arch/x86/dts/slimbootloader.dts create mode 100644 arch/x86/include/asm/arch-slimbootloader/slimbootloader.h copy arch/x86/include/asm/{fsp/fsp_hob.h => hob.h} (71%) create mode 100644 arch/x86/lib/hob.c create mode 100644 board/intel/slimbootloader/Kconfig create mode 100644 board/intel/slimbootloader/Makefile create mode 100644 board/intel/slimbootloader/slimbootloader.c create mode 100644 board/intel/slimbootloader/start.S create mode 100644 cmd/x86/hob.c create mode 100644 configs/slimbootloader_defconfig create mode 100644 doc/board/intel/slimbootloader.rst create mode 100644 include/configs/slimbootloader.h