Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp774665pxb; Tue, 12 Apr 2022 13:07:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzcfi5sy/Tb8YOKGJrDEa2G/3Kg8uFHVwx0PQGbJe8YmTxMRpQ4sy4YjJhlEIF9y97Zq28 X-Received: by 2002:a17:902:f60e:b0:158:5c4d:d9b0 with SMTP id n14-20020a170902f60e00b001585c4dd9b0mr5126981plg.63.1649794024285; Tue, 12 Apr 2022 13:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649794024; cv=none; d=google.com; s=arc-20160816; b=09LuFlYhVP6D52r2yYus8vovL6gyaaKih+t8wFIORbLd8BqdmQCgERzVm27MoYR3q2 RKiaqbKqwkerkznPycrYYJ/ALgjPagdstT6ncmwykryzWK6Br2L4rMkusFm6sYNMhpic kZ+/zkltVXeMHTHu0qXZ8C+AsFQM4sdUYfEn5b4ggVaZFbVV2htOdRMVOSB4+3qR3vTz segzGkkPwmY/pgQHvE4ce6V/dYT7mdbiCqC/3aDSCb1MDQnf8CfuXgQaJ+Q+8L2XY9to bcolCxYyZMqpyQWMifw1x5LUQvyWHJONwy0RlzEhUNVL/p2rniCq4/MZo7UPew2v91Xr XlZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jIomhwih297ggtvGGsSjMVGW65+HYFbB6929iK8JS0Y=; b=cskBIegIa7dgZzcWVhmOy0GE3TrPCKNxfNYtUQ0wDY6BFz9eKAvsXvtF0Cviy+D77L I9EElAnJKli3vpA7EQH7J96ZAomHYbusrutdY2VyIXRZdtqzwFpu34RtmimPzsQYglfp mCI2Z6RmqMTS/pO/FWrcHbEoWQH1jUxLEkqGunPC1EBDPCHHWJVJh44esjvvxyX8wqKL qVcCbov5eL6NXglRmuh3TzFyGiwqslSx3Pc3mUyggL+p8wuTz4JQMOsYtPD6xCSl6pA3 MSwj55F9QgwCh98QU4I9rqBYrgmc+0lH/RfWa+OduHez5s9GDVqVS52sxSl1yNXHuX7q m1dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=oW6cpVHA; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p6-20020a62ab06000000b005060ce352e8si511725pff.171.2022.04.12.13.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 13:07:04 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=oW6cpVHA; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B0B957B07; Tue, 12 Apr 2022 12:55:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346237AbiDKM4J (ORCPT + 99 others); Mon, 11 Apr 2022 08:56:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346239AbiDKM4I (ORCPT ); Mon, 11 Apr 2022 08:56:08 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86AB139146 for ; Mon, 11 Apr 2022 05:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1649681631; x=1681217631; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=SiCUePDrJ89bzUhfoZ5GqmHxOEBBtleH5I9gXwug5RY=; b=oW6cpVHASuPfoYcUGD9r01JE+fHd3fADroL0xAsA4ErjMvm0hssoHSr7 Ch/I7OEYovaa9g7LWaCNzeFDXeAKw3+kjRaa+q+hBeRVtl4wy1W/4FdIW +2iHchMBaWsoOrWUHzI+u3uleDNBfRzaCetynoO82kgZ4tidf7sGEpmqU TAqDRz0xB8nzMsQEII6PYfTiO9ShMIIKSQcsGyrg5VbBa/6HJat0B1Vq0 rO3clpVZGK8Il4bcc/y8x6sp3yJM9rjBSjvzFAvJtH5A/13ekjUFVCyiw EMF1bPa1NhKP4twUFi1/qnNtl8IQgo8VCTwbPBKeHgIrF0cmDvXa1BA6x Q==; X-IronPort-AV: E=Sophos;i="5.90,251,1643698800"; d="scan'208";a="160069405" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Apr 2022 05:53:50 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Mon, 11 Apr 2022 05:53:50 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Mon, 11 Apr 2022 05:53:48 -0700 From: Tudor Ambarus To: , CC: , , , , , , Tudor Ambarus Subject: [PATCH v3 0/3] mtd: spi-nor: Parse BFPT to determine the 4-Byte Address Mode Date: Mon, 11 Apr 2022 15:53:43 +0300 Message-ID: <20220411125346.118274-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Depends on: https://lore.kernel.org/lkml/20220411091033.98754-1-tudor.ambarus@microchip.com/ Get the 4-Byte Address mode method from BFPT and favor it in the detriment of the "default" set_4byte_addr_mode method or the methods set by vendors. This may introduce some regressions if flashes have wrong BFPT data. The fix is to introduce post_bfpt() hooks and fix where needed. We should let the core/sfdp do the params initialization, and do vendor specific updates just where needed. v3: - Move the newly introduced BFPT definitions in sfdp.h, as they may be used by manufacturer drivers to handle flash ID collisions. - Drop "mtd: spi-nor: sfdp: Keep SFDP definitions private" patch for the same reason as above - Collect R-b tags v2: Drop quad enable patch Tudor Ambarus (3): mtd: spi-nor: Parse BFPT to determine the 4-Byte Address Mode methods mtd: spi-nor: Update name and description of the set_4byte_addr_mode BFPT methods mtd: spi-nor: Favor the BFPT-parsed set_4byte_addr_mode method drivers/mtd/spi-nor/core.c | 70 ++------------------ drivers/mtd/spi-nor/core.h | 1 - drivers/mtd/spi-nor/macronix.c | 9 ++- drivers/mtd/spi-nor/micron-st.c | 32 ++------- drivers/mtd/spi-nor/sfdp.c | 113 ++++++++++++++++++++++++++++++++ drivers/mtd/spi-nor/sfdp.h | 30 +++++++++ drivers/mtd/spi-nor/winbond.c | 18 +++-- 7 files changed, 174 insertions(+), 99 deletions(-) -- 2.25.1