NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

EZSDK Using data on SD and filesystem on NAND

From Texas Instruments Wiki
Jump to: navigation, search

Introduction[edit]

This topic helps you to boot from the filesystem on NAND using ubifs and the data on SD card for better performance of the video demo. The uImage would also be flashed to the NAND. The SD card contains the default full filesystem from which we would be using the data to run the demo.

Throughout this document there will be commands spelled out to execute. Some are to be executed on the Linux development host, some on the Linux target and some on the u-boot (bootloader) prompt. They are distinguished by different command prompts as follows:

host $ <this command is to be executed on the host>
target # <this command is to be executed on the target>
u-boot :> <this command is to be executed on the u-boot prompt>

Note! These instructions are for DM814X. To use the same steps for DM816X, kindly make the changes as required.

Creating Filesystem on SD card[edit]

To create the default filesystem on SD card, please refer to the "How to create an SD Card" in the Software Developers Guide.

Rebuilding the Linux Kernel[edit]

This needs to be done to enable support for ubifs in the linux kernel.

To configure the default linux kernel configuration, execute the command in the linux kernel directory in the EZSDK/board-support folder:

host $ make CROSS_COMPILE=path-to-Code-Sourcey-toolchain/arm-none-linux-gnueabi- ARCH=arm distclean
host $ make CROSS_COMPILE=path-to-Code-Sourcey-toolchain/arm-none-linux-gnueabi- ARCH=arm ti8148_evm_defconfig
host $ make CROSS_COMPILE=path-to-Code-Sourcey-toolchain/arm-none-linux-gnueabi- ARCH=arm menuconfig
 

Enable the foloowing for adding the ubifs support:

* Device Drivers
    * Memory Technology Device (MTD) Support
         * Enable UBI - Unsorted Block Images
* Filesystems
    * Miscellaneous Filesystems
         * UBIFS file system support
             * Extended attributes support
             * Advanced compression options
                  * LZO compression support
                  * ZLIB compression support

Deselect "Verify Nand Page Writes" for UBIFS support also:

* Device Drivers
    * Memory Technology Device (MTD) Support
         * NAND Device support
              * Verify Nand page writes

Create the linux kernel image and modules by executing the commands:

host $ make CROSS_COMPILE=path-to-Code-Sourcey-toolchain/arm-none-linux-gnueabi- ARCH=arm uImage
host $ make CROSS_COMPILE=path-to-Code-Sourcey-toolchain/arm-none-linux-gnueabi- ARCH=arm modules      

Copy the kernel image board-support/linux_x.x.xx-xxxxx/arch/arm/boot to /tftpboot for flashing it to NAND. Then make some of the modules with the new kernel image in the $EZSDK directory that are required in the new file system.

host $ make syslink
host $ make media-controller-utils
host $ make cmem
host $ make osal
host $ make omx

Creating the file system[edit]

For this experiment, the arago-base filesystem will be used which is present in the $EZSDK/filesystem.

Firstly, please extract the filesystem to a folder (say $HOME/targetfs)

host $ sudo tar -zxf $EZSDK/arago-base-tisdk-image-dm814x-evm.tar.gz -C $HOME/targetfs

For the video demo to work, add the init script for loading the hd-firmware i.e load-hd-firmware.sh to the filesystem. The scriptcan be copied from the $EZSDK/board-support/media-controller-utils_x_xx_xx_xx/src/linux/ti814x/

host $ sudo cp $EZSDK/board-support/media-controller-utils_x_xx_xx_xx/src/linux/ti814x/load-hd-firmware.sh $HOME/targetfs/etc/init.d/

Note! Create a file named media-controller-utils.conf in the /etc/modprobe.d directory in the filesystem with the contents:

blacklist vpss
blacklist ti81xxfb
blacklist sii9022a
blacklist ti81xxhdmi

Once the filesystem is ready, add the modules to the folder by:

host $ sudo make linux_install syslink_install media-controller-utils_install omx_install EXEC_DIR=$HOME/targetfs

Creating the UBI Image[edit]

To create the ubifs image, mtd-utils is required on the host to create the ubifs image. Execute the following command:

host $ sudo mkfs.ubifs -r [path_to_input_filesystem] -m [minimum_I/O_size] -e [LEB_size] -c [eraseblocks_count] -o [output_ubifs.img]

LEB= Logical Erase Block Size.

The NAND parameters may vary depending on the EVM. For eg:

host $ sudo mkfs.ubifs -r $HOME/targetfs -m 2048 -e 126976 -c 1601 -o rootfs.ubifs

This would create a ubifs image named rootfs.ubifs which will then be used by ubinize tool to generate the ubi.img.

To prepare the ubi image, tools like ubinize or ubiupdatevol can be used. In this experiment, the ubinize tool is being used. For this, a cfg config file is needed which carries some parameters for the ubinize command. Lets say the cfg file is named as ubinize.cfg and place it in the same folder as rootfs.ubifs. The contents of the configuration file looks like:

  [ubifs]               <== Section header
  mode=ubi              <== Volume mode (other option is static)
  image=rootfs.ubifs    <== Source image
  vol_id=0              <== Volume ID in UBI image
  vol_size=160MiB       <== Volume size
  vol_type=dynamic      <== Allow for dynamic resize
  vol_name=rootfs       <== Volume name
  vol_flags=autoresize  <== Autoresize volume at first mount

