How to deploy GBC firmware - Telecominfraproject/OpenCellular GitHub Wiki

Overview

Open Cellular platforms use coreboot to initialize hardware and LinuxBoot to boot the target OS.

coreboot (https://www.coreboot.org (http://coreboot.org/)) is a small firmware core that is used to initialize critical hardware components, such as processor and DRAM. On AARCH64 coreboot can be seen as BL1 and BL31.

After hardware is sufficiently initialized, coreboot will load an embedded “payload” into memory and execute it. The payload used in Open Cellular is LinuxBoot (https://www.linuxboot.org (https://www.linuxboot.org/)) which consists of a Linux kernel and an initramfs (an embedded environment) that serves to load the final OS target from either local storage or via network.

Coreboot is duplicated in the Open Cellular github repository under firmware/coreboot: https://github.com/Telecominfraproject/OpenCellular/tree/master/firmware/coreboot

How To's

Build a Rotundu image

In order to build the image follow the setup instructions in - How to coreboot

Put the binaries in the right place

You will need binaries which should be stored under 3rdparty/blobs/mainboard/opencellular/ in the coreboot root directory.

Set the config

Choose one of the matching configs in release/dev mode depending on the SPI flash size.

config 8MB
CONFIG_USE_OPTION_TABLE=y
CONFIG_VENDOR_OPENCELLULAR=y
CONFIG_FSP_FILE="3rdparty/blobs/mainboard/opencellular/rotundu/fsp/baytrail/BAYTRAIL_FSP.fd"
CONFIG_VBOOT=y
CONFIG_IFD_BIN_PATH="3rdparty/blobs/mainboard/opencellular/rotundu/fd_8M.bin"
CONFIG_ME_BIN_PATH="3rdparty/blobs/mainboard/opencellular/rotundu/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_OPENCELLULAR_ROTUNDU=y
CONFIG_PCIEXP_L1_SUB_STATE=y
CONFIG_PCIEXP_ASPM=y
CONFIG_PCIEXP_COMMON_CLOCK=y
CONFIG_PCIEXP_CLK_PM=y
CONFIG_CPU_MICROCODE_HEADER_FILES="3rdparty/blobs/mainboard/opencellular/rotundu/cpu/baytrail/microcode/M013067222D.h 3rdparty/blobs/mainboard/opencellular/rotundu/cpu/baytrail/microcode/M0130673321.h 3rdparty/blobs/mainboard/opencellular/rotundu/cpu/baytrail/microcode/M0130678815.h 3rdparty/blobs/mainboard/opencellular/rotundu/cpu/baytrail/microcode/M0130679901.h"
CONFIG_HAVE_FSP_BIN=y
CONFIG_HAVE_ME_BIN=y
CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION=y
CONFIG_NO_GFX_INIT=y
CONFIG_VPD=y
CONFIG_VBOOT_MEASURED_BOOT=y
CONFIG_VBOOT_MEASURED_BOOT_FMAP_RUNTIME_DATA="RW_MRC_CACHE"
CONFIG_VBOOT_SLOTS_RW_AB=y
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_6=y
CONFIG_NO_POST=y
CONFIG_SEABIOS_ADD_SERCON_PORT_FILE=y
config 16MB
CONFIG_USE_OPTION_TABLE=y
CONFIG_VENDOR_OPENCELLULAR=y
CONFIG_FSP_FILE="3rdparty/blobs/mainboard/opencellular/rotundu/fsp/baytrail/BAYTRAIL_FSP.fd"
CONFIG_CBFS_SIZE=0x003effc0
CONFIG_FMDFILE="src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot-16M.fmd"
CONFIG_VBOOT=y
CONFIG_IFD_BIN_PATH="3rdparty/blobs/mainboard/opencellular/rotundu/fd_16M.bin"
CONFIG_ME_BIN_PATH="3rdparty/blobs/mainboard/opencellular/rotundu/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_OPENCELLULAR_ROTUNDU=y
CONFIG_PCIEXP_L1_SUB_STATE=y
CONFIG_COREBOOT_ROMSIZE_KB_16384=y
CONFIG_PCIEXP_ASPM=y
CONFIG_PCIEXP_COMMON_CLOCK=y
CONFIG_PCIEXP_CLK_PM=y
CONFIG_CPU_MICROCODE_HEADER_FILES="3rdparty/blobs/mainboard/opencellular/rotundu/cpu/baytrail/microcode/M013067222D.h 3rdparty/blobs/mainboard/opencellular/rotundu/cpu/baytrail/microcode/M0130673321.h 3rdparty/blobs/mainboard/opencellular/rotundu/cpu/baytrail/microcode/M0130678815.h 3rdparty/blobs/mainboard/opencellular/rotundu/cpu/baytrail/microcode/M0130679901.h"
CONFIG_HAVE_FSP_BIN=y
CONFIG_HAVE_ME_BIN=y
CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION=y
CONFIG_NO_GFX_INIT=y
CONFIG_VPD=y
CONFIG_VBOOT_MEASURED_BOOT=y
CONFIG_VBOOT_MEASURED_BOOT_FMAP_RUNTIME_DATA="RW_MRC_CACHE"
CONFIG_VBOOT_SLOTS_RW_AB=y
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_6=y
CONFIG_NO_POST=y
CONFIG_SEABIOS_ADD_SERCON_PORT_FILE=y

Write the configuration to the .config file in the coreboot root directory and run:

make menuconfig

Choose a payload

Payload can be choosen via menuconfig.

SeaBIOS payload

Can be enabled via Payload -> Seabios in the coreboot menuconfig:

LinuxBoot payload

Can be enabled via Payload -> LinuxBoot in the coreboot menuconfig:

Serial Console
Compilation with external toolchain

Systemboot payload

The process is complex, see the systemboot documentation.

Build the Image

Non LinuxBoot payload
make
LinuxBoot payload
LINUXBOOT_COMPILE=/absolute/path/to/your/arch-gcc-compiler- make

Afterwards you can create production keys, sign the image and flash it on the SPI flash. More information can be found at the coreboot howto.

Build an Elgon image

In order to build the image follow the setup instructions in - How to coreboot

Set the config

Choose one of the matching configs in release/dev mode.

Put the binaries in the right place

You will need a compiled devicetree blob. The DTS is under version control at src/mainboard/opencellular/elgon/gbcv2.dts. Compile it using dtc and place it as 3rdparty/blobs/mainboard/opencellular/elgon/gbcv2.dtb

dev config
CONFIG_COLLECT_TIMESTAMPS=y                                                                                                                                                                                                                  
CONFIG_VENDOR_OPENCELLULAR=y
CONFIG_FMDFILE="src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot.fmd"
CONFIG_VBOOT=y
CONFIG_NO_POST=y
CONFIG_CAVIUM_BDK_VERBOSE_INIT=y
CONFIG_CAVIUM_BDK_VERBOSE_DRAM=y
CONFIG_CAVIUM_BDK_VERBOSE_DRAM_TEST=y
CONFIG_CAVIUM_BDK_VERBOSE_QLM=y
CONFIG_CAVIUM_BDK_VERBOSE_PCIE_CONFIG=y
CONFIG_CAVIUM_BDK_VERBOSE_PCIE=y
CONFIG_CAVIUM_BDK_VERBOSE_PHY=y
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x80000
CONFIG_BOARD_OPENCELLULAR_ELGON=y
CONFIG_LINUXBOOT_DTB_FILE="3rdparty/blobs/mainboard/opencellular/elgon/gbcv2.dtb"
release config
CONFIG_VENDOR_OPENCELLULAR=y                                                                                                                                                                                                                 
CONFIG_FMDFILE="src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot.fmd"
CONFIG_VBOOT=y
CONFIG_NO_POST=y
# CONFIG_CONSOLE_SERIAL is not set
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x80000
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_6=y
CONFIG_BOARD_OPENCELLULAR_ELGON=y
CONFIG_LINUXBOOT_DTB_FILE="3rdparty/blobs/mainboard/opencellular/elgon/gbcv2.dtb"
kernel configuration
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
# CONFIG_CONTEXT_TRACKING_FORCE is not set
CONFIG_CGROUPS=y
CONFIG_MEMCG=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_NAMESPACES=y
CONFIG_USER_NS=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_GZIP is not set
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
# CONFIG_KALLSYMS is not set
CONFIG_EMBEDDED=y
# CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB_FREELIST_RANDOM=y
CONFIG_SLAB_FREELIST_HARDENED=y
CONFIG_JUMP_LABEL=y
CONFIG_GCC_PLUGINS=y
CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y
CONFIG_GCC_PLUGIN_STRUCTLEAK=y
CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y
CONFIG_GCC_PLUGIN_RANDSTRUCT=y
# CONFIG_BLK_DEBUG_FS is not set
CONFIG_PARTITION_ADVANCED=y
# CONFIG_IOSCHED_DEADLINE is not set
# CONFIG_MQ_IOSCHED_DEADLINE is not set
# CONFIG_MQ_IOSCHED_KYBER is not set
CONFIG_ARCH_THUNDER=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCIE_ECRC=y
CONFIG_PCIEAER_INJECT=y
CONFIG_PCI_IOV=y
CONFIG_PCI_PRI=y
CONFIG_PCI_PASID=y
CONFIG_PCI_HOST_GENERIC=y
CONFIG_PCI_HOST_THUNDER_PEM=y
CONFIG_PCI_HOST_THUNDER_ECAM=y
CONFIG_ARM64_VA_BITS_48=y
CONFIG_SCHED_MC=y
CONFIG_NR_CPUS=8
CONFIG_PREEMPT=y
# CONFIG_SPARSEMEM_VMEMMAP is not set
# CONFIG_COMPACTION is not set
CONFIG_SECCOMP=y
CONFIG_KEXEC=y
CONFIG_RANDOMIZE_BASE=y
# CONFIG_EFI is not set
# CONFIG_BINFMT_SCRIPT is not set
# CONFIG_COREDUMP is not set
CONFIG_PM_AUTOSLEEP=y
CONFIG_PM_WAKELOCKS=y
CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
CONFIG_CPU_IDLE=y
CONFIG_ARM_CPUIDLE=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_DIAG is not set
# CONFIG_IPV6 is not set
# CONFIG_WIRELESS is not set
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_ALLOW_DEV_COREDUMP is not set
CONFIG_MTD=y
# CONFIG_MTD_OF_PARTS is not set
CONFIG_MTD_SPI_NOR=y
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
CONFIG_OF_OVERLAY=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_CRYPTOLOOP=y
CONFIG_BLK_DEV_NVME=y
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_SAS_LIBSAS=y
# CONFIG_SCSI_LOWLEVEL is not set
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y
# CONFIG_ATA_BMDMA is not set
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
CONFIG_DM_CRYPT=y
CONFIG_DM_VERITY=y
CONFIG_DM_VERITY_FEC=y
CONFIG_NETDEVICES=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
# CONFIG_NET_VENDOR_AGERE is not set
# CONFIG_NET_VENDOR_ALACRITECH is not set
# CONFIG_NET_VENDOR_ALTEON is not set
# CONFIG_NET_VENDOR_AMAZON is not set
# CONFIG_NET_VENDOR_AMD is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_ATHEROS is not set
# CONFIG_NET_CADENCE is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_BROCADE is not set
CONFIG_THUNDER_NIC_PF=y
CONFIG_THUNDER_NIC_VF=y
CONFIG_LIQUIDIO=y
CONFIG_LIQUIDIO_VF=y
# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_CISCO is not set
# CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_EXAR is not set
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_HP is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_MYRI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NVIDIA is not set
# CONFIG_NET_VENDOR_OKI is not set
# CONFIG_NET_PACKET_ENGINE is not set
# CONFIG_NET_VENDOR_QLOGIC is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_REALTEK is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_RDC is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SILAN is not set
# CONFIG_NET_VENDOR_SIS is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SUN is not set
# CONFIG_NET_VENDOR_TEHUTI is not set
# CONFIG_NET_VENDOR_TI is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
CONFIG_MDIO_OCTEON=y
# CONFIG_USB_NET_DRIVERS is not set
# CONFIG_WLAN is not set
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_SERIO_SERPORT is not set
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_LEGACY_PTY_COUNT=16
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_DEV_BUS=y
CONFIG_HW_RANDOM_TIMERIOMEM=y
CONFIG_TCG_TPM=y
CONFIG_TCG_TIS=y
CONFIG_TCG_TIS_SPI=y
CONFIG_TCG_TIS_I2C_INFINEON=y
# CONFIG_DEVPORT is not set
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y
CONFIG_I2C_THUNDERX=y
CONFIG_I2C_SLAVE=y
CONFIG_SPI=y
CONFIG_SPI_THUNDERX=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_THUNDERX=y
CONFIG_POWER_RESET_BRCMSTB=y
CONFIG_POWER_RESET_XGENE=y
CONFIG_POWER_RESET_SYSCON=y
CONFIG_SYSCON_REBOOT_MODE=y
CONFIG_BATTERY_BQ27XXX=y
# CONFIG_HWMON is not set
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_VGA_ARB is not set
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PLATFORM=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_STORAGE=y
CONFIG_USB_UAS=y
CONFIG_MMC=y
CONFIG_SDIO_UART=y
CONFIG_MMC_ARMMMCI=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PCI=y
# CONFIG_MMC_RICOH_MMC is not set
CONFIG_MMC_CAVIUM_THUNDERX=y
CONFIG_EDAC=y
# CONFIG_EDAC_LEGACY_SYSFS is not set
CONFIG_EDAC_THUNDERX=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_ISL1208=y
CONFIG_RTC_DRV_ISL12022=y
# CONFIG_COMMON_CLK_XGENE is not set
# CONFIG_ARM_ARCH_TIMER_EVTSTREAM is not set
# CONFIG_FSL_ERRATUM_A008585 is not set
# CONFIG_HISILICON_ERRATUM_161010101 is not set
# CONFIG_ARM64_ERRATUM_858921 is not set
CONFIG_IOMMU_IO_PGTABLE_ARMV7S=y
CONFIG_ARM_SMMU=y
CONFIG_ARM_SMMU_V3=y
CONFIG_GENERIC_PHY=y
CONFIG_TEE=y
CONFIG_OPTEE=y
CONFIG_GOOGLE_FIRMWARE=y
CONFIG_GOOGLE_COREBOOT_TABLE_OF=y
CONFIG_GOOGLE_MEMCONSOLE_COREBOOT=y
CONFIG_GOOGLE_VPD=y
CONFIG_EXT4_FS=y
CONFIG_FS_DAX=y
CONFIG_EXPORTFS_BLOCK_OPS=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_UTF8=y
CONFIG_TMPFS=y
# CONFIG_MISC_FILESYSTEMS is not set
# CONFIG_NETWORK_FILESYSTEMS is not set
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_UTF8=y
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=5
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_FTRACE is not set
# CONFIG_STRICT_DEVMEM is not set
CONFIG_SECURITY_DMESG_RESTRICT=y
CONFIG_SECURITY=y
CONFIG_HARDENED_USERCOPY=y
CONFIG_FORTIFY_SOURCE=y
# CONFIG_INTEGRITY is not set
# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
CONFIG_CRYPTO_SEQIV=y
# CONFIG_CRYPTO_ECHAINIV is not set
CONFIG_CRYPTO_ANSI_CPRNG=y
# CONFIG_CRYPTO_HW is not set
CONFIG_ARM64_CRYPTO=y
CONFIG_CRYPTO_SHA512_ARM64=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=y
CONFIG_CRYPTO_CRC32_ARM64_CE=y
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_CRYPTO_CHACHA20_NEON=y
CONFIG_CRYPTO_AES_ARM64_BS=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC7=y
⚠️ **GitHub.com Fallback** ⚠️