Merge pull request #3344 from hegdevasant/libflash
openpower/libflash: Use SKIBOOT_VERSION
diff --git a/openpower/configs/blackbird_defconfig b/openpower/configs/blackbird_defconfig
new file mode 100644
index 0000000..ff6a7f8
--- /dev/null
+++ b/openpower/configs/blackbird_defconfig
@@ -0,0 +1,70 @@
+BR2_powerpc64le=y
+BR2_powerpc_power8=y
+BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
+BR2_GCC_VERSION_6_X=y
+BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux --disable-libsanitizer"
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_TARGET_GENERIC_HOSTNAME="skiroot"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+BR2_ROOTFS_DEVICE_TABLE="../openpower/device_table.txt"
+BR2_TARGET_GENERIC_GETTY_PORT="hvc0"
+BR2_ENABLE_LOCALE_WHITELIST="C de en es fr it ja ko pt_BR ru zh_CN zh_TW"
+BR2_GENERATE_LOCALE="en_US.UTF-8 de_DE.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 it_IT.UTF-8 ja_JP.UTF-8 ko_KR.UTF-8 pt_BR.UTF-8 ru_RU.UTF-8 zh_CN.UTF-8 zh_TW.UTF-8"
+BR2_SYSTEM_ENABLE_NLS=y
+BR2_ROOTFS_USERS_TABLES="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/users-table"
+BR2_ROOTFS_OVERLAY="../openpower/overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.3.7"
+BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
+BR2_LINUX_KERNEL_ZIMAGE_EPAPR=y
+BR2_LINUX_KERNEL_XZ=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/busybox.fragment"
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
+BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T4=y
+BR2_PACKAGE_CRYPTSETUP=y
+BR2_PACKAGE_IPMITOOL=y
+BR2_PACKAGE_IPMITOOL_USB=y
+BR2_PACKAGE_MDADM=y
+BR2_PACKAGE_PCIUTILS=y
+BR2_PACKAGE_NCURSES_WCHAR=y
+BR2_PACKAGE_DROPBEAR=y
+# BR2_PACKAGE_DROPBEAR_SERVER is not set
+BR2_PACKAGE_ETHTOOL=y
+BR2_PACKAGE_LRZSZ=y
+BR2_PACKAGE_NETCAT=y
+BR2_PACKAGE_RSYNC=y
+BR2_PACKAGE_SUDO=y
+BR2_PACKAGE_UTIL_LINUX_AGETTY=y
+BR2_TARGET_ROOTFS_CPIO_XZ=y
+BR2_TARGET_ROOTFS_INITRAMFS=y
+BR2_OPENPOWER_PLATFORM=y
+BR2_OPENPOWER_POWER9=y
+BR2_HOSTBOOT_CONFIG_FILE="blackbird.config"
+BR2_OPENPOWER_MACHINE_XML_GITHUB_PROJECT_VALUE="blackbird-xml"
+BR2_OPENPOWER_MACHINE_XML_VERSION="17e9e84d504582c881e480b82fe1cf115312130f"
+BR2_OPENPOWER_MACHINE_XML_FILENAME="blackbird.xml"
+BR2_OPENPOWER_SYSTEM_XML_FILENAME="BLACKBIRD_hb.system.xml"
+BR2_OPENPOWER_MRW_XML_FILENAME="BLACKBIRD_hb.mrw.xml"
+BR2_OPENPOWER_BIOS_XML_FILENAME="BLACKBIRD_bios.xml"
+BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME="defaultPnorLayout_64.xml"
+BR2_OPENPOWER_CONFIG_NAME="blackbird"
+BR2_OPENPOWER_PNOR_FILENAME="blackbird.pnor"
+BR2_HOSTBOOT_BINARY_SBE_FILENAME="nimbus_sbe.img.ecc"
+BR2_HOSTBOOT_BINARY_SBEC_FILENAME="centaur_sbec_pad.img.ecc"
+BR2_HOSTBOOT_BINARY_WINK_FILENAME="p9n.ref_image.hdr.bin.ecc"
+BR2_IMA_CATALOG_FILENAME="ima_catalog.bin"
+BR2_OPENPOWER_TARGETING_BIN_FILENAME="BLACKBIRD_HB.targeting.bin"
+BR2_OPENPOWER_TARGETING_ECC_FILENAME="BLACKBIRD_HB.targeting.bin.ecc"
+BR2_BUILD_PNOR_SQUASHFS=y
+BR2_PACKAGE_PETITBOOT=y
+BR2_PACKAGE_PETITBOOT_MTD=y
+BR2_CAPP_UCODE_BIN_FILENAME="cappucode.bin"
+BR2_PACKAGE_LOADKEYS=y
+BR2_IMA_CATALOG_DTS="POWER9"
diff --git a/openpower/configs/hostboot/blackbird.config b/openpower/configs/hostboot/blackbird.config
new file mode 100755
index 0000000..c2888f3
--- /dev/null
+++ b/openpower/configs/hostboot/blackbird.config
@@ -0,0 +1,74 @@
+# The BMC MBOX Protocol is used to access PNOR
+unset SFC_IS_AST2500
+unset SFC_IS_AST2400
+set PNORDD_IS_BMCMBOX
+unset PNORDD_IS_SFC
+unset BMC_DOES_SFC_INIT
+unset SFC_IS_IBM_DPSS
+set ALLOW_MICRON_PNOR
+set ALLOW_MACRONIX_PNOR
+
+# VPD options.
+set MVPD_READ_FROM_HW
+set MVPD_WRITE_TO_HW
+set MVPD_READ_FROM_PNOR
+set MVPD_WRITE_TO_PNOR
+set DJVPD_READ_FROM_HW
+unset DJVPD_WRITE_TO_HW
+set DJVPD_READ_FROM_PNOR
+set DJVPD_WRITE_TO_PNOR
+set MEMVPD_READ_FROM_HW
+set MEMVPD_WRITE_TO_HW
+set MEMVPD_READ_FROM_PNOR
+set MEMVPD_WRITE_TO_PNOR
+set PVPD_READ_FROM_HW
+set PVPD_WRITE_TO_HW
+set PVPD_READ_FROM_PNOR
+set PVPD_WRITE_TO_PNOR
+unset CDIMM_FORMAT_FOR_CVPD
+
+# gpio config
+set GPIODD
+unset PALMETTO_VDDR
+
+# Enable Consecutive SBE Updates
+set SBE_UPDATE_CONSECUTIVE
+unset SBE_UPDATE_INDEPENDENT
+unset SBE_UPDATE_SEQUENTIAL
+unset SBE_UPDATE_SIMULTANEOUS
+unset NO_SBE_UPDATES
+
+unset PCIE_HOTPLUG_CONTROLLER
+
+# turn on console output
+set CONSOLE
+set BMC_AST2500
+
+unset DISABLE_HOSTBOOT_RUNTIME
+
+# Compile in hostboot runtime PRD
+set HBRT_PRD
+set HTMGT
+set START_OCC_DURING_BOOT
+unset CONSOLE_OUTPUT_OCC_COMM
+
+#PNOR flags
+unset PNOR_TWO_SIDE_SUPPORT
+
+set BMC_BT_LPC_IPMI
+
+# Output LPC Port 80h boot progress (Blackbird BMC will read)
+set ISTEP_LPC_PORT8X_DEBUG
+
+# Enable Checktop Analysis
+set ENABLE_CHECKSTOP_ANALYSIS
+set IPLTIME_CHECKSTOP_ANALYSIS
+
+# set for trace debug to console
+unset CONSOLE_OUTPUT_TRACE
+set CONSOLE_OUTPUT_FFDCDISPLAY
+
+# Raptor shipped without Secure Boot
+unset SECUREBOOT
+unset TPMDD
+unset TPM_NUVOTON
diff --git a/openpower/package/hcode/Config.in b/openpower/package/hcode/Config.in
index ea9af50..2e15d99 100644
--- a/openpower/package/hcode/Config.in
+++ b/openpower/package/hcode/Config.in
@@ -31,7 +31,7 @@
config BR2_HCODE_VERSION
string
- default "hw121019a.opmst" if BR2_HCODE_LATEST_VERSION
+ default "hw121219a.opmst" if BR2_HCODE_LATEST_VERSION
default BR2_HCODE_CUSTOM_VERSION_VALUE \
if BR2_HCODE_CUSTOM_VERSION
diff --git a/openpower/package/skiboot/0001-platform-add-Raptor-Blackbird-support.patch b/openpower/package/skiboot/0001-platform-add-Raptor-Blackbird-support.patch
new file mode 100644
index 0000000..a7ed4f1
--- /dev/null
+++ b/openpower/package/skiboot/0001-platform-add-Raptor-Blackbird-support.patch
@@ -0,0 +1,112 @@
+From 376bed3fbe902138b92e95d9da58bb5e1509072e Mon Sep 17 00:00:00 2001
+From: Stewart Smith <stewart@flamingspork.com>
+Date: Sun, 8 Dec 2019 19:06:25 -0800
+Subject: [PATCH] platform: add Raptor Blackbird support
+
+Based off the Raptor patch:
+https://git.raptorcs.com/git/blackbird-skiboot/commit/?id=c81f9d66592dc2a7cf7f6c59c3def5cee0638c1f
+
+Notable changes are slot names matching what's silkscreened on the board.
+See https://i1.wp.com/www.flamingspork.com/blog/wp-content/uploads/2019/12/IMG_4006-scaled.jpg
+for a photo of the actual board.
+
+I haven't included the port 80h bit as I haven't worked out how to probe that from the BMC to test.
+
+Boot tested, seems good.
+
+Signed-off-by: Stewart Smith <stewart@flamingspork.com>
+---
+ platforms/astbmc/Makefile.inc | 3 +-
+ platforms/astbmc/blackbird.c | 66 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 68 insertions(+), 1 deletion(-)
+ create mode 100644 platforms/astbmc/blackbird.c
+
+diff --git a/platforms/astbmc/Makefile.inc b/platforms/astbmc/Makefile.inc
+index fd4eaeac..e0f8760d 100644
+--- a/platforms/astbmc/Makefile.inc
++++ b/platforms/astbmc/Makefile.inc
+@@ -6,7 +6,8 @@ ASTBMC_OBJS = pnor.o common.o slots.o \
+ garrison.o barreleye.o \
+ witherspoon.o zaius.o romulus.o p9dsu.o \
+ vesnin.o nicole.o mihawk.o\
+- talos.o swift.o
++ talos.o blackbird.o \
++ swift.o
+
+ ASTBMC = $(PLATDIR)/astbmc/built-in.a
+ $(ASTBMC): $(ASTBMC_OBJS:%=$(PLATDIR)/astbmc/%)
+diff --git a/platforms/astbmc/blackbird.c b/platforms/astbmc/blackbird.c
+new file mode 100644
+index 00000000..8817b8c5
+--- /dev/null
++++ b/platforms/astbmc/blackbird.c
+@@ -0,0 +1,66 @@
++// SPDX-License-Identifier: Apache-2.0
++/* Copyright 2017 IBM Corp.
++ * Copyright 2018-2019 Raptor Engineering, LLC
++ * Copyright 2019 Stewart Smith
++ */
++
++#include <skiboot.h>
++#include <device.h>
++#include <console.h>
++#include <chip.h>
++#include <ipmi.h>
++#include <psi.h>
++
++#include "astbmc.h"
++
++ST_PLUGGABLE(blackbird_cpu1_slot1, "SLOT1 PCIE 4.0 X16");
++ST_PLUGGABLE(blackbird_cpu1_slot2, "SLOT2 PCIE 4.0 X8");
++
++ST_BUILTIN_DEV(blackbird_builtin_sata, "Builtin SATA");
++ST_BUILTIN_DEV(blackbird_builtin_usb, "Builtin USB");
++ST_BUILTIN_DEV(blackbird_builtin_ethernet, "Builtin Ethernet");
++ST_BUILTIN_DEV(blackbird_builtin_bmc, "BMC");
++
++static const struct slot_table_entry blackbird_phb_table[] = {
++ ST_PHB_ENTRY(0, 0, blackbird_cpu1_slot1),
++ ST_PHB_ENTRY(0, 1, blackbird_cpu1_slot2),
++
++ ST_PHB_ENTRY(0, 2, blackbird_builtin_sata),
++ ST_PHB_ENTRY(0, 3, blackbird_builtin_usb),
++ ST_PHB_ENTRY(0, 4, blackbird_builtin_ethernet),
++ ST_PHB_ENTRY(0, 5, blackbird_builtin_bmc),
++
++ { .etype = st_end },
++};
++
++static bool blackbird_probe(void)
++{
++ if (!dt_node_is_compatible(dt_root, "rcs,blackbird"))
++ return false;
++
++ /* Lot of common early inits here */
++ astbmc_early_init();
++
++ /* Setup UART for use by OPAL (Linux hvc) */
++ uart_set_console_policy(UART_CONSOLE_OPAL);
++
++ slot_table_init(blackbird_phb_table);
++
++ return true;
++}
++
++DECLARE_PLATFORM(blackbird) = {
++ .name = "Blackbird",
++ .probe = blackbird_probe,
++ .init = astbmc_init,
++ .start_preload_resource = flash_start_preload_resource,
++ .resource_loaded = flash_resource_loaded,
++ .bmc = &bmc_plat_ast2500_openbmc,
++ .pci_get_slot_info = slot_table_get_slot_info,
++ .pci_probe_complete = check_all_slot_table,
++ .cec_power_down = astbmc_ipmi_power_down,
++ .cec_reboot = astbmc_ipmi_reboot,
++ .elog_commit = ipmi_elog_commit,
++ .exit = astbmc_exit,
++ .terminate = ipmi_terminate,
++};
+--
+2.23.0
+