Commit graph

82 commits

Author SHA1 Message Date
Hariharan K
2a156d089e drivers: mtd: nand: Updating part MX35UF2GE4AD
The MX35UF2GE4AD nand part has support for 8-bit ECC,
2Gb flash density and 128 bytes of OOB. Updating the
correct info in the nand id table.

Change-Id: I21f1bd0a897b92694040dc5908580c80a4b003da
Signed-off-by: Hariharan K <quic_harihk@quicinc.com>
2024-05-22 21:12:07 -07:00
Hariharan K
b7dd2c641e drivers: mtd: nand: Updating part MX35UF4GE4AD-Z4I
The MX35UF4GE4AD-Z4I part has 256 bytes of spare
size. Updating the correct info in the nand table.

Change-Id: Ic3c71d870db8f7e54d0aeb0de27e1812f0fdff7d
Signed-off-by: Hariharan K <quic_harihk@quicinc.com>
2024-05-13 23:34:28 +05:30
Timple Raj M
5e5611e5fc drivers: mtd: nand: Add winbond W25N04KWZEIR device
Change-Id: Id76f33547c3acb7db7e6ad35d478c77580f14ad1
Signed-off-by: Timple Raj M <quic_timple@quicinc.com>
2023-11-03 16:03:20 +05:30
Vandhiadevan Karunamoorthy
dd2a35262d driver: nand: update flush status buffer
Change-Id: I9e08b58e11b70d2f9a6859c0ed836388d8b17084
Signed-off-by: Vandhiadevan Karunamoorthy <quic_vkarunam@quicinc.com>
2023-08-01 03:10:33 -07:00
Timple Raj M
aef14b3223 mtd: nand: Add support for giga device spi nand
This change will add support for giga device
GD5F2GM7REYIG spi nand support.

Change-Id: I97772e0a8210bd5a6d41e10bbfbdd75b44e53108
Signed-off-by: Timple Raj M <quic_timple@quicinc.com>
2023-04-24 20:25:38 +05:30
Timple Raj M
cd66774f4e mtd: nand: Add support for Macronix MX35UF1G24AD device
Change-Id: I37e18d4cc64709fa9f49f138b15d4d5ab878b812
Signed-off-by: Timple Raj M <quic_timple@quicinc.com>
2023-04-18 14:37:38 +05:30
Timple Raj M
41ffcbb192 driver: nand: Add winbond W25N512GW and W25N02KWZEIR devices
This patch adds the winbond W25N512GW and W25N02KWZEIR devices
and fixes the W25N01GWZEIG device id from 0xBA to 0xBA21,
W25N02JWZEIF device id from 0xBF to 0xBF22 and
W25N01JW device id from 0xBC to 0xBC21

Change-Id: Ic91800386446263477af06c6d39d9051a2dde3b9
Signed-off-by: Timple Raj M <quic_timple@quicinc.com>
2023-03-27 16:01:01 +05:30
Gurumoorthy Santhakumar
0f241074bd driver: nand: fix the block size of GD5F1GQ5REYIG
It has the capacity of 1Gbit, i.e., 128MB, so
the number of blocks has been updated to 1024.
1Gbits = 128MB = 2048(page) * 64 (pages per block) * 1024 (blocks)

Change-Id: I552776e4e151d16782db915c3ebae874c5c02696
Signed-off-by: Gurumoorthy Santhakumar <quic_gsanthak@quicinc.com>
2022-12-14 21:40:26 -08:00
Timple Raj M
61c9cf3505 driver: nand: qpic_nand: Add support for giga device spi nand
This change will  add support for giga device GD5F1GM7REYIG
spi nand support.

Change-Id: Ie32cb6824bd0fbcf04449fa070005b7fa323c025
Signed-off-by: Timple Raj M <quic_timple@quicinc.com>
2022-10-11 11:23:34 +05:30
Saahil Tomar
4c8be9b750 drivers : nand : Update Serial training fixup
This change fixup the magic word (0xBAD0FF5E) instead of zero.
So the uboot will skip setting qcom,training_offset
if the serial training partition is not present in flash.

