From patchwork Fri Dec 22 05:45:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1879510 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=G2CFIyDk; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SxGWt16YHz1ypX for ; Fri, 22 Dec 2023 16:46:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB681877D5; Fri, 22 Dec 2023 06:46:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="G2CFIyDk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 27F4F877C8; Fri, 22 Dec 2023 06:46:38 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AC2BE86E7E for ; Fri, 22 Dec 2023 06:46:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tkuw584924@gmail.com Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1d3eabe9321so10466275ad.2 for ; Thu, 21 Dec 2023 21:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703223994; x=1703828794; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ib4vJPyjcl9CBr6/cZpeTTYTztRSS6v16gBkPKkjnmk=; b=G2CFIyDkJrrhhORBcX2o4ruc/yS4k0ZVJz44N2a8Lcdz+fVZ8yn3T3oX+pA5LScQ5p 8Ab3ET5Kh97ukXm6R8PvVf/FnsIXuuG4S4yFIr0da9R97zJNReNm5S8SCwZsZ6pMQPaE KUapStjKwXCIucU+CiSOdD3pCR1T2whaIHP8mcwHBdhi3gP9u2IryIentgNeWnDLAMCa RFEImOQpx7yjOJQguathUKLC4+qE39DeyKXbZMFmcm1h0G86kuFVdrzFAMd4CNxzK9kq oClg8JVU4rd2htpCV88y5WTZCii2sBuA1LYSJ8ripNzktb6/m+3+G6+G3IWXUdZGdeUf rH6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703223994; x=1703828794; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ib4vJPyjcl9CBr6/cZpeTTYTztRSS6v16gBkPKkjnmk=; b=VuNEsQlCzN7bCjCuD/RsNwNTA7ETCqJ4mmav+3y38Q0p8x+9n6tn7OBTmTpJdwykEn LybTPdMT2TS7ePqfNkZps2GGGAjijRWWyvZL+YyWS7wIIGFacMTc/2ohF9235ggduQiw 06WnxyQGRmkZWfrgfO51yvTG1OwrSU7CXKwtu9wQiIUs44yEI08Cap7j3rYfPKiYNJCw yaEkFuevZUb4LJZQudaorhVJpx05XSVqaLyU0QVjkykuuuaECuhtaieMXIkhkJS+mvs2 AwG8QM/fqXkwYFIn+3kz34cjTOAPqtKfsyT3of/bepGK0ScgeBk1NEX7dnDAgU32L9Cc 3RrA== X-Gm-Message-State: AOJu0YyKvFwsvc3f1I+p4eRJf6HJpxvbOABQCzs/sl8jSsHKBLxCGMlp cHU4Ap5yaKJvbLaPwYpFpsgHtndm/dM= X-Google-Smtp-Source: AGHT+IGdVlOF5GJH6L/j/XYUU1nqRfqJCxTYMAvf5lgoDo5jxHU/XZFQu0BNbJHDHNoBsYHlqR0FrA== X-Received: by 2002:a17:902:e547:b0:1d3:ef7a:4140 with SMTP id n7-20020a170902e54700b001d3ef7a4140mr604007plf.104.1703223993974; Thu, 21 Dec 2023 21:46:33 -0800 (PST) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id h9-20020a170902704900b001d05456394csm2590661plt.28.2023.12.21.21.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:46:33 -0800 (PST) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: u-boot@lists.denx.de Cc: jagan@amarulasolutions.com, vigneshr@ti.com, tudor.ambarus@linaro.org, pratyush@kernel.org, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano Subject: [PATCH v2 1/9] mtd: spi-nor-core: Clean up macros for Infineon(Cypress) S25 and S28 Date: Fri, 22 Dec 2023 14:45:58 +0900 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean From: Takahiro Kuwano Some macro definitions used in Infineon(Cypress) S25 and S28 series are redundant and some have inconsistent prefix. This patch removes redundant ones and renames some to have same prefix as others. Signed-off-by: Takahiro Kuwano Reviewed-by: Jagan Teki --- drivers/mtd/spi/spi-nor-core.c | 26 ++++++++++++++------------ include/linux/mtd/spi-nor.h | 11 +++-------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 9a1801ba93..a2ef65cf6f 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -331,7 +331,7 @@ static int spansion_read_any_reg(struct spi_nor *nor, u32 addr, u8 dummy, u8 *val) { struct spi_mem_op op = - SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_RDAR, 1), + SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_RD_ANY_REG, 1), SPI_MEM_OP_ADDR(nor->addr_mode_nbytes, addr, 1), SPI_MEM_OP_DUMMY(dummy / 8, 1), SPI_MEM_OP_DATA_IN(1, NULL, 1)); @@ -342,7 +342,7 @@ static int spansion_read_any_reg(struct spi_nor *nor, u32 addr, u8 dummy, static int spansion_write_any_reg(struct spi_nor *nor, u32 addr, u8 val) { struct spi_mem_op op = - SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WRAR, 1), + SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WR_ANY_REG, 1), SPI_MEM_OP_ADDR(nor->addr_mode_nbytes, addr, 1), SPI_MEM_OP_NO_DUMMY, SPI_MEM_OP_DATA_OUT(1, NULL, 1)); @@ -714,7 +714,7 @@ static int set_4byte(struct spi_nor *nor, const struct flash_info *info, */ static int spansion_sr_ready(struct spi_nor *nor, u32 addr_base, u8 dummy) { - u32 reg_addr = addr_base + SPINOR_REG_ADDR_STR1V; + u32 reg_addr = addr_base + SPINOR_REG_CYPRESS_STR1V; u8 sr; int ret; @@ -1856,7 +1856,7 @@ static int macronix_quad_enable(struct spi_nor *nor) static int spansion_quad_enable_volatile(struct spi_nor *nor, u32 addr_base, u8 dummy) { - u32 addr = addr_base + SPINOR_REG_ADDR_CFR1V; + u32 addr = addr_base + SPINOR_REG_CYPRESS_CFR1V; u8 cr; int ret; @@ -3263,11 +3263,11 @@ static int s25fs_s_setup(struct spi_nor *nor, const struct flash_info *info, * Read CR3V to check if uniform sector is selected. If not, assign an * erase hook that supports non-uniform erase. */ - ret = spansion_read_any_reg(nor, SPINOR_REG_ADDR_CFR3V, + ret = spansion_read_any_reg(nor, SPINOR_REG_CYPRESS_CFR3V, S25FS_S_RDAR_DUMMY, &cfr3v); if (ret) return ret; - if (!(cfr3v & CFR3V_UNHYSA)) + if (!(cfr3v & SPINOR_REG_CYPRESS_CFR3_UNISECT)) nor->erase = s25fs_s_erase_non_uniform; return spi_nor_default_setup(nor, info, params); @@ -3366,7 +3366,8 @@ static int s25_setup(struct spi_nor *nor, const struct flash_info *info, * uniform 128KB only due to complexity of non-uniform layout. */ if (nor->info->id[4] == S25FS256T_ID4) { - ret = spansion_read_any_reg(nor, SPINOR_REG_ADDR_ARCFN, 8, &cr); + ret = spansion_read_any_reg(nor, SPINOR_REG_CYPRESS_ARCFN, 8, + &cr); if (ret) return ret; @@ -3380,10 +3381,10 @@ static int s25_setup(struct spi_nor *nor, const struct flash_info *info, * Read CFR3V to check if uniform sector is selected. If not, assign an * erase hook that supports non-uniform erase. */ - ret = spansion_read_any_reg(nor, SPINOR_REG_ADDR_CFR3V, 0, &cr); + ret = spansion_read_any_reg(nor, SPINOR_REG_CYPRESS_CFR3V, 0, &cr); if (ret) return ret; - if (!(cr & CFR3V_UNHYSA)) + if (!(cr & SPINOR_REG_CYPRESS_CFR3_UNISECT)) nor->erase = s25_erase_non_uniform; /* @@ -3444,12 +3445,13 @@ static int s25_post_bfpt_fixup(struct spi_nor *nor, * dies are configured to 512B buffer. */ for (addr = 0; addr < params->size; addr += SZ_128M) { - ret = spansion_read_any_reg(nor, addr + SPINOR_REG_ADDR_CFR3V, - 0, &cfr3v); + ret = spansion_read_any_reg(nor, + addr + SPINOR_REG_CYPRESS_CFR3V, 0, + &cfr3v); if (ret) return ret; - if (!(cfr3v & CFR3V_PGMBUF)) { + if (!(cfr3v & SPINOR_REG_CYPRESS_CFR3_PGSZ)) { params->page_size = 256; return 0; } diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 2861b73edb..f9a55c8e74 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -136,14 +136,6 @@ #define SPINOR_OP_BRRD 0x16 /* Bank register read */ #define SPINOR_OP_CLSR 0x30 /* Clear status register 1 */ #define SPINOR_OP_EX4B_CYPRESS 0xB8 /* Exit 4-byte mode */ -#define SPINOR_OP_RDAR 0x65 /* Read any register */ -#define SPINOR_OP_WRAR 0x71 /* Write any register */ -#define SPINOR_REG_ADDR_STR1V 0x00800000 -#define SPINOR_REG_ADDR_CFR1V 0x00800002 -#define SPINOR_REG_ADDR_CFR3V 0x00800004 -#define SPINOR_REG_ADDR_ARCFN 0x00000006 -#define CFR3V_UNHYSA BIT(3) /* Uniform sectors or not */ -#define CFR3V_PGMBUF BIT(4) /* Program buffer size */ /* Used for Micron flashes only. */ #define SPINOR_OP_RD_EVCR 0x65 /* Read EVCR register */ @@ -189,6 +181,9 @@ #define SPINOR_OP_RD_ANY_REG 0x65 /* Read any register */ #define SPINOR_OP_WR_ANY_REG 0x71 /* Write any register */ #define SPINOR_OP_S28_SE_4K 0x21 +#define SPINOR_REG_CYPRESS_ARCFN 0x00000006 +#define SPINOR_REG_CYPRESS_STR1V 0x00800000 +#define SPINOR_REG_CYPRESS_CFR1V 0x00800002 #define SPINOR_REG_CYPRESS_CFR2V 0x00800003 #define SPINOR_REG_CYPRESS_CFR2_MEMLAT_11_24 0xb #define SPINOR_REG_CYPRESS_CFR3V 0x00800004 From patchwork Fri Dec 22 05:45:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1879511 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=NNCfsZzQ; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SxGX36vBlz20R1 for ; Fri, 22 Dec 2023 16:46:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DAF5877C8; Fri, 22 Dec 2023 06:46:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NNCfsZzQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5F24587650; Fri, 22 Dec 2023 06:46:41 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 09ADD876F8 for ; Fri, 22 Dec 2023 06:46:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tkuw584924@gmail.com Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1d3e05abcaeso10778215ad.1 for ; Thu, 21 Dec 2023 21:46:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703223997; x=1703828797; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TUalSoE8z8MXRqfRa1OfC3wOXoIVBbR6QXqEtCvdtRo=; b=NNCfsZzQW0GlnEe9x26SuyJwhpZA0SRUBE8WUYXRnxM2L37B9SdxFBBzxIMkIi9768 hWZmIx65pAO3GvuMvGlcVKV2Sf7P7q8sbANIS74T9gwL3faR6I6XC1vvt2ktemNoP5kQ VHCS/2Ijp+bJOiPsKl0U1YBwdQRBOk5xnVHY8yoM7q9G5Ibpy+T8flYLQEt6Y2yYns09 dNElPjL/2CgwrlxHC7a9plFNw4AC5DcaSt93jeeG9otmPWx5BbhsvP+89mwqKi7qqVSN 4b8Xb95FxvzVF/5ktqjCaGjcpT/TpYy6CXspMfy+j0TrSQOD5sIg95+0J5r/m0Ha3eN1 erow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703223997; x=1703828797; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TUalSoE8z8MXRqfRa1OfC3wOXoIVBbR6QXqEtCvdtRo=; b=HFC8GONegP4pYiMQjqkDDH/NNo1wxKqoYyZVdTLXxC0akfsTxi2uDMdsO/jd/cuA+N dEhZs1OCiRYMED5CSJJdhDOsEO7Nkdv427YIEl96IjDR6crj118l0/uqzCSCgWBkmwXz F3XELEp/emvaxOfkq1kArQ+zD4jDf1TUCydwM4eRw5igSMognsZtRiqDl177D2Krunjq LADPnkgnQM3+2Nih+bzoqH6QEOgJ/9+Wnh/ZxPRd0WMa303gTV7nCRxddoRV4xpjbQpC 1GvxqEezFvuJ0H0f+pNnbJmQ7jTEaOdCOTw8ug6oyNlV9khQfeFRc8e4GU+mOvSPhUyX RBsw== X-Gm-Message-State: AOJu0YxDZ/TraoF77OQ4e93blfHplVGsV/dL/4ocTLUv8k1nafjEKAhC sfyEXvc2Fd7KEa6tymXk9Pdg1rXUf1U= X-Google-Smtp-Source: AGHT+IFpacrnQwWFbzewA0G1964swQOJifelbOxburVNHQ9qJqF7aN2DaRdJJtYIUSuOiSVjFWBk1Q== X-Received: by 2002:a17:903:41cb:b0:1d4:1623:89ff with SMTP id u11-20020a17090341cb00b001d4162389ffmr516358ple.83.1703223997384; Thu, 21 Dec 2023 21:46:37 -0800 (PST) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id h9-20020a170902704900b001d05456394csm2590661plt.28.2023.12.21.21.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:46:37 -0800 (PST) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: u-boot@lists.denx.de Cc: jagan@amarulasolutions.com, vigneshr@ti.com, tudor.ambarus@linaro.org, pratyush@kernel.org, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano Subject: [PATCH v2 2/9] mtd: spi-nor-core: Consolidate non-uniform erase helpers for S25 and S28 Date: Fri, 22 Dec 2023 14:45:59 +0900 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean From: Takahiro Kuwano s25_erase_non_uniform() and s28hx_t_erase_uniform() support hybrid sector layout (32 x 4KB sectors overlaid at bottom address) and doing same thing. Consolidate them into single helper named s25_s28_erase_non_uniform(). Signed-off-by: Takahiro Kuwano Reviewed-by: Jagan Teki --- drivers/mtd/spi/spi-nor-core.c | 13 +++---------- include/linux/mtd/spi-nor.h | 1 - 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index a2ef65cf6f..f62a2f2008 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -3344,7 +3344,7 @@ static int s25_quad_enable(struct spi_nor *nor) return 0; } -static int s25_erase_non_uniform(struct spi_nor *nor, loff_t addr) +static int s25_s28_erase_non_uniform(struct spi_nor *nor, loff_t addr) { /* Support 32 x 4KB sectors at bottom */ return spansion_erase_non_uniform(nor, addr, SPINOR_OP_BE_4K_4B, 0, @@ -3385,7 +3385,7 @@ static int s25_setup(struct spi_nor *nor, const struct flash_info *info, if (ret) return ret; if (!(cr & SPINOR_REG_CYPRESS_CFR3_UNISECT)) - nor->erase = s25_erase_non_uniform; + nor->erase = s25_s28_erase_non_uniform; /* * For the multi-die package parts, the ready() hook is needed to check @@ -3558,13 +3558,6 @@ static int spi_nor_cypress_octal_dtr_enable(struct spi_nor *nor) return 0; } -static int s28hx_t_erase_non_uniform(struct spi_nor *nor, loff_t addr) -{ - /* Factory default configuration: 32 x 4 KiB sectors at bottom. */ - return spansion_erase_non_uniform(nor, addr, SPINOR_OP_S28_SE_4K, - 0, SZ_128K); -} - static int s28hx_t_setup(struct spi_nor *nor, const struct flash_info *info, const struct spi_nor_flash_parameter *params) { @@ -3593,7 +3586,7 @@ static int s28hx_t_setup(struct spi_nor *nor, const struct flash_info *info, return ret; if (!(buf & SPINOR_REG_CYPRESS_CFR3_UNISECT)) - nor->erase = s28hx_t_erase_non_uniform; + nor->erase = s25_s28_erase_non_uniform; return spi_nor_default_setup(nor, info, params); } diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index f9a55c8e74..ebe38306a1 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -180,7 +180,6 @@ /* For Cypress flash. */ #define SPINOR_OP_RD_ANY_REG 0x65 /* Read any register */ #define SPINOR_OP_WR_ANY_REG 0x71 /* Write any register */ -#define SPINOR_OP_S28_SE_4K 0x21 #define SPINOR_REG_CYPRESS_ARCFN 0x00000006 #define SPINOR_REG_CYPRESS_STR1V 0x00800000 #define SPINOR_REG_CYPRESS_CFR1V 0x00800002 From patchwork Fri Dec 22 05:46:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1879513 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=GgWQ020N; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SxGXQ0rClz1ypX for ; Fri, 22 Dec 2023 16:47:18 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A0287877EC; Fri, 22 Dec 2023 06:46:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GgWQ020N"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9949387650; Fri, 22 Dec 2023 06:46:44 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 69B9E877E2 for ; Fri, 22 Dec 2023 06:46:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tkuw584924@gmail.com Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1d3eabe9321so10466765ad.2 for ; Thu, 21 Dec 2023 21:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703224001; x=1703828801; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yhonlz6dBLbPEeApf+akUUnz9ZMbYiPVL2+gHCwjZbA=; b=GgWQ020NZzSgn8Jw0dgJZFY+MfYu9+mdyfUmueeAV1Ay7CvrdJTOp+iwiSC0Fjdnn0 Pup/zCr/W6tVQZr1OxxHaES5anhqCHQ+7Pe1dWlvCfgScSUQsbPYLWF3VfML91eldzNA CPBVxl3LY1hTn11Q9cd/KVgAKzbIjOkzw/OAq+Fgk79Rltz/187QNHuZUZ6n0cxPAz0C P7eIsQL/humT4HfmH6/2ZGeqKJsF/H0sy06XuNZiloFUbnJ/IQ62tMod2e2GMqhE6gNB GsyLSjrT69FbvMH/ImkRZtfYDie/SHB15+B1mpfvhPfbsFctXYA0goOZHI00XeCYy24a GZTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703224001; x=1703828801; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yhonlz6dBLbPEeApf+akUUnz9ZMbYiPVL2+gHCwjZbA=; b=hyGXNAd3hFl3K7decSKFBJA4MmyyBacNzbkxzDEDNNEpfyPSQrhBmCHVjljNutVCj1 B6vguovg3eWJuUXJv7zm2a4lO7lJVev3z+dOm2MdSzNlwFfeUVZ72fkXUZ/ZDd2U+Y8/ w571bj8r3Z+8ByCb/cQyyjEDqsD83bKx6rYbVa5kb5ut53cMLEeDbnLrH5QKTnmRWwrb 0SqWDKNMWtWf+BnYiqSzFU1D6KWEOYivtluvMyfk6CTGxF4XF8VWZ9jXv04O04zOy45c W/1jB8CucPUusS+t9QTGBBGCMN/YQrpf6mEf5TExDO9Go4ozMxhndL6ONFlYSQn1rT6c ENHA== X-Gm-Message-State: AOJu0YxGxm8/cFtmafwao/JBQdfZKHAmoAm4BPbt5dryT5Yns3aaYjJq g9llWjsmSCrJoDD6kDJI5aKnvlrR0lo= X-Google-Smtp-Source: AGHT+IH7pgudbKnh5ho89uH4+GA6QpBNdnZKEsguZVF4kDU/VomE55G1gDYzQ4s+3qjV2gHUPyJ6xA== X-Received: by 2002:a17:902:f814:b0:1d4:8a3:52f3 with SMTP id ix20-20020a170902f81400b001d408a352f3mr497821plb.32.1703224000799; Thu, 21 Dec 2023 21:46:40 -0800 (PST) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id h9-20020a170902704900b001d05456394csm2590661plt.28.2023.12.21.21.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:46:40 -0800 (PST) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: u-boot@lists.denx.de Cc: jagan@amarulasolutions.com, vigneshr@ti.com, tudor.ambarus@linaro.org, pratyush@kernel.org, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano Subject: [PATCH v2 3/9] mtd: spi-nor-core: Rework spansion_read_any_reg() to support Octal DTR mode Date: Fri, 22 Dec 2023 14:46:00 +0900 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean From: Takahiro Kuwano In Infineon multi-die package parts, we need to use Read Any Register op to read status register in 2nd or further die. Infineon S28HS02GT is dual-die package and supports Octal DTR interface. To support this, spansion_read_any_reg() needs to be reworked. Implementation is similar to existing read_sr() that already supports Octal DTR mode. Signed-off-by: Takahiro Kuwano Reviewed-by: Jagan Teki --- drivers/mtd/spi/spi-nor-core.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index f62a2f2008..3f761b9b9e 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -331,12 +331,36 @@ static int spansion_read_any_reg(struct spi_nor *nor, u32 addr, u8 dummy, u8 *val) { struct spi_mem_op op = - SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_RD_ANY_REG, 1), - SPI_MEM_OP_ADDR(nor->addr_mode_nbytes, addr, 1), - SPI_MEM_OP_DUMMY(dummy / 8, 1), - SPI_MEM_OP_DATA_IN(1, NULL, 1)); + SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_RD_ANY_REG, 0), + SPI_MEM_OP_ADDR(nor->addr_mode_nbytes, addr, 0), + SPI_MEM_OP_DUMMY(dummy, 0), + SPI_MEM_OP_DATA_IN(1, NULL, 0)); + u8 buf[2]; + int ret; + + spi_nor_setup_op(nor, &op, nor->reg_proto); + + /* + * In Octal DTR mode, the number of address bytes is always 4 regardless + * of addressing mode setting. + */ + if (nor->reg_proto == SNOR_PROTO_8_8_8_DTR) + op.addr.nbytes = 4; + + /* + * We don't want to read only one byte in DTR mode. So, read 2 and then + * discard the second byte. + */ + if (spi_nor_protocol_is_dtr(nor->reg_proto)) + op.data.nbytes = 2; - return spi_nor_read_write_reg(nor, &op, val); + ret = spi_nor_read_write_reg(nor, &op, buf); + if (ret) + return ret; + + *val = buf[0]; + + return 0; } static int spansion_write_any_reg(struct spi_nor *nor, u32 addr, u8 val) From patchwork Fri Dec 22 05:46:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1879514 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=htqcuQBA; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SxGXb4YJwz1ypX for ; Fri, 22 Dec 2023 16:47:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4441E87650; Fri, 22 Dec 2023 06:46:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="htqcuQBA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 46BDB877C4; Fri, 22 Dec 2023 06:46:48 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EF50E87800 for ; Fri, 22 Dec 2023 06:46:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tkuw584924@gmail.com Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1d420aaa2abso789035ad.3 for ; Thu, 21 Dec 2023 21:46:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703224004; x=1703828804; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W2+UgqjE6qQ0jTIYF3OlUrm8dqmAvIT1HiSjii4rjqU=; b=htqcuQBAUMWVrGKp77i2GHvkZPac7r96Wg4M4w/P/0+WiH4IwV+qDRUQgSBF0iD3K2 ttORzABbHGZvFPWkJ8E7RehTModfxn4x6Gora6VWBT3TdCungdDlQBz4H4COTO2JAVDC Z33VU/j4bhJCHH4KufyhASYsFSW+GgL+Nbidgf/oshhl4HJt+z23GEUWR+yoBnwoRvvD aB0qLQVXjhAQx6EyFPpO/pSq6Y+oRwcF5APSe0Q2z7Bx7dnBg38iPit/KwhE95iwGihy i9auTKlEYGJFzpTGe8inlrqpw496Su3RQU/gQdozMwSayoK9X34qQ1us3oLmaqwHvLjy Q1iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703224004; x=1703828804; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W2+UgqjE6qQ0jTIYF3OlUrm8dqmAvIT1HiSjii4rjqU=; b=JdIS+VYGGte53ku60m0f7D3rk4/GPX/EZXuvrdCnUhfXArnTA1Sbx+ElvlZO2hqIdL fnu5BGzRBN8hvzmeAjnX8dQWzoO9U9QShxEiRWTIq++FAYUavZ7b3ADc737WVVO+z5Md FznaXwebGhaQJdyqeEO99vxhzAUXsYG8CuXmwERMpjm6iOeX/KJW1CxFj8NN9opsgwHX jrXpAMosE0JSYN1M6KnmYbk4VOP1//IWYPMR/yd+KkKkUN1+UyflN6D7CjWhcrYx/Kko LNJ7yI+VxIswkie39np1qXUvHJAJw/GNOid4b83X59vIoKPD0LO8rr0xqHTcbLRDq6wB EYMQ== X-Gm-Message-State: AOJu0Yw69M5pJMOKXwco42QyxwCwlMoFRfSn790Em0hL2tv2L7jU3BRZ 8rSl3m1SPX9Ha83XKg9158ZPLcut0Yo= X-Google-Smtp-Source: AGHT+IFybw0dWAMLzMyWx8Mz86dbdmUNkfG39x6pAxMFBk2zJnIIEbPRuS4jrkJvQKvaW7iRbJyf6Q== X-Received: by 2002:a17:903:2346:b0:1d3:ff24:b3b5 with SMTP id c6-20020a170903234600b001d3ff24b3b5mr610620plh.92.1703224004178; Thu, 21 Dec 2023 21:46:44 -0800 (PST) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id h9-20020a170902704900b001d05456394csm2590661plt.28.2023.12.21.21.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:46:43 -0800 (PST) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: u-boot@lists.denx.de Cc: jagan@amarulasolutions.com, vigneshr@ti.com, tudor.ambarus@linaro.org, pratyush@kernel.org, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano Subject: [PATCH v2 4/9] mtd: spi-nor-core: Use CLPEF(0x82) as alternative to CLSR(0x30) for S25 and S28 Date: Fri, 22 Dec 2023 14:46:01 +0900 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean From: Takahiro Kuwano Infineon(Cypress) S28Hx-T family does not support legacy CLSR(0x30) opcode. Instead, it supports CLPEF(0x82) which has the same functionality as CLSR. spansion_sr_ready() is for multi-die package parts including S28HS02GT, so we need to use CLPEF instead of CLSR. This change does not affect to S25x02GT which uses spansion_sr_ready() as S25Hx-T family also supports CLPEF(0x82) as well as CLSR(0x30). Signed-off-by: Takahiro Kuwano Reviewed-by: Jagan Teki --- drivers/mtd/spi/spi-nor-core.c | 2 +- include/linux/mtd/spi-nor.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 3f761b9b9e..20e82aaa65 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -752,7 +752,7 @@ static int spansion_sr_ready(struct spi_nor *nor, u32 addr_base, u8 dummy) else dev_dbg(nor->dev, "Programming Error occurred\n"); - nor->write_reg(nor, SPINOR_OP_CLSR, NULL, 0); + nor->write_reg(nor, SPINOR_OP_CYPRESS_CLPEF, NULL, 0); return -EIO; } diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index ebe38306a1..8a94e12037 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -180,6 +180,7 @@ /* For Cypress flash. */ #define SPINOR_OP_RD_ANY_REG 0x65 /* Read any register */ #define SPINOR_OP_WR_ANY_REG 0x71 /* Write any register */ +#define SPINOR_OP_CYPRESS_CLPEF 0x82 /* Clear P/E err flag */ #define SPINOR_REG_CYPRESS_ARCFN 0x00000006 #define SPINOR_REG_CYPRESS_STR1V 0x00800000 #define SPINOR_REG_CYPRESS_CFR1V 0x00800002 From patchwork Fri Dec 22 05:46:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1879515 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Qi9iic8n; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SxGXp04vqz1ypX for ; Fri, 22 Dec 2023 16:47:38 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ACBE7877E5; Fri, 22 Dec 2023 06:46:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Qi9iic8n"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B443386E7E; Fri, 22 Dec 2023 06:46:51 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 62EE3877E5 for ; Fri, 22 Dec 2023 06:46:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tkuw584924@gmail.com Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1d3cfb1568eso13380935ad.1 for ; Thu, 21 Dec 2023 21:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703224008; x=1703828808; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jXDiBDOuklrWro36zokvpc4Gu6GgP5AmL7Z29IfEAyI=; b=Qi9iic8nvw2NfOHP6UrbRjaCUZyCFSpPkylo+Gj4oiuwfJYPONDd0zW032lAXwHF9J xNTGPMZacOX+mdzVyTlMC+Wo5FR7ARMXG/wlBuwaYWVnfD4G3nQaXqHruRS/4TMz73oE UbGxU4ogYiJR4tzc26OhluvXmKez4FN3Xltbu4feag8dYyWhBP9sp5N0uqdgKMU9IDac QIxR/jwqlaQhf7C1I/m3mJ9SCfMA9Os4rY6rcqnXqJxP7vA380CSzonvl6YRewKARMRN N78APZFZB9c5QMm3tFK6tO9Cx5eGe0f3/L4Y1BclYacTSNRqwIEl+v1+vL9vUzwpc4va w2XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703224008; x=1703828808; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jXDiBDOuklrWro36zokvpc4Gu6GgP5AmL7Z29IfEAyI=; b=s8JONGRSC/nJ/GWwqdiMtVltR3m2G5GMO4lZzC+ewsanG6xjOPPsxw213t23ZdWAt5 P/28uygIXVFSkb7HOuqctHY7vpIOzIuia8JrZTju4lMcP3oKnhMdY/WhbnqSXX5zNKBp NmmhW6h9atlrgyjgizV4BwoRNVkaCvlHxJVtc24uNg4IJYG08+SmjFNZaVQynZ/TXR/J 6wS7KS4Q8ZQNcZL2mfQu2iYknJP3Q1mJTLEZ4GzXpDp/DC3JEoSWQmxMf0jSFeTZ5JpU NH3KBkhyTfCiUgkF5ldd8qg3a3DYsS92m4vSyE5/g+tIxQd89rJV+B4LBxvEgoYf/3N3 n75Q== X-Gm-Message-State: AOJu0Yx0bZYuElblOBF74oYahvsx+CHT9ltuUKIfEsUhiLeyyUmDfe3/ w3k/701yzHnB3+Ok26URtXVKBfZ7zdE= X-Google-Smtp-Source: AGHT+IEIr9uuyw8ofoWrD6m00ovcxQuVh5Zqq/ZPiZB90rNNGbFMEzW3SLzua+T3yXqkrofo145bDg== X-Received: by 2002:a17:902:760d:b0:1d0:6297:150a with SMTP id k13-20020a170902760d00b001d06297150amr853601pll.47.1703224007731; Thu, 21 Dec 2023 21:46:47 -0800 (PST) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id h9-20020a170902704900b001d05456394csm2590661plt.28.2023.12.21.21.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:46:47 -0800 (PST) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: u-boot@lists.denx.de Cc: jagan@amarulasolutions.com, vigneshr@ti.com, tudor.ambarus@linaro.org, pratyush@kernel.org, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano Subject: [PATCH v2 5/9] mtd: spi-nor-core: Rework s25_mdp_ready() to support Octal DTR mode Date: Fri, 22 Dec 2023 14:46:02 +0900 Message-Id: <590a68b594f61e8ec2315f3c0b17e7dc43a21a5d.1703220284.git.Takahiro.Kuwano@infineon.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean From: Takahiro Kuwano s25_mdp_ready() handles status polling for multi-die package parts that requires to read and check status register for each die. To support S28HS02GT(dual-die package with Octal DTR support), rename function and use nor->rdsr_dummy in octal DTR mode. Signed-off-by: Takahiro Kuwano Reviewed-by: Jagan Teki --- drivers/mtd/spi/spi-nor-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 20e82aaa65..fe5579db4d 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -3340,13 +3340,13 @@ static struct spi_nor_fixups s25fs_s_fixups = { .post_sfdp = s25fs_s_post_sfdp_fixup, }; -static int s25_mdp_ready(struct spi_nor *nor) +static int s25_s28_mdp_ready(struct spi_nor *nor) { u32 addr; int ret; for (addr = 0; addr < nor->mtd.size; addr += SZ_128M) { - ret = spansion_sr_ready(nor, addr, 0); + ret = spansion_sr_ready(nor, addr, nor->rdsr_dummy); if (!ret) return ret; } @@ -3416,7 +3416,7 @@ static int s25_setup(struct spi_nor *nor, const struct flash_info *info, * all dies' status via read any register. */ if (nor->mtd.size > SZ_128M) - nor->ready = s25_mdp_ready; + nor->ready = s25_s28_mdp_ready; return spi_nor_default_setup(nor, info, params); } From patchwork Fri Dec 22 05:46:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1879516 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=FENheEgG; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SxGY13HFGz1ypX for ; Fri, 22 Dec 2023 16:47:49 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3C99787809; Fri, 22 Dec 2023 06:46:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FENheEgG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6245C86E7E; Fri, 22 Dec 2023 06:46:55 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C21C18780E for ; Fri, 22 Dec 2023 06:46:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tkuw584924@gmail.com Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d2e6e14865so10878445ad.0 for ; Thu, 21 Dec 2023 21:46:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703224011; x=1703828811; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8+Um5VElaZeOGq0JNCRGIkrEoJrlBXk/NuDKnXCNh7k=; b=FENheEgG7OEIrVaGfxbQGr+vzwfXn8xU2Z1fGeh8gnCK1UxLU++BIiwgRuRS43eaS/ OlrMT2PbQNo7RPsYh9SR+CCUlnIZUM0xZPAsvKadukIPMazV8gTtwyBeVrK7PeKBk2zH SqeJ6MnohLVXeRyEThBObxvbH6LR9ZISHZpSqG33g7wtHsLHT8TebHo0cvvzwWdK/OeK 174DmPnQgC4PRScA+HW3SH8AoERzCmFnTGR3EXuMeuZv6jgT0vsfg13A6SxEY8rZuEFO nCLVDrsVsBBZaYYsRuC6yf8HlhdeiKQy9RUZEcT8bdXsZPwIh1nND5turaq0Xh5lO6XU W5eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703224011; x=1703828811; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8+Um5VElaZeOGq0JNCRGIkrEoJrlBXk/NuDKnXCNh7k=; b=FVwDR37P7kRhyKZsbR1DLVDlsxg8V3n8E5daSqgii9XjXhqeyhLJIUoZoSBiPan6vM OsGdW2L1s1kxcEQY34D5gVwHC9aSFeUlkKgu7rT319iOMdIfYwV4ez+oi1PHnNSkcGni xUM3hF/QmXhDyI4cE9neOhgcD37W5j72bu5vQarIMpP6V0TcJ4UIgvYCg6OLTIKqL398 Z6S+cbv4eFb1BCpL1QCYpYObQFt/i3QHYNk5i7BI12xS+kWKoOXvqoP7WJZP8vgfBfLN WjKoiEW0sium75BSW5+P2UCqKGzVuqps1YLcMpwODu1lP3Uag4iRXR/Z5vkIS1lM6m6o ltcg== X-Gm-Message-State: AOJu0YyY9ju9AnbykGpUip0glOFK/bOS7Z9/ITAaIqKVXOoxccv6QGXG NfRkxgkuq3Hco8+9ih0O3eoo+Jtkz+s= X-Google-Smtp-Source: AGHT+IGu2b+HRtum9EP9EOWYmvWyuexvWDIHOHFvRHWrbImih/CU6Y7Sgcqpmw9oabbWLUgnVK7AcQ== X-Received: by 2002:a17:902:684a:b0:1d3:ef33:d0ae with SMTP id f10-20020a170902684a00b001d3ef33d0aemr508293pln.114.1703224011125; Thu, 21 Dec 2023 21:46:51 -0800 (PST) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id h9-20020a170902704900b001d05456394csm2590661plt.28.2023.12.21.21.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:46:50 -0800 (PST) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: u-boot@lists.denx.de Cc: jagan@amarulasolutions.com, vigneshr@ti.com, tudor.ambarus@linaro.org, pratyush@kernel.org, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano Subject: [PATCH v2 6/9] mtd: spi-nor-core: Consolidate setup() hook for Infineon(Cypress) S25 and S28 Date: Fri, 22 Dec 2023 14:46:03 +0900 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean From: Takahiro Kuwano s28hx_t_setup() only checks sector layout setting. To support multi-die package parts like S28HS02GT, it needs to check device size and assign ready() hook for multi-die package parts. These are covered in s25_setup() so we can consolidate s28hx_t_setup() and s25_setup() into one named s25_s28_setup(). spi_nor_wait_till_ready() at the beginning of s28hx_t_setup() can be removed since there is no op that makes device busy state before setup. Signed-off-by: Takahiro Kuwano Reviewed-by: Jagan Teki --- drivers/mtd/spi/spi-nor-core.c | 41 ++++------------------------------ 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index fe5579db4d..0bc43d3d21 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -3375,8 +3375,8 @@ static int s25_s28_erase_non_uniform(struct spi_nor *nor, loff_t addr) SZ_128K); } -static int s25_setup(struct spi_nor *nor, const struct flash_info *info, - const struct spi_nor_flash_parameter *params) +static int s25_s28_setup(struct spi_nor *nor, const struct flash_info *info, + const struct spi_nor_flash_parameter *params) { int ret; u8 cr; @@ -3423,7 +3423,7 @@ static int s25_setup(struct spi_nor *nor, const struct flash_info *info, static void s25_default_init(struct spi_nor *nor) { - nor->setup = s25_setup; + nor->setup = s25_s28_setup; } static int s25_post_bfpt_fixup(struct spi_nor *nor, @@ -3582,43 +3582,10 @@ static int spi_nor_cypress_octal_dtr_enable(struct spi_nor *nor) return 0; } -static int s28hx_t_setup(struct spi_nor *nor, const struct flash_info *info, - const struct spi_nor_flash_parameter *params) -{ - struct spi_mem_op op; - u8 buf; - u8 addr_width = 3; - int ret; - - ret = spi_nor_wait_till_ready(nor); - if (ret) - return ret; - - /* - * Check CFR3V to check if non-uniform sector mode is selected. If it - * is, set the erase hook to the non-uniform erase procedure. - */ - op = (struct spi_mem_op) - SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_RD_ANY_REG, 1), - SPI_MEM_OP_ADDR(addr_width, - SPINOR_REG_CYPRESS_CFR3V, 1), - SPI_MEM_OP_NO_DUMMY, - SPI_MEM_OP_DATA_IN(1, &buf, 1)); - - ret = spi_mem_exec_op(nor->spi, &op); - if (ret) - return ret; - - if (!(buf & SPINOR_REG_CYPRESS_CFR3_UNISECT)) - nor->erase = s25_s28_erase_non_uniform; - - return spi_nor_default_setup(nor, info, params); -} - static void s28hx_t_default_init(struct spi_nor *nor) { nor->octal_dtr_enable = spi_nor_cypress_octal_dtr_enable; - nor->setup = s28hx_t_setup; + nor->setup = s25_s28_setup; } static void s28hx_t_post_sfdp_fixup(struct spi_nor *nor, From patchwork Fri Dec 22 05:46:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1879517 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=VNJhUiou; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SxGYC63MTz1ypX for ; Fri, 22 Dec 2023 16:47:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C122F8781B; Fri, 22 Dec 2023 06:46:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VNJhUiou"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7B5DF86E7E; Fri, 22 Dec 2023 06:46:58 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 446648781B for ; Fri, 22 Dec 2023 06:46:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tkuw584924@gmail.com Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d3e6c86868so12565905ad.1 for ; Thu, 21 Dec 2023 21:46:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703224014; x=1703828814; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S7WZ1iWxbxTriUGaEkBCAsqJd5Y/UcsAdo0qpC0gB3w=; b=VNJhUiouCGoyv80xbsyixxScgAy9ZHOnA8HGtW69i/2rQLk3/iHmwj2ZSQg/46CChO 2eCuLU2Cg1q7nVrf2abNsmP3rYXMa2PBw2oTLT9lJ0Qir79FR/resC8lJaAHGkVAPGWZ RO5WSavMyti8mp1QI9vWWuRVRfZKov7QEy+efxUI0ih45co1/L90+3cpmaQE9rlkpWdv lBoigTVQh9YSXYm/0kwvgVfMLYk5HRhdHaGdDgYgiU2xpcq6SndIsYZSU6NgN/7vZahp PIYWMTORj//UTsux0Xzp2loIBjyCDKp5Qx10Sw9iDpU88Mxi+Xy0iMZlYZenc3UNfM9e G6rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703224014; x=1703828814; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S7WZ1iWxbxTriUGaEkBCAsqJd5Y/UcsAdo0qpC0gB3w=; b=k5WvxHsJip6gWzL1Wah8mLptBycdoK8ypsQeg26YvqxXPhwG6mZKY1VredL0RkRWWN t77jr4WJZL12M7Bjr9LUvshOL+MnmGxOw98Xl0hD3WZQkbY32AOoDKLe4uAcUZfulOUy MGhfQDH3nQDLF9n7nE3zuWBL1AoJv6YDu4TcxjHh9YstrvB7E2GaDCELmzHiemw10SkP TxUT15eBAjs5/nKR4OA5WNj5mnRi9Cce/+aa/z0PbksqPwEdzP/ojFMyq4h8lJ+PEuW3 QXNXAV0S9KHyJQyEOdCUOrKmVAj4tm8Z9Q6xHMJQMtIFk/wtgcGFKt7m6bwWMEaF134Y xe0g== X-Gm-Message-State: AOJu0YxYzCI+OjxlbchxzDfKqzX6OqX96D49jwlxn/X8ku+LWdb1cC45 m1LIBe+lj6V4gDI2qv8R2aPSY1FtKDY= X-Google-Smtp-Source: AGHT+IHyUpPTqII7TcTSCuhDBhhrQwUjM96g1/XZ6QlmAgEH/iaBPBAClEwZ6urCktMeffDGoimvDQ== X-Received: by 2002:a17:902:da91:b0:1d0:737d:2ae5 with SMTP id j17-20020a170902da9100b001d0737d2ae5mr782466plx.87.1703224014649; Thu, 21 Dec 2023 21:46:54 -0800 (PST) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id h9-20020a170902704900b001d05456394csm2590661plt.28.2023.12.21.21.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:46:54 -0800 (PST) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: u-boot@lists.denx.de Cc: jagan@amarulasolutions.com, vigneshr@ti.com, tudor.ambarus@linaro.org, pratyush@kernel.org, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano Subject: [PATCH v2 7/9] mtd: spi-nor-core: Consolidate post_bfpt_fixup() for Infineon(Cypress) S25 and S28 Date: Fri, 22 Dec 2023 14:46:04 +0900 Message-Id: <4a6603f5d4221788f27b21f2de9ede6728b082cc.1703220284.git.Takahiro.Kuwano@infineon.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean From: Takahiro Kuwano s28hx_t_post_bfpt_fixup() fixes erase opcode, erase size, and page size. s25_post_bfpt_fixup() is doing same thing including multi-die support. We can consolidate s28hx_t_post_bfpt_fixup() and s25_post_bfpt_fixup() into one named s25_s28_post_bfpt_fixup(). In s25_s28_post_bfpt_fixup(), set_4byte() is called to force the device to be 4-byte addressing mode. In S28HS02GT datasheet, the B7 opcode is missing but it works actually (confirmed). Signed-off-by: Takahiro Kuwano Reviewed-by: Jagan Teki --- drivers/mtd/spi/spi-nor-core.c | 52 ++++------------------------------ 1 file changed, 6 insertions(+), 46 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 0bc43d3d21..22b5999a87 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -3426,10 +3426,10 @@ static void s25_default_init(struct spi_nor *nor) nor->setup = s25_s28_setup; } -static int s25_post_bfpt_fixup(struct spi_nor *nor, - const struct sfdp_parameter_header *header, - const struct sfdp_bfpt *bfpt, - struct spi_nor_flash_parameter *params) +static int s25_s28_post_bfpt_fixup(struct spi_nor *nor, + const struct sfdp_parameter_header *header, + const struct sfdp_bfpt *bfpt, + struct spi_nor_flash_parameter *params) { int ret; u32 addr; @@ -3503,7 +3503,7 @@ static void s25_post_sfdp_fixup(struct spi_nor *nor, static struct spi_nor_fixups s25_fixups = { .default_init = s25_default_init, - .post_bfpt = s25_post_bfpt_fixup, + .post_bfpt = s25_s28_post_bfpt_fixup, .post_sfdp = s25_post_sfdp_fixup, }; @@ -3619,50 +3619,10 @@ static void s28hx_t_post_sfdp_fixup(struct spi_nor *nor, params->rdsr_addr_nbytes = 4; } -static int s28hx_t_post_bfpt_fixup(struct spi_nor *nor, - const struct sfdp_parameter_header *bfpt_header, - const struct sfdp_bfpt *bfpt, - struct spi_nor_flash_parameter *params) -{ - struct spi_mem_op op; - u8 buf; - u8 addr_width = 3; - int ret; - - /* - * The BFPT table advertises a 512B page size but the page size is - * actually configurable (with the default being 256B). Read from - * CFR3V[4] and set the correct size. - */ - op = (struct spi_mem_op) - SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_RD_ANY_REG, 1), - SPI_MEM_OP_ADDR(addr_width, SPINOR_REG_CYPRESS_CFR3V, 1), - SPI_MEM_OP_NO_DUMMY, - SPI_MEM_OP_DATA_IN(1, &buf, 1)); - ret = spi_mem_exec_op(nor->spi, &op); - if (ret) - return ret; - - if (buf & SPINOR_REG_CYPRESS_CFR3_PGSZ) - params->page_size = 512; - else - params->page_size = 256; - - /* - * The BFPT advertises that it supports 4k erases, and the datasheet - * says the same. But 4k erases did not work when testing. So, use 256k - * erases for now. - */ - nor->erase_opcode = SPINOR_OP_SE_4B; - nor->mtd.erasesize = 0x40000; - - return 0; -} - static struct spi_nor_fixups s28hx_t_fixups = { .default_init = s28hx_t_default_init, .post_sfdp = s28hx_t_post_sfdp_fixup, - .post_bfpt = s28hx_t_post_bfpt_fixup, + .post_bfpt = s25_s28_post_bfpt_fixup, }; #endif /* CONFIG_SPI_FLASH_S28HX_T */ From patchwork Fri Dec 22 05:46:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1879519 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=EcaEF+HZ; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SxGYT4yGxz1ypX for ; Fri, 22 Dec 2023 16:48:13 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 40D508780A; Fri, 22 Dec 2023 06:47:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EcaEF+HZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E0EE086E7E; Fri, 22 Dec 2023 06:47:02 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 994FF8780C for ; Fri, 22 Dec 2023 06:46:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tkuw584924@gmail.com Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d04c097e34so11203555ad.0 for ; Thu, 21 Dec 2023 21:46:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703224018; x=1703828818; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xWXaoQIfJHWbkQd4hppCnSfiINqfufOvvFDHeqra62M=; b=EcaEF+HZnR3f+rgPl0NBD4itIizTP4sG16m0AhN9M5FNA1WuFucZ2OqI6Dnc1/1qWF FKt6HSnclvHzyDJVJqVLY5DAL62AMDJhJRDt2O5ZI1pfAttG80c8Npm6nuyEVAA8SqH3 mj4dFT6nywC0fYMTeLs4yg/rlyb/WZIACb3me2bsWDBxbzqdbl6C5zISr5HZArfBFg6E mEABrxaco8SDqqS6OQNQWbEUCFj+Fx/PV2zmQY0bYD0E5uKGd8VxfAL74a9bHGne+/aU si4ArxudKuJZvw4HWJUFRaxC8sxFmNUfNIUb+lio91Y0HShqqJfvhyx6RqFPbPscvwlg THJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703224018; x=1703828818; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xWXaoQIfJHWbkQd4hppCnSfiINqfufOvvFDHeqra62M=; b=J8g1OC5vzrAgIuTXggimN6exvNpmY5jdtLu3NowRs9DfqIyLA40uLwvkEDppnaxttw pWFM6H8fns+Meqyo4ylRYIdmlRrKVKi4dq0Ox1FYET2FPa5D/5M1zYG9VGqjYTRIJeaj q1ES+j1ffWIG7a9volNq5XaGMWaDp/PczBf8oKR389TLebGQvAjUA6mOfMa7/6z4MkFd dIA9SYjNY8MM8XDJHnVfGrWYrombEJuiFBIuSPTIVJQbGw0msrRaMycD6i028pHdOGNV GcN2O0MADSmsC1faybOegrFQPrGkNEou1awYx+MnGu+YaheMqYBz3W2OpZI1M1IjA4V9 6mXg== X-Gm-Message-State: AOJu0YxaUWrmGEfU1VTc+Lkqv6UNb2G0yPx0mPsdMY9oOH10GkXOqd/q b8wmBVlcfnSZFOL+QbKyw4nGKBaU+gg= X-Google-Smtp-Source: AGHT+IFpIuutzIB7mDrDxK87G80JXhRa0huH2KfR0ORUhGWacG1J9404LZnYUaXbwFXpOKU/a8UTIg== X-Received: by 2002:a17:902:c7c3:b0:1d3:fee6:8b40 with SMTP id r3-20020a170902c7c300b001d3fee68b40mr1795152pla.43.1703224018026; Thu, 21 Dec 2023 21:46:58 -0800 (PST) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id h9-20020a170902704900b001d05456394csm2590661plt.28.2023.12.21.21.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:46:57 -0800 (PST) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: u-boot@lists.denx.de Cc: jagan@amarulasolutions.com, vigneshr@ti.com, tudor.ambarus@linaro.org, pratyush@kernel.org, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano Subject: [PATCH v2 8/9] mtd: spi-nor-core: Rework spi_nor_cypress_octal_dtr_enable() Date: Fri, 22 Dec 2023 14:46:05 +0900 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean From: Takahiro Kuwano Enabling Octal DTR mode in multi-die package parts requires reister setup for each die. That can be done by simple for-loop. write_enable() takes effect to all die at once so we can call it before the loop. Besides we can replace spi_mem_exec_op() calls with spansion_read/write_any_reg(). And finally, we must mask CFR2V[7:4] when changing dummy cycles, as CFR2V[7] indicates current addressing mode and that should be 1 (4-byte address mode) for multi-die package parts. Signed-off-by: Takahiro Kuwano Reviewed-by: Jagan Teki --- drivers/mtd/spi/spi-nor-core.c | 54 +++++++++++++++++----------------- include/linux/mtd/spi-nor.h | 1 + 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 22b5999a87..860b11fd95 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -3535,48 +3535,48 @@ static struct spi_nor_fixups s25fl256l_fixups = { */ static int spi_nor_cypress_octal_dtr_enable(struct spi_nor *nor) { - struct spi_mem_op op; + u32 addr; u8 buf; - u8 addr_width = 3; int ret; - /* Use 24 dummy cycles for memory array reads. */ ret = write_enable(nor); if (ret) return ret; - buf = SPINOR_REG_CYPRESS_CFR2_MEMLAT_11_24; - op = (struct spi_mem_op)SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WR_ANY_REG, 1), - SPI_MEM_OP_ADDR(addr_width, SPINOR_REG_CYPRESS_CFR2V, 1), - SPI_MEM_OP_NO_DUMMY, - SPI_MEM_OP_DATA_OUT(1, &buf, 1)); - ret = spi_mem_exec_op(nor->spi, &op); - if (ret) { - dev_warn(nor->dev, - "failed to set default memory latency value: %d\n", - ret); - return ret; - } - ret = spi_nor_wait_till_ready(nor); - if (ret) - return ret; + /* Use 24 dummy cycles for memory array reads. */ + for (addr = 0; addr < nor->mtd.size; addr += SZ_128M) { + ret = spansion_read_any_reg(nor, + addr + SPINOR_REG_CYPRESS_CFR2V, 0, + &buf); + if (ret) + return ret; + buf &= ~SPINOR_REG_CYPRESS_CFR2_MEMLAT_MASK; + buf |= SPINOR_REG_CYPRESS_CFR2_MEMLAT_11_24; + ret = spansion_write_any_reg(nor, + addr + SPINOR_REG_CYPRESS_CFR2V, + buf); + if (ret) { + dev_warn(nor->dev, "failed to set default memory latency value: %d\n", ret); + return ret; + } + } nor->read_dummy = 24; - /* Set the octal and DTR enable bits. */ ret = write_enable(nor); if (ret) return ret; + /* Set the octal and DTR enable bits. */ buf = SPINOR_REG_CYPRESS_CFR5_OCT_DTR_EN; - op = (struct spi_mem_op)SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WR_ANY_REG, 1), - SPI_MEM_OP_ADDR(addr_width, SPINOR_REG_CYPRESS_CFR5V, 1), - SPI_MEM_OP_NO_DUMMY, - SPI_MEM_OP_DATA_OUT(1, &buf, 1)); - ret = spi_mem_exec_op(nor->spi, &op); - if (ret) { - dev_warn(nor->dev, "Failed to enable octal DTR mode\n"); - return ret; + for (addr = 0; addr < nor->mtd.size; addr += SZ_128M) { + ret = spansion_write_any_reg(nor, + addr + SPINOR_REG_CYPRESS_CFR5V, + buf); + if (ret) { + dev_warn(nor->dev, "Failed to enable octal DTR mode\n"); + return ret; + } } return 0; diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 8a94e12037..d1dbf3eadb 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -185,6 +185,7 @@ #define SPINOR_REG_CYPRESS_STR1V 0x00800000 #define SPINOR_REG_CYPRESS_CFR1V 0x00800002 #define SPINOR_REG_CYPRESS_CFR2V 0x00800003 +#define SPINOR_REG_CYPRESS_CFR2_MEMLAT_MASK GENMASK(3, 0) #define SPINOR_REG_CYPRESS_CFR2_MEMLAT_11_24 0xb #define SPINOR_REG_CYPRESS_CFR3V 0x00800004 #define SPINOR_REG_CYPRESS_CFR3_PGSZ BIT(4) /* Page size. */ From patchwork Fri Dec 22 05:46:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1879520 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=hU2kvNmZ; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SxGYh66XHz1ypX for ; Fri, 22 Dec 2023 16:48:24 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BE5758783A; Fri, 22 Dec 2023 06:47:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hU2kvNmZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F4FD87842; Fri, 22 Dec 2023 06:47:07 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D8F7087837 for ; Fri, 22 Dec 2023 06:47:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tkuw584924@gmail.com Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-58e256505f7so972716eaf.3 for ; Thu, 21 Dec 2023 21:47:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703224021; x=1703828821; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oOryQ7w3gidg35P+EfyyA5WPqGiRM/M4EleU65ToE/8=; b=hU2kvNmZvW1tNvmFeiQUDzwviNmkDGHVNV6aZyfuOpmuV5j/so1k8UnSVY6Phb9s7N ESIMSBIjiGLDNVBbJdbr0fpQdRdUWABk6DqT8d54TFbqdNBVqh/cqS128WUCyMNDn6Xw +q8hQ1DitG9dXC+2zCNMVS33hXvxXANxIVaYGnRzGXVLMtqp7ArVHaTi6oneBI1RQ13q NkgWU410hNC0+yczTHWupPkQ0WxxydQEPTdhzS2t92j0ASD0L1FcVC4PhRwHXcBBDGl6 pSobORlAaaPPllWQoueY/oJA7BJbSZ/YRxPbS7LCtX3s5Onvm/XXva9fbYq4ZS9phMHg Q25g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703224021; x=1703828821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oOryQ7w3gidg35P+EfyyA5WPqGiRM/M4EleU65ToE/8=; b=OwvDZ70Amtlq/FbBWWrheryoytgyMcteokWUzPLlcZqOOiuJkOjHDI96WxfBhfOWjj 3qXke1tVBVayPlZNLHoJ56GlpSWm21eTZcc6SH/D67q6F0DwTwjYP7/tIjd79lgMHtpK 7z1F101SCSKgwh37ZXZyTjjl5S2NdB4UNKibCZ6JPouSRnqrJemKlqp3TILgUtlg6M7A C12jZ/EeFqa13LezOSHglVCkCJaa3Rp3/suMwol96kWuWz0U4Q2NBzw6FOMnetnoBTgo 7qJnWQ7m5K47R+UBhnnefbQyOxrFxifBy9M2XnMhvbcCEb4c+ODOdwCryLL7TfagtSYE 5wnA== X-Gm-Message-State: AOJu0YwU/Q/NfRJODC3rsminxDNdQxRN4dqifLYV3RXPHMr4XoXYj7bL H5P4FdI6YPcEppZEWkvgQYWyWboiR1k= X-Google-Smtp-Source: AGHT+IFh6WXOEzX8s36ZjZQGl4Ew1lrJw0XGW/0ndSy4l/yLGR1V9obTmYW4Cw4pmFWRugOeQokNcQ== X-Received: by 2002:a05:6358:4412:b0:174:b1f1:85bd with SMTP id z18-20020a056358441200b00174b1f185bdmr837007rwc.39.1703224021456; Thu, 21 Dec 2023 21:47:01 -0800 (PST) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id h9-20020a170902704900b001d05456394csm2590661plt.28.2023.12.21.21.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:47:01 -0800 (PST) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: u-boot@lists.denx.de Cc: jagan@amarulasolutions.com, vigneshr@ti.com, tudor.ambarus@linaro.org, pratyush@kernel.org, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano Subject: [PATCH v2 9/9] mtd: spi-nor-ids: Add Infineon(Cypress) s28hs02gt ID Date: Fri, 22 Dec 2023 14:46:06 +0900 Message-Id: <1e205ee9275691afdc41129009a18dd715e6d1f2.1703220284.git.Takahiro.Kuwano@infineon.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean From: Takahiro Kuwano Infineon(Cypress) S28HS02GT is 1.8V, 2Gb (256MB) NOR Flash memory with Octal interface. It is a dual-die package parts and has same features with existing S28 series. Signed-off-by: Takahiro Kuwano Reviewed-by: Dhruva Gole Reviewed-by: Jagan Teki --- drivers/mtd/spi/spi-nor-ids.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c index f86e7ff8e5..949ceee375 100644 --- a/drivers/mtd/spi/spi-nor-ids.c +++ b/drivers/mtd/spi/spi-nor-ids.c @@ -370,6 +370,7 @@ const struct flash_info spi_nor_ids[] = { { INFO("s28hl01gt", 0x345a1b, 0, 256 * 1024, 512, SPI_NOR_OCTAL_DTR_READ) }, { INFO("s28hs512t", 0x345b1a, 0, 256 * 1024, 256, SPI_NOR_OCTAL_DTR_READ) }, { INFO("s28hs01gt", 0x345b1b, 0, 256 * 1024, 512, SPI_NOR_OCTAL_DTR_READ) }, + { INFO("s28hs02gt", 0x345b1c, 0, 256 * 1024, 1024, SPI_NOR_OCTAL_DTR_READ) }, #endif #endif #ifdef CONFIG_SPI_FLASH_SST /* SST */