Commit Graph

8623 Commits

Author SHA1 Message Date
Jon Lin
c981b50cb2 mtd: spinand: gigadevice: Support new GD5F1GM7UxG
Change-Id: Ic0c9817afd04d281c614f8043b320857bc0ca4ac
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-03-15 16:39:38 +08:00
Jon Lin
cd7c4819ab mtd: spi-nor: xtx: Add code
Change-Id: I789d0662cc77f038fd0521749274c3d484a42bfc
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-03-15 11:42:18 +08:00
Jon Lin
a3df8a05a6 mtd: spi-nor: xmc: Support new devices
XM25QH32C, XM25QH64C, XM25QU64C, XM25QH128B, XM25QH128C, XM25QU128C

Change-Id: I3a305f3a7359803c707c7efd7973cfcf1c8a4a32
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-03-15 11:42:18 +08:00
Jon Lin
a5456f1383 mtd: spi-nor: gigadevice: Support gd25q512
Change-Id: I2f0368bffb6002a21126f35eb555909339dcc5ae
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-03-15 11:42:18 +08:00
Jon Lin
28d87a7fab mtd: spi-nor: gigadevice: Add support gd25lb512m gd25b512m
Change-Id: Ibaa1807d5bb00627a3c3889f7290b3f8fe5f8f82
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-03-03 18:37:44 +08:00
Jon Lin
592eb21c88 mtd: spi-nor: eon: Enable SECT_4K erase for en25qh128 and en25qh256
Change-Id: I62b462ba666a7975618bf467ec8296353538515f
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-02-22 15:04:44 +08:00
Jaime Liao
c50772fd65 UPSTREAM: mtd: spinand: macronix: Add Quad support for serial NAND flash
Adding FLAG "SPINAND_HAS_QE_BIT" for Quad mode support on Macronix
Serial Flash.
Validated via normal(default) and QUAD mode by read, erase, read back,
on Xilinx Zynq PicoZed FPGA board which included Macronix
SPI Host(drivers/spi/spi-mxic.c).

Change-Id: I7951dd4705cdc7e03bd697da33d216cfd5237b4c
Signed-off-by: Jaime Liao <jaimeliao@mxic.com.tw>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/1628472472-32008-1-git-send-email-jaimeliao@mxic.com.tw
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 6f802696c2)
2022-01-27 20:08:24 +08:00
Tao Huang
f6909c028f Merge tag 'ASB-2021-12-05_12-5.10' of https://android.googlesource.com/kernel/common
https://source.android.com/security/bulletin/2021-12-01
CVE-2021-33909
CVE-2021-38204
CVE-2021-0961

* tag 'ASB-2021-12-05_12-5.10': (3010 commits)
  ANDROID: workqueue: export symbol of the function wq_worker_comm()
  ANDROID: GKI: Update symbols to symbol list
  ANDROID: vendor_hooks: Add hooks for binder proc transaction
  ANDROID: GKI: Add symbols abi for USB IP kernel modules.
  ANDROID: GKI: Fix file mode on mtk abi file
  UPSTREAM: erofs: fix deadlock when shrink erofs slab
  ANDROID: init_task: Init android vendor and oem data
  UPSTREAM: sched/core: Mitigate race cpus_share_cache()/update_top_cache_domain()
  ANDROID: Update symbol list for mtk
  UPSTREAM: erofs: fix unsafe pagevec reuse of hooked pclusters
  UPSTREAM: erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()
  UPSTREAM: usb: dwc3: gadget: Fix null pointer exception
  ANDROID: fips140: support "evaluation testing" builds via build.sh
  FROMGIT: sched/scs: Reset task stack state in bringup_cpu()
  ANDROID: dma-buf: heaps: fix dma-buf heap pool pages stat
  ANDROID: ABI: Add several spi_mem related symbols
  UPSTREAM: spi: spi-mem: add spi_mem_dtr_supports_op()
  ANDROID: gki_defconfig: enable CONFIG_SPI_MEM
  ANDROID: ABI: Add several iio related symbols
  ANDROID: ABI: Update symbol list for IMX
  ...

Change-Id: I09cddc92fa34553b944e62cc5cbbba94a84e5437