Change-Id: I0ee8c9475e1153fdbc295691ceb2a4b1d6fdd394
Signed-off-by: Saahil Tomar <quic_saahtoma@quicinc.com>
2022-03-07 14:45:01 +05:30
Kavin A
db4391c1d7 drivers: mtd: nand: Extract the Status register value
Flash Status register value will get updated in [15:8]
bits section. Hence right shift first and then extract
the required bit value.

Change-Id: I7f2233f22984da3db2324e9e2ba8aafff76adb32
Signed-off-by: Kavin A <quic_kavia@quicinc.com>
2022-01-25 04:01:59 -08:00
Kavin A
d539984c88 mtd: nand: Configure Buffer mode only in Winbond SPI Nand devices
Winbond SPI Nand devices provides two different modes for read operations,
Buffer Read Mode (BUF=1) and Continuous Read Mode (BUF=0).

We can configure the BUF bit to read and operate in any one mode.

Change-Id: Ie7adce70642756725e52dab8821333c42fdb601f
Signed-off-by: Kavin A <quic_kavia@quicinc.com>
2022-01-25 03:43:06 -08:00
Kavin A
9649af968e mtd: nand: Add support for Winbond 1G-bits spi nand.
This change will add support for Winbond "W25N01GWZEIG" spi nand

Change-Id: Ic42938142115408406a8790e114d2d2acfc0dbb5
Signed-off-by: Kavin A <quic_kavia@quicinc.com>
2022-01-25 03:41:58 -08:00
Kavin A
9b7697d4c5 mtd: qpic_nand: Add support for Macronix 2G-bits Nand device
This change will add support for Macronix "MX35UF2GE4AD-Z4I" spi nand

Change-Id: I5d783473c0ec918b02e59a85b71ee941fe649365
Signed-off-by: Kavin A <quic_kavia@quicinc.com>
2021-12-29 20:42:35 +05:30
Rajkumar Ayyasamy
0dc8c1c7a6 mtd: qpic_nand: add support to switch between 2K & 4K layout
qpic_nand sbl -> to switch to 2K layout
qpic_nand linux -> to switch back to 4K layout

Currently this switch is enabled for IPQ9574

Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
(cherry picked from commit c9a1c10b2e35ba8f14dafc1f4c07aa5a07a01541)
Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>

