# Intel® Quark™ SoC

| The Quark™ SoC code was developed using the Galileo Gen 2 board: Overall development SoC support FSP 1.1 integration Board support Quark™ FSP CorebootPayloadPkg

## Quark™ Documentation

- Block Diagram
- Specifications:
  - X1000 - Documentation:
    - Datasheet
    - Developer's Manual
    - Product Brief
- More documentation

## Quark™ EDK2 CorebootPayloadPkg

Build Instructions:

1. Set up build environment
2. Linux (assumes GCC48):

       build  -p CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc  -a IA32  \
           -t GCC48  -b DEBUG  -DDEBUG_PROPERTY_MASK=0x27  \
           -DDEBUG_PRINT_ERROR_LEVEL=0x80000042  -DSHELL_TYPE=BUILD_SHELL  \
           -DMAX_LOGICAL_PROCESSORS=1
       ls Build/CorebootPayloadPkgIA32/DEBUG_GCC48/FV/UEFIPAYLOAD.fd

3. Windows (assumes Visual Studio 2015):

       build  -p CorebootPayloadPkg\CorebootPayloadPkgIa32.dsc  -a IA32  -t VS2015x86  -b DEBUG  -DDEBUG_PROPERTY_MASK=0x27  -DDEBUG_PRINT_ERROR_LEVEL=0x80000042  -DSHELL_TYPE=BUILD_SHELL  -DMAX_LOGICAL_PROCESSORS=1
       dir Build\CorebootPayloadPkgIA32\DEBUG_VS2015x86\FV\UEFIPAYLOAD.fd

4. In the .config for coreboot, set the following Kconfig values:
   - CONFIG_PAYLOAD_ELF=y
   - CONFIG_PAYLOAD_FILE="path to UEFIPAYLOAD.fd"
5. Build coreboot
6. Copy the image build/coreboot.rom into flash

## Quark™ EDK2 Build Environment

Use the following steps to setup a build environment:

1. Get the EDK2 sources:
   1. EDK2: git clone https://github.com/tianocore/edk2.git
   2. EDK2-non-osi: git clone https://github.com/tianocore/edk2-non-osi.git
   3. Win32 BaseTools: git clone https://github.com/tianocore/edk2-BaseTools-win32.git
2. Set up a build window:
   - Linux:

         export WORKSPACE=$PWD
         export PACKAGES_PATH="$PWD/edk2:$PWD/edk2-non-osi"
         cd edk2
         export WORKSPACE=$PWD
         . edksetup.sh

   - Windows:

         set WORKSPACE=%CD%
         set PACKAGES_PATH=%WORKSPACE%\edk2;%WORKSPACE%\edk2-non-osi
         set EDK_TOOLS_BIN=%WORKSPACE%\edk2-BaseTools-win32
         cd edk2
         edksetup.bat

## Quark™ FSP

Getting the Quark FSP source:

1. Set up an EDK-II Build Environment
2. cd edk2
3. mkdir QuarkFspPkg
4. cd QuarkFspPkg
5. Use git to clone QuarkFspPkg into the QuarkFpsPkg directory (.)

### Building QuarkFspPkg

There are two versions of FSP: FSP 1.1 and FSP 2.0. There are also two different implementations of FSP, one using subroutines without SEC and PEI core and the original implementation which relies on SEC and PEI core. Finally there are two different build x86 types release (r32) and debug (d32).

Note that the subroutine implementations are a work in progress.

Build commands shown building debug FSP:

- Linux:
  - QuarkFspPkg/BuildFsp1_1.sh -d32
  - QuarkFspPkg/BuildFsp1_1Pei.sh -d32
  - QuarkFspPkg/BuildFsp2_0.sh -d32
  - QuarkFspPkg/BuildFsp2_0Pei.sh -d32
- Windows:
  - QuarkFspPkg/BuildFsp1_1.bat -d32
  - Windows: QuarkFspPkg/BuildFsp2_0.bat -d32

### Copying FSP files into coreboot Source Tree

There are some helper scripts to copy the FSP output into the coreboot source tree. The parameters to these scripts are:

1. EDK2 tree root
2. coreboot tree root
3. Build type: DEBUG or RELEASE

Script files:

- Linux:
  - QuarkFspPkg/coreboot_fsp1_1.sh
  - QuarkFspPkg/coreboot_fsp1_1Pei.sh
  - QuarkFspPkg/coreboot_fsp2_0.sh
  - QuarkFspPkg/coreboot_fsp2_0Pei.sh

## Quark™ EDK2 BIOS

Build Instructions:

1. Set up build environment
2. Build the image:
   - Linux:

         build -p QuarkPlatformPkg/Quark.dsc  -a IA32  -t GCC48  -b DEBUG  -DDEBUG_PROPERTY_MASK=0x27  -DDEBUG_PRINT_ERROR_LEVEL=0x80000042
         ls Build/Quark/DEBUG_GCC48/FV/Quark.fd

   - Windows:

         build -p QuarkPlatformPkg/Quark.dsc  -a IA32  -t VS2012x86  -b DEBUG  -DDEBUG_PROPERTY_MASK=0x27  -DDEBUG_PRINT_ERROR_LEVEL=0x80000042
         dir Build\Quark\DEBUG_VS2012x86\FV\Quark.fd

Documentation:

- EDK II firmware for Intel® Quark™ SoC X1000 based platforms
- Intel® Quark™ SoC X1000 UEFI Firmware Writer's Guide

Modified: 17 May 2016