Conflicts:
	arch/arm/boot/dts/rk322x.dtsi
	arch/arm64/boot/dts/rockchip/rk3399.dtsi
	drivers/dma-buf/heaps/system_heap.c
	drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
	drivers/gpu/drm/rockchip/rockchip_drm_vop.c
	drivers/gpu/drm/rockchip/rockchip_lvds.c
	drivers/gpu/drm/rockchip/rockchip_vop_reg.c
	drivers/mtd/nand/spi/core.c
	drivers/pci/controller/pcie-rockchip-host.c
	drivers/soc/rockchip/Kconfig
	drivers/usb/dwc3/core.c
	drivers/usb/dwc3/core.h
2021-12-14 17:09:02 +08:00
Jon Lin
f6ec516777 mtd: spinand: foresee: Add support for F35SQA002G
Support F35SQA002G

Change-Id: Ia5e695893e9a961645592da127cef7b7419355a7
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-11-18 09:33:26 +08:00
Jon Lin
d76a1073a7 mtd: spinand: Fix hyf devices read id information
Change to SPINAND_READID_METHOD_OPCODE_ADDR

Change-Id: I1114895634c03496e28d392ed06f5add3c19f4d9
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-11-15 17:58:31 +08:00
Jon Lin
1b6a02851b mtd: spinand: Fix etron devices read id information
Change to SPINAND_READID_METHOD_OPCODE_ADDR

Change-Id: Ie159a0ede287d2c157890d768b2c73238ed53608
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-11-15 17:58:31 +08:00
Jon Lin
ab64e61f7f mtd: spinand: Fix XTX devices read id information
Change to SPINAND_READID_METHOD_OPCODE_ADDR

Change-Id: I1a1f444dc7e4f6431efc0ba2dea20b2a5629803d
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-11-15 17:58:31 +08:00
Jon Lin
be2891ed31 mtd: torturetest: Support random pattern
insmod /oem/mtd_torturetest.ko dev=5 check=0 cycles_count=10 random_pattern=1

Change-Id: I8919da8241e7d3af6925aa7a377027e0c3d7d7f8
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-11-05 11:59:27 +08:00
Jon Lin
2690841f52 mtd: readtest: Support setting cycle test
insmod /oem/mtd_readtest.ko dev=3 cycles_count=10

Change-Id: Ib2e72c51f776fb39be1229d3e9a0180c10a2bed5
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-11-04 19:04:43 +08:00
Jon Lin
2fb4d11d5e mtd: spinand: Support xtx
XT26G01A, XT26G02A, XT26G04A, XT26G01B, XT26G02B, XT26G01C, XT26G02C,
XT26G04C, XT26G11C

Change-Id: I3397f0a1f29c09a10446b3838504dc77d867f124
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
c691a1418d mtd: spinand: winbond: Support new devices
W25N512GV, W25N02KV, W25N04KV, W25N01GW

Change-Id: If178c6cf7024ec961593b235229a9f7a4366df33
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
ac2cf3c621 mtd: spinand: Support unim
TX25G01

Change-Id: Ifebf63cc803870602c627c741d1cd51c65977b6b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
fce55885fd mtd: spinand: Support silicongo
SGM7000I-S24W1GH

Change-Id: I8bdaa383fd5977b4ee0828a04ddc738a1af0376a
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
fea785563f mtd: spinand: Support jsc
JS28U1GQSCAHG-83

Change-Id: Idf5062e23ccf1174c4f3096d86ce1975dc6b5c19
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
96ff56ea58 mtd: spinand: Support hyf
HYF1GQ4UPACAE, HYF1GQ4UDACAE, HYF2GQ4UAACAE, HYF2GQ4UHCCAE, HYF4GQ4UAACBE

Change-Id: I173aa2fbe8275a776fd63eb9c6d29b3589b7fe1c
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
9e2b33c54c mtd: spinand: gigadevice: Support new devices
GD5F2GQ5UExxG, GD5F2GQ4UBxxG, GD5F4GQ6UExxG, GD5F1GQ4UExxH, GD5F1GQ5RExxG,
GD5F2GQ5RExxG, GD5F2GM7RxG, GD5F2GM7UxG

Change-Id: Id2ec65a21bcdfc7687e57896513694609f34c48e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
911bb5158a mtd: spinand: Support foresee
FS35ND01G-S1Y2, FS35ND02G-S3Y2, FS35ND04G-S2Y2, fsxxndxxg

