From patchwork Mon Oct 10 08:41:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 680227 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sstsN12Gmz9s65 for ; Mon, 10 Oct 2016 19:42:00 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=pOozJt3z; 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 3sstsM754SzDrc6 for ; Mon, 10 Oct 2016 19:41:59 +1100 (AEDT) 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=pOozJt3z; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pa0-x244.google.com (mail-pa0-x244.google.com [IPv6:2607:f8b0:400e:c03::244]) (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 3sstsH25NvzDrbq for ; Mon, 10 Oct 2016 19:41:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=pOozJt3z; dkim-atps=neutral Received: by mail-pa0-x244.google.com with SMTP id r9so6769841paz.1 for ; Mon, 10 Oct 2016 01:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BsBEWtfErmGS8pEUmt8RX/4oVP2fp0/ccNgzK11ZE/Q=; b=pOozJt3zyAsSVJG2qbVo9Gl1wqgKddlEvLoncktT9JriL2g5wrGS9JqNo7S0ks5Msl Pwc4KkVnFbHWE9bq+6BB8CZgGKlqNCCcY4DqpWFFrgSkuiDBGJ+OM6SKi7E0lGJR5ikr s3ucGqGiwQJwQ6drl7fGH5uhuYo1HY0IWM2EadMFgQbfAlLfCddGkBJYMrzvOt8qF0k5 R/ChEIBfFMn30szzDFr8KHjBhCKGjGFi/PkLYmV9JoUFsFYuCc23vMLVmkZ9ZiL0Qqhh 2g90B0KLNXbVDS9FH7Bvey6mwuODH2h9Px9wO0aV98MByLJRXc0yKsh4l4HtUVD1UFim 9HWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BsBEWtfErmGS8pEUmt8RX/4oVP2fp0/ccNgzK11ZE/Q=; b=Of+b2g0UmL6x0zk60xXd+WrHSVexZnPCgV+vU13sDPoT0iCxkRKATFS5vx48LNONb7 DHgeRywDVoYz1oxRgZP79MS1mUCXkQ43oXW5YIad7kUxq/3y7P3ybRDDSXVRytZrMk2K QBD4uOk6ecH6xsCYokSbCw78No/ONY0tqSeA/Lqmg1Nu+Ry//bBZmJ/Xk4mJYtISFzwA RxVVL9cRsO1+fYLnpUq8N48uQSYxuL+BuTyRh/4S1TfCwjOUEV+/okhm4B+PFsnUNHLV E0V36uFXozEsPH+myzUu2gl6d9WWqj+puW0/jq5tRqVMxgWuAFUSaLTd1DqYaNtFTADc 1vHA== X-Gm-Message-State: AA6/9RmqfJxhFP6+Q9e8GovOheprmFN3de02WcuWOgtcUzwWuLElxZntaxhB7nT+jKydQQ== X-Received: by 10.66.132.15 with SMTP id oq15mr53401032pab.105.1476088913316; Mon, 10 Oct 2016 01:41:53 -0700 (PDT) Received: from canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id xs10sm1879238pac.24.2016.10.10.01.41.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Oct 2016 01:41:52 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Mon, 10 Oct 2016 19:41:41 +1100 Message-Id: <1476088901-25654-1-git-send-email-oohall@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: References: Subject: [Skiboot] [PATCH] hdat: add support for system and type strings X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" In P9 the compatible string is supplied by hostboot through the HDAT. This patch add support for using these strings to set the compatible property in the device tree rather than using the machine ID number scheme traditionally used in the HDAT. Cc: Vasant Hegde Signed-off-by: Oliver O'Halloran --- hdata/spira.c | 59 ++++++++++++++++++++++++++++++++++++----------------------- hdata/spira.h | 11 +++++++++++ 2 files changed, 47 insertions(+), 23 deletions(-) diff --git a/hdata/spira.c b/hdata/spira.c index 592197e7685b..c83146ab0991 100644 --- a/hdata/spira.c +++ b/hdata/spira.c @@ -752,8 +752,6 @@ static void add_nx(void) static void add_iplparams_sys_params(const void *iplp, struct dt_node *node) { const struct iplparams_sysparams *p; - u32 sys_type; - const char *sys_family; const struct HDIF_common_hdr *hdif = iplp; u16 version = be16_to_cpu(hdif->version); @@ -772,29 +770,44 @@ static void add_iplparams_sys_params(const void *iplp, struct dt_node *node) dt_add_property_nstr(node, "ibm,sys-model", p->sys_model, 4); - /* Compatible is 2 entries: ibm,powernv and ibm, + /* + * Compatible has up to three entries: + * "ibm,powernv", the system family and system type. + * + * On P9 and above the family and type strings come from the HDAT + * directly. On P8 we find it from the system ID numbers. */ - sys_type = be32_to_cpu(p->system_type); - switch(sys_type >> 28) { - case 0: - sys_family = "ibm,squadrons"; - break; - case 1: - sys_family = "ibm,eclipz"; - break; - case 2: - sys_family = "ibm,apollo"; - break; - case 3: - sys_family = "ibm,firenze"; - break; - default: - sys_family = NULL; - prerror("IPLPARAMS: Unknown system family\n"); - break; + if (version >= 0x70) { + dt_add_property_strings(dt_root, "compatible", + "ibm,powernv", p->sys_family_str, p->sys_type_str); + } else { + u32 sys_type = be32_to_cpu(p->system_type); + const char *sys_family; + + switch(sys_type >> 28) { + case 0: + sys_family = "ibm,squadrons"; + break; + case 1: + sys_family = "ibm,eclipz"; + break; + case 2: + sys_family = "ibm,apollo"; + break; + case 3: + case 4: /* HACK: this is actually "ibm,p9", but there's no + * useful destinction between the two right now */ + sys_family = "ibm,firenze"; + break; + default: + sys_family = NULL; + prerror("IPLPARAMS: Unknown system family\n"); + break; + } + + dt_add_property_strings(dt_root, "compatible", "ibm,powernv", + sys_family); } - dt_add_property_strings(dt_root, "compatible", "ibm,powernv", - sys_family); /* Grab nest frequency when available */ if (version >= 0x005b) { diff --git a/hdata/spira.h b/hdata/spira.h index eabf7f953ab7..b2863342f5a5 100644 --- a/hdata/spira.h +++ b/hdata/spira.h @@ -321,6 +321,17 @@ struct iplparams_sysparams { uint8_t hw_page_table_size; /* >= 0x59 */ __be16 hv_disp_wheel; /* >= 0x58 */ __be32 nest_freq_mhz; /* >= 0x5b */ + uint8_t split_core_mode; /* >= 0x5c */ + uint8_t reserved1[3]; + uint8_t vendor_name[64]; /* >= 0x5f */ + __be16 sys_sec_settings; /* >= 0x60 */ + __be16 tpm_config; + __be16 tmps_per_drawer; + __be16 reserved2; + uint8_t hw_hash_keys; + uint8_t sys_family_str[64]; /* >= 0x70 */ + uint8_t sys_type_str[64]; + } __packed; /* Idata index 1: IPL parameters */