From patchwork Tue Jun 29 06:01:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1498223 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=De6fZ9oE; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GDYmF2HRrz9sWG for ; Tue, 29 Jun 2021 16:02:37 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 57A4A83141; Tue, 29 Jun 2021 08:01:49 +0200 (CEST) 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="De6fZ9oE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 484708312F; Tue, 29 Jun 2021 08:01:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) (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 DFF2E8310F for ; Tue, 29 Jun 2021 08:01:34 +0200 (CEST) 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-ot1-x333.google.com with SMTP id 110-20020a9d0a770000b0290466fa79d098so4889158otg.9 for ; Mon, 28 Jun 2021 23:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tQsY7aKJqcmEFrXBbcDQx0KWlMoRcaqf7I21ACltSko=; b=De6fZ9oEtGNkADcRQNKiN8AS+9qUo/BvpwOaPv5Tkwb+fjPtkI/bEqC7np1Bq6pEvg PD9791tMPY1BkFnBka8uMvmQF9T8ccSkyCD2+7iieqC/KrU4QtHaNZOZ1e0y+TKwY8xR +sym/10Fkqv3hhgemkKMDTIyCJFfHE6Rt4pQaRSZVE3CVz8EWwxj35A9kWMraAZ0P0dZ 5w9B/JAhWheNOmKpWhxk1E4IrMNgCYn6ttfjdFL58QLdQUDIKAOsGyGm4/m+D9Ne1dv9 kbNBnITGEctRE9Row2PhMmGeY56N6IyWcD4L4O0bOCWz8GufrxXTp1hdZ49MkzzNkeML 3taw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tQsY7aKJqcmEFrXBbcDQx0KWlMoRcaqf7I21ACltSko=; b=WHG9gp9MCnb3ALoSfvFAtzvrE8qabWf9/HwCB59QqoTA3YTCgFpbAAs5FLajsWH1Fc MQcOwt/lMc4tE/3Ju205WSBPwfR5rM92aShWjstyK/bZR34TCqmbwUWVS40AV6dJD5/2 +Gc4dYhy5pr0CEPxNL8CxxQ8yumxHZa2tU2T58HHxwxFRTfD7x9zeSYRjONBRmVWzshF 1Cr1vJMDywKR+c7Y9QOCSQ5Hydh7ifCsXT5MAD4NL0vYVa0l8BLgl/c4lgA+LIOSwoz8 8CACJRPE7hYJT3ek03rXudVV4/Y5lyG8h4uSFMCPpR8D0yEhAG2tUfswysTh5tWz6/V1 1+Jw== X-Gm-Message-State: AOAM533unApHQIwVImXuEmaKKxMouhoR2JhdCGmbjSBsYUMJZU3TPKOi wiAm1835aAyaU1E2Pnes5ZlIO+UwVgI= X-Google-Smtp-Source: ABdhPJzfxgO32IUidFHOwzckHvMcVBLJkrAce0yW79Zf1/fUeJnTLPFlF7klbVk+1o9RtLfKSX+ZSQ== X-Received: by 2002:a05:6830:22d6:: with SMTP id q22mr2941019otc.40.1624946493541; Mon, 28 Jun 2021 23:01:33 -0700 (PDT) Received: from ISCNPF1JZGWX.infineon.com (zz20174137476F6254EB.userreverse.dion.ne.jp. [111.98.84.235]) by smtp.gmail.com with ESMTPSA id a44sm977168ooj.12.2021.06.28.23.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 23:01:33 -0700 (PDT) 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, p.yadav@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano Subject: [PATCH v9 7/9] mtd: spi-nor-core: Add Cypress manufacturer ID in set_4byte Date: Tue, 29 Jun 2021 15:01:02 +0900 Message-Id: <0536a93c87801afd97ae5de0f1f5b87b69057177.1624944246.git.Takahiro.Kuwano@infineon.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean From: Takahiro Kuwano Cypress chips support SPINOR_OP_EN4B(B7h) to enable 4-byte addressing mode. Cypress chips support B8h to disable 4-byte addressing mode instead of SPINOR_OP_EX4B(E9h). This patch defines new opcode and updates set_4byte() to support enable/disable 4-byte addressing mode for Cypress chips. Signed-off-by: Takahiro Kuwano Reviewed-by: Jagan Teki --- Changes in v9: - Rebase on top of u-boot-spi/next Changes in v8: - No change Changes in v7: - No change Changes in v6: - Define SPINOR_OP_EX4B_CYPRESS and use it drivers/mtd/spi/spi-nor-core.c | 3 +++ include/linux/mtd/spi-nor.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 7f1ed1bb36..94dfa97110 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -662,6 +662,9 @@ static int set_4byte(struct spi_nor *nor, const struct flash_info *info, } return status; + case SNOR_MFR_CYPRESS: + cmd = enable ? SPINOR_OP_EN4B : SPINOR_OP_EX4B_CYPRESS; + return nor->write_reg(nor, cmd, NULL, 0); default: /* Spansion style */ nor->cmd_buf[0] = enable << 7; diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index b9d66458a0..6df82bde94 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -123,6 +123,7 @@ #define SPINOR_OP_BRWR 0x17 /* Bank register write */ #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