From patchwork Tue Feb 27 06:25:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 878332 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zr7wj00cfz9s1c for ; Tue, 27 Feb 2018 17:25:25 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eUnb9MZU"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zr7wh4RxZzF1VD for ; Tue, 27 Feb 2018 17:25:24 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eUnb9MZU"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::232; helo=mail-pl0-x232.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eUnb9MZU"; dkim-atps=neutral Received: from mail-pl0-x232.google.com (mail-pl0-x232.google.com [IPv6:2607:f8b0:400e:c01::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zr7wb1M39zF1LK for ; Tue, 27 Feb 2018 17:25:18 +1100 (AEDT) Received: by mail-pl0-x232.google.com with SMTP id v3so10831723plg.3 for ; Mon, 26 Feb 2018 22:25:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=CpLWvOd4Z9QDV0hS9d35AO7Az7Ew6jctQXl0wZ1b4gE=; b=eUnb9MZUOkNeM947gJfGfxgukiPAHxq1jYRVHuNme6gcaj1hNDvoVvGdDEXXnAKqHI yklUufAyzCSjEIZQ4yo/JXlazgY6trb0kLokKW2hB10VwHqMCF81priptVervGmeYIL8 z0NUynocuwN+Rgm/NhPFtf9Eo+qD0Kq7Y+a4uzT5lLTtMkBZeGc6LErT8tYUtQG0diIb avXQK/PGzUfty6xkNaQPZEiMvUI+eEUN8yK37F0j6E1M+TYzeHRN3XPNnHjN0oQM1Udh 0zZKEnY3LBir54tkyflBQCn3e3GXdMAL1+aOiO+3xbQfXwYL5b6/eV9czF9MIOnEamK0 cYsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=CpLWvOd4Z9QDV0hS9d35AO7Az7Ew6jctQXl0wZ1b4gE=; b=P6BQ0UPDVHhJc8d3vnj46QC9hvWMGZGuAEkrAYZL/RT74qT4JpJE/fzWvE81nCqrhd rbA65GodFh28uO3JWzOZ+/S+fbXoTsu6Dh2lC863Yw9tVwT08NEujzFFd1ASBHB08iYj JtKyMIkGDYBDXQxJLeaI9Nrvgx38xIQhT1BuTkztFE8buLuAM/69cBGRBCp8fpJU+j1u H7CuYcQ/f73nBvnh2wn6Goej1Y0Kqa9E5pQ29iqmBKWJPWkrtaWUDd0nJ795fNgh9R4X ylwEtUYFdSHBlZ9pwRESzUZUC/9SfBPrtMvV+865nkALhJyiZcAfXTe1MXD7Xf1pjy3t YapA== X-Gm-Message-State: APf1xPA+zOiVLOKuKvvBRyrsfxXXz+W1QB5yW++1DKwgHqaRyOMiI/aV VR2OdGnkXVrpNEfT5pqtjR0HD+s3 X-Google-Smtp-Source: AH8x2277KNnftuYeqMG0EE997SsIWwAlVJeGCOC8H04mU0pGuce6kLZp13NXzmwgqbBv3gB/0/NcgA== X-Received: by 2002:a17:902:8c83:: with SMTP id t3-v6mr13464322plo.310.1519712715955; Mon, 26 Feb 2018 22:25:15 -0800 (PST) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id t11sm2495187pgn.49.2018.02.26.22.25.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Feb 2018 22:25:15 -0800 (PST) From: Joel Stanley X-Google-Original-From: Joel Stanley Received: by aurora.jms.id.au (sSMTP sendmail emulation); Tue, 27 Feb 2018 16:55:09 +1030 To: skiboot@lists.ozlabs.org Date: Tue, 27 Feb 2018 16:55:04 +1030 Message-Id: <20180227062504.23835-1-joel.stanley@au1.ibm.com> X-Mailer: git-send-email 2.15.1 Subject: [Skiboot] [PATCH RFC hostboot] bootconfig: Describe pnor boot flags X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dean Sanner MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The reserved boot flag is now used by a BMC to signal to the host firmware that it supports the mbox protocol[1]. Currently this has no affect on Hostboot, but in the future it will be used by skiboot. In the future hostboot could chose to use the mbox protocol to read and write PNOR. [1] github.com/openbmc/mboxbridge/blob/master/Documentation/mbox_protocol.md Change-Id: I51bc7878eabc975954371ada838d0a348b12ef9d Signed-off-by: Joel Stanley --- This patch is for hostboot, but we will have to interpret these flags in skiboot, so I'm asking for some review here in parallel to submitting it to the hostboot review process. Note that this is for the P8 branch only; the P9 version of hostboot uses mbox unconditionally. src/usr/initservice/bootconfig/bootconfig_ast2400.C | 20 ++++++++++++++++++++ src/usr/initservice/bootconfig/bootconfig_ast2400.H | 17 ++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/usr/initservice/bootconfig/bootconfig_ast2400.C b/src/usr/initservice/bootconfig/bootconfig_ast2400.C index d0d1a3e746b2..43696088b0d7 100644 --- a/src/usr/initservice/bootconfig/bootconfig_ast2400.C +++ b/src/usr/initservice/bootconfig/bootconfig_ast2400.C @@ -171,6 +171,24 @@ void AST2400BootConfig::configureBootOptions(uint8_t i_bootOptions ) errlCommit(errl,INITSVC_COMP_ID); } } +}; + +// configurePnorDriver() +// ---------------------------------------------------------------------------- +void AST2400BootConfig::configurePnorDriver( uint8_t i_driver ) +{ + switch (i_driver) { + case MBOX: + TRACFCOMP(g_bc_trace, + "configurePnorDriver() bmc supports mbox protocol"); + /* Fall through - no hostboot support for mbox */ + TRACFCOMP(g_bc_trace, + "configurePnorDriver() hb does not support mbox protocol"); + case SFC: + TRACFCOMP(g_bc_trace, + "configurePnorDriver() using sfc driver"); + break; + } } // ---------------------------------------------------------------------------- @@ -250,6 +268,8 @@ void AST2400BootConfig::processBootFlagsV1( uint8_t i_flags ) { configureBootMode( i_flags & BOOT_MODE_FLAGS ); + configurePnorDriver( i_flags & PNOR_DRIVER_FLAGS ); + configureBootOptions( i_flags & BOOT_OPTIONS_FLAGS ); configureHbLogLevel( i_flags & LOG_LEVEL_FLAGS ); diff --git a/src/usr/initservice/bootconfig/bootconfig_ast2400.H b/src/usr/initservice/bootconfig/bootconfig_ast2400.H index cbe341e2b137..7cf96e095fcc 100644 --- a/src/usr/initservice/bootconfig/bootconfig_ast2400.H +++ b/src/usr/initservice/bootconfig/bootconfig_ast2400.H @@ -75,7 +75,7 @@ class AST2400BootConfig : public BootConfig enum bootFlagMask_t { LOG_LEVEL_FLAGS = 0x07, - RESERVED_FLAGS = 0x08, + PNOR_DRIVER_FLAGS = 0x08, BOOT_OPTIONS_FLAGS = 0x30, BOOT_MODE_FLAGS = 0xC0, }; @@ -88,6 +88,13 @@ class AST2400BootConfig : public BootConfig ISTEP_MODE = 0x80, }; + // Masks to select pnor driver from config register + enum pnorDriver + { + SFC = 0x00, + MBOX = 0x08, + }; + // Masks to test boot options flags from config register enum bootOptionsFlags { @@ -179,6 +186,14 @@ public: */ void configureBootMode( uint8_t i_mode ); + /** + * @brief Process the pnor driver mode from the boot flags register. + * + * @param[i] i_driver - pnor driver as set in the boot flags reg. + * + */ + void configurePnorDriver( uint8_t i_driver ); + /** * @brief Process boot options from boot flags register *