Change-Id: I3e429b8cd5e600b4214c01d7949c01536f988e47
2021-10-22 19:23:10 +05:30
Sanchana Balu
8bf35dc3a9 Merge remote-tracking branch origin/win.coretech.1.0 into HEAD
Change-Id: Idb6d9698a8842341b88e611afc7dee10d219e491
2021-07-06 16:22:57 +05:30
Linux Build Service Account
6b3ac18cdb Merge "drivers: mtd: qpic_nand: Fix compilation issue for ipq50xx" 2021-07-03 12:40:50 -07:00
anusha
eb0121616f drivers: mtd: qpic_nand: Fix compilation issue for ipq50xx
Change-Id: I638f0e19a2934f92f00567e9ed2417fb8a3ce35c
Signed-off-by: anusha <anusharao@codeaurora.org>
2021-07-01 14:24:24 +05:30
anusha
eed8fc7b0d Merge remote-tracking branch 'origin/win.coretech.1.0' into HEAD
Change-Id: I2893089a3b0ca91ea22d49417934f126398a6a58
Signed-off-by: anusha <anusharao@codeaurora.org>
2021-06-30 13:11:44 +05:30
Rajkumar Ayyasamy
d11ded2ea4 drivers: qpic_nand: add support for Macronix spi nand
This change will add support for 4K Macronix spi nand
"MX35UF4GE4AD-Z4I"

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
Change-Id: I94e07d9e25de46c67fcb679ef149990e093afc8f
2021-06-24 09:58:22 -07:00
Linux Build Service Account
3b2c9ea52c Merge "driver: nand: qpic_nand: Add support for Gigadevice 2Gb SPI nand device GD5F2GQ5REYIG" 2021-05-27 06:12:58 -07:00
Linux Build Service Account
e88b6bb68f Merge "driver: nand: qpic_nand: Add support for Gigadevice SPI nand device GD5F4GQ6REYIHR" 2021-05-21 01:11:54 -07:00
sjagadam
10a29f259a driver: nand: qpic_nand: Add support for Gigadevice SPI nand device GD5F4GQ6REYIHR
Change-Id: I38050d1a23462fa4101cd658a612e646d6a4993d
Signed-off-by: sjagadam <sjagadam@codeaurora.org>
2021-05-10 14:26:05 +05:30
sjagadam
c0751657f2 driver: nand: qpic_nand: Add support for Gigadevice 2Gb SPI nand device GD5F2GQ5REYIG
Signed-off-by: sjagadam <sjagadam@codeaurora.org>
Change-Id: I9a1fa6b7a9990ad5bf372ea330d4bf3782bfce72
Signed-off-by: sjagadam <sjagadam@codeaurora.org>
2021-05-01 17:00:33 +05:30
sjagadam
235f540e47 driver: nand: qpic_nand: Add support for Dosillicon SPI nand device DS35M1GA
Change-Id: I2eee62bcdec0189cb5985d03e394acf8a5970b3d
Author: sjagadam <sjagadam@codeaurora.org>
2021-05-01 10:26:50 +05:30
anusha
0968fc48e4 ipq9574: Fixup fdt to pass qpic training offset to HLOS
Change-Id: I0bad5b47778ed7ea2beae08bea7c95a99644b469
Signed-off-by: anusha <anusharao@codeaurora.org>
2021-04-29 14:32:21 +05:30
sjagadam
3f60ccc070 driver: nand: qpic_nand: Add support for ESMT SPI nand device F50D2G41KA-83YIG2V
Signed-off-by: sjagadam <sjagadam@codeaurora.org>
Change-Id: Ib95578b56f1f8c062b0b16ffe4e936434297fc3d
2021-04-21 01:32:14 -07:00
Vandhiadevan Karunamoorthy
15aa7bfe5a bootqca: correct misprint log
Signed-off-by: Vandhiadevan Karunamoorthy <vkarunam@codeaurora.org>
Change-Id: I87b4f3b2aa4af9af41486e8056bd759a1722ba7c
2021-03-22 12:53:49 +05:30
Md Sadre Alam
b05847a5de drivers: nand: qpic_nand: Add support for Macronix spi nand.
This change will add support for Macronix "MX35UF1GE4AC" spi nand

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I66e82e22217d655b44e30baa64f3aefd5a5f2aaa
2021-01-27 19:59:26 +05:30
Md Sadre Alam
64af2446f8 driver: nand: qpic_nand: Add support for Winbond spi nand
This change will add support for winbond "W25N02JWZEIF"
spi nand device.

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I1dd258c3f0f3174d09e74fb7ffd0c26a43e6c24b
2021-01-22 19:55:54 +05:30
Md Sadre Alam
17fd8d354d driver: mtd: nand: qcom_nand: Add support for gigadevice nand
GD5F1GQ5REYIH

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I84e9d15792a86185e444936a8fe0e5ebd061be8a
2021-01-19 13:50:03 +05:30
Md Sadre Alam
02c55e3fb0 driver: nand: qpic_nand: Add support for giga device spi nand
This change will  add support for giga device GD5F1GQ5REYIG
spi nand support.

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I57211ce34543de81216d86653a45519b97cf2fb0
2021-01-19 13:45:49 +05:30
Md Sadre Alam
4609378109 driver: mtd: qpic_nand: Add support for F50D1G41LB spi-nand
Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: Ib042ec361ed4a16b93594a37c8daca6c26840ce7
2021-01-19 13:42:43 +05:30
Linux Build Service Account
57b89f1c98 Merge "driver: nand: qpic_nand: Add support for winbond device" 2021-01-12 05:11:07 -08:00
Karthick Shanmugham
b6d6a4aa72 ipq5018: block_drvr const declared only on HAVE_BLOCK_DEVICE
1. Modified to the declare block_drvr struct and const variable
only on HAVE_BLOCK_DEVICE config enabled.
2. Removed unused const training_block_128