Change-Id: Icdff45a209b5aa4dd2827e0e58bd543a84f9d809
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
205a24e347 mtd: spinand: Support fmsh
FM25S01A, FM25S02A, FM25S01

Change-Id: I7e0ceec39c57dc591d77a4ebde599ad326cf25b7
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
8506f6e6e7 mtd: spinand: Support etron
EM73C044VCF-0H

Change-Id: Ia61c2f4b20a1590c8208244cc984e1909108b1e1
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
560380d22f mtd: spinand: Support esmt
F50L1G41LB

Change-Id: I4a42522d775b511e9c049b5481ebc35e00821f95
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
cead43cc57 mtd: spinand: Support dosilicon
DS35X1GA, DS35Q2GA, DS35M1GA, DS35M2GA, DS35Q2GB, DS35M1GB

Change-Id: I5aeb0219f01dbe98d36b398e66b94ab31b07788e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
1f221f71d8 mtd: spinand: Support biwin
BWJX08K

Change-Id: I0e269e47b264190951c19f4315706b40d3b765e5
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-10-18 18:56:19 +08:00
Jon Lin
7c03ed057c mtd: spinand: core: Support suspend/resume/shutdown
Spinand may power off after suspending, so the corresponding resume
process is necessary.

Change-Id: I36c7dbf23877b342dfe9e7fb0c8eb4885bd46d71
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-22 16:53:58 +08:00
Jon Lin
ad26535135 mtd: spi-nor: gigadevice: Add support gd25lq255e
Change-Id: Iee74cbf20dbdbc00637d77a17369b837cbfc29c6
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-22 11:44:22 +08:00
Tudor Ambarus
9c9cd780f9 UPSTREAM: mtd: spi-nor: macronix: Fix name for mx66l51235f
According to macronix website, there is no mx66l51235l part number.
The chip detected as such is actually mx66l51235f. Rename the flash.
Do not update the mx66l51235l name from the spi_nor_dev_ids[], since
there are dt that are using this compatible.

Change-Id: I23594ca8301572df8024b413379e1d688f8ca793
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit d406f49b05)
2021-09-16 10:35:45 +08:00
Shuhao Mai
6676caeae1 UPSTREAM: mtd: spi-nor: winbond: Add support for w25q512jvq
Add support for w25q512jvq. This is of the same series chip with
w25q256jv, which is already supported, but with size doubled and
different JEDEC ID.

Tested on Intel whitley platform with dd from/to the flash for
read/write respectly, and flash_erase for erasing the flash.

Change-Id: I3b4243a0391ae994af131062a8a21f659494fccb
Signed-off-by: Shuhao Mai <shuhao.mai.1990@gmail.com>
[ta: put flash_info flags in order, first SPI_NOR_DUAL_READ, then
SPI_NOR_QUAD_READ]
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20210208075303.4200-1-shuhao.mai.1990@gmail.com
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit ff013330fb)
2021-09-16 10:35:44 +08:00
Reto Schneider
8d2673c6a0 UPSTREAM: mtd: spinand: gigadevice: Support GD5F1GQ5UExxG
The relevant changes to the already existing GD5F1GQ4UExxG support has
been determined by consulting the GigaDevice product change notice
AN-0392-10, version 1.0 from November 30, 2020.

As the overlaps are huge, variable names have been generalized
accordingly.

Apart from the lowered ECC strength (4 instead of 8 bits per 512 bytes),
the new device ID, and the extra quad IO dummy byte, no changes had to
be taken into account.

New hardware features are not supported, namely:
 - Power on reset
 - Unique ID
 - Double transfer rate (DTR)
 - Parameter page
 - Random data quad IO

The inverted semantic of the "driver strength" register bits, defaulting
to 100% instead of 50% for the Q5 devices, got ignored as the driver has
never touched them anyway.

The no longer supported "read from cache during block erase"
functionality is not reflected as the current SPI NAND core does not
support it anyway.

Implementation has been tested on MediaTek MT7688 based GARDENA smart
Gateways using both, GigaDevice GD5F1GQ5UEYIG and GD5F1GQ4UBYIG.

