Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BCBC8C4332F for ; Sun, 11 Dec 2022 15:55:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D742D852AA; Sun, 11 Dec 2022 16:55:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=intel.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=intel.com header.i=@intel.com header.b="hLkvqYKy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BAC97852AA; Sun, 11 Dec 2022 16:55:15 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0C1FB852A9 for ; Sun, 11 Dec 2022 16:55:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=jitloonl@ecsmtp.png.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670774113; x=1702310113; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=kJsfEeE5QVoKdfK0jYKMqYJINOTs+rApShwwrbT3Fvg=; b=hLkvqYKyoPxeIbeYBpxy4fGKPiifbztgHxjXH6jBWcwOEPoHX4qLV+hC 0GbvVoplnbney++3mUzr7ZG1TMuaIPipGE0dYq5if2msWW2LLcvUMYADq 6dd3Z9JNM7DozfnMiocrzs8uc74JNGe3Q3fmUCSd/yWUSQdJgcDlHTo7K 2MJ5svfEEoWkJChK0+Tyu9DoPa4p7LoD8pNPqFtG6WD5cdKDgroj0oP9q i/LE0ydNS1mBwVW3d0lOeo4upB4he240mrq7tnO/cGEOesPXAv8mvlpG9 pVsbs3QuUhGfflqzM6aKsFVlGFp3ootpfT+wXMo+D/dDe3GbikXJ47s8d g==; X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="403966182" X-IronPort-AV: E=Sophos;i="5.96,236,1665471600"; d="scan'208";a="403966182" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2022 07:55:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="647902046" X-IronPort-AV: E=Sophos;i="5.96,236,1665471600"; d="scan'208";a="647902046" Received: from pglmail07.png.intel.com ([10.221.193.207]) by orsmga002.jf.intel.com with ESMTP; 11 Dec 2022 07:55:06 -0800 Received: from localhost (pgli0028.png.intel.com [10.221.84.177]) by pglmail07.png.intel.com (Postfix) with ESMTP id 3E8296F; Sun, 11 Dec 2022 23:55:06 +0800 (+08) Received: by localhost (Postfix, from userid 12048045) id 38D59E00218; Sun, 11 Dec 2022 23:55:06 +0800 (+08) From: Jit Loon Lim To: u-boot@lists.denx.de Cc: Jagan Teki , Vignesh R , Marek , Simon , Tien Fong , Kok Kiang , Siew Chin , Sin Hui , Raaj , Dinesh , Boon Khai , Alif , Teik Heng , Hazim , Jit Loon Lim , Sieu Mun Tang , Lokanathan@ecsmtp.png.intel.com Subject: [PATCH] mtd: spi: Add ISSI QSPI to lightweight SPI flash stack for spl Date: Sun, 11 Dec 2022 23:55:04 +0800 Message-Id: <20221211155504.24741-1-jit.loon.lim@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.6 at phobos.denx.de X-Virus-Status: Clean From: "Lokanathan, Raaj" Add support for reading data/images from this ISSI QSPI flash. Signed-off-by: Lokanathan, Raaj Signed-off-by: Jit Loon Lim --- drivers/mtd/spi/spi-nor-tiny.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-tiny.c b/drivers/mtd/spi/spi-nor-tiny.c index 68152ce3b4..6a5da38cb1 100644 --- a/drivers/mtd/spi/spi-nor-tiny.c +++ b/drivers/mtd/spi/spi-nor-tiny.c @@ -219,6 +219,7 @@ static inline int set_4byte(struct spi_nor *nor, const struct flash_info *info, case SNOR_MFR_MICRON: /* Some Micron need WREN command; all will accept it */ need_wren = true; + case SNOR_MFR_ISSI: case SNOR_MFR_MACRONIX: case SNOR_MFR_WINBOND: if (need_wren) @@ -432,7 +433,7 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len, return -ENOTSUPP; } -#ifdef CONFIG_SPI_FLASH_MACRONIX +#if defined(CONFIG_SPI_FLASH_MACRONIX) || defined(CONFIG_SPI_FLASH_ISSI) /** * macronix_quad_enable() - set QE bit in Status Register. * @nor: pointer to a 'struct spi_nor' @@ -661,8 +662,9 @@ static int spi_nor_setup(struct spi_nor *nor, const struct flash_info *info, /* Enable Quad I/O if needed. */ if (spi_nor_get_protocol_width(nor->read_proto) == 4) { switch (JEDEC_MFR(info)) { -#ifdef CONFIG_SPI_FLASH_MACRONIX +#if defined(CONFIG_SPI_FLASH_MACRONIX) || defined(CONFIG_SPI_FLASH_ISSI) case SNOR_MFR_MACRONIX: + case SNOR_MFR_ISSI: err = macronix_quad_enable(nor); break; #endif -- 2.26.2