How to enable additional nand flash

I am using habanero. According to the docs it has an additional NAND flash which is not mounted.

How can I enable the external NAND flash on boot?

I was able to do so by adding the following kernel config:

CONFIG_NAND_SUPPORT=y
CONFIG_PACKAGE_nand-utils=y

and created the following script and added it to the startup script:

set_nand_ubifs()
{
  # Check if /mnt/ubifs is already mounted
  if mount | grep /mnt/ubifs > /dev/null; then
      echo "/mnt/ubifs is already mounted."
  else
      # Check if the UBI volume exists. Should exist if attached
      if [ ! -e /dev/ubi0 ]; then
        # If ubiattach failed assume it's a new empy block device
        if ! ubiattach /dev/ubi_ctrl -m 0 &> /dev/null ; then
          # Erase the NAND partition
          flash_erase /dev/mtd0 0 0

          # Format the NAND partition to UBI
          ubiformat /dev/mtd0

          # Attach the UBI device
          ubiattach /dev/ubi_ctrl -m 0

          # Create a UBI volume
          ubimkvol /dev/ubi0 -N ubivol -m

        fi
      fi

      # Create the mount point
      mkdir -p /mnt/ubifs

      # Mount the UBIFS
      mount -t ubifs /dev/ubi0_0 /mnt/ubifs

      echo "/mnt/ubifs has been successfully mounted."
  fi
}

set_nand_ubifs

This script mount the NAND flash to the /mnt/ubifs directory

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.