Commit ea690ad
mtd: rawnand: rockchip: Align hwecc vs. raw page helper layouts
Currently, read/write_page_hwecc() and read/write_page_raw() are not
aligned: there is a mismatch in the OOB bytes which are not
read/written at the same offset in both cases (raw vs. hwecc).
This is a real problem when relying on the presence of the Page
Addresses (PA) when using the NAND chip as a boot device, as the
BootROM expects additional data in the OOB area at specific locations.
Rockchip boot blocks are written per 4 x 512 byte sectors per page.
Each page with boot blocks must have a page address (PA) pointer in OOB
to the next page. Pages are written in a pattern depending on the NAND chip ID.
Generate boot block page address and pattern for hwecc in user space
and copy PA data to/from the already reserved last 4 bytes before ECC
in the chip->oob_poi data layout.
Align the different helpers. This change breaks existing jffs2 users.
Fixes: 058e0e8 ("mtd: rawnand: rockchip: NFC driver for RK3308, RK2928 and others")
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/5e782c08-862b-51ae-47ff-3299940928ca@gmail.com1 parent d0ca3b9 commit ea690ad
1 file changed
+21
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
601 | | - | |
| 601 | + | |
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
628 | 635 | | |
629 | 636 | | |
630 | 637 | | |
| |||
635 | 642 | | |
636 | 643 | | |
637 | 644 | | |
638 | | - | |
639 | | - | |
640 | | - | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
641 | 648 | | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | 649 | | |
646 | | - | |
647 | | - | |
| 650 | + | |
648 | 651 | | |
649 | 652 | | |
650 | | - | |
| 653 | + | |
651 | 654 | | |
652 | | - | |
| 655 | + | |
653 | 656 | | |
654 | 657 | | |
655 | 658 | | |
| |||
812 | 815 | | |
813 | 816 | | |
814 | 817 | | |
815 | | - | |
816 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
817 | 824 | | |
818 | 825 | | |
819 | 826 | | |
820 | 827 | | |
| 828 | + | |
821 | 829 | | |
822 | 830 | | |
823 | 831 | | |
| |||
0 commit comments