Commit Graph

9 Commits

Author SHA1 Message Date
Kinsey Moore
33379dcfc4 bsps/shared/xnandpsu: Add opportunistic page cache
Add an opportunistic page cache to the xnandpsu driver since it does not
implement partial page reads and common filesystem access patterns
perform multiple reads from the same page. This has been seen to provide
a 10x speedup to read speeds and a 2x speedup on first initialization
when used with JFFS2.
2024-03-11 12:09:59 -05:00
Kinsey Moore
437053282d bsps/xnandpsu: Constrain block erasure to device
The XNandPsu_EraseBlock function takes a target device and a block
offset for erasure. Ensure the block offset is within the size of the
target device.
2023-12-14 13:40:03 -06:00
Kinsey Moore
bb6ed3bed7 bsps/xnandpsu: Always wrap page to device size
The xnandpsu driver conditionally tries to wrap page index to NAND chip
size causing an off-by-one error where the first page of the second chip
is not wrapped correctly. This removes the conditional so that page
index is always wrapped.
2023-10-27 11:33:44 -05:00
Kinsey Moore
3363fabb9d bsps/xnandpsu: Avoid loop counter reset
On configurations where multiple NAND chips are in use, the erasure
loop in XNandPsu_Erase() can reset the loop counter variable once it
gets to blocks in the second chip causing an infinite loop overwriting
parts of the first chip. This change ensures that the loop counter is
not accidentally reset.
2023-10-27 11:33:44 -05:00
Kinsey Moore
41d43cef6c bsps/xnandpsu: Ensure buffer cache sync
When a buffer is modified by both hardware components such as DMA and by
software components, the buffer cache state must be kept in sync so that
data is not accidentally thrown away during future invalidations.
2023-09-26 09:02:48 -05:00
Kinsey Moore
2b5526aa5e bsps/xnandpsu: Don't rely on usleep for polling
When polling hardware registers in high performance situations, don't
rely on usleep or other standard sleep functions since they will
necessarily rely on kernel ticks to be woken up. This can easily cause
an immense reduction in throughput.
2023-09-26 09:02:48 -05:00
Kinsey Moore
8cea348934 bsps/xnandpsu: Ensure correct cache maintenance
The changes here ensure correct cache maintenance around DMA operations.
One cache flush was missing and two cache invalidations occurred before
the corresponding read that would make them necessary.
2023-09-06 08:53:02 -05:00
Kinsey Moore
ada805ea2e bsps/nand: Update Xilinx NAND driver
This resovles gcc warnings by updating to the latest Xilinx NAND
controller driver.
2023-01-30 10:44:24 -06:00
Kinsey Moore
30ca711d19 bsps: Import Xilinx NAND driver
This adds Xilinx's driver for the Xilinx NAND controller embedded in the
ZynqMP SoC. Within that device alone, it is possible to access this
peripheral from MicroBlaze, ARMv7, and ARMv8 cores. This has been added
to the hardware ZynqMP BSPs since QEMU does not support emulation of
this peripheral. This driver supports polled operation only. The
imported files are and should be able to remain unmodified. Import
information is kept in bsps/shared/dev/nand/VERSION.
2022-12-23 13:06:42 -06:00