Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1222821rbb; Mon, 26 Feb 2024 02:45:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVci2MqiuEe4iu/cnxM9Cau1uL4O+K/vTzP5c8LZpMiPn96x7DaM0J4COztT5LeMX+eoo0F6Za5bnfF0ArU1P7f1h1iPxctCTLwOf5hJg== X-Google-Smtp-Source: AGHT+IHLR/T0WevQmHXOlbjdJUNQFQhpFPADHSYY7hAyfWd5PZg+VeGQlE6IBmuw2N/qNXaFgYOP X-Received: by 2002:a17:906:360a:b0:a3e:ce27:15a2 with SMTP id q10-20020a170906360a00b00a3ece2715a2mr6884646ejb.28.1708944300596; Mon, 26 Feb 2024 02:45:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708944300; cv=pass; d=google.com; s=arc-20160816; b=T6HQ+bRElDJ5bZiwQ9Kf/p2FRCwMmA2thC48z0SwfMayDCAHpSJo3gMRKiw2x/3cAh OfN5DmjBBLQnok/nrmsZcsuOVNdlJ9Js5Jjv6tJn0VfciGYnXl1iSMvvc/KSd0LIT3+a 92Q8RmVZeX50HCQHZcxSdUKOGl/cVEUgJDq5g29ZfwqOZN7KPst+1FRNbhgbC63dHRDP dFyESRmv5xMqr8BC7mDWv/O1RzqWxfBRYPIxSaIzJOkllM+NUQKxseuJyd/eh+ntwKzg Zqty37ITqJXnIDHYRY/YFhxQf2kQ3kQjRbC/pYn1wiry9PDLCFbAPOMZLYOlB6zl1LVu 9scQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=GjFvSsWMQF//AIRWMkIQWeYqQcroXAOSfkVX4RVpqIs=; fh=/1STbxAIgMcGmfPDmQY9Qa9CQcd8vtC0UBh6c/QvATI=; b=mqRm0ghet3AZksLnr/opwJ0xHlQoxr5Tnis59Dpe03uj2qCj8RjuUhqNqXTkuIvCUS 1Y4S5C/K+ReodPdk0Hbnmg5IxJfbnXnK8LJ7rEAKyrfj24yLAFKz1ZSXWC6E69taAgWB HeT7V21aWaADhnGnbPL9VekAy2qvgVL1ltzftkA2CXCXUq/HSg5RNriRELvRobDXC1If mpKjDLpKXqcHaUbvfa4H7rfNn93TbVVJUoUTwlHzGWDvSp7o1dQS01XAPFCFMuHBN5vk shA78JFi9i+9smHeN/RH6N1TkrCWaE4W9xLTziC3WMFGHAcIR6P0MzoSkkP/YyC4LXxs TCxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=tecon.ru dmarc=pass fromdomain=tecon.ru); spf=pass (google.com: domain of linux-kernel+bounces-81178-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81178-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=tecon.ru Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n21-20020a170906165500b00a3eba52b3ffsi1924504ejd.821.2024.02.26.02.45.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:45:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81178-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=tecon.ru dmarc=pass fromdomain=tecon.ru); spf=pass (google.com: domain of linux-kernel+bounces-81178-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81178-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=tecon.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5C23B1F251AD for ; Mon, 26 Feb 2024 10:45:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A645648CC6; Mon, 26 Feb 2024 10:42:17 +0000 (UTC) Received: from mail.tecon.ru (mail.tecon.ru [82.112.190.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7E1C1DDF2 for ; Mon, 26 Feb 2024 10:42:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.112.190.120 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708944137; cv=none; b=pmL8uEpp1ZyFROVqT/qqeL7KQnw+tXb1S96SIzZVkYzuqAPlJGAwhwOsAuuugj1NxeVUxAvabt9WreBpnr5LdUvFnQ+HYl2vFMCwPHfvurdKdatH3bkIN0VX17Lm6ho6feiOSZfLGg/qOboC/uVZyaNxOHVThSeR5REsJJg905U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708944137; c=relaxed/simple; bh=zyNhrX2MVbvnqyKCu8lbBxzBNryOLSqO8SEiSi2jKFE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TinIiknRPhce+ioMhqhj7wc5YS9eUzu1fGXfJ6cebhTh3YGXxu6iejw7TKbFKuEFIY/mxzgaV7RoOo/D+LQBYsuok3xAUnGdnuiM6glX/mkKRIn8ktxLIT21Iz8iWV5ip5eoT02Vd9Yfxeho+N3TnDOED3BCpCs3/tw/HRNDq8c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=tecon.ru; spf=pass smtp.mailfrom=tecon.ru; arc=none smtp.client-ip=82.112.190.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=tecon.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tecon.ru From: Dmitry Dunaev To: CC: , Dmitry Dunaev , Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , , Subject: [PATCH v2] mtd: spi-nor: Add Puya Semiconductor chips driver Date: Mon, 26 Feb 2024 13:40:59 +0300 Message-ID: <20240226104101.1848855-1-dunaev@tecon.ru> In-Reply-To: <9ebf9cdf-eeba-417a-8410-3f87a0973136@linaro.org> References: <9ebf9cdf-eeba-417a-8410-3f87a0973136@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Add a SPI NOR manufacturer driver for Puya Semiconductor chips Signed-off-by: Dmitry Dunaev --- drivers/mtd/spi-nor/Makefile | 1 + drivers/mtd/spi-nor/core.c | 1 + drivers/mtd/spi-nor/core.h | 1 + drivers/mtd/spi-nor/puya.c | 64 ++++++++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 drivers/mtd/spi-nor/puya.c diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile index 5e68468b72fc..3e22039d0432 100644 --- a/drivers/mtd/spi-nor/Makefile +++ b/drivers/mtd/spi-nor/Makefile @@ -10,6 +10,7 @@ spi-nor-objs += intel.o spi-nor-objs += issi.o spi-nor-objs += macronix.o spi-nor-objs += micron-st.o +spi-nor-objs += puya.o spi-nor-objs += spansion.o spi-nor-objs += sst.o spi-nor-objs += winbond.o diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 4129764fad8c..09ad2142d004 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2045,6 +2045,7 @@ static const struct spi_nor_manufacturer *manufacturers[] = { &spi_nor_issi, &spi_nor_macronix, &spi_nor_micron, + &spi_nor_puya, &spi_nor_st, &spi_nor_spansion, &spi_nor_sst, diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index d36c0e072954..93df7a6328ca 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -609,6 +609,7 @@ extern const struct spi_nor_manufacturer spi_nor_intel; extern const struct spi_nor_manufacturer spi_nor_issi; extern const struct spi_nor_manufacturer spi_nor_macronix; extern const struct spi_nor_manufacturer spi_nor_micron; +extern const struct spi_nor_manufacturer spi_nor_puya; extern const struct spi_nor_manufacturer spi_nor_st; extern const struct spi_nor_manufacturer spi_nor_spansion; extern const struct spi_nor_manufacturer spi_nor_sst; diff --git a/drivers/mtd/spi-nor/puya.c b/drivers/mtd/spi-nor/puya.c new file mode 100644 index 000000000000..2198a9ed7101 --- /dev/null +++ b/drivers/mtd/spi-nor/puya.c @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2024, Tecon MT LLC. + */ + +#include + +#include "core.h" + +/* Puya Semiconductor (Shanghai) Co., Ltd */ +static const struct flash_info puya_nor_parts[] = { + { + .id = SNOR_ID(0x85, 0x60, 0x10), + .name = "p25q05h", + .size = SZ_64K, + .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + }, { + .id = SNOR_ID(0x85, 0x60, 0x11), + .name = "p25q10h", + .size = SZ_128K, + .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + }, { + .id = SNOR_ID(0x85, 0x60, 0x12), + .name = "p25q20h", + .size = SZ_256K, + .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + }, { + .id = SNOR_ID(0x85, 0x60, 0x13), + .name = "p25q40h", + .size = SZ_512K, + .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + }, { + .id = SNOR_ID(0x85, 0x60, 0x14), + .name = "p25q80h", + .size = SZ_1M, + .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + }, { + .id = SNOR_ID(0x85, 0x60, 0x15), + .name = "p25q16h", + .size = SZ_2M, + .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + }, { + .id = SNOR_ID(0x85, 0x60, 0x16), + .name = "p25q32h", + .size = SZ_4M, + .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + }, { + .id = SNOR_ID(0x85, 0x60, 0x17), + .name = "p25q64h", + .size = SZ_8M, + .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + }, { + .id = SNOR_ID(0x85, 0x60, 0x18), + .name = "p25q128h", + .size = SZ_8M, + .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + } +}; + +const struct spi_nor_manufacturer spi_nor_puya = { + .name = "puya", + .parts = puya_nor_parts, + .nparts = ARRAY_SIZE(puya_nor_parts), +}; -- 2.34.1