From patchwork Wed Nov 23 11:48:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1708280 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=avUWvAxp; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NHKD66VM3z23mf for ; Wed, 23 Nov 2022 22:49:26 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0FAB885242; Wed, 23 Nov 2022 12:49:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="avUWvAxp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EBF08854BD; Wed, 23 Nov 2022 12:49:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20603.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::603]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0A17E85230 for ; Wed, 23 Nov 2022 12:49:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=michal.simek@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iLQOJWThJU+buac5+yKpzgUl+7r06wvvX6Y37RlUn63qlZM3RNbjHxQt9mtUy1OAfV/dJN8QzupVmeDxNIOukrDcECS+90ZQU7U9xJVuUK9RR/UJ+OwHNqB2nYKpgis5w0UD3jIjJ2r/MhpcA5h2MX6Km0JQZz0EipTPJcLcYUfzMKj476Gdks1l56bA13wTWP/aeLmb4Av/HsZoZko0oE/SW3QdFxqrxiHk2Xu4SDuaJYGX6EUXL/ymb6Rf3HZ9NekDHIdRAGXeGWGqTFsMlaWcFgu+BqG/N9jR95ucLscQ0lVGGmbwGb9bRUZyymPJmM6eIgN2H7B3oP+TFuNXDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nyW7mzlj3LGBeWfYQFoOIXGbtIXcKUa+ReJk/C7nhrc=; b=do47VOttn5G2GA0CRYaKWvGb3iVPCqmKFhEIHOh1nSroPmIKuegW2F3BMDEUsw/+JbHjWRRVPnK+ijG0vVP52h/GEPvKYRgotlT5QtOyuaLAixjPOm5CH1euL5MrRb3PndKWjeBp/zLLDRd6r4f/3KinNG2LOErEtepTm7ayXXSnAvMSydvah7yJq832WAuYNU7LcxIeg2PFIsco2yUCI51HF9QXv5amEhKoRb2Shi//itIE149TNu6+mY8PR/kRthdQBhsF1jxrC91lfqDYkGsrxKbgUVzFBaKGIYOcWGMykV/EsVlD/nFgiTcL2Oyo+eLzBqAVuAyPyYe2keiYRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nyW7mzlj3LGBeWfYQFoOIXGbtIXcKUa+ReJk/C7nhrc=; b=avUWvAxpjvUOPC2/s0gFOYJG1hU7rLeWvkmgskC1X9Cy96kZ3tce/Obv5YEBACJmokOsANco3uY26ilNvER9DCkl8pIEx7h9YWr+iF0JQaTfhtbQryS0OD/eD5KVpY0mFn5zybtCEG5jPS3uv9efM4lxnlvL/qfb10dTvty3gAc= Received: from MW4PR04CA0323.namprd04.prod.outlook.com (2603:10b6:303:82::28) by SJ2PR12MB8136.namprd12.prod.outlook.com (2603:10b6:a03:4f8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.20; Wed, 23 Nov 2022 11:49:14 +0000 Received: from CO1NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:303:82:cafe::de) by MW4PR04CA0323.outlook.office365.com (2603:10b6:303:82::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17 via Frontend Transport; Wed, 23 Nov 2022 11:49:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT045.mail.protection.outlook.com (10.13.175.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5834.8 via Frontend Transport; Wed, 23 Nov 2022 11:49:13 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 23 Nov 2022 05:49:11 -0600 From: Michal Simek To: , CC: Ovidiu Panait Subject: [PATCH] xilinx: Add option to select SC id instead of DUT id for SC support Date: Wed, 23 Nov 2022 12:48:44 +0100 Message-ID: <90bb7cc5463568a690b979f18c8d42556986b46d.1669204122.git.michal.simek@amd.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT045:EE_|SJ2PR12MB8136:EE_ X-MS-Office365-Filtering-Correlation-Id: aac755d6-b612-40f8-27ae-08dacd48be5a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4bBPKVI3EyfQAVoEcOuE0igYnM8SbmOb6h/xvVyxXVShxJQVqBnmmtpXifXEUaNmBhFs51dxqQ8htcmlOtqj0kOD7KGTLzXzh2x7iZ5Jwa4F92lp01cZRlYU90wXysynDbf9CK0Fw1UyfrXIAH9XVfIzCz617/mDiC/+sbYQYDTSKi0ClOjg4eU7lLc6wZ3EG0+KHjBpOle+17KzRkCSH7PzmtBPrkyQIv+3dci40gLT8YzWRW39bjzdywkQz3yw++SUqIRcSrc3c8T9AhDHFNwKGn2IUb6pPIb6exR7zKZx4qW4gDgCoQVj/ibMSCa2ljYIdvLAyKfzGVFeqojJJN5Nq+KkFWwPSfxs6MlRjkxuTnQ0ZRRt2LWZTi/+lHwUHoa55EvXO16VN8qOCmXDvJoF89dIzhi7GXvsjmjqoYk+aryPX90ioyBAt+MXdQZsUzptRm4SwVwa3utKqknoP4NlFpLXCJKWAg1hmWl91l48Gyz7mtQixX3u2TutuQC0s7zs6r4sXyIpcaaF2iJxsQjHZ4Kh187TkCvqoB+foWARdJ/JzXTfspJ6DqAD5+LxkUET5adoSNMKKXetRZVikUPebpR1iEhOJzaG19gD6mYy0/q8HM0AGsRaL18Ppo//o6CQXLW29jBL8GOIOvNvlBu4OxfNGGFx/P63dFYPvUSHV8VyWmpEcy5lngQ4fRNtmzIfhrPzbaFlcfp06v9iTHTOoFVtxRV32KPCATKHzqk= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(396003)(136003)(376002)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(8676002)(36756003)(81166007)(356005)(82740400003)(8936002)(70586007)(40480700001)(36860700001)(4326008)(83380400001)(2906002)(86362001)(478600001)(2616005)(40460700003)(44832011)(41300700001)(336012)(316002)(47076005)(426003)(186003)(5660300002)(110136005)(16526019)(26005)(82310400005)(6666004)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2022 11:49:13.9546 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aac755d6-b612-40f8-27ae-08dacd48be5a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8136 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Reading MAC address from on board EEPROM requires different type for System Controller (SC). Signed-off-by: Michal Simek --- board/xilinx/Kconfig | 9 +++++++++ board/xilinx/common/fru.h | 1 + board/xilinx/common/fru_ops.c | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/board/xilinx/Kconfig b/board/xilinx/Kconfig index 4ea78418780c..4f0776e8bd95 100644 --- a/board/xilinx/Kconfig +++ b/board/xilinx/Kconfig @@ -65,3 +65,12 @@ config CMD_FRU information present in the device. The FRU Information is used to primarily to provide "inventory" information about the boards that the FRU Information Device is located on. + +config FRU_SC + bool "FRU system controller decoding" + help + Xilinx System Controller (SC) FRU format is describing boards from two + angles. One from DUT and then from SC. DUT is default option for + the main CPU. SC behaves more or less as slave and have different ID. + If you build U-Boot for SC you should enable this option to get proper + MAC address. diff --git a/board/xilinx/common/fru.h b/board/xilinx/common/fru.h index 59f6b722cf12..586c41b66ef7 100644 --- a/board/xilinx/common/fru.h +++ b/board/xilinx/common/fru.h @@ -90,6 +90,7 @@ struct fru_table { #define FRU_MULTIREC_MAC_OFFSET 4 #define FRU_LAST_REC BIT(7) #define FRU_DUT_MACID 0x31 +#define FRU_SC_MACID 0x11 /* This should be minimum of fields */ #define FRU_BOARD_AREA_TOTAL_FIELDS 5 diff --git a/board/xilinx/common/fru_ops.c b/board/xilinx/common/fru_ops.c index 49846ae3d660..c4f009affc5e 100644 --- a/board/xilinx/common/fru_ops.c +++ b/board/xilinx/common/fru_ops.c @@ -239,8 +239,12 @@ static int fru_parse_multirec(unsigned long addr) if (mrc.rec_type == FRU_MULTIREC_TYPE_OEM) { struct fru_multirec_mac *mac = (void *)addr + hdr_len; + u32 type = FRU_DUT_MACID; - if (mac->ver == FRU_DUT_MACID) { + if (CONFIG_IS_ENABLED(FRU_SC)) + type = FRU_SC_MACID; + + if (mac->ver == type) { mac_len = mrc.len - FRU_MULTIREC_MAC_OFFSET; memcpy(&fru_data.mac.macid, mac->macid, mac_len); }