NAND flash boot rootfs
Instructions:
← Older revision Revision as of 19:38, 9 March 2016 (2 intermediate revisions not shown)Line 1: Line 1: -===Boot from NAND flash===+==Boot from NAND flash (rootfs)== * The default boot option - power on. * The default boot option - power on. -* A UBIFS image of rootfs is written to /dev/mtd4 ('''ubi0:elphel393''' in bootargs in the device tree)+* A UBIFS image of rootfs is written to /dev/mtd4 ('''ubi0:elphel393''' in bootargs in the device tree) - mounted as '''/''' -====Reflash factory image (update software/firmware or corrupt flash partition) ====+ +==Reflash factory image== +===Notes=== +* Update software/firmware or corrupt flash partition +* To update u-boot images, device tree and kernel - booting from micro SD card is not required. +* To update rootfs - boot from micro SD card otherwise a mounted flash partition will be rewritten, get corrupt and the camera won't boot - boot from micro SD card and reflash rootfs partition to recover. +* '''boot.bin''', '''u-boot-dtb.img''' - most likely won't need updating at all. Only if their partitions get corrupt +** As Zynq's BootROM performs 32KB jumps within the first 128MiB of flash in the search of a boot.bin header with a correct checksum it is possible to flash a few backup images to the 1st flash partition (mtd0) in the device tree. The partition size is 1MB, boot.bin size is normally around 100KB (<192KB - Zynq OCM requirement) + +===Instructions=== * Use files from '''.../poky/build/tmp/deploy/images/elphel393/nand/''' * Use files from '''.../poky/build/tmp/deploy/images/elphel393/nand/''' +** '''boot.bin''' +** '''u-boot-dtb.img''' +** '''devicetree.dtb''' +** '''uImage''' +** '''rootfs.ubifs''' (<font color='green'>recommended</font>), '''rootfs.ubi''' (<font color='red'>radical</font>) * Copy all of the image files to a micro SD card (or boot first from the card then copy over network) * Copy all of the image files to a micro SD card (or boot first from the card then copy over network) -* Boot from micro SD card.+* Boot from micro SD card (<font color='red'>important for rootfs updates</font>) * Reflash what is needed: * Reflash what is needed: ** Reflash SPL ('''boot.bin''', /dev/mtd0) ** Reflash SPL ('''boot.bin''', /dev/mtd0) Line 50: Line 64: Update: Update: <font size='2'> <font size='2'> - # '''NOT TESTED'''+ flash_unlock /dev/mtd4 ubiattach /dev/ubi_ctrl -m 4 ubiattach /dev/ubi_ctrl -m 4 - #ubimkvol /dev/ubi0 -N elphel393-rootfs -s 256MiB+ # NOT NEEDED: ubimkvol /dev/ubi0 -N elphel393-rootfs -s 256MiB ubiupdatevol /dev/ubi0_0 rootfs.ubifs ubiupdatevol /dev/ubi0_0 rootfs.ubifs + # # read: http://www.linux-mtd.infradead.org/faq/ubifs.html # read: http://www.linux-mtd.infradead.org/faq/ubifs.html # read: http://free-electrons.com/blog/creating-flashing-ubi-ubifs-images/ # read: http://free-electrons.com/blog/creating-flashing-ubi-ubifs-images/ OlegPoky 2.0 manual
Boot options:
← Older revision Revision as of 18:47, 9 March 2016 Line 29: Line 29: * [[Sd_boot_rootfs|Detailed instructions]] * [[Sd_boot_rootfs|Detailed instructions]] -===Boot from NAND flash===+===Boot from NAND flash (rootfs)=== * The default boot option - power on. * The default boot option - power on. -* A UBIFS image of rootfs is written to /dev/mtd4 ('''ubi0:elphel393''' in bootargs in the device tree)+* A UBIFS image is written to /dev/mtd4 - is mounted as '''/''' -====Reflash factory image (update software/firmware or corrupt flash partition) ====+* [[NAND_flash_boot_rootfs|Detailed instructions]] -* Use files from '''.../poky/build/tmp/deploy/images/elphel393/nand/'''+ -* Copy all of the image files to a micro SD card (or boot first from the card then copy over network)+ -* Boot from micro SD card.+ -* Reflash what is needed:+ -** Reflash SPL ('''boot.bin''', /dev/mtd0)+ -<font size='2'>+ - cd <path-to-image-files>+ - # boot.bin+ - # mtd0 is 1MB (8 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block)+ - # erase only first 2 blocks, other block are reserved for copies+ - flash_unlock /dev/mtd0+ - flash_erase /dev/mtd0 0 2+ - nandwrite -n /dev/mtd0 -p boot.bin+ -</font>+ -** Reflash u-boot ('''u-boot-dtb.img''', /dev/mtd1)+ -<font size='2'>+ - cd <path-to-image-files>+ - # u-boot-dtb.img+ - # mtd1 is 4M (32 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block)+ - # erase only the 1st 8 blocks as image is <1M, leave unused area for backup copies+ - flash_unlock /dev/mtd1+ - flash_erase /dev/mtd1 0 8+ - nandwrite -n /dev/mtd1 -p u-boot-dtb.img+ -</font>+ -** Reflash devicetree ('''devicetree.dtb''', /dev/mtd2)+ -<font size='2'>+ - cd <path-to-image-files>+ - # u-boot-dtb.img+ - # mtd2 is 1M (8 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block)+ - flash_unlock /dev/mtd2+ - flash_erase /dev/mtd2 0 8+ - nandwrite -n /dev/mtd2 -p devicetree.dtb+ -</font>+ -** Reflash kernel ('''uImage''', /dev/mtd3)+ -<font size='2'>+ - cd <path-to-image-files>+ - # uImage+ - # mtd3 is 16M (128 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block)+ - flash_unlock /dev/mtd3+ - flash_erase /dev/mtd3 0 128+ - nandwrite -n /dev/mtd3 -p uImage+ -</font>+ -** For rootfs there are 2 options: + -*** update - <font color='green'>recommended</font>, '''rootfs.ubifs'''+ -*** reflash - <font color='red'>radical</font>, '''rootfs.ubi'''+ -Update:+ -<font size='2'>+ - # '''NOT TESTED'''+ - ubiattach /dev/ubi_ctrl -m 4+ - #ubimkvol /dev/ubi0 -N elphel393-rootfs -s 256MiB+ - ubiupdatevol /dev/ubi0_0 rootfs.ubifs+ - # read: http://www.linux-mtd.infradead.org/faq/ubifs.html+ - # read: http://free-electrons.com/blog/creating-flashing-ubi-ubifs-images/+ - # read: http://www.linux-mtd.infradead.org/doc/ubi.html#L_volupdate+ - # read: http://comments.gmane.org/gmane.linux.drivers.mtd/39415+ -</font>+ -Reflash:+ -<font size='2'>+ - cd <path-to-image-files>+ - flash_unlock /dev/mtd4+ - flash_erase /dev/mtd4 0 2048+ - ubiformat /dev/mtd4 -f rootfs.ubi -s 2048 -O 2048+ -</font>+ -'''Note:''' Considering to store the u-boot, device tree and kernel on UBUFS partitions in future.+ ==<font color="blue">Setup</font>== ==<font color="blue">Setup</font>== OlegNAND flash boot rootfs
Created page with "===Boot from NAND flash=== * The default boot option - power on. * A UBIFS image of rootfs is written to /dev/mtd4 ('''ubi0:elphel393''' in bootargs in the device tree) ====Refla..."
New page
===Boot from NAND flash===* The default boot option - power on.
* A UBIFS image of rootfs is written to /dev/mtd4 ('''ubi0:elphel393''' in bootargs in the device tree)
====Reflash factory image (update software/firmware or corrupt flash partition) ====
* Use files from '''.../poky/build/tmp/deploy/images/elphel393/nand/'''
* Copy all of the image files to a micro SD card (or boot first from the card then copy over network)
* Boot from micro SD card.
* Reflash what is needed:
** Reflash SPL ('''boot.bin''', /dev/mtd0)
<font size='2'>
cd <path-to-image-files>
# boot.bin
# mtd0 is 1MB (8 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block)
# erase only first 2 blocks, other block are reserved for copies
flash_unlock /dev/mtd0
flash_erase /dev/mtd0 0 2
nandwrite -n /dev/mtd0 -p boot.bin
</font>
** Reflash u-boot ('''u-boot-dtb.img''', /dev/mtd1)
<font size='2'>
cd <path-to-image-files>
# u-boot-dtb.img
# mtd1 is 4M (32 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block)
# erase only the 1st 8 blocks as image is <1M, leave unused area for backup copies
flash_unlock /dev/mtd1
flash_erase /dev/mtd1 0 8
nandwrite -n /dev/mtd1 -p u-boot-dtb.img
</font>
** Reflash devicetree ('''devicetree.dtb''', /dev/mtd2)
<font size='2'>
cd <path-to-image-files>
# u-boot-dtb.img
# mtd2 is 1M (8 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block)
flash_unlock /dev/mtd2
flash_erase /dev/mtd2 0 8
nandwrite -n /dev/mtd2 -p devicetree.dtb
</font>
** Reflash kernel ('''uImage''', /dev/mtd3)
<font size='2'>
cd <path-to-image-files>
# uImage
# mtd3 is 16M (128 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block)
flash_unlock /dev/mtd3
flash_erase /dev/mtd3 0 128
nandwrite -n /dev/mtd3 -p uImage
</font>
** For rootfs there are 2 options:
*** update - <font color='green'>recommended</font>, '''rootfs.ubifs'''
*** reflash - <font color='red'>radical</font>, '''rootfs.ubi'''
Update:
<font size='2'>
# '''NOT TESTED'''
ubiattach /dev/ubi_ctrl -m 4
#ubimkvol /dev/ubi0 -N elphel393-rootfs -s 256MiB
ubiupdatevol /dev/ubi0_0 rootfs.ubifs
# read: http://www.linux-mtd.infradead.org/faq/ubifs.html
# read: http://free-electrons.com/blog/creating-flashing-ubi-ubifs-images/
# read: http://www.linux-mtd.infradead.org/doc/ubi.html#L_volupdate
# read: http://comments.gmane.org/gmane.linux.drivers.mtd/39415
</font>
Reflash:
<font size='2'>
cd <path-to-image-files>
flash_unlock /dev/mtd4
flash_erase /dev/mtd4 0 2048
ubiformat /dev/mtd4 -f rootfs.ubi -s 2048 -O 2048
</font>
'''Note:''' Considering to store the u-boot, device tree and kernel on UBUFS partitions in future.
[[Category:Elphel393]] Oleg
Poky 2.0 manual
Boot options:
← Older revision Revision as of 18:42, 9 March 2016 Line 24: Line 24: ==<font color="blue">Boot options</font>== ==<font color="blue">Boot options</font>== -===Boot from micro SD card===+===Boot from micro SD card (rootfs)=== -* The micro SD card/adapter must be modified for this boot mode (to keep CD pin high) - only then the camera will boot.+* The micro SD card/adapter must be modified for this boot mode (to keep CD pin high) - only then the camera will boot -* EXT4 partition mounted as '''/'''.+* EXT4 partition mounted as '''/''' -====Instructions====+* [[Sd_boot_rootfs|Detailed instructions]] -PC:+ -* After all of the targets are built use files from '''.../poky/build/tmp/deploy/images/elphel393/mmc/'''+ -* Format to have 2 partitions: FAT32 and EXT4 (use gparted), the order of partitions is important or change bootargs in the device tree.+ -* FAT32: copy the following files:+ -*** '''boot.bin'''+ -*** '''u-boot-dtb.img'''+ -*** '''devicetree.dtb'''+ -*** '''uImage'''+ -* EXT4: mounted to some <mountpoint>+ -** unpack the '''rootfs.tar.gz''', console:+ - <font size='2'>tar -C <mountpoint> -xzpf rootfs.tar.gz</font>+ - + -Camera:+ -* Insert, power on+ ===Boot from NAND flash=== ===Boot from NAND flash=== OlegSd boot rootfs
Created page with "==Notes== * The micro SD card/adapter must be modified for this boot mode (to keep CD pin high with the card inserted) - only then the camera will boot. * EXT4 partition mounted ..."
New page
==Notes==* The micro SD card/adapter must be modified for this boot mode (to keep CD pin high with the card inserted) - only then the camera will boot.
* EXT4 partition mounted as /.
==Prepare the card==
PC:
* After all of the targets are built in poky use files from '''.../poky/build/tmp/deploy/images/elphel393/mmc/''':
** '''boot.bin'''
** '''u-boot-dtb.img'''
** '''devicetree.dtb'''
** '''uImage'''
** '''rootfs.tar.gz'''
* Format into 2 partitions: FAT32 and EXT4 (use gparted or command line instructions below), the order of partitions is important or change bootargs in the device tree accordingly.
* FAT32: copy the following files:
*** '''boot.bin'''
*** '''u-boot-dtb.img'''
*** '''devicetree.dtb'''
*** '''uImage'''
* If EXT4 is not empty - format it or delete old contents
* Mount EXT4 to some <mountpoint>
** unpack the '''rootfs.tar.gz''', console:
<font size='2'>tar -C <mountpoint> -xzpf rootfs.tar.gz</font>
==Boot==
* Insert, power on
==Format micro SD card (command line)==
Example for '''/dev/sda''':
* create partitions with fdisk
* mkfs.vfat -F 32 /dev/sda1
* mkfs.ext4 /dev/sda2
[[Category:Elphel393]] Oleg
Poky 2.0 manual
Reflash factory image (update software/firmware or corrupt flash partition):
← Older revision Revision as of 08:31, 9 March 2016 (16 intermediate revisions not shown)Line 12: Line 12: ==<font color="blue">Output files</font>== ==<font color="blue">Output files</font>== -Found in the poky's deploy directory: '''poky/build/tmp/deploy/images/'''+Found in the poky's deploy directory: +* files for rootfs in NAND Flash: '''poky/build/tmp/deploy/images/elphel393/nand/''' +* files for rootfs on MMC (micro SD card): '''poky/build/tmp/deploy/images/elphel393/mmc/''' These names are listed as they appear in the u-boot configuration header file - actual output files have different names: These names are listed as they appear in the u-boot configuration header file - actual output files have different names: * '''boot.bin''' - u-boot as the first stage bootloader = Secondary Program Loader that boots '''u-boot-dtb.img''' * '''boot.bin''' - u-boot as the first stage bootloader = Secondary Program Loader that boots '''u-boot-dtb.img''' * '''u-boot-dtb.img''' - full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'') * '''u-boot-dtb.img''' - full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'') -* '''devicetree.dtb''' - device tree with described interfaces, zynq registers, interrupts and drivers+* '''devicetree.dtb''' - device tree with listed interfaces, zynq registers, interrupts and drivers * '''uImage''' - kernel, drivers * '''uImage''' - kernel, drivers -* '''uramdisk.image.gz''' - applications+* '''rootfs.ubifs''' or '''rootfs.tar.gz''' - rootfs - + -Copy them on the micro SD card (FAT partition) > run '''boot''' once in the u-boot command line.+ ==<font color="blue">Boot options</font>== ==<font color="blue">Boot options</font>== -* Auto unpacking the root file system image to RAM when booting:+===Boot from micro SD card=== -** Check u-boot default environment variables when building the bootloader.+* The micro SD card/adapter must be modified for this boot mode (to keep CD pin high) - only then the camera will boot. -** Keep '''uramdisk.image.gz''' along with all the other files on the FAT partition of (micro)SD card.+* EXT4 partition mounted as '''/'''. -* <font style='color:rgba(100,100,100,1)'>Root file system on EXT2(EXT3,etc.) partition of (micro)SD card.</font>+====Instructions==== +PC: +* After all of the targets are built use files from '''.../poky/build/tmp/deploy/images/elphel393/mmc/''' +* Format to have 2 partitions: FAT32 and EXT4 (use gparted), the order of partitions is important or change bootargs in the device tree. +* FAT32: copy the following files: +*** '''boot.bin''' +*** '''u-boot-dtb.img''' +*** '''devicetree.dtb''' +*** '''uImage''' +* EXT4: mounted to some <mountpoint> +** unpack the '''rootfs.tar.gz''', console: + <font size='2'>tar -C <mountpoint> -xzpf rootfs.tar.gz</font> + +Camera: +* Insert, power on + +===Boot from NAND flash=== +* The default boot option - power on. +* A UBIFS image of rootfs is written to /dev/mtd4 ('''ubi0:elphel393''' in bootargs in the device tree) +====Reflash factory image (update software/firmware or corrupt flash partition) ==== +* Use files from '''.../poky/build/tmp/deploy/images/elphel393/nand/''' +* Copy all of the image files to a micro SD card (or boot first from the card then copy over network) +* Boot from micro SD card. +* Reflash what is needed: +** Reflash SPL ('''boot.bin''', /dev/mtd0) +<font size='2'> + cd <path-to-image-files> + # boot.bin + # mtd0 is 1MB (8 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block) + # erase only first 2 blocks, other block are reserved for copies + flash_unlock /dev/mtd0 + flash_erase /dev/mtd0 0 2 + nandwrite -n /dev/mtd0 -p boot.bin +</font> +** Reflash u-boot ('''u-boot-dtb.img''', /dev/mtd1) +<font size='2'> + cd <path-to-image-files> + # u-boot-dtb.img + # mtd1 is 4M (32 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block) + # erase only the 1st 8 blocks as image is <1M, leave unused area for backup copies + flash_unlock /dev/mtd1 + flash_erase /dev/mtd1 0 8 + nandwrite -n /dev/mtd1 -p u-boot-dtb.img +</font> +** Reflash devicetree ('''devicetree.dtb''', /dev/mtd2) +<font size='2'> + cd <path-to-image-files> + # u-boot-dtb.img + # mtd2 is 1M (8 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block) + flash_unlock /dev/mtd2 + flash_erase /dev/mtd2 0 8 + nandwrite -n /dev/mtd2 -p devicetree.dtb +</font> +** Reflash kernel ('''uImage''', /dev/mtd3) +<font size='2'> + cd <path-to-image-files> + # uImage + # mtd3 is 16M (128 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block) + flash_unlock /dev/mtd3 + flash_erase /dev/mtd3 0 128 + nandwrite -n /dev/mtd3 -p uImage +</font> +** For rootfs there are 2 options: +*** update - <font color='green'>recommended</font>, '''rootfs.ubifs''' +*** reflash - <font color='red'>radical</font>, '''rootfs.ubi''' +Update: +<font size='2'> + # '''NOT TESTED''' + ubiattach /dev/ubi_ctrl -m 4 + #ubimkvol /dev/ubi0 -N elphel393-rootfs -s 256MiB + ubiupdatevol /dev/ubi0_0 rootfs.ubifs + # read: http://www.linux-mtd.infradead.org/faq/ubifs.html + # read: http://free-electrons.com/blog/creating-flashing-ubi-ubifs-images/ + # read: http://www.linux-mtd.infradead.org/doc/ubi.html#L_volupdate + # read: http://comments.gmane.org/gmane.linux.drivers.mtd/39415 +</font> +Reflash: +<font size='2'> + cd <path-to-image-files> + flash_unlock /dev/mtd4 + flash_erase /dev/mtd4 0 2048 + ubiformat /dev/mtd4 -f rootfs.ubi -s 2048 -O 2048 +</font> +'''Note:''' Considering to store the u-boot, device tree and kernel on UBUFS partitions in future. ==<font color="blue">Setup</font>== ==<font color="blue">Setup</font>== Line 50: Line 133: '''#Part 2 : init environment and auto-fill Yocto's conf-files''' '''#Part 2 : init environment and auto-fill Yocto's conf-files''' + CONF_NOTES="meta/conf/conf-notes.txt" + + if [ -f $CONF_NOTES ]; then + rm $CONF_NOTES + fi + + echo "Common \"elphel393\" targets are:" >> $CONF_NOTES + echo " u-boot" >> $CONF_NOTES + echo " device-tree" >> $CONF_NOTES + echo " linux-xlnx" >> $CONF_NOTES + echo " core-image-elphel393" >> $CONF_NOTES CURRENT_PATH=$(dirname $(readlink -f "$0")) CURRENT_PATH=$(dirname $(readlink -f "$0")) OlegPoky 2.0 manual
Reflash factory image (update software/firmware or corrupt flash partition):
← Older revision Revision as of 07:37, 9 March 2016 (13 intermediate revisions not shown)Line 12: Line 12: ==<font color="blue">Output files</font>== ==<font color="blue">Output files</font>== -Found in the poky's deploy directory: '''poky/build/tmp/deploy/images/'''+Found in the poky's deploy directory: +* files for rootfs in NAND Flash: '''poky/build/tmp/deploy/images/elphel393/nand/''' +* files for rootfs on MMC (micro SD card): '''poky/build/tmp/deploy/images/elphel393/mmc/''' These names are listed as they appear in the u-boot configuration header file - actual output files have different names: These names are listed as they appear in the u-boot configuration header file - actual output files have different names: * '''boot.bin''' - u-boot as the first stage bootloader = Secondary Program Loader that boots '''u-boot-dtb.img''' * '''boot.bin''' - u-boot as the first stage bootloader = Secondary Program Loader that boots '''u-boot-dtb.img''' * '''u-boot-dtb.img''' - full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'') * '''u-boot-dtb.img''' - full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'') -* '''devicetree.dtb''' - device tree with described interfaces, zynq registers, interrupts and drivers+* '''devicetree.dtb''' - device tree with listed interfaces, zynq registers, interrupts and drivers * '''uImage''' - kernel, drivers * '''uImage''' - kernel, drivers -* '''uramdisk.image.gz''' - applications+* '''rootfs.ubifs''' or '''rootfs.tar.gz''' - rootfs - + -Copy them on the micro SD card (FAT partition) > run '''boot''' once in the u-boot command line.+ ==<font color="blue">Boot options</font>== ==<font color="blue">Boot options</font>== -* Auto unpacking the root file system image to RAM when booting:+===Boot from micro SD card=== -** Check u-boot default environment variables when building the bootloader.+* The micro SD card/adapter must be modified for this boot mode (to keep CD pin high) - only then the camera will boot. -** Keep '''uramdisk.image.gz''' along with all the other files on the FAT partition of (micro)SD card.+* EXT4 partition mounted as '''/'''. -* <font style='color:rgba(100,100,100,1)'>Root file system on EXT2(EXT3,etc.) partition of (micro)SD card.</font>+====Instructions==== +PC: +* After all of the targets are built use files from '''.../poky/build/tmp/deploy/images/elphel393/mmc/''' +* Format to have 2 partitions: FAT32 and EXT4 (use gparted), the order of partitions is important or change bootargs in the device tree. +* FAT32: copy the following files: +*** '''boot.bin''' +*** '''u-boot-dtb.img''' +*** '''devicetree.dtb''' +*** '''uImage''' +* EXT4: mounted to some <mountpoint> +** unpack the '''rootfs.tar.gz''', console: + <font size='2'>tar -C <mountpoint> -xzpf rootfs.tar.gz</font> + +Camera: +* Insert, power on + +===Boot from NAND flash=== +* The default boot option - power on. +* A UBIFS image of rootfs is written to /dev/mtd4 ('''ubi0:elphel393''' in bootargs in the device tree) +====Reflash factory image (update software/firmware or corrupt flash partition) ==== +* Use files from '''.../poky/build/tmp/deploy/images/elphel393/nand/''' +* Copy all of the image files to a micro SD card (or boot first from the card then copy over network) +* Boot from micro SD card. +* Reflash what is needed: +** Reflash SPL ('''boot.bin''', /dev/mtd0) +<font size='2'> + cd <path-to-image-files> + # boot.bin + # mtd0 is 1MB (8 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block) + # erase only first 2 blocks, other block are reserved for copies + flash_unlock /dev/mtd0 + flash_erase /dev/mtd0 0 2 + nandwrite -n /dev/mtd0 -p boot.bin +</font> +** Reflash u-boot ('''u-boot-dtb.img''', /dev/mtd1) +<font size='2'> + cd <path-to-image-files> + # u-boot-dtb.img + # mtd1 is 4M (32 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block) + # erase only the 1st 8 blocks as image is <1M, leave unused area for backup copies + flash_unlock /dev/mtd1 + flash_erase /dev/mtd1 0 8 + nandwrite -n /dev/mtd1 -p u-boot-dtb.img +</font> +** Reflash devicetree ('''devicetree.dtb''', /dev/mtd2) +<font size='2'> + cd <path-to-image-files> + # u-boot-dtb.img + # mtd2 is 1M (8 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block) + flash_unlock /dev/mtd2 + flash_erase /dev/mtd2 0 8 + nandwrite -n /dev/mtd2 -p devicetree.dtb +</font> +** Reflash kernel ('''uImage''', /dev/mtd3) +<font size='2'> + cd <path-to-image-files> + # uImage + # mtd3 is 16M (128 eraseblocks,128K = 1 block, there are 64 pages of 2048 per block) + flash_unlock /dev/mtd3 + flash_erase /dev/mtd3 0 128 + nandwrite -n /dev/mtd3 -p uImage +</font> +** For rootfs there are 2 options: +*** update - <font color='green'>recommended</font>, '''rootfs.ubifs''' +*** reflash - <font color='red'>radical</font>, '''rootfs.ubi''' +Update: +<font size='2'> + To be described... + http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mkfubifs +</font> +Reflash: +<font size='2'> + cd <path-to-image-files> + flash_unlock /dev/mtd4 + flash_erase /dev/mtd4 0 2048 + ubiformat /dev/mtd4 -f rootfs.ubi -s 2048 -O 2048 +</font> +'''Note:''' Considering to store the u-boot, device tree and kernel on UBUFS partitions in future. ==<font color="blue">Setup</font>== ==<font color="blue">Setup</font>== Line 50: Line 127: '''#Part 2 : init environment and auto-fill Yocto's conf-files''' '''#Part 2 : init environment and auto-fill Yocto's conf-files''' + CONF_NOTES="meta/conf/conf-notes.txt" + + if [ -f $CONF_NOTES ]; then + rm $CONF_NOTES + fi + + echo "Common \"elphel393\" targets are:" >> $CONF_NOTES + echo " u-boot" >> $CONF_NOTES + echo " device-tree" >> $CONF_NOTES + echo " linux-xlnx" >> $CONF_NOTES + echo " core-image-elphel393" >> $CONF_NOTES CURRENT_PATH=$(dirname $(readlink -f "$0")) CURRENT_PATH=$(dirname $(readlink -f "$0")) OlegPoky 2.0 manual
Output files:
← Older revision Revision as of 05:54, 9 March 2016 (5 intermediate revisions not shown)Line 12: Line 12: ==<font color="blue">Output files</font>== ==<font color="blue">Output files</font>== -Found in the poky's deploy directory: '''poky/build/tmp/deploy/images/'''+Found in the poky's deploy directory: +* files for rootfs in NAND Flash: '''poky/build/tmp/deploy/images/elphel393/nand/''' +* files for rootfs on MMC (micro SD card): '''poky/build/tmp/deploy/images/elphel393/mmc/''' These names are listed as they appear in the u-boot configuration header file - actual output files have different names: These names are listed as they appear in the u-boot configuration header file - actual output files have different names: * '''boot.bin''' - u-boot as the first stage bootloader = Secondary Program Loader that boots '''u-boot-dtb.img''' * '''boot.bin''' - u-boot as the first stage bootloader = Secondary Program Loader that boots '''u-boot-dtb.img''' * '''u-boot-dtb.img''' - full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'') * '''u-boot-dtb.img''' - full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'') -* '''devicetree.dtb''' - device tree with described interfaces, zynq registers, interrupts and drivers+* '''devicetree.dtb''' - device tree with listed interfaces, zynq registers, interrupts and drivers * '''uImage''' - kernel, drivers * '''uImage''' - kernel, drivers -* '''uramdisk.image.gz''' - applications+* '''rootfs.ubi''' or '''rootfs.tar.gz''' - rootfs - + -Copy them on the micro SD card (FAT partition) > run '''boot''' once in the u-boot command line.+ ==<font color="blue">Boot options</font>== ==<font color="blue">Boot options</font>== -* Auto unpacking the root file system image to RAM when booting:+===Boot from micro SD card=== -** Check u-boot default environment variables when building the bootloader.+* The card/adapter must be modified for the boot mode from SD card - only then the camera will boot. -** Keep '''uramdisk.image.gz''' along with all the other files on the FAT partition of (micro)SD card.+ -* <font style='color:rgba(100,100,100,1)'>Root file system on EXT2(EXT3,etc.) partition of (micro)SD card.</font>+===Boot from NAND flash=== +* Power on ==<font color="blue">Setup</font>== ==<font color="blue">Setup</font>== Line 50: Line 51: '''#Part 2 : init environment and auto-fill Yocto's conf-files''' '''#Part 2 : init environment and auto-fill Yocto's conf-files''' + CONF_NOTES="meta/conf/conf-notes.txt" + + if [ -f $CONF_NOTES ]; then + rm $CONF_NOTES + fi + + echo "Common \"elphel393\" targets are:" >> $CONF_NOTES + echo " u-boot" >> $CONF_NOTES + echo " device-tree" >> $CONF_NOTES + echo " linux-xlnx" >> $CONF_NOTES + echo " core-image-elphel393" >> $CONF_NOTES CURRENT_PATH=$(dirname $(readlink -f "$0")) CURRENT_PATH=$(dirname $(readlink -f "$0")) OlegPoky 2.0 manual
Boot options:
← Older revision Revision as of 04:51, 9 March 2016 (4 intermediate revisions not shown)Line 12: Line 12: ==<font color="blue">Output files</font>== ==<font color="blue">Output files</font>== -Found in the poky's deploy directory: '''poky/build/tmp/deploy/images/'''+Found in the poky's deploy directory: +* files for rootfs in NAND Flash: '''poky/build/tmp/deploy/images/elphel393/nand/''' +* files for rootfs in on MMC (micro SD card): '''poky/build/tmp/deploy/images/elphel393/mmc/''' These names are listed as they appear in the u-boot configuration header file - actual output files have different names: These names are listed as they appear in the u-boot configuration header file - actual output files have different names: * '''boot.bin''' - u-boot as the first stage bootloader = Secondary Program Loader that boots '''u-boot-dtb.img''' * '''boot.bin''' - u-boot as the first stage bootloader = Secondary Program Loader that boots '''u-boot-dtb.img''' * '''u-boot-dtb.img''' - full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'') * '''u-boot-dtb.img''' - full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'') -* '''devicetree.dtb''' - device tree with described interfaces, zynq registers, interrupts and drivers+* '''devicetree.dtb''' - device tree with listed interfaces, zynq registers, interrupts and drivers * '''uImage''' - kernel, drivers * '''uImage''' - kernel, drivers -* '''uramdisk.image.gz''' - applications+* '''rootfs.ubi''' or '''rootfs.tar.gz''' - rootfs - + -Copy them on the micro SD card (FAT partition) > run '''boot''' once in the u-boot command line.+ ==<font color="blue">Boot options</font>== ==<font color="blue">Boot options</font>== -* Auto unpacking the root file system image to RAM when booting:+===Boot from micro SD card=== -** Check u-boot default environment variables when building the bootloader.+* The card/adapter must be modified for the boot mode from SD card - only then the camera will boot. -** Keep '''uramdisk.image.gz''' along with all the other files on the FAT partition of (micro)SD card.+ -* <font style='color:rgba(100,100,100,1)'>Root file system on EXT2(EXT3,etc.) partition of (micro)SD card.</font>+===Boot from NAND flash=== +* Power on ==<font color="blue">Setup</font>== ==<font color="blue">Setup</font>== Line 50: Line 51: '''#Part 2 : init environment and auto-fill Yocto's conf-files''' '''#Part 2 : init environment and auto-fill Yocto's conf-files''' + CONF_NOTES="meta/conf/conf-notes.txt" + + if [ -f $CONF_NOTES ]; then + rm $CONF_NOTES + fi + + echo "Common \"elphel393\" targets are:" >> $CONF_NOTES + echo " u-boot" >> $CONF_NOTES + echo " device-tree" >> $CONF_NOTES + echo " linux-xlnx" >> $CONF_NOTES + echo " core-image-elphel393" >> $CONF_NOTES CURRENT_PATH=$(dirname $(readlink -f "$0")) CURRENT_PATH=$(dirname $(readlink -f "$0")) OlegPoky 2.0 manual
Output files:
← Older revision Revision as of 04:33, 9 March 2016 (3 intermediate revisions not shown)Line 12: Line 12: ==<font color="blue">Output files</font>== ==<font color="blue">Output files</font>== -Found in the poky's deploy directory: '''poky/build/tmp/deploy/images/'''+Found in the poky's deploy directory: +* files for rootfs in NAND Flash: '''poky/build/tmp/deploy/images/elphel393/nand/''' +* files for rootfs in on MMC (micro SD card): '''poky/build/tmp/deploy/images/elphel393/mmc/''' These names are listed as they appear in the u-boot configuration header file - actual output files have different names: These names are listed as they appear in the u-boot configuration header file - actual output files have different names: * '''boot.bin''' - u-boot as the first stage bootloader = Secondary Program Loader that boots '''u-boot-dtb.img''' * '''boot.bin''' - u-boot as the first stage bootloader = Secondary Program Loader that boots '''u-boot-dtb.img''' * '''u-boot-dtb.img''' - full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'') * '''u-boot-dtb.img''' - full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'') -* '''devicetree.dtb''' - device tree with described interfaces, zynq registers, interrupts and drivers+* '''devicetree.dtb''' - device tree with listed interfaces, zynq registers, interrupts and drivers * '''uImage''' - kernel, drivers * '''uImage''' - kernel, drivers -* '''uramdisk.image.gz''' - applications+* '''rootfs.ubi''' or '''rootfs.tar.gz''' - rootfs - + -Copy them on the micro SD card (FAT partition) > run '''boot''' once in the u-boot command line.+ ==<font color="blue">Boot options</font>== ==<font color="blue">Boot options</font>== Line 50: Line 50: '''#Part 2 : init environment and auto-fill Yocto's conf-files''' '''#Part 2 : init environment and auto-fill Yocto's conf-files''' + CONF_NOTES="meta/conf/conf-notes.txt" + + if [ -f $CONF_NOTES ]; then + rm $CONF_NOTES + fi + + echo "Common \"elphel393\" targets are:" >> $CONF_NOTES + echo " u-boot" >> $CONF_NOTES + echo " device-tree" >> $CONF_NOTES + echo " linux-xlnx" >> $CONF_NOTES + echo " core-image-elphel393" >> $CONF_NOTES CURRENT_PATH=$(dirname $(readlink -f "$0")) CURRENT_PATH=$(dirname $(readlink -f "$0")) OlegPoky 2.0 manual
Setup:
← Older revision Revision as of 07:03, 8 March 2016 Line 50: Line 50: '''#Part 2 : init environment and auto-fill Yocto's conf-files''' '''#Part 2 : init environment and auto-fill Yocto's conf-files''' + CONF_NOTES="meta/conf/conf-notes.txt" + + if [ -f $CONF_NOTES ]; then + rm $CONF_NOTES + fi + + echo "Common \"elphel393\" targets are:" >> $CONF_NOTES + echo " u-boot" >> $CONF_NOTES + echo " device-tree" >> $CONF_NOTES + echo " linux-xlnx" >> $CONF_NOTES + echo " core-image-elphel393" >> $CONF_NOTES CURRENT_PATH=$(dirname $(readlink -f "$0")) CURRENT_PATH=$(dirname $(readlink -f "$0")) OlegMicrozed issues
List:
← Older revision Revision as of 22:35, 23 February 2016 (4 intermediate revisions not shown)Line 1: Line 1: ==List== ==List== -* <b style='color:green'>[SOLVED]</b> UART+===<b style='color:green'>[CLEARED]</b> UART=== <font size='2'> <font size='2'> <b>Description:</b> <b>Description:</b> Line 31: Line 31: </font> </font> -* SSH terminal+===<b style='color:green'>[CLEARED]</b> SSH terminal=== <font size='2'> <font size='2'> <b>Description:</b> <b>Description:</b> Freezes, lags but remembers all typed symbols Freezes, lags but remembers all typed symbols <b>Possible reason:</b> <b>Possible reason:</b> - Bad network cable? Network problem?+ Devices with identical MACs in LAN </font> </font> -* RTC+===RTC=== <font size='2'> <font size='2'> - Too many messages when rtc is missing <b>Description:</b> <b>Description:</b> + Not an issue 3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log 3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log <b>Possible reason:</b> <b>Possible reason:</b> - driver+ a. Microzed doesn't have a real-time clock (rtc) + b. Reported by /etc/init.d/hwclock.sh - not the driver </font> </font> -* U-boot Falcon mode (boot from SPL directly to OS avoiding full u-boot)+===U-boot Falcon mode (boot from SPL directly to OS avoiding full u-boot)=== <font size='2'> <font size='2'> <b>Description:</b> <b>Description:</b> Line 53: Line 54: <b>Possible reason:</b> <b>Possible reason:</b> -* U-boot spl reads u-boot-dtb.img 2 times+===U-boot spl reads u-boot-dtb.img 2 times=== <font size='2'> <font size='2'> <b>Description:</b> <b>Description:</b> Line 92: Line 93: </font> </font> - -* hwclock multiple error messages -<font size='2'> - <b>Description:</b> - Not an issue - "hwclock: can't open '/dev/misc/rtc': No such file or directory" repeated 3 times - <b>Possible reason:</b> - a. Microzed doesn't have a real-time clock (rtc) - b. Reported by /etc/init.d/hwclock.sh - not the driver ==Useful pages== ==Useful pages== OlegMicrozed issues
Poky 2.0 manual
Setup:
← Older revision Revision as of 01:13, 20 February 2016 Line 41: Line 41: git clone -b master https://github.com/Elphel/meta-elphel393.git meta-elphel393 git clone -b master https://github.com/Elphel/meta-elphel393.git meta-elphel393 - cd meta-elphel393; git checkout e8c6e139848a21b1bf0c05b306108e390bc44e24; cd ..+ cd meta-elphel393; git checkout c5237f99d94217bff8c9180bed93ee673c9590a1; cd .. git clone -b master https://github.com/Xilinx/meta-xilinx.git meta-xilinx git clone -b master https://github.com/Xilinx/meta-xilinx.git meta-xilinx OlegMicrozed issues
New page
==List==* <b style='color:green'>[SOLVED]</b> UART
<font size='2'>
<b>Description:</b>
UART register contents: timeout=0 rxfifo_level=56, should be timeout=10 rxfifo_level=56
minicom prints 56 symbols at a time when rxfifo reaches its level.
remembers all typed symbols
sometimes the timeout register is set correctly
<b>Possible reason:</b>
In driver .startup and .termios conflict? Racing Resets or reset takes time?
<b>Solution:</b>
Added a delay after reset - some other functions in the driver also have it - some not. Luck?
<b>Patch:</b>
<i>diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index f214c7f..164e32d 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -704,6 +704,9 @@ static void cdns_uart_set_termios(struct uart_port *port,
ctrl_reg |= CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST;
cdns_uart_writel(ctrl_reg, CDNS_UART_CR_OFFSET);
+ while (cdns_uart_readl(CDNS_UART_CR_OFFSET) &
+ (CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST))
+ cpu_relax();
/*
* Clear the RX disable and TX disable bits and then set the TX enable
* bit and RX enable bit to enable the transmitter and receiver.</i>
<b>Links:</b>
* https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Uart-timeout-problem/td-p/432016
* http://www.makelinux.net/ldd3/chp-7-sect-3
</font>
* SSH terminal
<font size='2'>
<b>Description:</b>
Freezes, lags but remembers all typed symbols
<b>Possible reason:</b>
Bad network cable? Network problem?
</font>
* RTC
<font size='2'>
Too many messages when rtc is missing
<b>Description:</b>
3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log
<b>Possible reason:</b>
driver
</font>
* U-boot Falcon mode (boot from SPL directly to OS avoiding full u-boot)
<font size='2'>
<b>Description:</b>
Try
<b>Possible reason:</b>
* U-boot spl reads u-boot-dtb.img 2 times
<font size='2'>
<b>Description:</b>
Not an issue - prints "reading u-boot-dtb.img" 2 times. "Very Annoying","Every microsecond counts"!
<b>Possible reason:</b>
<b>u-boot/common/spl/spl_fat.c:</b>
<i>int spl_load_image_fat(block_dev_desc_t *block_dev,
int partition,
const char *filename)
{
int err;
struct image_header *header;
err = spl_register_fat_device(block_dev, partition);
if (err)
goto end;
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
sizeof(struct image_header));
err = <b>file_fat_read</b>(filename, header, sizeof(struct image_header));
if (err <= 0)
goto end;
spl_parse_image_header(header);
err = <b>file_fat_read</b>(filename, (u8 *)spl_image.load_addr, 0);
end:
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
if (err <= 0)
printf("%s: error reading image %s, err - %d\n",
__func__, filename, err);
#endif
return (err <= 0);
}</i>
</font>
* hwclock multiple error messages
<font size='2'>
<b>Description:</b>
Not an issue
"hwclock: can't open '/dev/misc/rtc': No such file or directory" repeated 3 times
<b>Possible reason:</b>
a. Microzed doesn't have a real-time clock (rtc)
b. Reported by /etc/init.d/hwclock.sh - not the driver
==Useful pages==
* http://processors.wiki.ti.com/index.php/Enabling_Stack_Dumping_in_Linux_Kernel
* https://lists.yoctoproject.org/pipermail/poky/2015-February/010037.html - change hostname in poky
* http://www.makelinux.net/ldd3/chp-7-sect-3
* http://www.denx.de/wiki/pub/U-Boot/MiniSummitELCE2013/2013-ELCE-U-Boot-Falcon-Boot.pdf Oleg
Microzed issues
New page
==List==* <b style='color:green'>[SOLVED]</b> UART
<font size='2'>
<b>Description:</b>
UART register contents: timeout=0 rxfifo_level=56, should be timeout=10 rxfifo_level=56
minicom prints 56 symbols at a time when rxfifo reaches its level.
remembers all typed symbols
sometimes the timeout register is set correctly
<b>Possible reason:</b>
In driver .startup and .termios conflict? Racing Resets or reset takes time?
<b>Solution:</b>
Added a delay after reset - some other functions in the driver also have it - some not. Luck?
<b>Patch:</b>
<i>diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index f214c7f..164e32d 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -704,6 +704,9 @@ static void cdns_uart_set_termios(struct uart_port *port,
ctrl_reg |= CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST;
cdns_uart_writel(ctrl_reg, CDNS_UART_CR_OFFSET);
+ while (cdns_uart_readl(CDNS_UART_CR_OFFSET) &
+ (CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST))
+ cpu_relax();
/*
* Clear the RX disable and TX disable bits and then set the TX enable
* bit and RX enable bit to enable the transmitter and receiver.</i>
<b>Links:</b>
* https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Uart-timeout-problem/td-p/432016
* http://www.makelinux.net/ldd3/chp-7-sect-3
</font>
* SSH terminal
<font size='2'>
<b>Description:</b>
Freezes, lags but remembers all typed symbols
<b>Possible reason:</b>
Bad network cable? Network problem?
</font>
* RTC
<font size='2'>
Too many messages when rtc is missing
<b>Description:</b>
3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log
<b>Possible reason:</b>
driver
</font>
* U-boot Falcon mode (boot from SPL directly to OS avoiding full u-boot)
<font size='2'>
<b>Description:</b>
Try
<b>Possible reason:</b>
* U-boot spl reads u-boot-dtb.img 2 times
<font size='2'>
<b>Description:</b>
Not an issue - prints "reading u-boot-dtb.img" 2 times. "Very Annoying","Every microsecond counts"!
<b>Possible reason:</b>
<b>u-boot/common/spl/spl_fat.c:</b>
<i>int spl_load_image_fat(block_dev_desc_t *block_dev,
int partition,
const char *filename)
{
int err;
struct image_header *header;
err = spl_register_fat_device(block_dev, partition);
if (err)
goto end;
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
sizeof(struct image_header));
err = <b>file_fat_read</b>(filename, header, sizeof(struct image_header));
if (err <= 0)
goto end;
spl_parse_image_header(header);
err = <b>file_fat_read</b>(filename, (u8 *)spl_image.load_addr, 0);
end:
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
if (err <= 0)
printf("%s: error reading image %s, err - %d\n",
__func__, filename, err);
#endif
return (err <= 0);
}</i>
</font>
==Useful pages==
* http://processors.wiki.ti.com/index.php/Enabling_Stack_Dumping_in_Linux_Kernel
* https://lists.yoctoproject.org/pipermail/poky/2015-February/010037.html - change hostname in poky
* http://www.makelinux.net/ldd3/chp-7-sect-3
* http://www.denx.de/wiki/pub/U-Boot/MiniSummitELCE2013/2013-ELCE-U-Boot-Falcon-Boot.pdf Oleg
Microzed issues
New page
==List==* <b style='color:green'>[SOLVED]</b> UART
<font size='2'>
<b>Description:</b>
UART register contents: timeout=0 rxfifo_level=56, should be timeout=10 rxfifo_level=56
minicom prints 56 symbols at a time when rxfifo reaches its level.
remembers all typed symbols
sometimes the timeout register is set correctly
<b>Possible reason:</b>
In driver .startup and .termios conflict? Racing Resets or reset takes time?
<b>Solution:</b>
Added a delay after reset - some other functions in the driver also have it - some not. Luck?
<b>Patch:</b>
<i>diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index f214c7f..164e32d 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -704,6 +704,9 @@ static void cdns_uart_set_termios(struct uart_port *port,
ctrl_reg |= CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST;
cdns_uart_writel(ctrl_reg, CDNS_UART_CR_OFFSET);
+ while (cdns_uart_readl(CDNS_UART_CR_OFFSET) &
+ (CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST))
+ cpu_relax();
/*
* Clear the RX disable and TX disable bits and then set the TX enable
* bit and RX enable bit to enable the transmitter and receiver.</i>
<b>Links:</b>
* https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Uart-timeout-problem/td-p/432016
* http://www.makelinux.net/ldd3/chp-7-sect-3
</font>
* SSH terminal
<font size='2'>
<b>Description:</b>
Freezes, lags but remembers all typed symbols
<b>Possible reason:</b>
Bad network cable? Network problem?
</font>
* RTC
<font size='2'>
Too many messages when rtc is missing
<b>Description:</b>
3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log
<b>Possible reason:</b>
driver
</font>
* U-boot Falcon mode (boot from SPL directly to OS avoiding full u-boot)
<font size='2'>
<b>Description:</b>
Try
<b>Possible reason:</b>
* U-boot spl reads u-boot-dtb.img 2 times
<font size='2'>
<b>Description:</b>
Not an issue - prints "reading u-boot-dtb.img" 2 times. "Very Annoying","Every microsecond counts"!
<b>Possible reason:</b>
<b>u-boot/common/spl/spl_fat.c:</b>
<i>int spl_load_image_fat(block_dev_desc_t *block_dev,
int partition,
const char *filename)
{
int err;
struct image_header *header;
err = spl_register_fat_device(block_dev, partition);
if (err)
goto end;
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
sizeof(struct image_header));
err = <b>file_fat_read</b>(filename, header, sizeof(struct image_header));
if (err <= 0)
goto end;
spl_parse_image_header(header);
err = <b>file_fat_read</b>(filename, (u8 *)spl_image.load_addr, 0);
end:
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
if (err <= 0)
printf("%s: error reading image %s, err - %d\n",
__func__, filename, err);
#endif
return (err <= 0);
}</i>
</font>
==Useful pages==
* http://processors.wiki.ti.com/index.php/Enabling_Stack_Dumping_in_Linux_Kernel
* https://lists.yoctoproject.org/pipermail/poky/2015-February/010037.html - change hostname in poky
* http://www.makelinux.net/ldd3/chp-7-sect-3 Oleg
Microzed issues
New page
==List==* <b style='color:green'>[SOLVED]</b> UART
<font size='2'>
<b>Description:</b>
UART register contents: timeout=0 rxfifo_level=56, should be timeout=10 rxfifo_level=56
minicom prints 56 symbols at a time when rxfifo reaches its level.
remembers all typed symbols
sometimes the timeout register is set correctly
<b>Possible reason:</b>
In driver .startup and .termios conflict? Racing Resets or reset takes time?
<b>Solution:</b>
Added a delay after reset - some other functions in the driver also have it - some not. Luck?
<b>Patch:</b>
<i>diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index f214c7f..164e32d 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -704,6 +704,9 @@ static void cdns_uart_set_termios(struct uart_port *port,
ctrl_reg |= CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST;
cdns_uart_writel(ctrl_reg, CDNS_UART_CR_OFFSET);
+ while (cdns_uart_readl(CDNS_UART_CR_OFFSET) &
+ (CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST))
+ cpu_relax();
/*
* Clear the RX disable and TX disable bits and then set the TX enable
* bit and RX enable bit to enable the transmitter and receiver.</i>
<b>Links:</b>
* https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Uart-timeout-problem/td-p/432016
* http://www.makelinux.net/ldd3/chp-7-sect-3
</font>
* SSH terminal
<font size='2'>
<b>Description:</b>
Freezes, lags but remembers all typed symbols
<b>Possible reason:</b>
Bad network cable? Network problem?
</font>
* RTC
<font size='2'>
Too many messages when rtc is missing
<b>Description:</b>
3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log
<b>Possible reason:</b>
driver
</font>
* U-boot Falcon mode (boot from SPL directly to OS avoiding full u-boot)
<font size='2'>
<b>Description:</b>
Try
<b>Possible reason:</b>
</font>
==Useful pages==
* http://processors.wiki.ti.com/index.php/Enabling_Stack_Dumping_in_Linux_Kernel
* https://lists.yoctoproject.org/pipermail/poky/2015-February/010037.html - change hostname in poky
* http://www.makelinux.net/ldd3/chp-7-sect-3 Oleg
Microzed issues
New page
==List==* <b style='color:green'>[SOLVED]</b> UART
<font size='2'>
<b>Description:</b>
UART register contents: timeout=0 rxfifo_level=56, should be timeout=10 rxfifo_level=56
minicom prints 56 symbols at a time when rxfifo reaches its level.
remembers all typed symbols
sometimes the timeout register is set correctly
<b>Possible reason:</b>
In driver .startup and .termios conflict? Racing Resets or reset takes time?
<b>Solution:</b>
Added a delay after reset - some other functions in the driver also have it - some not. Luck?
<b>Patch:</b>
<i>diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index f214c7f..164e32d 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -704,6 +704,9 @@ static void cdns_uart_set_termios(struct uart_port *port,
ctrl_reg |= CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST;
cdns_uart_writel(ctrl_reg, CDNS_UART_CR_OFFSET);
+ while (cdns_uart_readl(CDNS_UART_CR_OFFSET) &
+ (CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST))
+ cpu_relax();
/*
* Clear the RX disable and TX disable bits and then set the TX enable
* bit and RX enable bit to enable the transmitter and receiver.</i>
<b>Links:</b>
* https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Uart-timeout-problem/td-p/432016
* http://www.makelinux.net/ldd3/chp-7-sect-3
</font>
* SSH terminal
<font size='2'>
<b>Description:</b>
Freezes, lags but remembers all typed symbols
<b>Possible reason:</b>
Bad network cable? Network problem?
</font>
* RTC
<font size='2'>
Too many messages when rtc is missing
<b>Description:</b>
3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log
<b>Possible reason:</b>
driver
</font>
==Useful pages==
* http://processors.wiki.ti.com/index.php/Enabling_Stack_Dumping_in_Linux_Kernel
* https://lists.yoctoproject.org/pipermail/poky/2015-February/010037.html - change hostname in poky
* http://www.makelinux.net/ldd3/chp-7-sect-3 Oleg
Microzed issues
New page
==List==* UART
<font size='2'>
<b>Description:</b>
UART register contents: timeout=0 rxfifo_level=56, should be timeout=10 rxfifo_level=56
minicom prints 56 symbols at a time when rxfifo reaches its level.
remembers all typed symbols
sometimes the timeout register is set correctly
<b>Possible reason:</b>
In driver .startup and .termios conflict?
</font>
* SSH terminal
<font size='2'>
<b>Description:</b>
Freezes, lags but remembers all typed symbols
<b>Possible reason:</b>
UART problem?
</font>
* RTC
<font size='2'>
Too many messages when rtc is missing
<b>Description:</b>
3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log
<b>Possible reason:</b>
driver
</font>
==Useful pages==
* https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Uart-timeout-problem/td-p/432016
* http://processors.wiki.ti.com/index.php/Enabling_Stack_Dumping_in_Linux_Kernel
* https://lists.yoctoproject.org/pipermail/poky/2015-February/010037.html
* http://www.makelinux.net/ldd3/chp-7-sect-3 Oleg
Pages
