Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1489284pxp; Sun, 20 Mar 2022 19:20:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc7GapLxmI0dUA96O/8bXbLbJVkg+IkoJoG75bGjxrVkyFaPfZZitf1dR+cFRhPajCiVq0 X-Received: by 2002:aa7:dbd6:0:b0:408:4a31:97a5 with SMTP id v22-20020aa7dbd6000000b004084a3197a5mr20838783edt.186.1647829242607; Sun, 20 Mar 2022 19:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647829242; cv=none; d=google.com; s=arc-20160816; b=GDqgFqwIA5QFsKGqh9qFIGIRXSaPooOZHsdaQu0sMfJm5uQIVOvjKtcDqYeZBNu3f4 HR3rpXgoDHIIdoQIMGTsV6kRH5mc8YLQYF5zw7Gx1MzXUTD03M7dhShLepwPYaLiLJSf iNjhsST//s/sfVj92mkwwbq8G7GVcmrlJzVVFlbJd8KZQEsOGqDE/7Mpz4NJ3Upt9S9f Rw9ygV4E8b+WvaakDihqTYo+MjglEhtA+zzOKjJTqymOW93SXm9mdlg7oW5ljQl/Jhcq 2E0/ud+CLtcgeifl6KDX1kQOl50a3rtONUxJrI/q3B48mDDgiUznU2b4pJcJ/ft+wvJE bBBg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oNRpcSr1HaFOuyEkI71aW2rwKdw2XVGrF5tMoGdemZ8=; b=ev5Orcv14fXSBHjV7ogiRMot/ZyY3wH0Uk0A5fpMdix3auPBASO87PGJXSG/6bQRpK lV/lPxsbUWQUMxKNATyrYXxJE39ctr94qRtnOMD72IoD9VFWPeOvtZ/n4YLTqk6MdwRv z1u1hkroo8kLObYu+E/heeJf8fT7wg5bprcId4C1fd/EkQ6uLLsYff+D9X0ElYFVxdwV dOQynZnt4xM7XEh6DKQxzVZ0YboqHGmnc8x95BUls6digpvEPXloimxGigKi2UlEqJr0 /xw5fI8MsFF9JS9+pDDxDSYj800IquPZUatHoixDBO2INM74keASWrSzZdn7oL+BFZyK 7zzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IbNfRmZH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a509510000000b00418fe1f6031si8644773eda.246.2022.03.20.19.20.17; Sun, 20 Mar 2022 19:20:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IbNfRmZH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243693AbiCTKCQ (ORCPT + 99 others); Sun, 20 Mar 2022 06:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243836AbiCTKCF (ORCPT ); Sun, 20 Mar 2022 06:02:05 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 155CD5C859 for ; Sun, 20 Mar 2022 03:00:43 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id p8so13141266pfh.8 for ; Sun, 20 Mar 2022 03:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oNRpcSr1HaFOuyEkI71aW2rwKdw2XVGrF5tMoGdemZ8=; b=IbNfRmZHJZCE7z4L1cQKmWItxXNZKLG9m1P9OGy57MocjhaYUB39Sa1NsCz+IBDpff /VBGPslXIhi7M8zHe/Uh+l0yRC9HyUWVSV1BiJl2pr/AplZ4+KNTb35liEX8kqLvjmP3 6OqwxlGTaaAl/hZcYBddeNf3H30cfS0LlVcz4i8Xm+eR0rMre13a/ClLEWAJm7gVhIUr BHU6SqS7BCn/9vqdmvUjcMxsk0rXiqv76yYt55qR+ceqanNAKuQdrSu+9fgsX0Ne+sEX r1xmQuI5DBuyvR0In2fC8Z6ZxcKjo6ioPZPp9gcV+acZ+07Wvr8xu3WLuAKfx6/+DZhl i2OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oNRpcSr1HaFOuyEkI71aW2rwKdw2XVGrF5tMoGdemZ8=; b=MDGoTYMuoilHK6zl2WFWvVktxf/otdj5fe9OJ5jEo6KFb7hi6S8E+U6TlFR+jcUn8T O0aTDomn9FKvDtE/JB0i0KHdJ/vZTp/E0mzCPQoN77Wli+duUHhArrED3TddJ8YSc8mZ lFuieDFwFHPZ7FrVStyO91dlgpL7Ft0Ll4yoT3MZy++p05g4FQEMVWVttWsmInmewRgc EUtLrpaAUeE3W6duRR/3wDN2vqGZXI23MKG9Mk9Yb8M46QdbhXORyckIYRxBYaC3RctU F+4F4HAnsVPM5UjLyEcgmfqQzJ05qEEIs6cULwkWzFge6ODo/F1XkZkszgZ6/0Lak9Lc 4EIg== X-Gm-Message-State: AOAM533NYFSUXeLnVjjPBjOsPczPOByb+BNBVOzTHeV7oaK4c0GjoAS+ DngpV8em0k5iqHylPc6Do5A= X-Received: by 2002:a63:4526:0:b0:380:7c34:fc84 with SMTP id s38-20020a634526000000b003807c34fc84mr14539438pga.2.1647770442511; Sun, 20 Mar 2022 03:00:42 -0700 (PDT) Received: from guoguo-omen.lan ([2001:250:3000:7000:7978:d40d:86ff:591d]) by smtp.gmail.com with ESMTPSA id m11-20020a056a00080b00b004f791d0115esm16597810pfk.171.2022.03.20.03.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 03:00:42 -0700 (PDT) From: Chuanhong Guo To: linux-mtd@lists.infradead.org Cc: Chuanhong Guo , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Reto Schneider , Frieder Schrempf , Stefan Roese , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/5] mtd: spinand: gigadevice: fix Quad IO for GD5F1GQ5UExxG Date: Sun, 20 Mar 2022 17:59:57 +0800 Message-Id: <20220320100001.247905-2-gch981213@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220320100001.247905-1-gch981213@gmail.com> References: <20220320100001.247905-1-gch981213@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Read From Cache Quad IO (EBH) uses 2 dummy bytes on this chip according to page 23 of the datasheet[0]. [0]: https://www.gigadevice.com/datasheet/gd5f1gq5xexxg/ Fixes: 469b99248985 ("mtd: spinand: gigadevice: Support GD5F1GQ5UExxG") Signed-off-by: Chuanhong Guo --- drivers/mtd/nand/spi/gigadevice.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c index 1dd1c5898093..da77ab20296e 100644 --- a/drivers/mtd/nand/spi/gigadevice.c +++ b/drivers/mtd/nand/spi/gigadevice.c @@ -39,6 +39,14 @@ static SPINAND_OP_VARIANTS(read_cache_variants_f, SPINAND_PAGE_READ_FROM_CACHE_OP_3A(true, 0, 1, NULL, 0), SPINAND_PAGE_READ_FROM_CACHE_OP_3A(false, 0, 0, NULL, 0)); +static SPINAND_OP_VARIANTS(read_cache_variants_1gq5, + SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); + static SPINAND_OP_VARIANTS(write_cache_variants, SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), SPINAND_PROG_LOAD(true, 0, NULL, 0)); @@ -339,7 +347,7 @@ static const struct spinand_info gigadevice_spinand_table[] = { SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x51), NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1), NAND_ECCREQ(4, 512), - SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5, &write_cache_variants, &update_cache_variants), SPINAND_HAS_QE_BIT, -- 2.35.1