Signed-off-by: Karthick Shanmugham <kartshan@codeaurora.org>
Change-Id: Icfe05aec82a124429443aadf735767366b168d6b
2021-01-06 13:56:43 +05:30
c_nguruj
c731f6790a Merge remote-tracking branch 'origin/win.coretech.1.0'
Change-Id: I7d23f9025357d5f0a1fe46dd30c906f938bab240
Signed-off-by: c_nguruj <dharilak@codeaurora.org>
2020-12-24 17:13:36 +05:30
Md Sadre Alam
82f1b86949 drivers: mtd: qpic_nand: Read one complete page for serial trainig
This change will change serial training data read to one complete
page instead of 64-bytes read. Partial page read will cause some
data curroption issue if read request failed so read one complete page.

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: Ibad101f096440e5dc10dfb4b3329a0aa6bddee7d
2020-12-18 17:34:40 +05:30
Md Sadre Alam
d60219d19c driver: nand: qpic_nand: Fix proper clock source macro in set_clk_rate function.
This change will fix proper clock source macro in set_clk_rate function.
Currently we are passing the wrong value to qpic_set_clk_rate for clock
source.

wrong:
qpic_set_clk_rate(IO_MACRO_CLK_200_MHZ, QPIC_IO_MACRO_CLK, NAND_QSPI_MSTR_CONFIG);

The last argument should be clock source not register base address.

correct:
qpic_set_clk_rate(IO_MACRO_CLK_200_MHZ, QPIC_IO_MACRO_CLK, GPLL0_CLK_SRC);

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: Ie9e07c253220924fd0c9287f7f0e2c5d42351128
2020-12-07 11:13:51 +05:30
Md Sadre Alam
f0af526b77 driver: nand: qpic_nand: Add support for winbond device
Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I19c0d6b285d4b054d9700f58a88395cd0ffe3896
2020-11-25 10:35:31 +05:30
Md Sadre Alam
3cf90dc5c7 driver: nand: qpic: Fix memory leak problem in serial training.
This change will fix memory leak problem in serial training.

For serial tarining we are allocating memory to hold the training
pattern buf. For any failure we are freeing the buffer but due to
wrong lavel used memory was not getting freed due to this memory leak
problem is happening.

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I35ffd27df9b24ea53aed9e9f0623d8890ba66f06
2020-11-16 04:50:33 -08:00
Vandhiadevan Karunamoorthy
413d029cab qpic-nand: Serial training: Fix for Access violation
This change fix Access violation created by APPS
master by accessing QPIC_XPU issue due to accessing
QPIC_QSPI_MSTR_CONFIG & QPIC_NAND_FLASH_SPI_CFG registers

Signed-off-by: Vandhiadevan Karunamoorthy <vkarunam@codeaurora.org>
Change-Id: Ibb840db12359eea01823dd7732fcb1ac1e7b8967
2020-10-14 18:19:07 +05:30
Karthick Shanmugham
48a7534422 ipq5018: Fix compilation issue for unused-const-variable
1. Modified to the declare block_drvr struct and const variable
   only on HAVE_BLOCK_DEVICE config enabled.
2. Removed unused const training_block_64

Signed-off-by: Karthick Shanmugham <kartshan@codeaurora.org>
Change-Id: Icfe05aec82a124429443aadf735767366b168d6b
2020-10-07 06:41:43 -07:00
Md Sadre Alam
43b1d16567 driver: nand: qpic_nand: Fix Erase address configuration.
This change will fix erase address configuration for QSPI
nand devices whose density is beyond 128MiB.

To erase a block as per datasheet of serial nand device
page row address <5:0> and the Block row address <16:6>.

In code we are forming directly pages address starting
from <16:0> i.e 17-bit address. Currently we are configuring
address_0 and address_1 register as follws.

addr0 = (page << 16) and addr1 = 0x0;

This logic will work if device size upto 128MiB, but if device
size beyond 128MiB then this logic will fail becasue upper most bit
will go out of add0 register.

Fixing this by changing address configuration logic for erase block.

addr0 = (page << 16) addr1 = (page >> 16) & 0xffff;

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I4950bb611780257629491ffbb42c91fcfedebc58
2020-09-30 14:17:08 +05:30
Md Sadre Alam
453489a928 driver: nand: qpic_nand: Add macro for debug print.
This change will define qspi_debug macro to print
debug messages.