Change-Id: I0e819a07711e58542af2bcf753b4ecb10eb9f882
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210211113619.3502-1-code@reto-schneider.ch
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 469b992489)
2021-09-16 10:35:44 +08:00
Thirumalesha Narasimhappa
408217c2f7 UPSTREAM: mtd: spinand: micron: Add support for MT29F2G01AAAED
The MT29F2G01AAAED is a single die, 2Gb Micron SPI NAND Flash with 4-bit
ECC

Change-Id: I6b1baaef7e092bf932a8fdbcb66d3db2e36ef900
Signed-off-by: Thirumalesha Narasimhappa <nthirumalesha7@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20201108113735.2533-3-nthirumalesha7@gmail.com
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 8c573d9419)
2021-09-16 10:35:44 +08:00
Thirumalesha Narasimhappa
f9df464e4c UPSTREAM: mtd: spinand: micron: Use more specific names
Rename the read/write/update of SPINAND_OP_VARIANTS() to more
specialized names.

Change-Id: I5c02b9bf76376ea4ed320cf49be1f7630329dfc3
Signed-off-by: Thirumalesha Narasimhappa <nthirumalesha7@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20201108113735.2533-2-nthirumalesha7@gmail.com
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit bdb84a22b0)
2021-09-16 09:50:33 +08:00
Miquel Raynal
91915f631e UPSTREAM: mtd: spinand: Fill a default ECC provider/algorithm
The SPI-NAND layer default is on-die ECC because until now it was the
only one supported. New SPI-NAND chip flavors might use something else
as ECC engine provider but this will always be the default if the user
does not choose explicitly something else.

Change-Id: Ia437dda2d2a43007bf04e2e6a072610c283c97d6
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200930154109.3922-6-miquel.raynal@bootlin.com
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit c8efe01028)
2021-09-16 09:36:51 +08:00
Miquel Raynal
a516594d0c UPSTREAM: mtd: spinand: Instantiate a SPI-NAND on-die ECC engine
Make use of the existing functions taken from the SPI-NAND core to
instantiate an on-die ECC engine specific to the SPI-NAND core. The
next step will be to tweak the core to use this object instead of
calling the helpers directly.

Change-Id: I91c0f9cd7da6f805fdd21b1a014c3446c6fa8813
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200930154109.3922-4-miquel.raynal@bootlin.com
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 945845b54c)
2021-09-16 09:35:17 +08:00
Miquel Raynal
4ac6f9b33e UPSTREAM: mtd: spinand: Move ECC related definitions earlier in the driver
Prepare the creation of a SPI-NAND on-die ECC engine by gathering the
ECC-related code earlier enough in the core to avoid the need for
forward declarations.

The next step is to actually create that engine by implementing the
generic ECC interface.

Change-Id: I1730a95750b49f2f6653bbf8db81478e7819f4c6
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200930154109.3922-3-miquel.raynal@bootlin.com
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 55a1a71a7f)
2021-09-16 09:34:40 +08:00
Jaime Liao
be50629ec0 UPSTREAM: mtd: spinand: macronix: Add support for serial NAND flash
Macronix NAND Flash devices are available in different configurations
and densities.

MX"35" means SPI NAND
MX35"LF"/"UF" , LF means 3V and UF meands 1.8V
MX35LF"2G" , 2G means 2Gbits
MX35LF2G"E4"/"24"/"14",
E4 means internal ECC and Quad I/O(x4)
24 means 8-bit ecc requirement and Quad I/O(x4)
14 means 4-bit ecc requirement and Quad I/O(x4)

MX35LF2G14AC is 3V 2Gbit serial NAND flash device
(without on-die ECC)
https://www.mxic.com.tw/Lists/Datasheet/Attachments/7926/MX35LF2G14AC,%203V,%202Gb,%20v1.1.pdf

MX35UF4G24AD is 1.8V 4Gbit serial NAND flash device
(without on-die ECC)
https://www.mxic.com.tw/Lists/Datasheet/Attachments/7980/MX35UF4G24AD,%201.8V,%204Gb,%20v0.00.pdf

MX35UF4GE4AD/MX35UF2GE4AD are 1.8V 4G/2Gbit serial
NAND flash device with 8-bit on-die ECC
https://www.mxic.com.tw/Lists/Datasheet/Attachments/7983/MX35UF4GE4AD,%201.8V,%204Gb,%20v0.00.pdf

