From patchwork Fri Dec 13 06:09:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 1208967 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Z0d93tj0z9sP6 for ; Fri, 13 Dec 2019 17:10:05 +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="qrmXxKSv"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="vYKdLshx"; 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 47Z0d92rWXzDrBd for ; Fri, 13 Dec 2019 17:10:05 +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.19; helo=wout3-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="qrmXxKSv"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="vYKdLshx"; dkim-atps=neutral Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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 47Z0cl5pk8zDrB5 for ; Fri, 13 Dec 2019 17:09:42 +1100 (AEDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id C9B8B8F9; Fri, 13 Dec 2019 01:09:38 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 13 Dec 2019 01:09:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= flamingspork.com; h=from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=mesmtp; bh=vW7sOflPVJ IeikJ1icNHcliSSMxKMMohnJMM+671mME=; b=qrmXxKSvl3FLyuo824aQJrAwLl AsZqdfyII1g7o+nqYAq5RQhS7QnUPXCt1RQBk7UykUe/IC2V+1JMnNWLBkQhruf6 knXr5FkaBaTrDrG5vDz1Tw6A77iBIuucLz6ZvyDnQM410wflEneUfdW0lSaPSyFt PMf66j29QT6suK6nk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=vW7sOflPVJIeikJ1i cNHcliSSMxKMMohnJMM+671mME=; b=vYKdLshx/w4P6z+uTU4Z9SeydI+9Tq86o yOW9tKLbROFxMYlcnKmoW+MT4Ta+5egnSuLZ2voWDx3sDVzkoJqc3OmayO8UGQAk N7+Zaq6YMolPEttLiglnLf8a+QHFHyarIsbmA4RgyUXVjE3Lyi3uG+P+pn4McTGa llT+R2hlw8/2h7S846P1g1pfzJh6ztC6JMLWSppXC7V/cZ/ExLXI09XQ/KYf/CzR vwX07cx+kBteKrL41HiG2kXCZrMhMU46TzXlO4AButBBxa8cf9sN/WgLk9D2Ng0h R/GX/kJ69tnSCCSrERI/l/9y8GiVBUopaVUYv50ta84ixtW+ir37Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudelkedgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepufhtvgifrghrthcuufhmihhthhcuoehsthgvfigrrhhtsehflhgr mhhinhhgshhpohhrkhdrtghomheqnecuffhomhgrihhnpehrrghpthhorhgtshdrtghomh dpfihprdgtohhmnecukfhppedujeegrddvuddrudeifedruddtleenucfrrghrrghmpehm rghilhhfrhhomhepshhtvgifrghrthesfhhlrghmihhnghhsphhorhhkrdgtohhmnecuve hluhhsthgvrhfuihiivgeptd 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 BF67580064; Fri, 13 Dec 2019 01:09:37 -0500 (EST) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Thu, 12 Dec 2019 22:09:36 -0800 Message-Id: <20191213060936.1105109-1-stewart@flamingspork.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [Skiboot] [PATCH] 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 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 Reviewed-by: Dan HorĂ¡k --- 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 +#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; +} + +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, +};