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
09/26/19 [linux-elphel][warrior] by Oleg Dzhimiev: renamed the file back to the changes are minimal from the 4.14
Oleg Dzhimiev committed changes to the Elphel git project :
renamed the file back to the changes are minimal from the 4.14
renamed the file back to the changes are minimal from the 4.14
09/25/19 [linux-elphel][warrior] by Oleg Dzhimiev: updated nand driver from linux-xlnx 4.14 to 4.19
Oleg Dzhimiev committed changes to the Elphel git project :
updated nand driver from linux-xlnx 4.14 to 4.19
updated nand driver from linux-xlnx 4.14 to 4.19
09/23/19 [linux-elphel][warrior] by Oleg Dzhimiev: updated
Oleg Dzhimiev committed changes to the Elphel git project :
updated
updated
09/23/19 [linux-elphel][warrior] by Oleg Dzhimiev: updated
Oleg Dzhimiev committed changes to the Elphel git project :
updated
updated
09/23/19 [linux-elphel][warrior] by Oleg Dzhimiev: missed of.h header file
Oleg Dzhimiev committed changes to the Elphel git project :
missed of.h header file
missed of.h header file
09/23/19 [linux-elphel][warrior] by Oleg Dzhimiev: reintroduced
Oleg Dzhimiev committed changes to the Elphel git project :
reintroduced
reintroduced
09/23/19 [linux-elphel][warrior] by Oleg Dzhimiev: Updated and moved to patch
Oleg Dzhimiev committed changes to the Elphel git project :
Updated and moved to patch
Updated and moved to patch
09/23/19 [linux-elphel][warrior] by Oleg Dzhimiev: Updated and moved to a patch to make it easier to updated next time
Oleg Dzhimiev committed changes to the Elphel git project :
Updated and moved to a patch to make it easier to updated next time
Updated and moved to a patch to make it easier to updated next time
09/23/19 [linux-elphel][warrior] by Oleg Dzhimiev: Updated and moved to a patch to make it easier updating next time
Oleg Dzhimiev committed changes to the Elphel git project :
Updated and moved to a patch to make it easier updating next time
Updated and moved to a patch to make it easier updating next time
09/23/19 [linux-elphel][warrior] by Oleg Dzhimiev: updated and moved changes to a patch so it's easier to update next time
Oleg Dzhimiev committed changes to the Elphel git project :
updated and moved changes to a patch so it's easier to update next time
updated and moved changes to a patch so it's easier to update next time
Poky migration from rocko to warrior
[SOLVED] Note 3: Entropy device hwrng
← Older revision Revision as of 19:06, 10 September 2019 (One intermediate revision by the same user not shown)Line 92: Line 92: ** Haven't found if Xilinx uses any driver for /dev/hwrng ** Haven't found if Xilinx uses any driver for /dev/hwrng ** TODO: Find out if the order of entropy sources can be changed ** TODO: Find out if the order of entropy sources can be changed −** That lag at boot is really annoying - 5-10 seconds?!!+** That lag at boot is really annoying - 5 secs?!! ==<font color='green'>'''[SOLVED]'''</font> Note 4: PHP causing 'unsupported FP instruction in kernel mode'== ==<font color='green'>'''[SOLVED]'''</font> Note 4: PHP causing 'unsupported FP instruction in kernel mode'== Line 148: Line 148: - <s>switched from '''-mfloat-abi=softfp''' to '''-mfloat-abi=hard''' - the problem seems to go away - but is it 100%?</s> - <s>switched from '''-mfloat-abi=softfp''' to '''-mfloat-abi=hard''' - the problem seems to go away - but is it 100%?</s> - used kmalloc instead of auto variable in mt9x001_pgm_initsensor() - no Oopses so far - used kmalloc instead of auto variable in mt9x001_pgm_initsensor() - no Oopses so far + +* More notes on debugging + - CONFIG_DEBUG_STACK_USAGE=y + and it reports how many bytes left in stack for various processes. For that particular process (php) the "bytes left" were '''4''' on successful boots and + ~'''1028''' after a huge variable (of 1024 bytes) got moved to heap. + - Also there's a warning in Eclipse about "frame size" beaing larger than 1024 ==<font color='green'>'''[SOLVED]'''</font> Note 5: Bring up NAND OTP support== ==<font color='green'>'''[SOLVED]'''</font> Note 5: Bring up NAND OTP support== OlegPoky migration from rocko to warrior
[SOLVED] Note 3: Entropy device hwrng
← Older revision Revision as of 19:06, 10 September 2019 (2 intermediate revisions by the same user not shown)Line 92: Line 92: ** Haven't found if Xilinx uses any driver for /dev/hwrng ** Haven't found if Xilinx uses any driver for /dev/hwrng ** TODO: Find out if the order of entropy sources can be changed ** TODO: Find out if the order of entropy sources can be changed −** That lag at boot is really annoying - 5-10 seconds?!!+** That lag at boot is really annoying - 5 secs?!! −==<font color='green'>'''SOLVED'''</font> Note 4: PHP causing 'unsupported FP instruction in kernel mode'==+==<font color='green'>'''[SOLVED]'''</font> Note 4: PHP causing 'unsupported FP instruction in kernel mode'== * Kernel Oops: * Kernel Oops: <font size='1'>[ 35.872118] BUG: unsupported FP instruction in kernel mode <font size='1'>[ 35.872118] BUG: unsupported FP instruction in kernel mode Line 148: Line 148: - <s>switched from '''-mfloat-abi=softfp''' to '''-mfloat-abi=hard''' - the problem seems to go away - but is it 100%?</s> - <s>switched from '''-mfloat-abi=softfp''' to '''-mfloat-abi=hard''' - the problem seems to go away - but is it 100%?</s> - used kmalloc instead of auto variable in mt9x001_pgm_initsensor() - no Oopses so far - used kmalloc instead of auto variable in mt9x001_pgm_initsensor() - no Oopses so far + +* More notes on debugging + - CONFIG_DEBUG_STACK_USAGE=y + and it reports how many bytes left in stack for various processes. For that particular process (php) the "bytes left" were '''4''' on successful boots and + ~'''1028''' after a huge variable (of 1024 bytes) got moved to heap. + - Also there's a warning in Eclipse about "frame size" beaing larger than 1024 ==<font color='green'>'''[SOLVED]'''</font> Note 5: Bring up NAND OTP support== ==<font color='green'>'''[SOLVED]'''</font> Note 5: Bring up NAND OTP support== OlegPages