MX35UF2GE4AC/MX35UF1GE4AC are 1.8V 2G/1Gbit serial
NAND flash device with 8-bit on-die ECC
https://www.mxic.com.tw/Lists/Datasheet/Attachments/7974/MX35UF2GE4AC,%201.8V,%202Gb,%20v1.0.pdf

MX35UF2G14AC/MX35UF1G14AC are 1.8V 2G/1Gbit serial
NAND flash device (without on-die ECC)
https://www.mxic.com.tw/Lists/Datasheet/Attachments/7931/MX35UF2G14AC,%201.8V,%202Gb,%20v1.1.pdf

Validated via normal(default) and QUAD mode by read, erase, read back,
on Xilinx Zynq PicoZed FPGA board which included Macronix
SPI Host(drivers/spi/spi-mxic.c).

Change-Id: I9f5e6cd3aee2f8951c8f16e1d1c24c13f13511fc
Signed-off-by: Jaime Liao <jaimeliao@mxic.com.tw>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/1621475108-22523-1-git-send-email-jaimeliao@mxic.com.tw
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit c374839f9b)
2021-09-16 09:32:26 +08:00
YouChing Lin
72b926e26f UPSTREAM: mtd: spinand: macronix: Add support for MX35LFxG24AD
The Macronix MX35LF1G24AD(/2G24AD/4G24AD) are 3V, 1G/2G/4Gbit serial
SLC NAND flash device (without on-die ECC).

Validated by read, erase, read back, write, read back on Xilinx Zynq
PicoZed FPGA board which included Macronix SPI Host(drivers/spi/spi-mxic.c)
& S/W BCH ecc(drivers/mtd/nand/ecc-sw-bch.c) with bug fixing patch
(mtd: nand: ecc-bch: Fix the size of calc_buf/code_buf of the BCH).

Change-Id: I88c68306bdc61a856cef9e5af1bc4c1e19fc2abd
Signed-off-by: YouChing Lin <ycllin@mxic.com.tw>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/1607570529-22341-3-git-send-email-ycllin@mxic.com.tw
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit ee4e0eafa4)
2021-09-16 09:31:59 +08:00
YouChing Lin
57aaaa225f UPSTREAM: mtd: spinand: macronix: Add support for MX35LFxGE4AD
The Macronix MX35LF2GE4AD / MX35LF4GE4AD are 3V, 2G / 4Gbit serial
SLC NAND flash device (with on-die ECC).

Validated by read, erase, read back, write, read back and nandtest
on Xilinx Zynq PicoZed FPGA board which included Macronix SPI Host
(drivers/spi/spi-mxic.c).

Change-Id: I1603b4acd8c62720de245d70543b4743deaa7ad5
Signed-off-by: YouChing Lin <ycllin@mxic.com.tw>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/1604561020-13499-1-git-send-email-ycllin@mxic.com.tw
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 5ece78de88)
2021-09-16 09:31:59 +08:00
Jon Lin
954b859e88 mtd: spinand: Enable MTD_NAND_BBT_USING_FLASH
Using BBT in flash to avoid frequently flash operation for bbt info.
And it's secure to record the bad block info in bbt instead of
programing to the bad block with extremely unstable performance directly.

Change-Id: Icfe816c2c17ff3b747ce0a2512b1d9d6d0129fa0
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-15 10:45:22 +08:00
Jon Lin
9c5560bfce mtd: nand: add BBT using flash management strategy
Support storing ram BBT into flash.

Change-Id: I42c2e91779e5385d959a4ce3807006074ae17483
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-15 10:45:22 +08:00
Doyle, Patrick
922d9619af UPSTREAM: mtd: nand: bbt: Fix corner case in bad block table handling
In the unlikely event that both blocks 10 and 11 are marked as bad (on a
32 bit machine), then the process of marking block 10 as bad stomps on
cached entry for block 11.  There are (of course) other examples.

Signed-off-by: Patrick Doyle <pdoyle@irobot.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Yoshio Furuyama <ytc-mb-yfuruyama7@kioxia.com>
[<miquel.raynal@bootlin.com>: Fixed the title]
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/774a92693f311e7de01e5935e720a179fb1b2468.1616635406.git.ytc-mb-yfuruyama7@kioxia.com
(cherry picked from commit fd0d8d85f7)
Change-Id: Ic3afc21e5f3e40950ed45036a41c57982983c70c
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-15 10:19:21 +08:00
Jon Lin
db0f003c66 mtd: nand: bbt: Fix error in BBT block location methord
Avoid the high 32btis input param of GENMASK bigger then BITS_PER_LONG.

