Re: [U-Boot] [PATCH v9 1/9] x86: Add new slimbootloader CPU type

2019-08-08 Thread Bin Meng
On Thu, Aug 8, 2019 at 10:44 PM Bin Meng  wrote:
>
> On Sat, Aug 3, 2019 at 4:30 PM Park, Aiden  wrote:
> >
> > This slimbootloader CPU type is to enable U-Boot as a payload which
> > runs on top of Slim Bootloader (https://github.com/slimbootloader).
> > The Slim Bootloader is designed with multi-stage architecture for
> > the execution from reset vector to OS booting, and supports QEMU,
> > Apollolake, Whiskeylake and Coffeelake platforms consuming Intel
> > FSP (https://github.com/IntelFsp) for silicon initialization
> > including CAR and memory initialization.
> > The Slim Bootloader generates new HOB (Hand Off Block) which are
> > serial port info, memory map info, performance data info and so on,
> > and passes it to a Payload. U-Boot as a payload will use these HOB
> > information for basic initialization such as serial console.
> >
> > As an initial commit,
> > - Add CONFIG_SYS_SLIMBOOTLOADER to enable slimbootloader CPU type
> > - Add new arch/x86/cpu/slimbootloader directory with minimum codes
> > - Get hob_list pointer from Slim Bootloader
> >
> > Signed-off-by: Aiden Park 
> > Reviewed-by: Bin Meng 
> > Reviewed-by: Andy Shevchenko 
> > ---
> > Changes in v8:
> >   * Add a space between acronym and (definition)
> >
> > Changes in v6:
> >   * Add CONFIG_USE_HOB
> >   * Move some CONFIGs to board Kconfig
> >   * Remove arch-slimbootloader/slimbooloader.h
> >   * Apply code-review comments
> >
> > Changes in v4:
> >   * Use common arch/x86/cpu/start.S
> >   * Update U-boot or u-boot to U-Boot in commit message
> >
> > Changes in v3:
> >   * Add a brief description about Slim Bootloader
> >   * Enable USB_KEYBOARD, E1000 and RTL8169 by default
> >   * Fix comment from code review
> >
> >  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/slimbootloader.c | 21 
> >  arch/x86/cpu/start.S |  6 --
> >  arch/x86/include/asm/global_data.h   |  2 +-
> >  arch/x86/lib/asm-offsets.c   |  2 +-
> >  9 files changed, 75 insertions(+), 4 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/slimbootloader.c
> >
>
> Tested-by: Bin Meng 

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v9 1/9] x86: Add new slimbootloader CPU type

2019-08-08 Thread Bin Meng
On Sat, Aug 3, 2019 at 4:30 PM Park, Aiden  wrote:
>
> This slimbootloader CPU type is to enable U-Boot as a payload which
> runs on top of Slim Bootloader (https://github.com/slimbootloader).
> The Slim Bootloader is designed with multi-stage architecture for
> the execution from reset vector to OS booting, and supports QEMU,
> Apollolake, Whiskeylake and Coffeelake platforms consuming Intel
> FSP (https://github.com/IntelFsp) for silicon initialization
> including CAR and memory initialization.
> The Slim Bootloader generates new HOB (Hand Off Block) which are
> serial port info, memory map info, performance data info and so on,
> and passes it to a Payload. U-Boot as a payload will use these HOB
> information for basic initialization such as serial console.
>
> As an initial commit,
> - Add CONFIG_SYS_SLIMBOOTLOADER to enable slimbootloader CPU type
> - Add new arch/x86/cpu/slimbootloader directory with minimum codes
> - Get hob_list pointer from Slim Bootloader
>
> Signed-off-by: Aiden Park 
> Reviewed-by: Bin Meng 
> Reviewed-by: Andy Shevchenko 
> ---
> Changes in v8:
>   * Add a space between acronym and (definition)
>
> Changes in v6:
>   * Add CONFIG_USE_HOB
>   * Move some CONFIGs to board Kconfig
>   * Remove arch-slimbootloader/slimbooloader.h
>   * Apply code-review comments
>
> Changes in v4:
>   * Use common arch/x86/cpu/start.S
>   * Update U-boot or u-boot to U-Boot in commit message
>
> Changes in v3:
>   * Add a brief description about Slim Bootloader
>   * Enable USB_KEYBOARD, E1000 and RTL8169 by default
>   * Fix comment from code review
>
>  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/slimbootloader.c | 21 
>  arch/x86/cpu/start.S |  6 --
>  arch/x86/include/asm/global_data.h   |  2 +-
>  arch/x86/lib/asm-offsets.c   |  2 +-
>  9 files changed, 75 insertions(+), 4 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/slimbootloader.c
>

Tested-by: Bin Meng 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v9 1/9] x86: Add new slimbootloader CPU type

2019-08-03 Thread Park, Aiden
This slimbootloader CPU type is to enable U-Boot as a payload which
runs on top of Slim Bootloader (https://github.com/slimbootloader).
The Slim Bootloader is designed with multi-stage architecture for
the execution from reset vector to OS booting, and supports QEMU,
Apollolake, Whiskeylake and Coffeelake platforms consuming Intel
FSP (https://github.com/IntelFsp) for silicon initialization
including CAR and memory initialization.
The Slim Bootloader generates new HOB (Hand Off Block) which are
serial port info, memory map info, performance data info and so on,
and passes it to a Payload. U-Boot as a payload will use these HOB
information for basic initialization such as serial console.

As an initial commit,
- Add CONFIG_SYS_SLIMBOOTLOADER to enable slimbootloader CPU type
- Add new arch/x86/cpu/slimbootloader directory with minimum codes
- Get hob_list pointer from Slim Bootloader

Signed-off-by: Aiden Park 
Reviewed-by: Bin Meng 
Reviewed-by: Andy Shevchenko 
---
Changes in v8:
  * Add a space between acronym and (definition)

Changes in v6:
  * Add CONFIG_USE_HOB
  * Move some CONFIGs to board Kconfig
  * Remove arch-slimbootloader/slimbooloader.h
  * Apply code-review comments

Changes in v4:
  * Use common arch/x86/cpu/start.S
  * Update U-boot or u-boot to U-Boot in commit message

Changes in v3:
  * Add a brief description about Slim Bootloader
  * Enable USB_KEYBOARD, E1000 and RTL8169 by default
  * Fix comment from code review

 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/slimbootloader.c | 21 
 arch/x86/cpu/start.S |  6 --
 arch/x86/include/asm/global_data.h   |  2 +-
 arch/x86/lib/asm-offsets.c   |  2 +-
 9 files changed, 75 insertions(+), 4 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/slimbootloader.c

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 70f939869a..218e817cf3 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -115,6 +115,7 @@ source "arch/x86/cpu/efi/Kconfig"
 source "arch/x86/cpu/qemu/Kconfig"
 source "arch/x86/cpu/quark/Kconfig"
 source "arch/x86/cpu/queensbay/Kconfig"
+source "arch/x86/cpu/slimbootloader/Kconfig"
 source "arch/x86/cpu/tangier/Kconfig"
 
 # architecture-specific options below
@@ -344,9 +345,17 @@ config INTEL_ME_FILE
  The filename of the file to use as Intel Management Engine in the
  board directory.
 
+config USE_HOB
+   bool "Use HOB (Hand-Off Block)"
+   help
+ Select this option to access HOB (Hand-Off Block) data structures
+ and parse HOBs. This HOB infra structure can be reused with
+ different solutions across different platforms.
+
 config HAVE_FSP
bool "Add an Firmware Support Package binary"
depends on !EFI
+   select USE_HOB
help
  Select this option to add an Firmware Support Package binary to
  the resulting U-Boot image. It is a binary blob which U-Boot uses
diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile
index 85fd5e616e..3f1f62da2b 100644
--- a/arch/x86/cpu/Makefile
+++ b/arch/x86/cpu/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_INTEL_BAYTRAIL) += baytrail/
 obj-$(CONFIG_INTEL_BRASWELL) += braswell/
 obj-$(CONFIG_INTEL_BROADWELL) += broadwell/
 obj-$(CONFIG_SYS_COREBOOT) += coreboot/
+obj-$(CONFIG_SYS_SLIMBOOTLOADER) += slimbootloader/
 obj-$(CONFIG_EFI) += efi/
 obj-$(CONFIG_QEMU) += qemu/
 obj-$(CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE) += ivybridge/
diff --git a/arch/x86/cpu/slimbootloader/Kconfig 
b/arch/x86/cpu/slimbootloader/Kconfig
new file mode 100644
index 00..3ea4c9958c
--- /dev/null
+++ b/arch/x86/cpu/slimbootloader/Kconfig
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2019 Intel Corporation 
+
+config SYS_SLIMBOOTLOADER
+   bool
+   select USE_HOB
+   imply SYS_NS16550
+   imply AHCI_PCI
+   imply SCSI
+   imply SCSI_AHCI
+   imply MMC
+   imply MMC_PCI
+   imply MMC_SDHCI
+   imply MMC_SDHCI_SDMA
+   imply USB
+   imply USB_EHCI_HCD
+   imply USB_XHCI_HCD
+   imply E1000
diff --git a/arch/x86/cpu/slimbootloader/Makefile 
b/arch/x86/cpu/slimbootloader/Makefile
new file mode 100644
index 00..627a721e8c
--- /dev/null
+++ b/arch/x86/cpu/slimbootloader/Makefile
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2019 Intel Corporation 
+
+obj-y += car.o slimbootloader.o
diff --git a/arch/x86/cpu/slimbootloader/car.S 
b/arch/x86/cpu/slimbootloader/car.S
new file mode 100644
index