From patchwork Tue Dec 17 03:54:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 1210958 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47cPQn1B5Nz9sR4 for ; Tue, 17 Dec 2019 14:54:25 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=flamingspork.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=flamingspork.com header.i=@flamingspork.com header.b="btgJ6CwH"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="f/Fcwz6I"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47cPQm6RYzzDqXG for ; Tue, 17 Dec 2019 14:54:24 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flamingspork.com (client-ip=64.147.123.21; helo=wout5-smtp.messagingengine.com; envelope-from=stewart@flamingspork.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=flamingspork.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=flamingspork.com header.i=@flamingspork.com header.b="btgJ6CwH"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="f/Fcwz6I"; dkim-atps=neutral Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47cPQX47DFzDqWp for ; Tue, 17 Dec 2019 14:54:11 +1100 (AEDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 6E71A87C; Mon, 16 Dec 2019 22:54:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 16 Dec 2019 22:54:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= flamingspork.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=mesmtp; bh=QRA2HJee30VmF9FyHD1UgHT2Gcf7dr/Yt39jU1MYcAE=; b=bt gJ6CwHFqtljp9ipVkzSIU9pHkQtFAwvZNNVknEKXAf40ilgqNKuCIndFj8wzXkEJ lraa7vyv9mCuKrG/33KR3B234AF7sADl1Bhing2lUeVB/IcQOQeq23j/EPsnxaaL 5XH3J3bIM0oLmGZpzC+7HnR85cfSrK/9DHzBk/c5s= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=QRA2HJee30VmF9FyHD1UgHT2Gcf7dr/Yt39jU1MYcAE=; b=f/Fcwz6I Zlt9TyD8XXBbIlH08gK81ak96fWkVMhvRQBcQVh2eRzmSJRlh9iV2NMN73grfqQD X4C7LtN92xgD00SLYYmDwZmEHx3NV2vDIVjvLkzsHAcJWKX5Wpat/aJWrJDBkd4X a8vs/bjQja4mJl7ZPXVHFenx2Dwvadqvm4NdHTDGFUeT/2fXRunFSr6BDQ+iYSwo UwzSuU3AXNfE+PlW01FWHogdOaQ6i5C2LZoR4hL0IZrklAGz0zkeXNqhYNO9Iehp iUkYvZFkp3qeQRgYjkVNAfEsI+dnq6wO4vmUm6EfGw/2BdxCiV+gRHnXHsxv7r8j GX/FoqhH+dNfRw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddtiedgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepufhtvgifrghrthcuufhmihhthhcuoehsthgvfigrrhhtsehf lhgrmhhinhhgshhpohhrkhdrtghomheqnecuffhomhgrihhnpehrrghpthhorhgtshdrtg homhenucfkphepudejgedrvddurdduieefrddutdelnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehsthgvfigrrhhtsehflhgrmhhinhhgshhpohhrkhdrtghomhenucevlhhushhtvg hrufhiiigvpedt X-ME-Proxy: Received: from zoe.tuckerbox.house (174-21-163-109.tukw.qwest.net [174.21.163.109]) by mail.messagingengine.com (Postfix) with ESMTPA id F2A0C8005C; Mon, 16 Dec 2019 22:54:05 -0500 (EST) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Mon, 16 Dec 2019 19:54:04 -0800 Message-Id: <20191217035404.27272-1-stewart@flamingspork.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191213060936.1105109-1-stewart@flamingspork.com> References: <20191213060936.1105109-1-stewart@flamingspork.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2] platform: add Raptor Blackbird support X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Based off the Raptor patch: https://git.raptorcs.com/git/blackbird-skiboot/commit/?id=c81f9d66592dc2a7cf7f6c59c3def5cee0638c1f Notable changes: - slot names matching what's silkscreened on the board - We communicate with the IPL observer - Including indicating IPL is done, which makes fan control kick in. Signed-off-by: Stewart Smith Reviewed-by: Dan HorĂ¡k --- Changes since v1: - Talk IPL observer --- platforms/astbmc/Makefile.inc | 3 +- platforms/astbmc/blackbird.c | 77 +++++++++++++++++++++++++++++++++++ 2 files changed, 79 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..2d12c63c --- /dev/null +++ b/platforms/astbmc/blackbird.c @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: Apache-2.0 +/* Copyright 2017 IBM Corp. + * Copyright 2018-2019 Raptor Engineering, LLC + * Copyright 2019 Stewart Smith + */ + +#include +#include +#include +#include +#include +#include +#include + +#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; +} + +static void blackbird_exit(void) +{ + /* Let the IPL Observer know that we're done */ + lpc_probe_write(OPAL_LPC_IO, 0x81, 0xfe, 1); + lpc_probe_write(OPAL_LPC_IO, 0x82, 0xfe, 1); + + astbmc_exit(); +} + +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 = blackbird_exit, + .terminate = ipmi_terminate, + .op_display = op_display_lpc, +};