Skip to content

Commit

Permalink
general-add-xtx-spi-nor-chips(:1)
Browse files Browse the repository at this point in the history
Original-Subject: 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 <microcaicai@gmail.com>
X-Armbian: Patch-File: general-add-xtx-spi-nor-chips
X-Armbian: Patch-File-Counter: 1
X-Armbian: Patch-Rel-Directory: patch/kernel/archive/rockchip64-6.1
X-Armbian: Patch-Type: kernel
X-Armbian: Patch-Root-Type: core
X-Armbian: Patch-Sub-Type: common
X-Armbian: Original-Subject: spi-nor: Add support for xt25f32b/xt25f128b
  • Loading branch information
microcai authored and Armbian AutoPatcher committed Jun 29, 2020
1 parent 4694c54 commit cfb8adc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mtd/spi-nor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spi-nor-objs += winbond.o
spi-nor-objs += xilinx.o
spi-nor-objs += xmc.o
spi-nor-$(CONFIG_DEBUG_FS) += debugfs.o
spi-nor-objs += xtx.o
obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o

obj-$(CONFIG_MTD_SPI_NOR) += controllers/
1 change: 1 addition & 0 deletions drivers/mtd/spi-nor/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,7 @@ static const struct spi_nor_manufacturer *manufacturers[] = {
&spi_nor_winbond,
&spi_nor_xilinx,
&spi_nor_xmc,
&spi_nor_xtx,
};

static const struct flash_info *spi_nor_match_id(struct spi_nor *nor,
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/spi-nor/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ extern const struct spi_nor_manufacturer spi_nor_sst;
extern const struct spi_nor_manufacturer spi_nor_winbond;
extern const struct spi_nor_manufacturer spi_nor_xilinx;
extern const struct spi_nor_manufacturer spi_nor_xmc;
extern const struct spi_nor_manufacturer spi_nor_xtx;

extern const struct attribute_group *spi_nor_sysfs_groups[];

Expand Down
21 changes: 21 additions & 0 deletions drivers/mtd/spi-nor/xtx.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2005, Intec Automation Inc.
* Copyright (C) 2014, Freescale Semiconductor, Inc.
*/

#include <linux/mtd/spi-nor.h>

#include "core.h"

static const struct flash_info xtx_parts[] = {
/* XTX (Shenzhen Xin Tian Xia Tech) */
{ "xt25f32b", INFO(0x0b4016, 0, 64 * 1024, 64) },
{ "xt25f128b", INFO(0x0b4018, 0, 64 * 1024, 256) },
};

const struct spi_nor_manufacturer spi_nor_xtx = {
.name = "xtx",
.parts = xtx_parts,
.nparts = ARRAY_SIZE(xtx_parts),
};

0 comments on commit cfb8adc

Please sign in to comment.