From patchwork Mon Jun 29 15:57:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: microcai X-Patchwork-Id: 1318913 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=nYa0m+DS; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fgIP8sWC; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49wXGj0J1yz9sQt for ; Tue, 30 Jun 2020 01:58:53 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:MIME-Version: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=xLjcoyHPpst2Bg5BKb/oyXIrasdN+qE3oAlGJHL9TIk=; b=nYa0m+DSW1ua1rCE7mIgn6cXIx 4IGjbOv3h5VpuIuCNWos7t+CXckoiopzsv2arDFJoE9kPuJmGjRdtahyHSjWIW9jhHvxtGvsg3mSv juJLl2bwQimVBSdMVrkeeKuFiVGg0qdWnLVyoP+uC9nMoTdzDKEQrPfKykD/RsAxgAQ+Qv4vbYeO7 XuNvVRrcAoTabJHbLs0DHYLp6L/+Nq0FL5mLx2b2dtNMxEi6zeynmSYIuvT7kajAxmDGmRayQ2E2J A5NaJI2GhufrUdXTI/QIWYSuB6xj5U8/eGcrgn1oOgFyaYIECm3BcriV5oAD0rLwBKrZptpp4OFLx I1XpIePA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpwAW-0004bH-Iz; Mon, 29 Jun 2020 15:58:04 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpwAU-0004Zz-OF for linux-mtd@lists.infradead.org; Mon, 29 Jun 2020 15:58:03 +0000 Received: by mail-lj1-x242.google.com with SMTP id 9so18600581ljc.8 for ; Mon, 29 Jun 2020 08:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=zMZEixiFTF5mevY+VAYJknP06+KYN1owPnfYBfA5mxY=; b=fgIP8sWCkgrxJ+mLPRUsnOUtmnT8rWOcMr5mr81MZdDyY8rho2NuX5xFE2H3wesszQ mcd1dx0F7G+izOpy6l1Q/1cxspZ9URShXtjWxPEXMgQNHqHh2baD4Zc8YGtdXnmJoGTl e0AhQuG8+eQlDwRxuPr/F7eDzV6euJu6nu1qMPZmhw1eGLMdGLg1ivo6v1RuuieZ0k9t jo/5HyLQ5hbOEViAErngn2fWTJ/buTp2J3IVsw7h9BqdCYXQfWPBQJbqc+Y4hayqRv8q FXjEYb18omFR0bm9d9fNMziFFh/tFowXdaPBVYNfNKDkPgX35VjGEcu/2ojH+eVtcP5J 5MFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=zMZEixiFTF5mevY+VAYJknP06+KYN1owPnfYBfA5mxY=; b=LdzPOGLx0bwaDYQtYXzwGdqIMSSAUnkgGQiS0mQd1KsJdRhWRF6p2p4XQLfSbecxWA aibO49Kpbg8Jtjer1JoAGzz1JRat/jppw924bpJHeP9wM5DxDrdfN2rb2I1CmYniNybN 8RvhMg9p2ogRtWw4PxDvo+jYEQkJ16rYaoUHLERGzW2xrCnx7cyoJWQV0tMh+Vj1FXKv R412ZAa7ud1ay8hdBmWI1kmmpwJDj4LuuEmIEXtCVS/g7czdc/WQfSrdlUkQo/lldmaN MkSztfEE1F2RBNjZcb3AiTwBBU4B5XTcrTHgZBhLag0aSI0N5a/8s7a2jEbksZEcAbuK 8e5A== X-Gm-Message-State: AOAM532NvCwVIDjCOID39CW1nKGMorNhVjWonUqtuOZCq9LKDtg76M3A 6+VeCz/7WN7HW8dVgUnjiPIfpX1awQXoJd5WP6U= X-Google-Smtp-Source: ABdhPJyJa1uJ8nWPgBY1njmJFVf8+PrABb1P8QVxFmDEpUU06Og534cpetWQyyaLbYaEtBrKco73a0FNHHfFhqvuMS8= X-Received: by 2002:a2e:7a03:: with SMTP id v3mr2178955ljc.141.1593446279815; Mon, 29 Jun 2020 08:57:59 -0700 (PDT) MIME-Version: 1.0 From: microcai Date: Mon, 29 Jun 2020 23:57:48 +0800 Message-ID: Subject: [PATCH] spi-nor: Add support for xt25f32b/xt25f128b To: tudor.ambarus@microchip.com X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:242 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [microcaicai[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mtd@lists.infradead.org, LKML Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From 5e308ec7332d01e84a3a5233f4cb8bd5a00026cf Mon Sep 17 00:00:00 2001 From: microcai Date: Mon, 29 Jun 2020 23:36:40 +0800 Subject: [PATCH] spi-nor: Add support for xt25f32b/xt25f128b The RockPi4b dev board ship with xt25f32b solded. add these ids so the board's spi flash can be accessed within linux. Signed-off-by: microcai --- drivers/mtd/spi-nor/Makefile | 1 + drivers/mtd/spi-nor/xtx.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 drivers/mtd/spi-nor/xtx.c diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile index 653923896205..3f7a52d7fa0b 100644 --- a/drivers/mtd/spi-nor/Makefile +++ b/drivers/mtd/spi-nor/Makefile @@ -17,6 +17,7 @@ spi-nor-objs += sst.o spi-nor-objs += winbond.o spi-nor-objs += xilinx.o spi-nor-objs += xmc.o +spi-nor-objs += xtx.o obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o obj-$(CONFIG_MTD_SPI_NOR) += controllers/ diff --git a/drivers/mtd/spi-nor/xtx.c b/drivers/mtd/spi-nor/xtx.c new file mode 100644 index 000000000000..05f2d69401b2 --- /dev/null +++ b/drivers/mtd/spi-nor/xtx.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2005, Intec Automation Inc. + * Copyright (C) 2014, Freescale Semiconductor, Inc. + */ + +#include + +#include "core.h" + +static const struct flash_info xtx_parts[] = { + /* XTX (Shenzhen Xin Tian Xia Tech) */ + { "xt25f32b", INFO(0x0b4016, 0, 64 * 1024, 64, SECT_4K) }, + { "xt25f128b", INFO(0x0b4018, 0, 64 * 1024, 256, SECT_4K) }, +}; + +const struct spi_nor_manufacturer spi_nor_xtx = { + .name = "xtx", + .parts = xtx_parts, + .nparts = ARRAY_SIZE(xtx_parts), +};