Note: vol_size is assumed to be 160 MiB. Depending on the partition for filesystem, this may vary.

After creating the configuration file, execute the command:

host $ sudo ubinize -o [output_image] -m [minimum_I/O_size] -p [PEB_size]KiB -s [sub-page_size] [configuration_file]

PEB: Physical Erase Block

eg-

host $ sudo ubinize -o ubi.img -m 2048 -p 128KiB -s 2048 ubinize.cfg

This creates a ubi image with the name ubi.img. Copy this image to a location in your filesystem $HOME/targetfs.

For attaching the image to NAND, boot the board once with NFS with the target file system as $HOME/targetfs.

Flashing the u-boot to NAND[edit]

To flash the NAND with uboot, please follow the instructions at EZSDK Flashing NAND. Ensure that the boot mode is set to NAND.

Flashing the uImage to NAND[edit]

To flash the uImage to NAND, make sure the new kernel image is present in the /tftpboot folder in your host. Flash the kernel image by executing:

u-boot :> mw.b 0x81000000 0xFF 0x440000
u-boot :> tftp 0x81000000 uImage
u-boot :> nand erase 0x00280000 0x00440000
u-boot :> nand write 0x81000000 0x00280000 <kernel-size>

Note! kernel_size must be upward aligned to NAND page size. Lets suppose it is 0x2a6000

Setting the boot parameters[edit]

After power cycling the board, change the boot parameters as shown here:

u-boot :> setenv bootcmd 'nand read 0x81000000 0x00280000 0x2a6000; bootm 0x81000000'
u-boot :> setenv bootargs console=ttyO0,115200n8 rootwait rw mem=256M earlyprintk notifyk.vpssm3_sva=0xBF900000 vram=50M 

ti814xfb.vram=0:16M,1:16M,2:6M root=/dev/nfs nfsroot=$serverip:$HOME/targetfs ip=dhcp

       u-boot :> saveenv

Note! NAND page aligned kernel size is assumed to be 0x2a6000

Attaching the ubi Image[edit]

After booting, erase the partition that will be used for the filesystem and format the partition with ubiformat. Go to the folder where the ubi.img is kept on the filesystem and execute the following commands:

target # flash_eraseall /dev/mtd4
target # ubiformat /dev/mtd4 -s 2048 -f ubi.img 

Booting with the ubi filesystem[edit]

Boot the board again to use the filesystem from the nand partition. For this, set the bootargs on u-boot prompt as shown here:

u-boot :> setenv bootargs console=ttyO0,115200n8 rootwait rw mem=256M earlyprintk notifyk.vpssm3_sva=0xBF900000 vram=50M 
ti814xfb.vram=0:16M,1:16M,2:6M ubi.mtd=4,2048 root=ubi0:rootfs rw rootfstype=ubifs
u-boot :> saveenv
u-boot :> boot

Once you successfully boot the board, you need to add load-hd-firmware script to the running level.

target # update-rc.d load-hd-firmware.sh start 01 S .
target # depmod -a

After this, reboot the board to get the firmware loaded at boot time.

Running the Decode Display Demo[edit]

Mount the SD card on some mount point:

target # mount -t ext3 /dev/mmcblk0p2 /mnt/

Before running the demo, turn off the graphics plane 0 by running the following command:

target # echo 0 > /sys/devices/platform/vpss/graphics0/enabled

In case Graphics Planes 1 and 2 are currently open, then they need to be disabled as well.

target # echo 0 > /sys/devices/platform/vpss/graphics1/enabled
target # echo 0 > /sys/devices/platform/vpss/graphics2/enabled

To run the decode display demo:

target # cd /usr/share/ti/ti-omx
target # ./decode_display_a8host_debug.xv5T -w 1920 -h 1080 -f 30 -i /mnt/usr/share/ti/data/videos/dm816x_1080p_demo.264 -g 0 -d 0 -c h264

Additional References[edit]

For more information on UBI

For more information on UBIFS

FAQ on UBI

FAQ on UBIFS

Download the Latest EZSDK[edit]

The latest EZSDK is available for download from http://software-dl.ti.com/dsps/dsps_public_sw/ezsdk/latest/index_FDS.html.

The current version is 5.05.02.00. The supported platforms are DM816x and DM814x.

EZSDK Support
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article EZSDK Using data on SD and filesystem on NAND here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article EZSDK Using data on SD and filesystem on NAND here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article EZSDK Using data on SD and filesystem on NAND here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article EZSDK Using data on SD and filesystem on NAND here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article EZSDK Using data on SD and filesystem on NAND here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article EZSDK Using data on SD and filesystem on NAND here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article EZSDK Using data on SD and filesystem on NAND here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article EZSDK Using data on SD and filesystem on NAND here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article EZSDK Using data on SD and filesystem on NAND here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity