From patchwork Wed Oct 19 13:50:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Oetken X-Patchwork-Id: 1691971 X-Patchwork-Delegate: vigneshr@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=pS7/zoKj; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Vfc+IjHU; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mssc72H5Cz23k2 for ; Thu, 20 Oct 2022 00:52:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Y4sekQazDF0hAuoMgc5SjGaB5/YDf4tdiGfwSVKl3yM=; b=pS7/zoKjyAsu0M Ad9qpALNYlBYP62bu3l7c7cvKKYwlKkQ79LmgJ1qJNB21dTApXtdV07q71PunfMCVNggayyq7/4yU MiQDFlCrteWJaBGagINrwJMv8QMMm0pHGTH0vtFepp00Lnq656A6bvTanmyANMirGB4ifMUOPLTEy w+puWt0uOJ8kci8k8qoajUkU6oPyWHrFJUIBmJzaiKcKq/6HkMG51O/7P0DTwKTSv7wTws10t6TdJ 0VwKA/qRTdos2/jYJKaVnXa4OJtavZ3Zn8o/5XG8aNhJI7SJrxP3YfB51b4DAWuJZ9SE8t3iR5KDf fAp0vkJVyD7bw90lJz7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol9Tx-002JgX-Cs; Wed, 19 Oct 2022 13:51:41 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol9Tt-002Jcx-FR for linux-mtd@lists.infradead.org; Wed, 19 Oct 2022 13:51:39 +0000 Received: by mail-ej1-x62c.google.com with SMTP id fy4so40071138ejc.5 for ; Wed, 19 Oct 2022 06:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=V5rsWxy6mxVNpBtppEhN4ngzoP+zKtBp3obxI/sO/xI=; b=Vfc+IjHUyS4nvwiOZQgyEjgKXAxlBtBeALnDH/1IELk3Dt2TDuR6D8cWFppdFc4jkQ UcTy17Lw4l8XQWpGQQbJL0KJRLeS8F5U8vH9vPO//5GXjZKDojoNr1epJptZ79PUKHeB FVh4EIy8oWnFlqK5NUyp0jUYxZpElE+zzhMUYVDeSZxNFKjKjHawnOMBAik3Hqj7UNgc IxaisjcYf+BQsxPdXjqlvcfisehsHGqNZvTKopLpQg+DFbwKJ4a15LFYuUdiqUHd6IHM /LHHioKWmnmhoW1KMuTy/scYtV4Go/FQqeFwU4wwuDzR/eVcZuaiNObdqKczSojw6bFx 8QVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V5rsWxy6mxVNpBtppEhN4ngzoP+zKtBp3obxI/sO/xI=; b=n4yll/wGos4+NhAPPiQqep+2R2RX5IuUIYxjuro1N/WyOrETwspDvxo9ve/FsQzr/V xvESSydWEtYi0DQIHvQZDE+U5AoDTLs1uitLUIAV5AF29JGe0zQjo+fnlwcawecS8JSG 6MuXa7kq5GCSojNzm1uxsb5dzp025A5pOF0Itb+Uxhd0XrkIW81D+dUEzbhQDxpJgy6Y 7cIGrjfMXRQZJCfRndeoe9U/UFTA8ML9+9cTf7cc71cwTCTAlsaO9hzv+w0v76R3cNny R8nQ1kHTy5oNF9wGja2RZnkv2nF8/ilVY+kMAiCq8kQD9FB509eKhOjXIuiosaMm5GaZ Nf4w== X-Gm-Message-State: ACrzQf06xDiSvcY5pFsBSz6zNlLQaQ9h+KBojtYAFZgox9OGKSiX+I92 DIKnJ0z6wH81I2bEd/9C8SQ= X-Google-Smtp-Source: AMsMyM7S3bJl7cMHe70p6z/YrGTReD4ksaCZBNKJa6xLymsRgAAgUnALNVlxBPC2tfbm/lmNFWhG+g== X-Received: by 2002:a17:906:5dae:b0:78e:302f:4218 with SMTP id n14-20020a1709065dae00b0078e302f4218mr7203504ejv.22.1666187493084; Wed, 19 Oct 2022 06:51:33 -0700 (PDT) Received: from penguin.lxd (ipbcc2d39a.dynamic.kabel-deutschland.de. [188.194.211.154]) by smtp.gmail.com with ESMTPSA id z5-20020a1709067e4500b0078a83220609sm9161299ejr.13.2022.10.19.06.51.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 06:51:32 -0700 (PDT) From: Andreas Oetken To: Miquel Raynal , linux-mtd@lists.infradead.org Cc: Andreas Oetken , Andreas Oetken Subject: [PATCH] mtd: devices: add fixups to support MT28FW02GBBA1HPC Date: Wed, 19 Oct 2022 15:50:07 +0200 Message-Id: <20221019135007.15932-1-ennoerlangen@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221019_065137_529871_0BC48DCA X-CRM114-Status: GOOD ( 14.77 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Apply existing fixups for MT28FW02GBBA1HPC from: Commit 0a8e98305f63deaf0a799d5cf5532cc83af035d1 ("mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N") Commit 0fe3ede7941dfcd6fd540fc2b08645 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:62c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ennoerlangen[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Apply existing fixups for MT28FW02GBBA1HPC from: Commit 0a8e98305f63deaf0a799d5cf5532cc83af035d1 ("mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N") Commit 0fe3ede7941dfcd6fd540fc2b086453d3ee8f236 ("mtd: cfi: Add early fixup for S70GL02GS") Signed-off-by: Andreas Oetken --- drivers/mtd/chips/cfi_cmdset_0002.c | 4 +++- drivers/mtd/chips/cfi_probe.c | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 9bd65f3f805c..4e0bc2a1abb5 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -441,8 +441,10 @@ static void fixup_quirks(struct mtd_info *mtd) struct map_info *map = mtd->priv; struct cfi_private *cfi = map->fldrv_priv; - if (cfi->mfr == CFI_MFR_AMD && cfi->id == 0x0c01) + if (cfi->mfr == CFI_MFR_AMD && cfi->id == 0x0c01 || + cfi->mfr == CFI_MFR_INTEL && cfi->id == 0x227e) /*MT28FW02GBBA1HPC*/ cfi->quirks |= CFI_QUIRK_DQ_TRUE_DATA; + } /* Used to fix CFI-Tables of chips without Extended Query Tables */ diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c index cf426956454c..102c1ffb9aad 100644 --- a/drivers/mtd/chips/cfi_probe.c +++ b/drivers/mtd/chips/cfi_probe.c @@ -186,9 +186,22 @@ static void fixup_s70gl02gs_chips(struct cfi_private *cfi) pr_warn("Bad S70GL02GS CFI data; adjust to detect 2 chips\n"); } + +static void fixup_mt28fw02gbba1hpc_chips(struct cfi_private *cfi) +{ + /* + * MT28FW02GBBA1HPC flash reports a single 256 MiB chip, but is really made up + * of two 128 MiB chips with 1024 sectors each. + */ + cfi->cfiq->DevSize = 27; + cfi->cfiq->EraseRegionInfo[0] = 0x20003ff; + pr_warn("Bad MT28FW02GBBA1HPC CFI data; adjust to detect 2 chips\n"); +} + static const struct cfi_early_fixup cfi_early_fixup_table[] = { { CFI_MFR_AMD, 0x4801, fixup_s70gl02gs_chips }, - { }, + { CFI_MFR_INTEL, 0x227e, fixup_mt28fw02gbba1hpc_chips}, + { } }; static int __xipram cfi_chip_setup(struct map_info *map,