Hackathon

corebootteam.slack.com

 

OR

 

#coreboot at freenode IRC

Slack

review.coreboot.org

Gerrit Code Review

Hands-on: Read PCI register

Hands-on: Read PCI register

  • Write a single function
    • Dump the following PCI registers of device 00:14.0
      • 0x02
      • 0x10
    • Put the function into a separate file
    • The function must be called in romstage and in ramstage init phase
  • Use the existing functions in mainboard/ocp/weedge100s
  • Use as much defines as possible
  • Write down the dumped register values for
    • romstage
    • ramstage

Task:

Hands-on: Read PCI register

  • Add a new source file and header
  • Include the added file into the build system
  • Search for a function that does read from PCI register space
  • Write your own function
  • Call your function from romstage and ramstage

Hint:

  • special define __SIMPLE_DEVICE__
    • always set in romstage on x86
    • optional use in ramstage
    • changes function prototype of PCI functions

30 min

Hands-on: Read raw values from FMAP region

Hands-on: Read raw values from FMAP region

  • Locate the "COREBOOT" FMAP region
  • Mmap the region and print the first 8 bytes as ASCII string
  • Print an error if you don't find the FMAP region
  • On sucess write down the dumped value

Task:

20 min

Hands-on: Read cbmem console

Hands-on: Read the cbmem console in Linux

  • Use the wedge100s as target
  • Read the cbmem console using Linux's sysfs
  • Write down the second line after "coreboot romstage starting..."

Task:

15 min

Hands-on: Read the cbmem console in Linux

  • Boot into the Linux system with SeaBIOS

Hint:

CTF

Background

The Wedge100s SoC implementation is utterly broken:

  • UPD is currently not working on FSP Broadwell DE but is used to configure the FSP dynamically from coreboot
  • No SPI console support for broadwell DE
  • The Vital Product Data is a Google feature and not available without Chrome OS support. But it is required by the LinuxBoot payload in conjunction with systemboot.
  • In the current Wedge100s mainboard implementation is missing the MRC cache which is required for fast boot cycles.  

MRC cache

  • Memory Reference Code
  • Ripped out of FSP by Google to get rid of BLOBs
  • Idea:
    • Backup DRAM training values in flash
    • Restore training values on S3 resume and normal boot
    • Old platforms did use NVRAM instead
    • Old method: mrc.cache in CBFS
    • New method: FMAP region
  • Nowadays:
    • Additional configuration values (PEG)
    • Written to flash in ramstage
    • Write protected adter ramstage
  • Decreased boot times: 10 seconds -> 0.1 second (2Channel DDR3)

Hands-on: Add FMAP MRC cache

Hands-on: Add FMAP MRC cache

  • Include a RW_MRC_CACHE region in the FMAP
  • Decrease the size of COREBOOT(CBFS)
  • Boot the wedge100s at least two times
  • Compare the timestamps to make sure there's a difference in boot time
  • Write down the offset of UNIFIED_MRC_CACHE and the size of COREBOOT(CBFS)

Task:

30 min

Hands-on: Add FMAP MRC cache

  • Have a look at CHROMEOS enabled boards

Hint:

Hands-on: Fix SPI console

Hands-on: Fix SPI console

Task:

  • Add CONSOLE to FMAP
  • Fix linking errors
  • Fix compiler errors
  • Make it accept globals in romstage
  • Build SPI console enabled coreboot.rom for wedge100s
  • Run with SPI console enabled on wedge100s

Problem:

  • SPI console doesn't work on fsp_broadwell_de

Hands-on: Fix SPI console

Hint:

  • Add "CONSOLE" region to FMAP
  • Enable SPI flash console
  • Run make to find missing source file include
  • Add source file
  • Add headers
  • Replaces defines that it compiles in all stages
  • Add defines for globals in romstage

45 min

Hands-on: Get VPD running on Wedge100s

  • Vital Product Data
  • Key Value Store
  • FMAP partitions:
    • RO_VPD : Stores machine-specific information, like the mainboard serial number and MAC address.
    • RW_VPD : Stores all data that will be updated after a device leaves the factory.

Hands-on: Get VPD running on Wedge100s

  • Modifiy VPD using the vpd tool

Hands-on: Get VPD running on Wedge100s

./vpd -f build/coreboot.rom -O -i RO_VPD -s "Boot0000"='{"device_path": "/dev/sda1", "bc_file": "/boot/bc.img", "bc_name": "test"}'

Task:

Hands-on: Get VPD running on Wedge100s

  • Move VPD code to src/drivers/vpd and adapt it to fit as a driver
  • Add "select VPD" to the ChromeOS kconfig option
  • Add "select VPD" to Wedge100s kconfig
  • Add VPD_RO and VPD_RW to FMAP
  • Add RO VPD using vpd tool
  • Use LinuxBoot to access the VPD

120 min

Hackathon

By 9elements Agency GmbH