09/30/19 [meta-elphel393][warrior] by Oleg Dzhimiev: fixed building when initramfs is not built yet
Oleg Dzhimiev committed changes to the Elphel git project :
fixed building when initramfs is not built yet
fixed building when initramfs is not built yet
09/30/19 [meta-elphel393][warrior] by Oleg Dzhimiev: cosmetic changes
Oleg Dzhimiev committed changes to the Elphel git project :
cosmetic changes
cosmetic changes
09/30/19 [meta-elphel393][warrior] by Oleg Dzhimiev: Switched to only single kernel compile if initramfs was previously built - initramfs lags 1 build behind but it only affect the kernel modules which we don't have in initramfs - it's only...
Oleg Dzhimiev committed changes to the Elphel git project :
Switched to only single kernel compile if initramfs was previously built - initramfs lags 1 build behind but it only affect the kernel modules which we don't have in initramfs - it's only used for NAND flash boot to mount overlayfs and switch_root there
Switched to only single kernel compile if initramfs was previously built - initramfs lags 1 build behind but it only affect the kernel modules which we don't have in initramfs - it's only used for NAND flash boot to mount overlayfs and switch_root there
09/27/19 [linux-elphel][warrior] by Oleg Dzhimiev: udpated nand records to increase the 4th partition (rootfs) size to 320MB
Oleg Dzhimiev committed changes to the Elphel git project :
udpated nand records to increase the 4th partition (rootfs) size to 320MB
udpated nand records to increase the 4th partition (rootfs) size to 320MB
09/27/19 [linux-elphel][warrior] by Oleg Dzhimiev: does not matter
Oleg Dzhimiev committed changes to the Elphel git project :
does not matter
does not matter
09/27/19 [linux-elphel][warrior] by Oleg Dzhimiev: don't need, subpage writes are supported
Oleg Dzhimiev committed changes to the Elphel git project :
don't need, subpage writes are supported
don't need, subpage writes are supported
09/27/19 [meta-elphel393][warrior] by Oleg Dzhimiev: debugging overlayfs
Oleg Dzhimiev committed changes to the Elphel git project :
debugging overlayfs
debugging overlayfs
09/27/19 [meta-elphel393][warrior] by Oleg Dzhimiev: increased mkubifs size to 320MB
Oleg Dzhimiev committed changes to the Elphel git project :
increased mkubifs size to 320MB
increased mkubifs size to 320MB
09/27/19 [elphel-web-393][warrior] by Oleg Dzhimiev: 1. UBI VID header offset to 512 (was 2048) 2. Increased size of rootfs on NAND to 320MB
Oleg Dzhimiev committed changes to the Elphel git project :
1. UBI VID header offset to 512 (was 2048) 2. Increased size of rootfs on NAND to 320MB
1. UBI VID header offset to 512 (was 2048) 2. Increased size of rootfs on NAND to 320MB
09/26/19 [elphel-web-393][thud] by Oleg Dzhimiev: updated UBI formatting to newer subpage size
Oleg Dzhimiev committed changes to the Elphel git project :
updated UBI formatting to newer subpage size
updated UBI formatting to newer subpage size
09/26/19 [meta-elphel393][warrior] by Oleg Dzhimiev: enabled PL353 nand driver
Oleg Dzhimiev committed changes to the Elphel git project :
enabled PL353 nand driver
enabled PL353 nand driver
09/26/19 [meta-elphel393][warrior] by Oleg Dzhimiev: added patches
Oleg Dzhimiev committed changes to the Elphel git project :
added patches
added patches
09/26/19 [meta-elphel393][warrior] by Oleg Dzhimiev: updated UBI parameters to 4.19 with 512B subpages
Oleg Dzhimiev committed changes to the Elphel git project :
updated UBI parameters to 4.19 with 512B subpages
updated UBI parameters to 4.19 with 512B subpages
Updating nand flash driver from linux kernel 4.14 to 4.19
Updating to 4.19
← Older revision Revision as of 20:10, 26 September 2019 (4 intermediate revisions by the same user not shown)Line 9: Line 9: * ON-DIE ECC feature supported - they call it internal ECC in the datasheet: * ON-DIE ECC feature supported - they call it internal ECC in the datasheet: Internal ECC enables 5-bit detection and 4-bit error correction in 512 bytes Internal ECC enables 5-bit detection and 4-bit error correction in 512 bytes −* Subpage (or partial) writes are not supported. ==Linux Kernel 4.14 and older== ==Linux Kernel 4.14 and older== Line 20: Line 19: * A lot has changed since 4.14 * A lot has changed since 4.14 ** new ''->exec_op'' hook vs old ''->cmdfunc'' ** new ''->exec_op'' hook vs old ''->cmdfunc'' +** Xilinx tries to keep up with their driver - they might have tested this on [https://lwn.net/Articles/756725/ Micron MT29F2G08ABAEAWP (On-die capable) and AMD/Spansion S34ML01G1] * OTP function are not supported yet, and need a minor change to make them more universal * OTP function are not supported yet, and need a minor change to make them more universal −* Old LOCK/UNLOCK function need to be updated to the new codebase+ That minor change is to set ops.mode to MTD_OPS_RAW instead of normal. Hooks for normal ops −* Set ''nand-ecc-mode = "on-die";'' in the device tree.+ can enable/disable ECC features which will reset OTP mode (which is also a feature set) + +* Old LOCK/UNLOCK functions from pre 4.14 kernel need to be updated to the new codebase + Those op_parser patterns. + Also UNLOCK command is 2 parts: 0x23 BOUND_LO 0x24 BOUND_HI - so, before 0x24 has to be some sort of a delay or the op should be split into 2. + Datasheet does not provide any timing info + +* Set ''nand-ecc-mode = "on-die";'' in the device tree. + In 4.14 it used to be detected as "on-die", but not anymore. * Add NAND_NO_SUBPAGE_WRITE to chip->options for MT29F8G08ADBDAH4 * Add NAND_NO_SUBPAGE_WRITE to chip->options for MT29F8G08ADBDAH4 −===Results===+ Otherwise driver goes for subpage program support. '''Need to test this.''' + +===Driver code=== See the code here: See the code here: * [https://git.elphel.com/Elphel/linux-elphel/blob/warrior/src/arch/arm/boot/dts/elphel393-zynq-base.dtsi#L299 device tree] * [https://git.elphel.com/Elphel/linux-elphel/blob/warrior/src/arch/arm/boot/dts/elphel393-zynq-base.dtsi#L299 device tree] − Those ''arm,nand-cycle-t0-6'' can be removed+ Those ''arm,nand-cycle-t0-6'' are obsolete and can be removed from DT. * [https://git.elphel.com/Elphel/linux-elphel/tree/d4f217cf68d8c3c9a84f680dd014b1a0de0571c8/src/drivers/mtd/nand/raw driver code] * [https://git.elphel.com/Elphel/linux-elphel/tree/d4f217cf68d8c3c9a84f680dd014b1a0de0571c8/src/drivers/mtd/nand/raw driver code] − Didn't make a patch - the changes are for a specific MT29F8G08ADBDAH4. Although they might work for others as well we have only tested the chip we use.+ Didn't make a patch - the changes are for a specific MT29F8G08ADBDAH4. Although they might work for other chips as well we have only tested the one we use. OlegUpdating nand flash driver from linux kernel 4.14 to 4.19
Updating to 4.19
← Older revision Revision as of 18:47, 26 September 2019 (One intermediate revision by the same user not shown)Line 20: Line 20: * A lot has changed since 4.14 * A lot has changed since 4.14 ** new ''->exec_op'' hook vs old ''->cmdfunc'' ** new ''->exec_op'' hook vs old ''->cmdfunc'' +** Xilinx tries to keep up with their driver * OTP function are not supported yet, and need a minor change to make them more universal * OTP function are not supported yet, and need a minor change to make them more universal −* Old LOCK/UNLOCK function need to be updated to the new codebase+ That minor change is to set ops.mode to MTD_OPS_RAW instead of normal. Hooks for normal ops −* Set ''nand-ecc-mode = "on-die";'' in the device tree.+ can enable/disable ECC features which will reset OTP mode (which is also a feature set) + +* Old LOCK/UNLOCK functions from pre 4.14 kernel need to be updated to the new codebase + Those op_parser patterns. + Also UNLOCK command is 2 parts: 0x23 BOUND_LO 0x24 BOUND_HI - so, before 0x24 has to be some sort of a delay or the op should be split into 2. + Datasheet does not provide any timing info + +* Set ''nand-ecc-mode = "on-die";'' in the device tree. + In 4.14 it used to be detected as "on-die", but not anymore. * Add NAND_NO_SUBPAGE_WRITE to chip->options for MT29F8G08ADBDAH4 * Add NAND_NO_SUBPAGE_WRITE to chip->options for MT29F8G08ADBDAH4 −===Results===+ Otherwise driver goes for subpage program support + +===Driver code=== See the code here: See the code here: * [https://git.elphel.com/Elphel/linux-elphel/blob/warrior/src/arch/arm/boot/dts/elphel393-zynq-base.dtsi#L299 device tree] * [https://git.elphel.com/Elphel/linux-elphel/blob/warrior/src/arch/arm/boot/dts/elphel393-zynq-base.dtsi#L299 device tree] − Those ''arm,nand-cycle-t0-6'' can be removed+ Those ''arm,nand-cycle-t0-6'' are obsolete and can be removed from DT. * [https://git.elphel.com/Elphel/linux-elphel/tree/d4f217cf68d8c3c9a84f680dd014b1a0de0571c8/src/drivers/mtd/nand/raw driver code] * [https://git.elphel.com/Elphel/linux-elphel/tree/d4f217cf68d8c3c9a84f680dd014b1a0de0571c8/src/drivers/mtd/nand/raw driver code] − Didn't make a patch - the changes are for a specific MT29F8G08ADBDAH4. Although they might work for others as well we have only tested the chip we use.+ Didn't make a patch - the changes are for a specific MT29F8G08ADBDAH4. Although they might work for other chips as well we have only tested the one we use. OlegUpdating nand flash driver from linux kernel 4.14 to 4.19
Created page with "==About== Below are the changes had to be made to update our nand flash driver code from kernel 4.14 to 4.19. The kernel versions mentioned are the rebases from the mainline k..."
New page
==About==Below are the changes had to be made to update our nand flash driver code from kernel 4.14 to 4.19.
The kernel versions mentioned are the rebases from the mainline kernel in linux-xlnx repo with xilinx's code:
[https://github.com/Xilinx/linux-xlnx/tree/xlnx_rebase_v4.14 xlnx_rebase_v4.14]
[https://github.com/Xilinx/linux-xlnx/tree/xlnx_rebase_v4.19 xlnx_rebase_v4.19]
==NAND FLASH chip==
Micron MT29F8G08ADBDAH4:
* ON-DIE ECC feature supported - they call it internal ECC in the datasheet:
Internal ECC enables 5-bit detection and 4-bit error correction in 512 bytes
* Subpage (or partial) writes are not supported.
==Linux Kernel 4.14 and older==
Until 4.14 (including) our driver code additions worked unchanged. We basically needed a couple of things:
* LOCK/UNLOCK functions (which were removed in 4.14). The code existed in up to 4.13 release - so it was just taken from there.
* Function to work with the chip's (MT29F8G08ADBDAH4) OTP area. The original code was taken from [http://webcache.googleusercontent.com/search?q=cache:-k_EdkxxQCUJ:lists.infradead.org/pipermail/linux-mtd/2013-March/045994.html+&cd=2&hl=en&ct=clnk&gl=us&client=ubuntu here]
==Updating to 4.19==
===Notes===
* A lot has changed since 4.14
** new ''->exec_op'' hook vs old ''->cmdfunc''
* OTP function are not supported yet, and need a minor change to make them more universal
* Old LOCK/UNLOCK function need to be updated to the new codebase
* Set ''nand-ecc-mode = "on-die";'' in the device tree.
* Add NAND_NO_SUBPAGE_WRITE to chip->options for MT29F8G08ADBDAH4
===Results===
See the code here:
* [https://git.elphel.com/Elphel/linux-elphel/blob/warrior/src/arch/arm/boot/dts/elphel393-zynq-base.dtsi#L299 device tree]
Those ''arm,nand-cycle-t0-6'' can be removed
* [https://git.elphel.com/Elphel/linux-elphel/tree/d4f217cf68d8c3c9a84f680dd014b1a0de0571c8/src/drivers/mtd/nand/raw driver code]
Didn't make a patch - the changes are for a specific MT29F8G08ADBDAH4. Although they might work for others as well we have only tested the chip we use. Oleg
09/26/19 [linux-elphel][warrior] by Oleg Dzhimiev: set ecc.size correctly, added NAND_NO_SUBPAGE_WRITE to options
Oleg Dzhimiev committed changes to the Elphel git project :
set ecc.size correctly, added NAND_NO_SUBPAGE_WRITE to options
set ecc.size correctly, added NAND_NO_SUBPAGE_WRITE to options
09/26/19 [linux-elphel][warrior] by Oleg Dzhimiev: better setting of nand ecc step size
Oleg Dzhimiev committed changes to the Elphel git project :
better setting of nand ecc step size
better setting of nand ecc step size
09/26/19 [linux-elphel][warrior] by Oleg Dzhimiev: assigned back raw hooks
Oleg Dzhimiev committed changes to the Elphel git project :
assigned back raw hooks
assigned back raw hooks
09/26/19 [linux-elphel][warrior] by Oleg Dzhimiev: updated comments
Oleg Dzhimiev committed changes to the Elphel git project :
updated comments
updated comments
Pages
