From patchwork Mon Jul 29 04:35:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Park, Aiden" X-Patchwork-Id: 1138123 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 45xn1R5hdVz9s7T for ; Mon, 29 Jul 2019 14:35:37 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id DB657C21D8A; Mon, 29 Jul 2019 04:35:30 +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 A69AEC21CB6; Mon, 29 Jul 2019 04:35:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A2039C21CB6; Mon, 29 Jul 2019 04:35:25 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lists.denx.de (Postfix) with ESMTPS id D236FC21C6A for ; Mon, 29 Jul 2019 04:35:24 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jul 2019 21:35:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,321,1559545200"; d="scan'208";a="195199637" Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by fmsmga004.fm.intel.com with ESMTP; 28 Jul 2019 21:35:22 -0700 Received: from orsmsx159.amr.corp.intel.com (10.22.240.24) by ORSMSX110.amr.corp.intel.com (10.22.240.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 28 Jul 2019 21:35:21 -0700 Received: from orsmsx116.amr.corp.intel.com ([169.254.7.85]) by ORSMSX159.amr.corp.intel.com ([169.254.11.26]) with mapi id 14.03.0439.000; Sun, 28 Jul 2019 21:35:21 -0700 From: "Park, Aiden" To: Bin Meng , Andy Shevchenko , U-Boot Mailing List , Simon Glass Thread-Topic: [PATCH v7 0/9] x86: Add basic Slim Bootloader payload support Thread-Index: AdVFxb1V+wGD1m8IRDmOJ6t33MIG5A== Date: Mon, 29 Jul 2019 04:35:20 +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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2M1M2ZhODMtZWEzZS00NWQ3LWE2MjktODBiOWE1Y2E0N2UxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWlJlTkpGWnNEQlllbzF1alo0bTdqN3kwVFwvRW9CdncwblJiK3p6S3oyS2VXY2N0clNwMGl3K3psN3JDbCs1M08ifQ== x-ctpclassification: CTP_NT x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Subject: [U-Boot] [PATCH v7 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 v7: * Split HOB library into EFI_GUID pre-work and making a common library * 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/hob.h | 229 ++++++++++++++++ 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 | 78 ++++++ configs/slimbootloader_defconfig | 22 ++ doc/board/intel/index.rst | 1 + doc/board/intel/slimbootloader.rst | 174 ++++++++++++ include/configs/slimbootloader.h | 62 +++++ 36 files changed, 1273 insertions(+), 431 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 create mode 100644 arch/x86/include/asm/hob.h 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