Change-Id: I49c5278f63fa53dc5b2237aeb9bfef97990ecc86
Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
2020-07-01 21:28:09 +05:30
Md Sadre Alam
07e59f4960 driver: nand: qpic_nand: Enable config for serial training.
This change will enable config for serial training.

This change also fix the the logic to get most appropriate phase
out of passed phase.

This change also add support to read serial training offset from
partition table. Also patching freqency value & phase value to kernel.

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: Ibb4a5cd80f16605e8e91bdf6a0c6c484edff1735
2020-06-21 22:22:13 -07:00
Md Sadre Alam
ae38a196ca driver: nand: qpic_nand: Fix NULL pointer dereference.
This change will fix NULL pointer dereference while reading
from spi nand flash in oobbuf.

The multipage read features is only to read with ecc for
raw read/write the the access is page wise due to mtd layer
will request only one page at a time. So don't increment oobbuf
for every page while reading if already bitflips are present in spi
nand flash. if so data abort will happen due to NULL pointer
dereference.

error:
NAND read: device 0 offset 0x4480000, size 0x1000
data abort
pc : [<4a9515ec>]          lr : [<44000e18>]
reloc pc : [<4a9515ec>]    lr : [<44000e18>]
sp : 4a77f6f4  ip : bbfff3dc     fp : 4a783510
r10: 4a97bb40  r9 : 4a77feb0     r8 : 44000e0c
r7 : 4a97ca2c  r6 : 0000000f     r5 : 00000004  r4 : 00000003
r3 : ffffffff  r2 : 000001f4     r1 : 000000ff  r0 : 44000e0c
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...
resetting ...

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I435f65183b56ceef64bad7d0df7ffebe02175a66
2020-06-14 04:37:14 -07:00
Md Sadre Alam
bfeb556cf7 driver: nand: qpic: Fix serial training logic.
This change will fix serial training logic and enable
config to enable default qpic_io_macro clock @ 80MHz with
default phase delay valu 4 for all qspi serial line.

This change also fix the delay issue while writing to qpic
register via bam.

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I345f736fdae9d48b6da0115ca7a8519b43fe9efd
2020-06-04 22:06:22 +05:30
Md Sadre Alam
0b0d196901 driver: nand: qcom_nand: Fix xPU error for qspi register write.
This change will add support to write some ops group register via
BAM to avoid xPU error.

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I65ea875f783b7254f01cb3cf43eb43295caa4ed9
2020-05-18 16:32:24 +05:30
Md Sadre Alam
a99d538e1b driver: mtd: qpic_nand: Add support for serial training.
This change will add support for serial training in
QPIC.

Due to different PNR and PCB delays, serial read data
can come with different delays to QPIC. At high frequency
operations Rx clock should be adjusted according to delays
so that Rx Data can be captured correctly. CLK_CNTR_INIT_VAL_VEC
in NAND_FLASH_SPI_CFG register is a 12-bit vector which is divided
in 4 parts of 3 bits each representing delay of 4 serial input data
lines. Bit [2:0] corresponds to qspi_miso[0], bit [5:3] corresponds
to qspi_miso[1], bit [8:6] corresponds to qspi_miso[2] and bit [11:9]
corresponds to qspi_miso[3]. Delay of each qspi_miso line can be set
from 0 to 7.

For serial training the following rule should be followd.

1) SW should write a page with any known pattern in flash at lower
frequency.

2) Set the CLK_CNTR_INIT_VAL_VEC for qspi_miso[0] line.

3) Read that page repetitively in high frequency mode until it
gets data accurately.

4) Repeat above steps for other qspi_miso lines.

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: If622809efff55fb2abe60f409a590abd5313741b
Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
2020-05-12 04:27:24 -07:00
Md Sadre Alam
4d380489d5 driver: nand: qpic: Enable default clock setting for qpic.
This change will enable default clock setting QPIC block.

Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
Change-Id: I12396dc9776c611df69216bad1471a988130b22d
2020-05-07 20:45:20 +05:30