For example offs 62, bits_per_block 3, and BITS_PER_LONG 64, then:
GENMASK(offs + bits_per_block - 1, offs) -> GENMASK(64, 62) -> 0.
But actually we want to mask GENMASK(63, 62) which is equals to
0xc000000000000000.

Change-Id: Ie3ee89a4b3e3deca45ccf429bfdfc5b88e3e6b9c
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-09 16:39:20 +08:00
Jon Lin
9ac1ea44cb mtd: spinand: alias spinand0
RK SDK solution develop a serials of support for better compatibility.
All of these is based on "spinand0" alias.

Change-Id: I6603221de66eb6a6cc8ebeafa42a0282d7ddd4e8
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-08 15:21:10 +08:00
Jon Lin
5fcb2ec048 mtd: spi-nor: Change to sfc_nor alias
RK SDK solution develop a serials of support for better compatibility.
All of these is based on "sfc_nor" alias.

Change-Id: I4291a07420f4ad9f02a4d0ef3498061ae910cd7a
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-08 15:19:27 +08:00
Frieder Schrempf
ded6da217c mtd: spinand: Fix incorrect parameters for on-die ECC
The new generic NAND ECC framework stores the configuration and
requirements in separate places since commit 93ef92f6f4 ("mtd: nand: Use
the new generic ECC object"). In 5.10.x The SPI NAND layer still uses only
the requirements to track the ECC properties. This mismatch leads to
values of zero being used for ECC strength and step_size in the SPI NAND
layer wherever nanddev_get_ecc_conf() is used and therefore breaks the SPI
NAND on-die ECC support in 5.10.x.

By using nanddev_get_ecc_requirements() instead of nanddev_get_ecc_conf()
for SPI NAND, we make sure that the correct parameters for the detected
chip are used. In later versions (5.11.x) this is fixed anyway with the
implementation of the SPI NAND on-die ECC engine.

Cc: stable@vger.kernel.org # 5.10.x
Reported-by: voice INTER connect GmbH <developer@voiceinterconnect.de>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-03 10:09:28 +02:00
Andreas Persson
779a0f4347 mtd: cfi_cmdset_0002: fix crash when erasing/writing AMD cards
commit 2394e62873 upstream.

Erasing an AMD linear flash card (AM29F016D) crashes after the first
sector has been erased. Likewise, writing to it crashes after two bytes
have been written. The reason is a missing check for a null pointer -
the cmdset_priv field is not set for this type of card.

Fixes: 4844ef8030 ("mtd: cfi_cmdset_0002: Add support for polling status register")
Signed-off-by: Andreas Persson <andreasp56@outlook.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/DB6P189MB05830B3530B8087476C5CFE4C1159@DB6P189MB0583.EURP189.PROD.OUTLOOK.COM
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 08:35:33 -04:00
Yang Yingliang
c183b55ed7 mtd: rawnand: marvell: add missing clk_disable_unprepare() on error in marvell_nfc_resume()
[ Upstream commit ae94c49527 ]

Add clk_disable_unprepare() on error path in marvell_nfc_resume().

Fixes: bd9c3f9b3c ("mtd: rawnand: marvell: add suspend and resume hooks")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210601125814.3260364-1-yangyingliang@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:56:47 +02:00
Miquel Raynal
cf05986cc4 mtd: rawnand: arasan: Ensure proper configuration for the asserted target
[ Upstream commit b5437c7b68 ]

The controller being always asserting one CS or the other, there is no
need to actually select the right target before doing a page read/write.
However, the anfc_select_target() helper actually also changes the
timing configuration and clock in the case were two different NAND chips
with different timing requirements would be used. In this situation, we
must ensure proper configuration of the controller by calling it.

As a consequence of this change, the anfc_select_target() helper is
being moved earlier in the driver.

Fixes: 88ffef1b65 ("mtd: rawnand: arasan: Support the hardware BCH ECC engine")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210526093242.183847-4-miquel.raynal@bootlin.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:56:38 +02:00