[U-Boot,v7,0/9] x86: Add basic Slim Bootloader payload support
mbox series

Message ID A1484485FD99714DB2AB2C5EF81E7AC2AA75B66D@ORSMSX116.amr.corp.intel.com
Headers show
Series
  • x86: Add basic Slim Bootloader payload support
Related show

Message

Park, Aiden July 29, 2019, 4:35 a.m. UTC
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

Comments

Bin Meng Aug. 1, 2019, 5:22 a.m. UTC | #1
Hi Aiden,

On Mon, Jul 29, 2019 at 12:35 PM Park, Aiden <aiden.park@intel.com> wrote:
>
> 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

Thanks for all the efforts so far!

There are some checkpatch warnings which I think we should fix:

CHECK: Unnecessary parentheses around guid_hob->name
#379: FILE: arch/x86/lib/fsp/fsp_support.c:374:
+               if (!guidcmp(guid, &(guid_hob->name)))

ERROR: trailing statements should be on next line
#76: FILE: arch/x86/cpu/slimbootloader/sdram.c:37:
+               if (entries->entry[iter].type != E820_RAM) {} else

Regards,
Bin
Andy Shevchenko Aug. 1, 2019, 8:10 a.m. UTC | #2
On Thu, Aug 1, 2019 at 8:22 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> On Mon, Jul 29, 2019 at 12:35 PM Park, Aiden <aiden.park@intel.com> wrote:

> There are some checkpatch warnings which I think we should fix:

> ERROR: trailing statements should be on next line
> #76: FILE: arch/x86/cpu/slimbootloader/sdram.c:37:
> +               if (entries->entry[iter].type != E820_RAM) {} else

I'm not sure this is valid one. It's for macro use and checkpatch most
probably didn't recognize that.
Park, Aiden Aug. 2, 2019, 2:36 a.m. UTC | #3
Hi Bin,

> -----Original Message-----
> From: Bin Meng [mailto:bmeng.cn@gmail.com]
> Sent: Thursday, August 1, 2019 2:23 PM
> To: Park, Aiden <aiden.park@intel.com>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>; U-Boot Mailing List <u-
> boot@lists.denx.de>; Simon Glass <sjg@chromium.org>
> Subject: Re: [PATCH v7 0/9] x86: Add basic Slim Bootloader payload support
> 
> Hi Aiden,
> 
> On Mon, Jul 29, 2019 at 12:35 PM Park, Aiden <aiden.park@intel.com> wrote:
> >
> > 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
> 
> Thanks for all the efforts so far!
> 
> There are some checkpatch warnings which I think we should fix:
> 
> CHECK: Unnecessary parentheses around guid_hob->name
> #379: FILE: arch/x86/lib/fsp/fsp_support.c:374:
> +               if (!guidcmp(guid, &(guid_hob->name)))
> 
> ERROR: trailing statements should be on next line
> #76: FILE: arch/x86/cpu/slimbootloader/sdram.c:37:
> +               if (entries->entry[iter].type != E820_RAM) {} else
> 
Sorry for missing checkpatch issue. Let me apply the warnings. Thanks.

> Regards,
> Bin

Best Regards,
Aiden