From patchwork Wed Oct 14 09:09:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lulu Su X-Patchwork-Id: 1381937 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 4CB67v21j5z9sVR for ; Wed, 14 Oct 2020 20:10:19 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=wistron.com Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CB67t6yKVzDqZS for ; Wed, 14 Oct 2020 20:10:18 +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=wistron.com (client-ip=103.200.3.19; helo=segapp02.wistron.com; envelope-from=lulu_su@wistron.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=wistron.com Received: from segapp02.wistron.com (segapp02.wistron.com [103.200.3.19]) by lists.ozlabs.org (Postfix) with ESMTP id 4CB67h1QmHzDqVJ for ; Wed, 14 Oct 2020 20:10:07 +1100 (AEDT) Received: from EXCHAPP04.whq.wistron (unverified [10.37.38.27]) by TWNHUMSW3.wistron.com (Clearswift SMTPRS 5.6.0) with ESMTP id ; Wed, 14 Oct 2020 17:10:01 +0800 Received: from EXCHAPP04.whq.wistron (10.37.38.27) by EXCHAPP04.whq.wistron (10.37.38.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 14 Oct 2020 17:10:00 +0800 Received: from gitserver.wistron.com (10.37.38.233) by EXCHAPP04.whq.wistron (10.37.38.27) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 14 Oct 2020 17:10:00 +0800 From: Lulu Su To: , Stewart Smith Date: Wed, 14 Oct 2020 17:09:53 +0800 Message-ID: <20201014090954.31552-1-Lulu_Su@wistron.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-TM-SNTS-SMTP: F6E5FBF8B04D4A7B6087C57DFB915A569EB0522FBC6EB78AC9F85AFA5F272CC82000:8 Subject: [Skiboot] [PATCH] platform/mowgli: modify VPD to export correct data to system VPD EEPROM 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: , Cc: Oliver OHalloran , skiboot-stable@lists.ozlabs.org, LuluTHSu Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: LuluTHSu Hostboot doesn't export the correct data for the system VPD EEPROM for this system. So add vpd_dt_fixup(). Cc: skiboot-stable@lists.ozlabs.org Signed-off-by: LuluTHSu --- platforms/astbmc/mowgli.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/platforms/astbmc/mowgli.c b/platforms/astbmc/mowgli.c index 265cab3..e61a109 100644 --- a/platforms/astbmc/mowgli.c +++ b/platforms/astbmc/mowgli.c @@ -30,6 +30,24 @@ static const struct slot_table_entry mowgli_phb_table[] = { { .etype = st_end }, }; +/* + * HACK: Hostboot doesn't export the correct data for the system VPD EEPROM + * for this system. So we need to work around it here. + */ +static void vpd_dt_fixup(void) +{ + struct dt_node *n = dt_find_by_path(dt_root, + "/xscom@603fc00000000/i2cm@a2000/i2c-bus@0/eeprom@50"); + + if (n) { + dt_check_del_prop(n, "compatible"); + dt_add_property_string(n, "compatible", "atmel,24c512"); + + dt_check_del_prop(n, "label"); + dt_add_property_string(n, "label", "system-vpd"); + } +} + static bool mowgli_probe(void) { if (!dt_node_is_compatible(dt_root, "ibm,mowgli")) @@ -41,6 +59,8 @@ static bool mowgli_probe(void) /* Setup UART for use by OPAL (Linux hvc) */ uart_set_console_policy(UART_CONSOLE_OPAL); + vpd_dt_fixup(); + slot_table_init(mowgli_phb_table); return true;